From 163df771751eb5e21d1369b6f6a26de2d0aa67ba Mon Sep 17 00:00:00 2001 From: Keith Date: Sat, 19 Oct 2019 15:33:08 +0800 Subject: [PATCH 1/4] chore: update lerna hashes[skip ci] --- packages/ckb-sdk-rpc/package.json | 2 +- packages/ckb-sdk-utils/package.json | 2 +- packages/ckb-types/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index 025af9f6..ffc7ed08 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -39,5 +39,5 @@ "@nervosnetwork/ckb-types": "0.23.0", "dotenv": "8.1.0" }, - "gitHead": "75ca98410be660b343f79a8f56380b218ac0ed1a" + "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" } diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index d564919e..45fa109e 100644 --- a/packages/ckb-sdk-utils/package.json +++ b/packages/ckb-sdk-utils/package.json @@ -39,5 +39,5 @@ "@types/elliptic": "6.4.8", "@types/utf8": "2.1.6" }, - "gitHead": "75ca98410be660b343f79a8f56380b218ac0ed1a" + "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" } diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 5f77e0e8..eb739439 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": "75ca98410be660b343f79a8f56380b218ac0ed1a" + "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" } From 1dd82a4afba22f547406953444aa59df7e3a86bd Mon Sep 17 00:00:00 2001 From: Chen Yu Date: Tue, 22 Oct 2019 15:43:32 +0800 Subject: [PATCH 2/4] Calculate min tx fee (#372) * feat(utils): add utils.calculateMinTransactionFee to calculate the minimum transaction fee * feat(utils): add methods for calculating transaction fee 1. add utils.serializeTransaction method to serialize a full transaction; 2. add utils.calculateTrasnactionSize to get the size of a full transaction * refactor(utils): rename calculateMinTransactionFee to calculateTransactionFee * refactor(utils): rename calculateTransactionSize to calculateSerializedTxSizeInBlock --- .../serialization/transaction/fixtures.json | 76 +++++++++++++++++++ .../serialization/transaction/index.test.js | 30 ++++++++ .../__tests__/utils/index.test.js | 29 +++++++ .../utils/transactionFee.fixtures.json | 12 +++ .../utils/transactionSize.fixture.json | 60 +++++++++++++++ packages/ckb-sdk-utils/src/index.ts | 27 ++++++- .../src/serialization/transaction.ts | 13 ++++ 7 files changed, 244 insertions(+), 3 deletions(-) create mode 100644 packages/ckb-sdk-utils/__tests__/utils/transactionFee.fixtures.json create mode 100644 packages/ckb-sdk-utils/__tests__/utils/transactionSize.fixture.json diff --git a/packages/ckb-sdk-utils/__tests__/serialization/transaction/fixtures.json b/packages/ckb-sdk-utils/__tests__/serialization/transaction/fixtures.json index bd16c555..3b63f064 100644 --- a/packages/ckb-sdk-utils/__tests__/serialization/transaction/fixtures.json +++ b/packages/ckb-sdk-utils/__tests__/serialization/transaction/fixtures.json @@ -178,6 +178,20 @@ "expected": "0x140000000c000000100000000000000000000000" } }, + "serializeWitnesses": { + "empty witnesses": { + "witnesses": [], + "expected": "0x04000000" + }, + "witnesses has multiple items": { + "witnesses": ["0x10", "0x01"], + "expected": "0x160000000c0000001100000001000000100100000001" + }, + "witnesses has one item": { + "witnesses": ["0x3954acece65096bfa81258983ddb83915fc56bd8"], + "expected": "0x2000000008000000140000003954acece65096bfa81258983ddb83915fc56bd8" + } + }, "serializeRawTransaction": { "basic raw transaction": { "rawTransaction": { @@ -239,5 +253,67 @@ }, "expected": "0xb90100001c000000200000006e00000072000000a2000000a50100000000000002000000c12386705b5cbb312b693874f3edf45c43a274482e27b8df0fd80c8d3f5feb8b00000000010fb4945d52baf91e0dee2a686cdd9d84cad95b566a1d7409b970ee0a0f364f6002000000000000000001000000000000000000000031f695263423a4b05045dd25ce6692bb55d7bba2965d8be16b036e138e72cc6501000000030100000c000000a20000009600000010000000180000006100000000e87648170000004900000010000000300000003100000068d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88011400000059a27ef3ba84f061517d13f42cf44ed02061006135000000100000003000000031000000ece45e0979030e2f8909f76258631c42333b1e906fd9701ec3600a464a90b8f600000000006100000010000000180000006100000000506a41e15900004900000010000000300000003100000068d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88011400000059a27ef3ba84f061517d13f42cf44ed020610061140000000c000000100000000000000000000000" } + }, + "serializeTransaction": { + "basic transaction": { + "transaction": { + "version": "0x0", + "cellDeps": [ + { + "outPoint": { + "txHash": "0xc12386705b5cbb312b693874f3edf45c43a274482e27b8df0fd80c8d3f5feb8b", + "index": "0x0" + }, + "depType": "depGroup" + }, + { + "outPoint": { + "txHash": "0x0fb4945d52baf91e0dee2a686cdd9d84cad95b566a1d7409b970ee0a0f364f60", + "index": "0x2" + }, + "depType": "code" + } + ], + "headerDeps": [], + "inputs": [ + { + "previousOutput": { + "txHash": "0x31f695263423a4b05045dd25ce6692bb55d7bba2965d8be16b036e138e72cc65", + "index": "0x1" + }, + "since": "0x0" + } + ], + "outputs": [ + { + "capacity": "0x174876e800", + "lock": { + "codeHash": "0x68d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88", + "args": "0x59a27ef3ba84f061517d13f42cf44ed020610061", + "hashType": "type" + }, + "type": { + "codeHash": "0xece45e0979030e2f8909f76258631c42333b1e906fd9701ec3600a464a90b8f6", + "args": "0x", + "hashType": "data" + } + }, + { + "capacity": "0x59e1416a5000", + "lock": { + "codeHash": "0x68d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88", + "args": "0x59a27ef3ba84f061517d13f42cf44ed020610061", + "hashType": "type" + }, + "type": null + } + ], + "outputsData": ["0x", "0x"], + "witnesses": [ + "0x82df73581bcd08cb9aa270128d15e79996229ce8ea9e4f985b49fbf36762c5c37936caf3ea3784ee326f60b8992924fcf496f9503c907982525a3436f01ab32900" + ] + }, + "expected": "0x120200000c000000c5010000b90100001c000000200000006e00000072000000a2000000a50100000000000002000000c12386705b5cbb312b693874f3edf45c43a274482e27b8df0fd80c8d3f5feb8b00000000010fb4945d52baf91e0dee2a686cdd9d84cad95b566a1d7409b970ee0a0f364f6002000000000000000001000000000000000000000031f695263423a4b05045dd25ce6692bb55d7bba2965d8be16b036e138e72cc6501000000030100000c000000a20000009600000010000000180000006100000000e87648170000004900000010000000300000003100000068d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88011400000059a27ef3ba84f061517d13f42cf44ed02061006135000000100000003000000031000000ece45e0979030e2f8909f76258631c42333b1e906fd9701ec3600a464a90b8f600000000006100000010000000180000006100000000506a41e15900004900000010000000300000003100000068d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88011400000059a27ef3ba84f061517d13f42cf44ed020610061140000000c0000001000000000000000000000004d000000080000004100000082df73581bcd08cb9aa270128d15e79996229ce8ea9e4f985b49fbf36762c5c37936caf3ea3784ee326f60b8992924fcf496f9503c907982525a3436f01ab32900" + } } } diff --git a/packages/ckb-sdk-utils/__tests__/serialization/transaction/index.test.js b/packages/ckb-sdk-utils/__tests__/serialization/transaction/index.test.js index ecfb5596..6a08230f 100644 --- a/packages/ckb-sdk-utils/__tests__/serialization/transaction/index.test.js +++ b/packages/ckb-sdk-utils/__tests__/serialization/transaction/index.test.js @@ -9,7 +9,9 @@ const { serializeOutput, serializeOutputs, serializeOutputsData, + serializeWitnesses, serializeRawTransaction, + serializeTransaction, } = require('../../../lib/serialization/transaction') const fixtures = require('./fixtures.json') @@ -173,6 +175,20 @@ describe('Test Transaction Serialization', () => { }) }) + describe('Serialize Witnesses', () => { + const fixtureTable = Object.entries(fixtures.serializeWitnesses).map( + ([title, { witnesses, expected, exception }]) => [title, witnesses, expected, exception] + ) + test.each(fixtureTable)('%s', (_title, witnesses, expected, exception) => { + if (undefined !== expected) { + expect(serializeWitnesses(witnesses)).toBe(expected) + } + if (undefined !== exception) { + expect(() => serializeWitnesses(witnesses)).toThrowError(exception) + } + }) + }) + describe('Serialize RawTransaction', () => { const fixtureTable = Object.entries(fixtures.serializeRawTransaction).map( ([title, { rawTransaction, expected, exception }]) => [title, rawTransaction, expected, exception] @@ -186,4 +202,18 @@ describe('Test Transaction Serialization', () => { } }) }) + + describe('Serialize Transaction', () => { + const fixtureTable = Object.entries(fixtures.serializeTransaction).map( + ([title, { transaction, expected, exception }]) => [title, transaction, expected, exception] + ) + test.each(fixtureTable)('%j', (_title, transaction, expected, exception) => { + if (undefined !== expected) { + expect(serializeTransaction(transaction)).toBe(expected) + } + if (undefined !== exception) { + expect(() => serializeTransaction(transaction)).toThrow(new Error(exception)) + } + }) + }) }) diff --git a/packages/ckb-sdk-utils/__tests__/utils/index.test.js b/packages/ckb-sdk-utils/__tests__/utils/index.test.js index 3590a722..d8f8c3f1 100644 --- a/packages/ckb-sdk-utils/__tests__/utils/index.test.js +++ b/packages/ckb-sdk-utils/__tests__/utils/index.test.js @@ -3,6 +3,8 @@ const exceptions = require('../../lib/exceptions') const bech32Fixtures = require('./bech32.fixtures.json') const rawTransactionToHashFixtures = require('./rawTransactionToHash.fixtures.json') const transformerFixtures = require('./transformer.fixtures.json') +const transactionFeeFixtures = require('./transactionFee.fixtures.json') +const transactionSizeFixture = require('./transactionSize.fixture.json') const { ArgumentRequired } = require('../../lib/exceptions') const { @@ -25,6 +27,8 @@ const { toHexInLittleEndian, AddressType, fullPayloadToAddress, + calculateTransactionFee, + calculateSerializedTxSizeInBlock, } = ckbUtils const { HexStringShouldStartWith0x, InvalidHexString } = exceptions @@ -366,3 +370,28 @@ describe('address', () => { expect(bytesToHex(parsedBytes)).toBe(`0x${fixture.hrp}${fixture.blake160Pubkey}`) }) }) + +describe('transaction fee', () => { + const fixtureTable = Object.entries(transactionFeeFixtures).map( + ([title, { transactionSize, feeRate, expected, exception }]) => [ + title, + BigInt(transactionSize), + BigInt(feeRate), + BigInt(expected), + exception, + ] + ) + test.each(fixtureTable)('%s', (_title, transactionSize, feeRate, expected, exception) => { + if (undefined !== expected) { + expect(calculateTransactionFee(transactionSize, feeRate)).toBe(expected) + } + if (undefined !== exception) { + expect(() => calculateTransactionFee(transactionSize, feeRate)).toThrowError(exception) + } + }) +}) + +describe('transaction size', () => { + const { transaction, expected } = transactionSizeFixture + expect(calculateSerializedTxSizeInBlock(transaction)).toBe(expected) +}) diff --git a/packages/ckb-sdk-utils/__tests__/utils/transactionFee.fixtures.json b/packages/ckb-sdk-utils/__tests__/utils/transactionFee.fixtures.json new file mode 100644 index 00000000..9332c1e9 --- /dev/null +++ b/packages/ckb-sdk-utils/__tests__/utils/transactionFee.fixtures.json @@ -0,0 +1,12 @@ +{ + "cell the fee": { + "transactionSize": 1035, + "feeRate": 900, + "expected": 932 + }, + "uncell the fee": { + "transactionSize": 900, + "feeRate": 900, + "expected": 810 + } +} diff --git a/packages/ckb-sdk-utils/__tests__/utils/transactionSize.fixture.json b/packages/ckb-sdk-utils/__tests__/utils/transactionSize.fixture.json new file mode 100644 index 00000000..0ffd8827 --- /dev/null +++ b/packages/ckb-sdk-utils/__tests__/utils/transactionSize.fixture.json @@ -0,0 +1,60 @@ +{ + "transaction": { + "version": "0x0", + "cellDeps": [ + { + "outPoint": { + "txHash": "0xc12386705b5cbb312b693874f3edf45c43a274482e27b8df0fd80c8d3f5feb8b", + "index": "0x0" + }, + "depType": "depGroup" + }, + { + "outPoint": { + "txHash": "0x0fb4945d52baf91e0dee2a686cdd9d84cad95b566a1d7409b970ee0a0f364f60", + "index": "0x2" + }, + "depType": "code" + } + ], + "headerDeps": [], + "inputs": [ + { + "previousOutput": { + "txHash": "0x31f695263423a4b05045dd25ce6692bb55d7bba2965d8be16b036e138e72cc65", + "index": "0x1" + }, + "since": "0x0" + } + ], + "outputs": [ + { + "capacity": "0x174876e800", + "lock": { + "codeHash": "0x68d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88", + "args": "0x59a27ef3ba84f061517d13f42cf44ed020610061", + "hashType": "type" + }, + "type": { + "codeHash": "0xece45e0979030e2f8909f76258631c42333b1e906fd9701ec3600a464a90b8f6", + "args": "0x", + "hashType": "data" + } + }, + { + "capacity": "0x59e1416a5000", + "lock": { + "codeHash": "0x68d5438ac952d2f584abf879527946a537e82c7f3c1cbf6d8ebf9767437d8e88", + "args": "0x59a27ef3ba84f061517d13f42cf44ed020610061", + "hashType": "type" + }, + "type": null + } + ], + "outputsData": ["0x", "0x"], + "witnesses": [ + "0x82df73581bcd08cb9aa270128d15e79996229ce8ea9e4f985b49fbf36762c5c37936caf3ea3784ee326f60b8992924fcf496f9503c907982525a3436f01ab32900" + ] + }, + "expected": 534 +} diff --git a/packages/ckb-sdk-utils/src/index.ts b/packages/ckb-sdk-utils/src/index.ts index 1434600f..e137ba49 100644 --- a/packages/ckb-sdk-utils/src/index.ts +++ b/packages/ckb-sdk-utils/src/index.ts @@ -4,12 +4,11 @@ import { pubkeyToAddress, AddressOptions } from './address' import { HexStringShouldStartWith0x, ArgumentRequired, InvalidHexString } from './exceptions' import crypto from './crypto' import { serializeScript } from './serialization/script' -import { serializeRawTransaction } from './serialization/transaction' +import { serializeRawTransaction, serializeTransaction } from './serialization/transaction' export * from './address' export * from './serialization' -export { serializeScript } from './serialization/script' -export { serializeRawTransaction } from './serialization/transaction' +export { serializeScript, serializeRawTransaction, serializeTransaction } declare const TextDecoder: any // will be removed when Node@11 becomes LTS declare const TextEncoder: any // will be removed when Node@11 becomes LTS @@ -103,3 +102,25 @@ export const privateKeyToPublicKey = (privateKey: string) => { export const privateKeyToAddress = (privateKey: string, options: AddressOptions) => pubkeyToAddress(privateKeyToPublicKey(privateKey), options) + +/** + * @function calculateTransactionFee + * @description calculate the transaction fee by transaction size and fee rate + * @param {bigint} transactionSize, the bytes of transaction + * @param {bigint} feeRate, the fee rate with unit of shannons/KB + */ +export const calculateTransactionFee = (transactionSize: bigint, feeRate: bigint) => { + const ratio = BigInt(1000) + const base = transactionSize * feeRate + const fee = base / ratio + if (fee * ratio < base) { + return fee + BigInt(1) + } + return fee +} + +export const calculateSerializedTxSizeInBlock = (transaction: Omit) => { + const EXTRA_SIZE_IN_BLOCK = 4 + const serializedTransaction = serializeTransaction(transaction) + return serializedTransaction.slice(2).length / 2 + EXTRA_SIZE_IN_BLOCK +} diff --git a/packages/ckb-sdk-utils/src/serialization/transaction.ts b/packages/ckb-sdk-utils/src/serialization/transaction.ts index 25a55673..13676992 100644 --- a/packages/ckb-sdk-utils/src/serialization/transaction.ts +++ b/packages/ckb-sdk-utils/src/serialization/transaction.ts @@ -68,6 +68,11 @@ export const serializeOutputsData = (outputsData: CKBComponents.Hash[]) => { return serializeDynVec(serializedOutputsDatumList) } +export const serializeWitnesses = (witnesses: CKBComponents.Witness[]) => { + const serializedWitnessList = witnesses.map(witness => serializeFixVec(witness)) + return serializeDynVec(serializedWitnessList) +} + export const serializeRawTransaction = (rawTransaction: CKBComponents.RawTransaction) => { const serializedVersion = serializeVersion(rawTransaction.version) const serializedCellDeps = serializeCellDeps(rawTransaction.cellDeps) @@ -87,3 +92,11 @@ export const serializeRawTransaction = (rawTransaction: CKBComponents.RawTransac return serializeTable(table) } + +export const serializeTransaction = (rawTransaction: CKBComponents.RawTransaction) => { + const serializedRawTransaction = serializeRawTransaction(rawTransaction) + const serializedWitnesses = serializeWitnesses(rawTransaction.witnesses || []) + + const table = new Map([['raw', serializedRawTransaction], ['witnesses', serializedWitnesses]]) + return serializeTable(table) +} From 10b8c08692e1b2fb2cf7e7aeb072a58e2f039dba Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 22 Oct 2019 16:21:27 +0800 Subject: [PATCH 3/4] chore: update package versions and changelogs --- CHANGELOG.md | 13 +++++++++++++ lerna.json | 2 +- packages/ckb-sdk-core/CHANGELOG.md | 8 ++++++++ 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 | 14 ++++++++++++++ packages/ckb-sdk-utils/package.json | 4 ++-- packages/ckb-types/CHANGELOG.md | 8 ++++++++ packages/ckb-types/package.json | 2 +- 10 files changed, 62 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2ce7265..b46da05f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.23.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.23.0...v0.23.1) (2019-10-22) + + +### Features + +* **utils** add methods for calculating transaction fee ([1dd82a4](https://github.com/nervosnetwork/ckb-sdk-js/commit/1dd82a4afba22f547406953444aa59df7e3a86bd)) + 1. add utils.serializeTransaction method to serialize a full transaction; + 2. add utils.calculateTrasnactionSize to get the size of a full transaction + + + + + # [0.23.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.22.1...v0.23.0) (2019-10-19) diff --git a/lerna.json b/lerna.json index 3d2e7d56..2758b476 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "0.23.0" + "version": "0.23.1" } diff --git a/packages/ckb-sdk-core/CHANGELOG.md b/packages/ckb-sdk-core/CHANGELOG.md index 95146420..1fdb9242 100644 --- a/packages/ckb-sdk-core/CHANGELOG.md +++ b/packages/ckb-sdk-core/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.23.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.23.0...v0.23.1) (2019-10-22) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-core + + + + + # [0.23.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.22.1...v0.23.0) (2019-10-19) diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index e2beed1d..aea34a83 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.23.0", + "version": "0.23.1", "description": "JavaScript SDK for Nervos Network CKB Project", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -30,9 +30,9 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-rpc": "0.23.0", - "@nervosnetwork/ckb-sdk-utils": "0.23.0", - "@nervosnetwork/ckb-types": "0.23.0" + "@nervosnetwork/ckb-sdk-rpc": "0.23.1", + "@nervosnetwork/ckb-sdk-utils": "0.23.1", + "@nervosnetwork/ckb-types": "0.23.1" }, "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" } diff --git a/packages/ckb-sdk-rpc/CHANGELOG.md b/packages/ckb-sdk-rpc/CHANGELOG.md index 13100489..e8ac186b 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.23.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.23.0...v0.23.1) (2019-10-22) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-rpc + + + + + # [0.23.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.22.1...v0.23.0) (2019-10-19) **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 ffc7ed08..38673067 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.23.0", + "version": "0.23.1", "description": "RPC module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js/packages/ckb-rpc#readme", @@ -32,11 +32,11 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.23.0", + "@nervosnetwork/ckb-sdk-utils": "0.23.1", "axios": "0.19.0" }, "devDependencies": { - "@nervosnetwork/ckb-types": "0.23.0", + "@nervosnetwork/ckb-types": "0.23.1", "dotenv": "8.1.0" }, "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" diff --git a/packages/ckb-sdk-utils/CHANGELOG.md b/packages/ckb-sdk-utils/CHANGELOG.md index 12d98030..81fc9f22 100644 --- a/packages/ckb-sdk-utils/CHANGELOG.md +++ b/packages/ckb-sdk-utils/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.23.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.23.0...v0.23.1) (2019-10-22) + + +### Features + +* **utils** add methods for calculating transaction fee ([1dd82a4](https://github.com/nervosnetwork/ckb-sdk-js/commit/1dd82a4afba22f547406953444aa59df7e3a86bd)) + 1. add utils.serializeTransaction method to serialize a full transaction; + 2. add utils.calculateTrasnactionSize to get the size of a full transaction + + + + + + # [0.23.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.22.1...v0.23.0) (2019-10-19) diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 45fa109e..3f8857ba 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.23.0", + "version": "0.23.1", "description": "Utils module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -30,7 +30,7 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-types": "0.23.0", + "@nervosnetwork/ckb-types": "0.23.1", "blake2b-wasm": "1.1.7", "elliptic": "6.5.1" }, diff --git a/packages/ckb-types/CHANGELOG.md b/packages/ckb-types/CHANGELOG.md index ca8b41a6..1ac70f72 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.23.1](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.23.0...v0.23.1) (2019-10-22) + +**Note:** Version bump only for package @nervosnetwork/ckb-types + + + + + # [0.23.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.22.1...v0.23.0) (2019-10-19) **Note:** Version bump only for package @nervosnetwork/ckb-types diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index eb739439..8ae735cb 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-types", - "version": "0.23.0", + "version": "0.23.1", "description": "Type module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", From 5641f5f9482eb39e0af25491fc84efc1f12ac1dd Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 22 Oct 2019 17:28:37 +0800 Subject: [PATCH 4/4] chore: update lerna hashes[skip ci] --- 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 aea34a83..e58da28a 100644 --- a/packages/ckb-sdk-core/package.json +++ b/packages/ckb-sdk-core/package.json @@ -34,5 +34,5 @@ "@nervosnetwork/ckb-sdk-utils": "0.23.1", "@nervosnetwork/ckb-types": "0.23.1" }, - "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" + "gitHead": "10b8c08692e1b2fb2cf7e7aeb072a58e2f039dba" } diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index 38673067..a8f4d78e 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -39,5 +39,5 @@ "@nervosnetwork/ckb-types": "0.23.1", "dotenv": "8.1.0" }, - "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" + "gitHead": "10b8c08692e1b2fb2cf7e7aeb072a58e2f039dba" } diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 3f8857ba..d7d68646 100644 --- a/packages/ckb-sdk-utils/package.json +++ b/packages/ckb-sdk-utils/package.json @@ -39,5 +39,5 @@ "@types/elliptic": "6.4.8", "@types/utf8": "2.1.6" }, - "gitHead": "a8a15a57061e4edb378f50796257550c3522239b" + "gitHead": "10b8c08692e1b2fb2cf7e7aeb072a58e2f039dba" } diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 8ae735cb..580340cb 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": "a8a15a57061e4edb378f50796257550c3522239b" + "gitHead": "10b8c08692e1b2fb2cf7e7aeb072a58e2f039dba" }