From ff68a1c225b50c10796a749a780bc80f3f551c6e Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 20 Nov 2020 15:31:51 +0800 Subject: [PATCH 1/5] ci: bump github action to deploy docs --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 74cc4c1d..f9e9f972 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,7 @@ jobs: lerna bootstrap yarn run docs - name: Deploy - uses: JamesIves/github-pages-deploy-action@3.5.7 + uses: JamesIves/github-pages-deploy-action@3.7.1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages From 6d9a85f05f393216fc06650fd650f43049874a20 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 24 Nov 2020 10:55:26 +0800 Subject: [PATCH 2/5] feat(utils): update acp lock script --- .../__tests__/address/fixtures.json | 14 +++++++++++--- .../__tests__/systemScripts/fixtures.json | 11 +++++++++-- .../__tests__/systemScripts/index.test.js | 6 +++--- packages/ckb-sdk-utils/src/address/index.ts | 13 +++++++++++-- packages/ckb-sdk-utils/src/systemScripts.ts | 16 +++++++++++++--- 5 files changed, 47 insertions(+), 13 deletions(-) diff --git a/packages/ckb-sdk-utils/__tests__/address/fixtures.json b/packages/ckb-sdk-utils/__tests__/address/fixtures.json index c210d7ee..6cd2b6b5 100644 --- a/packages/ckb-sdk-utils/__tests__/address/fixtures.json +++ b/packages/ckb-sdk-utils/__tests__/address/fixtures.json @@ -154,10 +154,18 @@ "args": "0x4fb2be2e5d0c1a3b8694f832350a33c1685d477a" } }, - "anyone can pay address": { - "params": ["ckt1qjr2r35c0f9vhcdgslx2fjwa9tylevr5qka7mfgmscd33wlhfykyhqf39tsxa6c9qjmn0e4ulffe00344y5due3gayw"], + "anyone can pay address on mainnet": { + "params": ["ckb1qypgzvf2uphwkpgykum7d0862wtmuddf9r0qw88kle"], + "expected": { + "codeHash": "0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354", + "hashType": "type", + "args": "0x81312ae06eeb0504b737e6bcfa5397be35a928de" + } + }, + "anyone can pay address on testnet": { + "params": ["ckt1qypgzvf2uphwkpgykum7d0862wtmuddf9r0qnzefn9"], "expected": { - "codeHash": "0x86a1c6987a4acbe1a887cca4c9dd2ac9fcb07405bbeda51b861b18bbf7492c4b", + "codeHash": "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356", "hashType": "type", "args": "0x81312ae06eeb0504b737e6bcfa5397be35a928de" } diff --git a/packages/ckb-sdk-utils/__tests__/systemScripts/fixtures.json b/packages/ckb-sdk-utils/__tests__/systemScripts/fixtures.json index 9552637b..f6e19c16 100644 --- a/packages/ckb-sdk-utils/__tests__/systemScripts/fixtures.json +++ b/packages/ckb-sdk-utils/__tests__/systemScripts/fixtures.json @@ -32,10 +32,17 @@ } }, "ANYONE_CAN_PAY": { + "mainnet": { + "codeHash": "0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354", + "hashType": "type", + "txHash": "0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d", + "index": "0x0", + "depType": "depGroup" + }, "testnet": { - "codeHash": "0x86a1c6987a4acbe1a887cca4c9dd2ac9fcb07405bbeda51b861b18bbf7492c4b", + "codeHash": "0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356", "hashType": "type", - "txHash": "0x4f32b3e39bd1b6350d326fdfafdfe05e5221865c3098ae323096f0bfc69e0a8c", + "txHash": "0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6", "index": "0x0", "depType": "depGroup" } diff --git a/packages/ckb-sdk-utils/__tests__/systemScripts/index.test.js b/packages/ckb-sdk-utils/__tests__/systemScripts/index.test.js index 988bea2c..a6c3bb32 100644 --- a/packages/ckb-sdk-utils/__tests__/systemScripts/index.test.js +++ b/packages/ckb-sdk-utils/__tests__/systemScripts/index.test.js @@ -29,12 +29,12 @@ describe('Test System Scripts', () => { }) describe('Test anyone can pay', () => { - it("shouldn't has mainnet script", () => { - expect(systemScripts.ANYONE_CAN_PAY.mainnet).toBeUndefined() + it('should has mainnet script', () => { + expect(getInfo(systemScripts.ANYONE_CAN_PAY_MAINNET, true)).toEqual(fixtures.ANYONE_CAN_PAY.mainnet) }) it('should has testnet script', () => { - expect(getInfo(systemScripts.ANYONE_CAN_PAY, false)).toEqual(fixtures.ANYONE_CAN_PAY.testnet) + expect(getInfo(systemScripts.ANYONE_CAN_PAY_TESTNET, false)).toEqual(fixtures.ANYONE_CAN_PAY.testnet) }) }) diff --git a/packages/ckb-sdk-utils/src/address/index.ts b/packages/ckb-sdk-utils/src/address/index.ts index f0ee062a..a6163c9b 100644 --- a/packages/ckb-sdk-utils/src/address/index.ts +++ b/packages/ckb-sdk-utils/src/address/index.ts @@ -1,5 +1,10 @@ import { bech32, blake160 } from '..' -import { SECP256K1_BLAKE160, SECP256K1_MULTISIG, ANYONE_CAN_PAY } from '../systemScripts' +import { + SECP256K1_BLAKE160, + SECP256K1_MULTISIG, + ANYONE_CAN_PAY_MAINNET, + ANYONE_CAN_PAY_TESTNET, +} from '../systemScripts' import { hexToBytes, bytesToHex } from '../convertors' import { HexStringWithout0xException, AddressException, AddressPayloadException } from '../exceptions' @@ -159,7 +164,11 @@ export const addressToScript = (address: string): CKBComponents.Script => { const type = payload[0] if (type === +AddressType.HashIdx) { - const codeHashIndices = [SECP256K1_BLAKE160, SECP256K1_MULTISIG, ANYONE_CAN_PAY] + const codeHashIndices = [ + SECP256K1_BLAKE160, + SECP256K1_MULTISIG, + address.startsWith(AddressPrefix.Mainnet) ? ANYONE_CAN_PAY_MAINNET : ANYONE_CAN_PAY_TESTNET, + ] const index = payload[1] const args = payload.slice(2) const script = codeHashIndices[index] diff --git a/packages/ckb-sdk-utils/src/systemScripts.ts b/packages/ckb-sdk-utils/src/systemScripts.ts index dbd81185..bc1b7ccc 100644 --- a/packages/ckb-sdk-utils/src/systemScripts.ts +++ b/packages/ckb-sdk-utils/src/systemScripts.ts @@ -59,12 +59,22 @@ export const SECP256K1_MULTISIG: SystemScript & OutPoints = { * @name ANYONE_CAN_PAY * @description ANYONE_CAN_PAY allows a recipient to provide cell capacity in asset transfer */ -export const ANYONE_CAN_PAY: SystemScript & Pick = { - codeHash: '0x86a1c6987a4acbe1a887cca4c9dd2ac9fcb07405bbeda51b861b18bbf7492c4b', +export const ANYONE_CAN_PAY_MAINNET: SystemScript & Pick = { + codeHash: '0xd369597ff47f29fbc0d47d2e3775370d1250b85140c670e4718af712983a2354', + hashType: 'type', + depType: 'depGroup', + mainnetOutPoint: { + txHash: '0x4153a2014952d7cac45f285ce9a7c5c0c0e1b21f2d378b82ac1433cb11c25c4d', + index: '0x0', + }, +} + +export const ANYONE_CAN_PAY_TESTNET: SystemScript & Pick = { + codeHash: '0x3419a1c09eb2567f6552ee7a8ecffd64155cffe0f1796e6e61ec088d740c1356', hashType: 'type', depType: 'depGroup', testnetOutPoint: { - txHash: '0x4f32b3e39bd1b6350d326fdfafdfe05e5221865c3098ae323096f0bfc69e0a8c', + txHash: '0xec26b0f85ed839ece5f11c4c4e837ec359f5adc4420410f6453b1f6b60fb96a6', index: '0x0', }, } From c10ec0b95877e67599ee67306b1968934a5b55ca Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 26 Nov 2020 00:28:55 +0800 Subject: [PATCH 3/5] feat: upgrade @ckb-lumos/indexer and add the example of sudt transaction --- README.md | 2 + package.json | 2 +- packages/ckb-sdk-core/examples/sudt.js | 224 ++++++++++++++++++ .../ckb-sdk-core/src/loadCellsFromIndexer.ts | 16 +- yarn.lock | 24 +- 5 files changed, 249 insertions(+), 19 deletions(-) create mode 100644 packages/ckb-sdk-core/examples/sudt.js diff --git a/README.md b/README.md index 8dcd4f37..8a0a781a 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,8 @@ The rpc module will throw an error when the result contains an error field, you 3. [Send Transaction with multiple private key](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/sendTransactionWithMultiplePrivateKey.js) 4. [Deposit to and withdraw from Nervos DAO](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/nervosDAO.js) 5. [Send Transaction with Lumos Collector](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/sendTransactionWithLumosCollector.js) +6. [SUDT](https://github.com/nervosnetwork/ckb-sdk-js/blob/develop/packages/ckb-sdk-core/examples/sudt.js) + # Development Process diff --git a/package.json b/package.json index 75d01d6f..2d5f3f42 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ ] }, "optionalDependencies": { - "@ckb-lumos/indexer": "0.4.5" + "@ckb-lumos/indexer": "0.14.0" }, "devDependencies": { "@cryptape/sdk-ts-config": "0.0.1", diff --git a/packages/ckb-sdk-core/examples/sudt.js b/packages/ckb-sdk-core/examples/sudt.js new file mode 100644 index 00000000..7aa8a65b --- /dev/null +++ b/packages/ckb-sdk-core/examples/sudt.js @@ -0,0 +1,224 @@ +/* eslint-disable camelcase */ +const path = require('path') +const os = require('os') +/* eslint-disable-next-line */ +const { Indexer, CellCollector } = require('@ckb-lumos/indexer') +const { SIMPLE_UDT, ANYONE_CAN_PAY_TESTNET } = require('@nervosnetwork/ckb-sdk-utils/lib/systemScripts') +const CKB = require('../lib').default + +const CONFIG = { + privateKey: process.env.PRIVATE_KEY, + ckbUrl: process.env.CKB_URL || 'http://localhost:8114', + lumosDbName: process.env.LUMOS_DB_NAME || 'testnet_lomus_db', + sudtDep: { + codeHash: SIMPLE_UDT.codeHash, + hashType: SIMPLE_UDT.hashType, + outPoint: SIMPLE_UDT.testnetOutPoint, + depType: SIMPLE_UDT.depType, + }, + acpDep: { + codeHash: ANYONE_CAN_PAY_TESTNET.codeHash, + hashType: ANYONE_CAN_PAY_TESTNET.hashType, + outPoint: ANYONE_CAN_PAY_TESTNET.testnetOutPoint, + depType: ANYONE_CAN_PAY_TESTNET.depType, + }, +} + +const CONSTANT = { + sudtCellSize: 142 * 10 ** 8, + acpCellSize: 61 * 10 ** 8, +} + +class SudtAccount { + constructor(privateKey = CONFIG.privateKey, ckbUrl = CONFIG.ckbUrl) { + this.ckb = new CKB(ckbUrl) + this.indexer = new Indexer(ckbUrl, path.join(os.tmpdir(), CONFIG.lumosDbName)) + this.indexer.start() + + const publicKey = this.ckb.utils.privateKeyToPublicKey(privateKey) + const publicKeyHash = `0x${this.ckb.utils.blake160(publicKey, 'hex')}` + this.sender = { privateKey, publicKey, publicKeyHash } + } + + getReady = async () => { + await this.ckb.loadDeps() + this.sender.lock = { + codeHash: this.ckb.config.secp256k1Dep.codeHash, + hashType: this.ckb.config.secp256k1Dep.hashType, + args: this.sender.publicKeyHash, + } + } + + getCells = async () => { + await this.ckb.loadCells({ indexer: this.indexer, CellCollector, lock: this.sender.lock, save: true }) + return this.ckb.cells.get(this.ckb.utils.scriptToHash(this.sender.lock)) + } + + getSudtCells = async tokenId => { + const cells = [] + const collector = new CellCollector(this.indexer, { + lock: { + code_hash: this.sender.lock.codeHash, + hash_type: this.sender.lock.hashType, + args: this.sender.publicKeyHash, + }, + type: { + code_hash: CONFIG.sudtDep.codeHash, + hash_type: CONFIG.sudtDep.hashType, + args: tokenId || this.ckb.utils.scriptToHash(this.sender.lock), + }, + }) + /* eslint-disable-next-line */ + for await (const { + cell_output: { lock, type, capacity }, + out_point, + data, + } of collector.collect()) { + cells.push({ + capacity: BigInt(capacity), + lock: { + codeHash: lock.code_hash, + hashType: lock.hash_type, + args: lock.args, + }, + type: { + codeHash: type.code_hash, + hashType: type.hash_type, + args: type.args, + }, + outPoint: { + txHash: out_point.tx_hash, + index: out_point.index, + }, + data, + sudt: BigInt(`0x${Buffer.from(data.slice(2), 'hex').reverse().toString('hex')}`), + }) + } + return cells + } + + createAcpCell = async amount => { + const address = this.ckb.utils.privateKeyToAddress(this.sender.privateKey, { prefix: 'ckt' }) + const rawTx = this.ckb.generateRawTransaction({ + fromAddress: address, + toAddress: address, + capacity: `0x${(BigInt(CONSTANT.acpCellSize) + amount).toString(16)}`, + fee: 100000n, + cells: this.ckb.cells.get(this.ckb.utils.scriptToHash(this.sender.lock)), + deps: [this.ckb.config.secp256k1Dep, CONFIG.acpDep], + }) + rawTx.outputs[0].lock = { + codeHash: CONFIG.acpDep.codeHash, + hashType: CONFIG.acpDep.hashType, + args: this.sender.publicKeyHash, + } + const signedTx = this.ckb.signTransaction(this.sender.privateKey)(rawTx) + return this.ckb.rpc.sendTransaction(signedTx) + } + + issue = async amount => { + const address = this.ckb.utils.privateKeyToAddress(this.sender.privateKey, { prefix: 'ckt' }) + const rawTx = this.ckb.generateRawTransaction({ + fromAddress: address, + toAddress: address, + capacity: CONSTANT.sudtCellSize, + fee: 100000n, + cells: this.ckb.cells.get(this.ckb.utils.scriptToHash(this.sender.lock)), + deps: [this.ckb.config.secp256k1Dep, CONFIG.sudtDep], + }) + + /* + * set the first output cell as the sudt-issuer + */ + rawTx.outputs[0].type = { + codeHash: CONFIG.sudtDep.codeHash, + hashType: CONFIG.sudtDep.hashType, + args: this.ckb.utils.scriptToHash(this.sender.lock), + } + rawTx.outputsData[0] = `0x${Buffer.from(amount.toString(16).padStart(32, '0'), 'hex').reverse().toString('hex')}` + const signedTx = this.ckb.signTransaction(this.sender.privateKey)(rawTx) + return this.ckb.rpc.sendTransaction(signedTx) + } + + transfer = async (tokenId, amount, receiverCell) => { + const availableCells = await this.getSudtCells(tokenId) + const inputs = [] + let sumSudt = 0n + /* eslint-disable-next-line */ + for (const cell of availableCells) { + inputs.push(cell) + sumSudt += cell.sudt + if (amount <= sumSudt) { + /* eslint-disable-next-line */ + continue + } + } + + if (amount > sumSudt) { + throw new Error(`This account has ${sumSudt} sudt, which is not enough for a transaction of amount ${amount}`) + } + + const address = this.ckb.utils.privateKeyToAddress(this.sender.privateKey, { prefix: 'ckt' }) + + const sudtTypeScript = inputs[0].type + + /* transaction skeleton */ + const rawTx = this.ckb.generateRawTransaction({ + fromAddress: address, + toAddress: address, + capacity: `0x${inputs.reduce((sum, i) => sum + i.capacity, 0n).toString(16)}`, + fee: 0n, + cells: inputs.map(input => ({ ...input, capacity: `0x${input.capacity.toString(16)}` })), + deps: [this.ckb.config.secp256k1Dep, CONFIG.sudtDep], + safeMode: false, + changeThreshold: '0x0', + outputsData: [sumSudt - amount, amount].map( + sudt => `0x${Buffer.from(sudt.toString(16), 'hex').reverse().toString('hex').padEnd(32, '0')}`, + ), + }) + + rawTx.outputs[0].type = sudtTypeScript + + /* add receiver */ + const fee = 10000n + rawTx.inputs.push({ + previousOutput: receiverCell.outPoint, + since: '0x0', + }) + rawTx.outputs.push({ + lock: receiverCell.lock, + capacity: `0x${(BigInt(receiverCell.capacity) - fee).toString(16)}`, + type: sudtTypeScript, + }) + rawTx.witnesses.push('0x') + + const signedTx = this.ckb.signTransaction(this.sender.privateKey)(rawTx) + return this.ckb.rpc.sendTransaction(signedTx) + } +} + +module.exports = SudtAccount + +// const run = async () => { +// const account = new SudtAccount() +// await account.getReady() +// const cells = await account.getCells() + +// /* issue sudt */ +// const txHash = await account.issue(2000000n * BigInt(10 ** 8)) +// console.log(txHash) + +// /* get sudt cells */ +// const sudtCells = await account.getSudtCells() +// console.log(sudtCells) + +// /* transfer */ +// const receiverCell = cells.find(cell => !cell.type && cell.data === '0x') +// if (!receiverCell) { +// throw new Error('Please add a secp256k1 cell to receive sudt') +// } +// const txHash = await account.transfer(null, 999n * BigInt(10 ** 8), receiverCell) +// console.log(txHash) +// } + +// run() diff --git a/packages/ckb-sdk-core/src/loadCellsFromIndexer.ts b/packages/ckb-sdk-core/src/loadCellsFromIndexer.ts index 7cc0d25b..8381acf5 100644 --- a/packages/ckb-sdk-core/src/loadCellsFromIndexer.ts +++ b/packages/ckb-sdk-core/src/loadCellsFromIndexer.ts @@ -17,14 +17,18 @@ export const loadCellsFromIndexer = async ({ const cells: RawTransactionParams.Cell[] = [] - /* eslint-disable no-restricted-syntax */ - for await (const cell of collector.collect()) { + /* eslint-disable no-restricted-syntax, camelcase */ + for await (const { + data, + cell_output: { capacity, type }, + out_point, + } of collector.collect()) { cells.push({ - data: cell.data, + data, lock, - type: cell.cell_output.type, - capacity: cell.cell_output.capacity, - outPoint: { txHash: cell.out_point.tx_hash, index: cell.out_point.index }, + type: type && { codeHash: type.code_hash, hashType: type.hash_type, args: type.args }, + capacity, + outPoint: { txHash: out_point.tx_hash, index: out_point.index }, }) } /* eslint-enable no-restricted-syntax */ diff --git a/yarn.lock b/yarn.lock index bbd5e35d..826b6c70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -263,23 +263,23 @@ resolved "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@ckb-lumos/base@^0.4.5": - version "0.4.8" - resolved "https://registry.npmjs.org/@ckb-lumos/base/-/base-0.4.8.tgz#04551817312530146383d12104717a8d3764a5da" - integrity sha512-Nwp5zhN0JgYjyqkeuIGR3tGL8j4f6G/rFsWK/qWpZhpsK95zJlPC+OogP/gVES/Cl9XPa9Ouq886sCe/8qfiHg== +"@ckb-lumos/base@^0.14.0": + version "0.14.0" + resolved "https://registry.npmjs.org/@ckb-lumos/base/-/base-0.14.0.tgz#84217dbba40254794970fc2053592ee8b6300191" + integrity sha512-8zF1TBCBOPnDsQvh/AMouadSzUXEt0+tMiAYQhF0kh21dTtazwC7+ocTB0yvgVKcQmymCW8uhID99GJjJDnPYA== dependencies: blake2b "^2.1.3" - ckb-js-toolkit "^0.9.1" + ckb-js-toolkit "^0.9.2" immutable "^4.0.0-rc.12" xxhash "^0.3.0" -"@ckb-lumos/indexer@0.4.5": - version "0.4.5" - resolved "https://registry.npmjs.org/@ckb-lumos/indexer/-/indexer-0.4.5.tgz#c802eb0bff5bcb88703fa684017f1f833a0cff22" - integrity sha512-nvGVOrZ23Hnrjs5VVHAesXzkZEMOH/y8JoGVuTCVhLRozbk+ajOhYhDJGjOY9x6lzND/EvJ3jmIvP7fRao42kA== +"@ckb-lumos/indexer@0.14.0": + version "0.14.0" + resolved "https://registry.npmjs.org/@ckb-lumos/indexer/-/indexer-0.14.0.tgz#bd3740c52046af714b7448de95bde4110053cf6e" + integrity sha512-xgd/4liFEp2Uh9ztfpfPHHw/O6BF+sHgN8CtqdHmj3cA7kjwGYYG1mNKpwBAIcX288ilju8epBNK1QfHE3+Ekg== dependencies: - "@ckb-lumos/base" "^0.4.5" - ckb-js-toolkit "^0.9.1" + "@ckb-lumos/base" "^0.14.0" + ckb-js-toolkit "^0.9.2" immutable "^4.0.0-rc.12" neon-cli "^0.4.0" node-pre-gyp "^0.14.0" @@ -2433,7 +2433,7 @@ cipher-base@^1.0.1, cipher-base@^1.0.3: inherits "^2.0.1" safe-buffer "^5.0.1" -ckb-js-toolkit@^0.9.1: +ckb-js-toolkit@^0.9.2: version "0.9.2" resolved "https://registry.npmjs.org/ckb-js-toolkit/-/ckb-js-toolkit-0.9.2.tgz#c80eb98dc25099241e97bb025ac1566b896bbd49" integrity sha512-KutTBpsvkioPl3wPzwS6A5yEppq2pbpSPG4dXnbAu+L5gBzhQVEOj5tH4WBwF8qHm6u9mc/zCRnmjPw8e8Ad2g== From ab1eea0fa1d2aa74c6d037bd6fffd6997b7e0dc5 Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 27 Nov 2020 10:35:13 +0800 Subject: [PATCH 4/5] chore: update package versions and changelogs --- CHANGELOG.md | 12 ++++++++++++ lerna.json | 2 +- packages/ckb-sdk-core/CHANGELOG.md | 11 +++++++++++ packages/ckb-sdk-core/package.json | 8 ++++---- packages/ckb-sdk-rpc/CHANGELOG.md | 8 ++++++++ packages/ckb-sdk-rpc/package.json | 6 +++--- packages/ckb-sdk-utils/CHANGELOG.md | 11 +++++++++++ packages/ckb-sdk-utils/package.json | 4 ++-- packages/ckb-types/CHANGELOG.md | 8 ++++++++ packages/ckb-types/package.json | 2 +- 10 files changed, 61 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5ce98d2..18bb84c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.38.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.38.0...v0.38.1) (2020-11-27) + + +### Features + +* **core:** upgrade @ckb-lumos/indexer and add the example of sudt transaction ([c10ec0b](https://github.com/nervosnetwork/ckb-sdk-js/commit/c10ec0b95877e67599ee67306b1968934a5b55ca)) +* **utils:** update acp lock script ([6d9a85f](https://github.com/nervosnetwork/ckb-sdk-js/commit/6d9a85f05f393216fc06650fd650f43049874a20)) + + + + + # [0.38.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.37.0...v0.38.0) (2020-11-20) diff --git a/lerna.json b/lerna.json index 4e56e136..b41bca41 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "0.38.0" + "version": "0.38.1" } diff --git a/packages/ckb-sdk-core/CHANGELOG.md b/packages/ckb-sdk-core/CHANGELOG.md index ab875398..393f952c 100644 --- a/packages/ckb-sdk-core/CHANGELOG.md +++ b/packages/ckb-sdk-core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.38.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.38.0...v0.38.1) (2020-11-27) + + +### Features + +* **core:** upgrade @ckb-lumos/indexer and add the example of sudt transaction ([c10ec0b](https://github.com/nervosnetwork/ckb-sdk-js/commit/c10ec0b95877e67599ee67306b1968934a5b55ca)) + + + + + # [0.38.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.37.0...v0.38.0) (2020-11-20) diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index cf1dabfe..a9f8cf5b 100644 --- a/packages/ckb-sdk-core/package.json +++ b/packages/ckb-sdk-core/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-core", - "version": "0.38.0", + "version": "0.38.1", "description": "JavaScript SDK for Nervos Network CKB Project", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -31,9 +31,9 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-rpc": "0.38.0", - "@nervosnetwork/ckb-sdk-utils": "0.38.0", - "@nervosnetwork/ckb-types": "0.38.0", + "@nervosnetwork/ckb-sdk-rpc": "0.38.1", + "@nervosnetwork/ckb-sdk-utils": "0.38.1", + "@nervosnetwork/ckb-types": "0.38.1", "tslib": "2.0.1" }, "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" diff --git a/packages/ckb-sdk-rpc/CHANGELOG.md b/packages/ckb-sdk-rpc/CHANGELOG.md index b7808083..09b736ab 100644 --- a/packages/ckb-sdk-rpc/CHANGELOG.md +++ b/packages/ckb-sdk-rpc/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.38.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.38.0...v0.38.1) (2020-11-27) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc + + + + + # [0.38.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.37.0...v0.38.0) (2020-11-20) **Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index f40148cc..4be8d916 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-rpc", - "version": "0.38.0", + "version": "0.38.1", "description": "RPC module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js/packages/ckb-rpc#readme", @@ -33,12 +33,12 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.38.0", + "@nervosnetwork/ckb-sdk-utils": "0.38.1", "axios": "0.19.2", "tslib": "2.0.1" }, "devDependencies": { - "@nervosnetwork/ckb-types": "0.38.0" + "@nervosnetwork/ckb-types": "0.38.1" }, "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" } diff --git a/packages/ckb-sdk-utils/CHANGELOG.md b/packages/ckb-sdk-utils/CHANGELOG.md index 4ec68afb..82b5801a 100644 --- a/packages/ckb-sdk-utils/CHANGELOG.md +++ b/packages/ckb-sdk-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.38.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.38.0...v0.38.1) (2020-11-27) + + +### Features + +* **utils:** update acp lock script ([6d9a85f](https://github.com/nervosnetwork/ckb-sdk-js/commit/6d9a85f05f393216fc06650fd650f43049874a20)) + + + + + # [0.38.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.37.0...v0.38.0) (2020-11-20) **Note:** Version bump only for package @nervosnetwork/ckb-sdk-utils diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 6f222aa4..1e50632e 100644 --- a/packages/ckb-sdk-utils/package.json +++ b/packages/ckb-sdk-utils/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-utils", - "version": "0.38.0", + "version": "0.38.1", "description": "Utils module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -31,7 +31,7 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-types": "0.38.0", + "@nervosnetwork/ckb-types": "0.38.1", "elliptic": "6.5.3", "jsbi": "3.1.3", "tslib": "2.0.1" diff --git a/packages/ckb-types/CHANGELOG.md b/packages/ckb-types/CHANGELOG.md index b5d65ef3..c3fe89b0 100644 --- a/packages/ckb-types/CHANGELOG.md +++ b/packages/ckb-types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.38.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.38.0...v0.38.1) (2020-11-27) + +**Note:** Version bump only for package @nervosnetwork/ckb-types + + + + + # [0.38.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.37.0...v0.38.0) (2020-11-20) **Note:** Version bump only for package @nervosnetwork/ckb-types diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 7b5c7cf5..0288fad4 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-types", - "version": "0.38.0", + "version": "0.38.1", "description": "Type module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", From 026d5750cc165e454f8b8ccdc47a3c87364f499b Mon Sep 17 00:00:00 2001 From: Keith Date: Fri, 27 Nov 2020 11:19:27 +0800 Subject: [PATCH 5/5] chore: update lerna hashes --- packages/ckb-sdk-core/package.json | 2 +- packages/ckb-sdk-rpc/package.json | 2 +- packages/ckb-sdk-utils/package.json | 2 +- packages/ckb-types/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index a9f8cf5b..fb462765 100644 --- a/packages/ckb-sdk-core/package.json +++ b/packages/ckb-sdk-core/package.json @@ -36,5 +36,5 @@ "@nervosnetwork/ckb-types": "0.38.1", "tslib": "2.0.1" }, - "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" + "gitHead": "ab1eea0fa1d2aa74c6d037bd6fffd6997b7e0dc5" } diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index 4be8d916..3ecc1699 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -40,5 +40,5 @@ "devDependencies": { "@nervosnetwork/ckb-types": "0.38.1" }, - "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" + "gitHead": "ab1eea0fa1d2aa74c6d037bd6fffd6997b7e0dc5" } diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 1e50632e..21b2c508 100644 --- a/packages/ckb-sdk-utils/package.json +++ b/packages/ckb-sdk-utils/package.json @@ -40,5 +40,5 @@ "@types/bitcoinjs-lib": "5.0.0", "@types/elliptic": "6.4.12" }, - "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" + "gitHead": "ab1eea0fa1d2aa74c6d037bd6fffd6997b7e0dc5" } diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 0288fad4..de963925 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -23,5 +23,5 @@ "scripts": { "doc": "../../node_modules/.bin/typedoc --out docs ./index.d.ts --mode modules --includeDeclarations --excludeExternals --ignoreCompilerErrors --theme default --readme README.md" }, - "gitHead": "16e10cb506a1fb98a4b09ab33d3ba13fe122eda5" + "gitHead": "ab1eea0fa1d2aa74c6d037bd6fffd6997b7e0dc5" }