From 946494d3458e8aee276e988540253abd9dc39156 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 6 Jun 2019 11:27:02 +0800 Subject: [PATCH 01/24] docs: update the command to install lerna independently[skip ci] --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0326ccd8..9eafaed3 100644 --- a/README.md +++ b/README.md @@ -168,9 +168,9 @@ The rpc module will throw an error when the result contains an error field, you This project used [lerna](https://github.com/lerna/lerna/) for packages management, which needs to be bootstrapped by the following steps: ```sh -$ yarn install # to install the lerna package in this project, could be skipped if the lerna has been installed globally -$ lerna bootstrap # install the depedencies and link the packages in the project -$ npm run tsc # build packages with tsc command +$ yarn add lerna --exact --ignore-workspace-root-check # to install the lerna package in this project, could be skipped if the lerna has been installed globally +$ npx lerna bootstrap # install the depedencies and link the packages in the project +$ yarn run tsc # build packages with tsc command ``` After the second step, namely the bootstrap, all module packages are linked together, and used as in one package. From d782b072d914875592eadc3988eeae43d45bbbb9 Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 10 Jun 2019 12:53:40 +0800 Subject: [PATCH 02/24] docs: add code quality badge --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eafaed3..f782adfb 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,9 @@ | Coverage | [![Codecov](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/master/graph/badge.svg)](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/master) | [![Codecov](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/develop/graph/badge.svg)](https://codecov.io/gh/nervosnetwork/ckb-sdk-js/branch/develop) | [![NPM](https://img.shields.io/npm/v/@nervosnetwork/ckb-sdk-core/latest.svg)](https://www.npmjs.com/package/@nervosnetwork/ckb-sdk-core) +[![Package Quality](https://npm.packagequality.com/shield/%40nervosnetwork%2Fckb-sdk-core.svg)](https://packagequality.com/#?package=@nervosnetwork/ckb-sdk-core) +[![License](https://img.shields.io/npm/l/@nervosnetwork/ckb-sdk-core.svg)](./LICENSE) [![Telegram Group](https://cdn.rawgit.com/Patrolavia/telegram-badge/8fe3382b/chat.svg)](https://t.me/nervos_ckb_dev) -![License](https://img.shields.io/npm/l/@nervosnetwork/ckb-sdk-core.svg) JavaScript SDK for Nervos [CKB](https://github.com/nervosnetwork/ckb). From 9accdebf7e143de517ff0df29292769348c39098 Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 11 Jun 2019 01:16:20 +0800 Subject: [PATCH 03/24] feat(cli): add dashboard mode of ckb-cli which provides convenience developping dapps locally. --- packages/ckb-cli/README.md | 10 +- packages/ckb-cli/package.json | 3 + packages/ckb-cli/src/dashboard/index.ts | 169 ++++++++++++++++++++++++ packages/ckb-cli/src/index.ts | 14 +- 4 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 packages/ckb-cli/src/dashboard/index.ts diff --git a/packages/ckb-cli/README.md b/packages/ckb-cli/README.md index 6d16dd35..6f814672 100644 --- a/packages/ckb-cli/README.md +++ b/packages/ckb-cli/README.md @@ -20,8 +20,10 @@ $ npm install -g @nervosnetwork/ckb-cli ## Usage +### REPL + ```sh -$ @nervosnetwork/ckb-cli +$ ckb-cli i ckb => connected to ckb => await core.rpc.getTipBlockNumber() '6905' @@ -63,3 +65,9 @@ ckb => await core.rpc.getBlock('0x89de946313839a8a77749b6218d4d7ab3513910c5ed860 proposals: [] } ckb => ``` + +### Dashboard + +```sh +$ ckb-cli d +``` diff --git a/packages/ckb-cli/package.json b/packages/ckb-cli/package.json index b9a65304..beb708e6 100644 --- a/packages/ckb-cli/package.json +++ b/packages/ckb-cli/package.json @@ -35,10 +35,13 @@ }, "dependencies": { "@nervosnetwork/ckb-sdk-core": "0.13.0", + "blessed": "0.1.81", + "blessed-contrib": "4.8.16", "commander": "2.20.0", "inquirer": "6.2.1" }, "devDependencies": { + "@types/blessed": "0.1.11", "@types/crypto-js": "3.1.43", "@types/inquirer": "6.0.0" }, diff --git a/packages/ckb-cli/src/dashboard/index.ts b/packages/ckb-cli/src/dashboard/index.ts new file mode 100644 index 00000000..9c2bcd11 --- /dev/null +++ b/packages/ckb-cli/src/dashboard/index.ts @@ -0,0 +1,169 @@ +import Core from '@nervosnetwork/ckb-sdk-core' +import * as contrib from 'blessed-contrib' +import { screen } from 'blessed' + +const { grid: Grid, table } = contrib + +const MAX_BLOCKS = 50 +const MAX_TRANSACTIONS = 50 +let listener: any + +interface ChainInfo { + url: string + version: string + tipNumber: string +} +type Block = [string, string, number] // [number, hash, tx count] +type Transaction = [string, string, string] // [hash, inputs, outputs] +interface RenderedData { + chainInfo: ChainInfo + blocks: Block[] + transactions: Transaction[] +} + +const data: RenderedData = { + chainInfo: { + url: '', + version: '', + tipNumber: '', + }, + blocks: [], + transactions: [], +} + +const dashboard = (core: Core) => { + const MainScreen = screen({ + smartCSR: true, + cursor: { + artificial: true, + shape: 'underline', + blink: false, + color: 'white', + }, + }) + + MainScreen.key(['escape', 'C-c'], () => process.exit(0)) + + const Layout = new Grid({ + rows: 12, + cols: 12, + screen: MainScreen, + }) + + const chainInfo = Layout.set(0, 0, 2, 12, table, { + label: 'Chain Infomation', + fg: 'white', + columnSpacing: 10, + columnWidth: [30, 60, 30], + interactive: false, + data: { + headers: [], + data: [], + }, + }) + + const updateChainInfo = (info: ChainInfo) => { + chainInfo.setData({ + headers: Object.keys(info).map(() => ''), + data: Object.entries(info), + }) + MainScreen.render() + } + + const blocks = Layout.set(2, 0, 3, 12, table, { + label: 'Block List', + fg: 'white', + columnSpacing: 10, + columnWidth: [15, 66, 10], + interactive: false, + scrollable: true, + data: { + headers: [], + data: [], + }, + }) + + const updateBlocks = (info: Block[]) => { + blocks.setData({ + headers: ['block number', 'hash', 'tx count'], + data: info, + }) + MainScreen.render() + } + + const transactions = Layout.set(5, 0, 7, 12, table, { + label: 'Transaction List', + fg: 'white', + columnSpacing: 10, + columnWidth: [66, 30, 60], + interactive: false, + scrollable: true, + data: { + headers: [], + data: [], + }, + }) + + const updateTransactions = (info: Transaction[]) => { + transactions.setData({ + headers: ['hash', 'inputs', 'outputs'], + data: info, + }) + MainScreen.render() + } + + const fetchAndUpdateChainInfo = async () => { + const [nodeInfo, tipNumber] = await Promise.all([core.rpc.localNodeInfo(), core.rpc.getTipBlockNumber()]) + data.chainInfo = { + url: core.node.url, + version: nodeInfo.version, + tipNumber, + } + updateChainInfo(data.chainInfo) + } + + const fetchAndUpdateBlock = async () => { + const block = await core.rpc.getBlockByNumber(data.chainInfo.tipNumber) + data.blocks = [ + [block.header.number, block.header.hash, block.transactions.length], + ...data.blocks.slice(0, MAX_BLOCKS - 1), + ] + const { transactions: txs } = block + if (txs.length) { + const newTxs: Transaction[] = txs.map(tx => [ + tx.hash, + JSON.stringify(tx.inputs.map(input => input.previousOutput.cell)), + JSON.stringify(tx.outputs.map(output => `${output.lock.args[0]}-${output.capacity}`)), + ]) + data.transactions = [...newTxs, ...data.transactions].slice(0, MAX_TRANSACTIONS) + } + updateBlocks(data.blocks) + updateTransactions(data.transactions) + } + + const stop = () => { + clearInterval(listener) + MainScreen.destroy() + } + + const start = () => { + listener = setInterval(async () => { + try { + const currentTipNumber = data.chainInfo.tipNumber + await fetchAndUpdateChainInfo() + if (+data.chainInfo.tipNumber > +currentTipNumber) { + fetchAndUpdateBlock() + } + } catch (err) { + stop() + console.error(err.message) + } + }, 500) + } + return { + start, + stop, + } +} + +export default dashboard diff --git a/packages/ckb-cli/src/index.ts b/packages/ckb-cli/src/index.ts index b373a1b1..bd6e6edb 100644 --- a/packages/ckb-cli/src/index.ts +++ b/packages/ckb-cli/src/index.ts @@ -4,7 +4,7 @@ import repl from 'repl' import Core from '@nervosnetwork/ckb-sdk-core' import commander from 'commander' import { prompt } from 'inquirer' -// import questions from './rpc' // { rpcMethods } +import dashboard from './dashboard' const RPC_URL = 'http://localhost:8114' @@ -70,8 +70,20 @@ commander const core = new Core(remote) replServer.context.core = core replServer.context.rpc = {} + replServer.context.dashboard = () => dashboard(core) Object.keys(core.rpc).forEach(key => { replServer.context.rpc[key] = (core.rpc as any)[key] }) }) + +commander + .command('dashboard [remote]') + .alias('d') + .description('dashboard') + .action(async (remote = RPC_URL) => { + console.info('boosting the dashboard') + const core = new Core(remote) + dashboard(core).start() + }) + commander.parse(process.argv) From 11be58b7ec39748bf791d878e1ff693155f49c68 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 11 Jun 2019 21:19:39 +0000 Subject: [PATCH 04/24] chore(deps-dev): bump prettier from 1.17.1 to 1.18.2 Bumps [prettier](https://github.com/prettier/prettier) from 1.17.1 to 1.18.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/1.17.1...1.18.2) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9e64ddad..c26b509c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5764,9 +5764,9 @@ prettier-linter-helpers@^1.0.0: fast-diff "^1.1.2" prettier@^1.15.3: - version "1.17.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db" - integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg== + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== pretty-format@^24.8.0: version "24.8.0" From 3c34d3ac4c9968fefd497bf734c0a2067986d765 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 11 Jun 2019 21:20:25 +0000 Subject: [PATCH 05/24] chore(deps-dev): bump husky from 2.3.0 to 2.4.0 Bumps [husky](https://github.com/typicode/husky) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/typicode/husky/releases) - [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md) - [Commits](https://github.com/typicode/husky/compare/v2.3.0...v2.4.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9e64ddad..2adf8930 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3376,9 +3376,9 @@ humanize-ms@^1.2.1: ms "^2.0.0" husky@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-2.3.0.tgz#8b78ed24d763042df7fd899991985d65a976dd13" - integrity sha512-A/ZQSEILoq+mQM3yC3RIBSaw1bYXdkKnyyKVSUiJl+iBjVZc5LQEXdGY1ZjrDxC4IzfRPiJ0IqzEQGCN5TQa/A== + version "2.4.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-2.4.0.tgz#1bac7c44588f6e91f808b72efc82d24a57194f36" + integrity sha512-3k1wuZU20gFkphNWMjh2ISCFaqfbaLY7R9FST2Mj9HeRhUK9ydj9qQR8qfXlog3EctVGsyeilcZkIT7uBZDDVA== dependencies: cosmiconfig "^5.2.0" execa "^1.0.0" From 2b982c791c15d0e5f3233ee6eff9b91bb9357096 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 11 Jun 2019 21:20:47 +0000 Subject: [PATCH 06/24] chore(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 1.9.0 to 1.10.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v1.10.2/packages/eslint-plugin) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9e64ddad..e5493085 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1164,18 +1164,24 @@ integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== "@typescript-eslint/eslint-plugin@^1.2.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.9.0.tgz#29d73006811bf2563b88891ceeff1c5ea9c8d9c6" - integrity sha512-FOgfBorxjlBGpDIw+0LaZIXRX6GEEUfzj8LXwaQIUCp+gDOvkI+1WgugJ7SmWiISqK9Vj5r8S7NDKO/LB+6X9A== + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz#552fc64cfcb19c6162190360217c945e8faa330a" + integrity sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw== dependencies: - "@typescript-eslint/experimental-utils" "1.9.0" - "@typescript-eslint/parser" "1.9.0" + "@typescript-eslint/experimental-utils" "1.10.2" eslint-utils "^1.3.1" functional-red-black-tree "^1.0.1" regexpp "^2.0.1" - requireindex "^1.2.0" tsutils "^3.7.0" +"@typescript-eslint/experimental-utils@1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz#cd548c03fc1a2b3ba5c136d1599001a1ede24215" + integrity sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg== + dependencies: + "@typescript-eslint/typescript-estree" "1.10.2" + eslint-scope "^4.0.0" + "@typescript-eslint/experimental-utils@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz#a92777d0c92d7bc8627abd7cdb06cdbcaf2b39e8" @@ -1183,7 +1189,7 @@ dependencies: "@typescript-eslint/typescript-estree" "1.9.0" -"@typescript-eslint/parser@1.9.0", "@typescript-eslint/parser@^1.2.0": +"@typescript-eslint/parser@^1.2.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.9.0.tgz#5796cbfcb9a3a5757aeb671c1ac88d7a94a95962" integrity sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA== @@ -1193,6 +1199,14 @@ eslint-scope "^4.0.0" eslint-visitor-keys "^1.0.0" +"@typescript-eslint/typescript-estree@1.10.2": + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz#8403585dd74b6cfb6f78aa98b6958de158b5897b" + integrity sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + "@typescript-eslint/typescript-estree@1.9.0": version "1.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz#5d6d49be936e96fb0f859673480f89b070a5dd9b" @@ -6164,11 +6178,6 @@ require-main-filename@^1.0.1: resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -requireindex@^1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" - integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== - resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" From 67ed225076da69028112d22ed3465810c790900f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 11 Jun 2019 21:21:12 +0000 Subject: [PATCH 07/24] chore(deps-dev): bump lint-staged from 8.1.7 to 8.2.0 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.1.7 to 8.2.0. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v8.1.7...v8.2.0) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9e64ddad..78cb7542 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2845,11 +2845,6 @@ find-node-modules@2.0.0: findup-sync "^3.0.0" merge "^1.2.1" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= - find-root@1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -4480,9 +4475,9 @@ libnpmpublish@^1.1.1: ssri "^6.0.1" lint-staged@^8.1.0: - version "8.1.7" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.7.tgz#a8988bc83bdffa97d04adb09dbc0b1f3a58fa6fc" - integrity sha512-egT0goFhIFoOGk6rasPngTFh2qDqxZddM0PwI58oi66RxCDcn5uDwxmiasWIF0qGnchHSYVJ8HPRD5LrFo7TKA== + version "8.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.0.tgz#3d4149a229580815c955047a7acd8f09054be5a9" + integrity sha512-DxguyxGOIfb67wZ6EOrqzjAbw6ZH9XK3YS74HO+erJf6+SAQeJJPN//GBOG5xhdt2THeuXjVPaHcCYOWGZwRbA== dependencies: chalk "^2.3.1" commander "^2.14.1" @@ -4491,7 +4486,6 @@ lint-staged@^8.1.0: dedent "^0.7.0" del "^3.0.0" execa "^1.0.0" - find-parent-dir "^0.3.0" g-status "^2.0.2" is-glob "^4.0.0" is-windows "^1.0.2" From aa522c581db10daaf1aaa8afbc3b9dc4abfa6b0f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 11 Jun 2019 21:21:41 +0000 Subject: [PATCH 08/24] chore(deps-dev): bump @types/node from 12.0.4 to 12.0.8 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 12.0.4 to 12.0.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9e64ddad..a2a063f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1136,9 +1136,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*", "@types/node@^12.0.0": - version "12.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.4.tgz#46832183115c904410c275e34cf9403992999c32" - integrity sha512-j8YL2C0fXq7IONwl/Ud5Kt0PeXw22zGERt+HSSnwbKOJVsAGkEz3sFCYwaF9IOuoG1HOtE0vKCj6sXF7Q0+Vaw== + version "12.0.8" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.8.tgz#551466be11b2adc3f3d47156758f610bd9f6b1d8" + integrity sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg== "@types/normalize-package-data@^2.4.0": version "2.4.0" From 3c1f334af2592c6d1a4313d31e73567f2641d3c7 Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 12 Jun 2019 20:43:41 +0800 Subject: [PATCH 09/24] feat(utils): add signRecoverable method to the ECPair class add signRecoverable method to the ECPair class, and use it to sign the transactions. BREAKING CHANGE: use signRecoverable instead of sign method to sign the transactions. --- .../ckb-sdk-core/__tests__/ckb-core.test.js | 2 -- .../__tests__/successFixtures.json | 6 ++--- packages/ckb-sdk-core/src/index.ts | 2 +- .../ckb-sdk-utils/__tests__/ecpair.test.js | 10 +++++++- .../__tests__/signature-fixtures.json | 10 +++++++- packages/ckb-sdk-utils/src/ecpair.ts | 23 ++++++++++++++----- 6 files changed, 38 insertions(+), 15 deletions(-) diff --git a/packages/ckb-sdk-core/__tests__/ckb-core.test.js b/packages/ckb-sdk-core/__tests__/ckb-core.test.js index a7ff5607..9d5361ea 100644 --- a/packages/ckb-sdk-core/__tests__/ckb-core.test.js +++ b/packages/ckb-sdk-core/__tests__/ckb-core.test.js @@ -68,7 +68,6 @@ describe('ckb-core', () => { it('throw an error when witnesses is missing', () => { const fixture = exceptionFixtures.signTransactionWithoutWitnesses - console.log(!fixture.transaction.witnesses) expect(core.signTransaction(fixture.privateKey)(fixture.transaction)).rejects.toEqual( new Error(fixture.exception) ) @@ -76,7 +75,6 @@ describe('ckb-core', () => { it('throw an error with invalid cound of witnesses', () => { const fixture = exceptionFixtures.signTransactionWithInvalidCountOfWitnesses - console.log(!fixture.transaction.witnesses) expect(core.signTransaction(fixture.privateKey)(fixture.transaction)).rejects.toEqual( new Error(fixture.exception) ) diff --git a/packages/ckb-sdk-core/__tests__/successFixtures.json b/packages/ckb-sdk-core/__tests__/successFixtures.json index 68fa8913..7fc7596c 100644 --- a/packages/ckb-sdk-core/__tests__/successFixtures.json +++ b/packages/ckb-sdk-core/__tests__/successFixtures.json @@ -35,8 +35,7 @@ "target": [ { "data": [ - "0x024a501efd328e062c8675f2365970728c859c592beeefd6be8ead3d901330bc01", - "0x304402202c643579e47045be050d3842ed9270151af8885e33954bddad0e53e81d1c2dbe02202dc637877a8302110846ebc6a16d9148c106e25f945063ad1c4d4db2b6952408" + "0x2c643579e47045be050d3842ed9270151af8885e33954bddad0e53e81d1c2dbe2dc637877a8302110846ebc6a16d9148c106e25f945063ad1c4d4db2b695240800" ] } ] @@ -117,8 +116,7 @@ "witnesses": [ { "data": [ - "0x024a501efd328e062c8675f2365970728c859c592beeefd6be8ead3d901330bc01", - "0x3045022100aa659c1d2920d144b76e4d03eb4d0c56b22e66501c68bb330bc58b5af1ba411c02203728e526386d4186955049405a669a9ce63ec0e3b233ca7696f9a5d95651a256" + "0xaa659c1d2920d144b76e4d03eb4d0c56b22e66501c68bb330bc58b5af1ba411c3728e526386d4186955049405a669a9ce63ec0e3b233ca7696f9a5d95651a25600" ] } ] diff --git a/packages/ckb-sdk-core/src/index.ts b/packages/ckb-sdk-core/src/index.ts index 0dbc64d0..7c62f612 100644 --- a/packages/ckb-sdk-core/src/index.ts +++ b/packages/ckb-sdk-core/src/index.ts @@ -116,7 +116,7 @@ class Core { s.update(this.utils.hexToBytes(datum)) }) const message = s.digest('hex') - const data = [`0x${addrObj.publicKey}`, `0x${addrObj.sign(message)}`, ...oldData] + const data = [`0x${addrObj.signRecoverable(message)}`, ...oldData] return { data, } diff --git a/packages/ckb-sdk-utils/__tests__/ecpair.test.js b/packages/ckb-sdk-utils/__tests__/ecpair.test.js index 212310ac..88ca097f 100644 --- a/packages/ckb-sdk-utils/__tests__/ecpair.test.js +++ b/packages/ckb-sdk-utils/__tests__/ecpair.test.js @@ -1,5 +1,5 @@ const ECPair = require('../lib/ecpair').default -const { sigFixtures } = require('./signature-fixtures.json') +const { sigFixtures, signRecoverableFixtures } = require('./signature-fixtures.json') const { hexToBytes } = require('../lib') describe('ECPair', () => { @@ -56,6 +56,14 @@ describe('ECPair', () => { }) }) + it('signRecoverable', () => { + signRecoverableFixtures.forEach(fixture => { + const ecpair = new ECPair(fixture.privKey) + const sig = ecpair.signRecoverable(fixture.msg) + expect(sig).toBe(fixture.sig) + }) + }) + it('throw error if private key is absent', () => { expect(() => new ECPair()).toThrow('Private key is required') }) diff --git a/packages/ckb-sdk-utils/__tests__/signature-fixtures.json b/packages/ckb-sdk-utils/__tests__/signature-fixtures.json index e616ae91..36b970c2 100644 --- a/packages/ckb-sdk-utils/__tests__/signature-fixtures.json +++ b/packages/ckb-sdk-utils/__tests__/signature-fixtures.json @@ -1,5 +1,6 @@ { - "sigFixtures": [{ + "sigFixtures": [ + { "msg": "403676bd85716a1e16b415093cee88c07d7cf2c2199aaf82320d354cb571f0d9", "sig": "3045022100c795b2b3c48d370324e5053f4509d4f1f18f80aec4a8cba68ebae922b9f882d8022045ae312bd84e25eed818ef84e7ed61a774f208fe2b2fe3588b60b4686086208201", "privkey": "e79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3" @@ -999,5 +1000,12 @@ "sig": "3045022100ae0f294fbc13c28259019d000a9a9817173febfb37fb0a273511add46af4226102202d2a8b8b0e058179a0baf190dc76f649075a8d3ab3832d3be859159cbe1a9ae701", "privkey": "66dc7feb6d7c733005c5d8716b22f38819738bd1538a40f46205f3f3be191efc" } + ], + "signRecoverableFixtures": [ + { + "msg": "95e919c41e1ae7593730097e9bb1185787b046ae9f47b4a10ff4e22f9c3e3eab", + "sig": "1e94db61cff452639cf7dd991cf0c856923dcf74af24b6f575b91479ad2c8ef40769812d1cf1fd1a15d2f6cb9ef3d91260ef27e65e1f9be399887e9a5447786301", + "privKey": "e79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3" + } ] } diff --git a/packages/ckb-sdk-utils/src/ecpair.ts b/packages/ckb-sdk-utils/src/ecpair.ts index 614c0b2b..3ff6c373 100644 --- a/packages/ckb-sdk-utils/src/ecpair.ts +++ b/packages/ckb-sdk-utils/src/ecpair.ts @@ -36,19 +36,30 @@ class ECPair { public getPublicKey = (enc: 'hex' | 'array') => this.key.getPublic(this.compressed, enc) - public sign = (msg: string | Uint8Array): string => { - const message = typeof msg === 'string' ? hexToBytes(msg) : msg + public sign = (message: string | Uint8Array): string => { + const msg = typeof message === 'string' ? hexToBytes(message) : message return this.key - .sign(message, { + .sign(msg, { canonical: true, }) .toDER('hex') } - public verify = (msg: string | Buffer, sig: string | Buffer) => { - const message = typeof msg === 'string' ? hexToBytes(msg) : msg + public verify = (message: string | Buffer, sig: string | Buffer) => { + const msg = typeof message === 'string' ? hexToBytes(message) : message const signature = typeof sig === 'string' ? hexToBytes(sig) : sig - return this.key.verify(message, signature as any) + return this.key.verify(msg, signature as any) + } + + public signRecoverable = (message: string | Uint8Array): string => { + const msg = typeof message === 'string' ? hexToBytes(message) : message + const { r, s, recoveryParam } = this.key.sign(msg, { + canonical: true, + }) + const fmtR = r.toString(16).padStart(64, '0') + const fmtS = s.toString(16).padStart(64, '0') + const fmtRecID = recoveryParam ? '01' : '00' + return `${fmtR}${fmtS}${fmtRecID}` } } From b975a53e1ed55bc563de54b024e4c2f8e62e8d26 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 13 Jun 2019 01:54:10 +0800 Subject: [PATCH 10/24] refactor(utils): throw error if signRecoverable returns null recid, and use returned recid for the s --- packages/ckb-sdk-utils/src/ecpair.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ckb-sdk-utils/src/ecpair.ts b/packages/ckb-sdk-utils/src/ecpair.ts index 3ff6c373..4476a910 100644 --- a/packages/ckb-sdk-utils/src/ecpair.ts +++ b/packages/ckb-sdk-utils/src/ecpair.ts @@ -56,10 +56,10 @@ class ECPair { const { r, s, recoveryParam } = this.key.sign(msg, { canonical: true, }) + if (recoveryParam === null) throw new Error('Fail to sign the message') const fmtR = r.toString(16).padStart(64, '0') const fmtS = s.toString(16).padStart(64, '0') - const fmtRecID = recoveryParam ? '01' : '00' - return `${fmtR}${fmtS}${fmtRecID}` + return `${fmtR}${fmtS}0${recoveryParam}` } } From f0b486af00a7eefd79d3a07bd5b84827b5fe0f8c Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 17 Jun 2019 18:42:10 +0800 Subject: [PATCH 11/24] fix(rpc): binding the node of method instances to the one of rpc instance. --- .../__tests__/successFixtures.json | 4 +-- .../ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js | 6 +--- packages/ckb-sdk-rpc/src/index.ts | 8 ++--- packages/ckb-sdk-rpc/src/method.ts | 34 +++++++------------ 4 files changed, 18 insertions(+), 34 deletions(-) diff --git a/packages/ckb-sdk-core/__tests__/successFixtures.json b/packages/ckb-sdk-core/__tests__/successFixtures.json index 7fc7596c..eb75f19b 100644 --- a/packages/ckb-sdk-core/__tests__/successFixtures.json +++ b/packages/ckb-sdk-core/__tests__/successFixtures.json @@ -13,9 +13,9 @@ "target": { "codeHash": "f1951123466e4479842387a66fabfd6b65fc87fd84ae8e6cd3053edb27fff2fd", "outPoint": { - "blockHash": "fc3ad90e38598032598c90b4ad4fefb420bacabaa7c5b40111daca7dfcc1f9d4", + "blockHash": "c3b42742ea8658c93de23f16a10c43212bd8b24a6bde5a93b8446dba3fb2a728", "cell": { - "txHash": "3f09b95f8886723cc850db0beb9c153169151c663f3e8f832dc04421fbb1f382", + "txHash": "6950a2491d7c0ccac11fcb985cbb3f6b5a70eaf6fff952c08a20d1b99c01fb98", "index": "1" } } diff --git a/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js b/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js index 78d675d5..d1e4e0ad 100644 --- a/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js +++ b/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js @@ -44,15 +44,11 @@ describe('ckb-rpc settings and helpers', () => { expect(rpc.methods.length).toBe(17) }) - it('has initialized node url of http://localhost:8114', () => { - expect(rpc.methods[0].constructor.node.url).toBe('http://localhost:8114') - }) - it('set node url to http://test.localhost:8114', () => { const url = 'http://test.localhost:8114' rpc.setNode({ url, }) - expect(rpc.methods[0].constructor.node.url).toBe(url) + expect(rpc.node.url).toBe(url) }) }) diff --git a/packages/ckb-sdk-rpc/src/index.ts b/packages/ckb-sdk-rpc/src/index.ts index b2678093..322b90a6 100644 --- a/packages/ckb-sdk-rpc/src/index.ts +++ b/packages/ckb-sdk-rpc/src/index.ts @@ -29,16 +29,12 @@ class CKBRPC extends DefaultRPC { } public setNode(node: CKBComponents.Node): CKBComponents.Node { - this.node = { - ...this.node, - ...node, - } - Method.setNode(this.node) + Object.assign(this.node, node) return this.node } public addMethod = (options: CKBComponents.Method) => { - const method = new Method(options) + const method = new Method(this.node, options) this.methods.push(method) Object.defineProperty(this, options.name, { diff --git a/packages/ckb-sdk-rpc/src/method.ts b/packages/ckb-sdk-rpc/src/method.ts index 06b94932..76ff7c17 100644 --- a/packages/ckb-sdk-rpc/src/method.ts +++ b/packages/ckb-sdk-rpc/src/method.ts @@ -2,36 +2,28 @@ import axios from 'axios' import { DebugLevel, LogColor } from './enum' class Method { - private _options: CKBComponents.Method = { + static debugLevel = DebugLevel.Off + + private options: CKBComponents.Method = { name: '', method: '', paramsFormatters: [], resultFormatters: undefined, } - static debugLevel = DebugLevel.Off - - static node: CKBComponents.Node = { - url: '', - } - - static setNode = (node: CKBComponents.Node) => { - Method.node = { - ...Method.node, - ...node, - } - } + private node: CKBComponents.Node - constructor(options: CKBComponents.Method) { - this._options = options + constructor(node: CKBComponents.Node, options: CKBComponents.Method) { + this.node = node + this.options = options } public call = (...params: (string | number)[]) => { - const data = params.map((p, i) => (this._options.paramsFormatters[i] && this._options.paramsFormatters[i](p)) || p) + const data = params.map((p, i) => (this.options.paramsFormatters[i] && this.options.paramsFormatters[i](p)) || p) const id = Math.round(Math.random() * 10000) const payload = { id, - method: this._options.method, + method: this.options.method, params: data, jsonrpc: '2.0', } @@ -41,7 +33,7 @@ class Method { 'content-type': 'application/json', }, data: payload, - url: Method.node.url, + url: this.node.url, }).then(res => { if (res.data.id !== id) { throw new Error('JSONRPC id not match') @@ -50,11 +42,11 @@ class Method { /* eslint-disabled */ console.group() console.group() - console.info(LogColor.Cyan, `\n----- ${this._options.name} request -----`, LogColor.Reset) + console.info(LogColor.Cyan, `\n----- ${this.options.name} request -----`, LogColor.Reset) console.info(JSON.stringify(payload, null, 2)) console.groupEnd() console.group() - console.info(LogColor.Cyan, `----- ${this._options.name} response -----`, LogColor.Reset) + console.info(LogColor.Cyan, `----- ${this.options.name} response -----`, LogColor.Reset) console.info(JSON.stringify(res.data, null, 2)) console.groupEnd() console.groupEnd() @@ -63,7 +55,7 @@ class Method { if (res.data.error) { throw new Error(JSON.stringify(res.data.error)) } - return this._options.resultFormatters ? this._options.resultFormatters(res.data.result) : res.data.result + return this.options.resultFormatters ? this.options.resultFormatters(res.data.result) : res.data.result }) } } From f8d577e107354d293f5596a450744ddc7d175711 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 18 Jun 2019 21:23:17 +0000 Subject: [PATCH 12/24] chore(deps-dev): bump lerna from 3.14.1 to 3.15.0 Bumps [lerna](https://github.com/lerna/lerna/tree/HEAD/core/lerna) from 3.14.1 to 3.15.0. - [Release notes](https://github.com/lerna/lerna/releases) - [Changelog](https://github.com/lerna/lerna/blob/master/core/lerna/CHANGELOG.md) - [Commits](https://github.com/lerna/lerna/commits/v3.15.0/core/lerna) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 606 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 311 insertions(+), 295 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4da18c0..e8c886c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -156,6 +156,78 @@ resolved "https://registry.npmjs.org/@cryptape/sdk-ts-config/-/sdk-ts-config-0.0.1.tgz#6e61db1a054fb13d0b0c24efcd5cf689e1fee7b3" integrity sha512-LQNESxwR3by07QuyPgM2QZ8WMl58PMX9c4GjRU8xPHu094pCiPy2AotHHP4ZF51tpR1rNztRPwwC/SmWRQH/9w== +"@evocateur/libnpmaccess@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.0.tgz#e546ee4e4bedca54ed9303948ec54c985cec33e4" + integrity sha512-bfrqZ0v+Il5TJBsgF2oyepeJg34K2pBItapzP+UT1QMIGpUh/Zc1pQql4jrafamZTqP3ZvdJxaElat8B5K3ICA== + dependencies: + "@evocateur/npm-registry-fetch" "^3.9.1" + aproba "^2.0.0" + figgy-pudding "^3.5.1" + get-stream "^4.0.0" + npm-package-arg "^6.1.0" + +"@evocateur/libnpmpublish@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.0.tgz#3e0d79fdc0a75f212adabb7c7e341b017effeac2" + integrity sha512-sezhX9FSnPIyrBBvxVocVJVO1uIWPczf6rOmUZSntCWfQMraO8pWTFlDJbroFqPbEqFFHf3eyw8NQ0Eb7OLd1g== + dependencies: + "@evocateur/npm-registry-fetch" "^3.9.1" + aproba "^2.0.0" + figgy-pudding "^3.5.1" + get-stream "^4.0.0" + lodash.clonedeep "^4.5.0" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + semver "^5.5.1" + ssri "^6.0.1" + +"@evocateur/npm-registry-fetch@^3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-3.9.1.tgz#75b3917320e559f6c91e26af17e62b085ec457a2" + integrity sha512-6v1bHbcAypQ+te/1RGSNL4JkK6mcMtcZrUusqo5iKRtYSAig9UJXlOaCcBR+eLywt2DQMNpEwAj24jwWDX5G/w== + dependencies: + JSONStream "^1.3.4" + bluebird "^3.5.1" + figgy-pudding "^3.4.1" + lru-cache "^4.1.3" + make-fetch-happen "^4.0.1" + npm-package-arg "^6.1.0" + safe-buffer "^5.1.2" + +"@evocateur/pacote@^9.6.0": + version "9.6.0" + resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.0.tgz#3f0d08fb81c572289a2dfa981e7f97b6dd83cef2" + integrity sha512-nKx8EPxXhzqNfePbqC6603z7Kkf6GBS2q+SNGtBS/bCgS5Q+p3OVR6MXKOkpvC3WHse98W2WLu8QaV9axtfxyw== + dependencies: + "@evocateur/npm-registry-fetch" "^3.9.1" + bluebird "^3.5.3" + cacache "^11.3.2" + figgy-pudding "^3.5.1" + get-stream "^4.1.0" + glob "^7.1.3" + lru-cache "^5.1.1" + make-fetch-happen "^4.0.1" + minimatch "^3.0.4" + minipass "^2.3.5" + mississippi "^3.0.0" + mkdirp "^0.5.1" + normalize-package-data "^2.4.0" + npm-package-arg "^6.1.0" + npm-packlist "^1.1.12" + npm-pick-manifest "^2.2.3" + osenv "^0.1.5" + promise-inflight "^1.0.1" + promise-retry "^1.1.1" + protoduck "^5.0.1" + rimraf "^2.6.2" + safe-buffer "^5.1.2" + semver "^5.6.0" + ssri "^6.0.1" + tar "^4.4.8" + unique-filename "^1.1.1" + which "^1.3.1" + "@jest/console@^24.7.1": version "24.7.1" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" @@ -302,20 +374,20 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" -"@lerna/add@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.14.0.tgz#799d416e67d48c285967abf883be746557aefa48" - integrity sha512-Sa79Ju6HqF3heSVpBiYPNrGtuS56U/jMzVq4CcVvhNwB34USLrzJJncGFVcfnuUvsjKeFJv+jHxUycHeRE8XYw== +"@lerna/add@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.15.0.tgz#10be562f43cde59b60f299083d54ac39520ec60a" + integrity sha512-+KrG4GFy/6FISZ+DwWf5Fj5YB4ESa4VTnSn/ujf3VEda6dxngHPN629j+TcPbsdOxUYVah+HuZbC/B8NnkrKpQ== dependencies: - "@lerna/bootstrap" "3.14.0" - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" + "@evocateur/pacote" "^9.6.0" + "@lerna/bootstrap" "3.15.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/npm-conf" "3.13.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" npm-package-arg "^6.1.0" p-map "^1.2.0" - pacote "^9.5.0" semver "^5.5.0" "@lerna/batch-packages@3.14.0": @@ -326,23 +398,23 @@ "@lerna/package-graph" "3.14.0" npmlog "^4.1.2" -"@lerna/bootstrap@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.14.0.tgz#dde35eac0a912097033e1daea237a50e5c3cb75b" - integrity sha512-AvnuDp8b0kX4zZgqD3v7ItPABhUsN5CmTEvZBD2JqM+xkQKhzCfz5ABcHEwDwOPWnNQmtH+/2iQdwaD7xBcAXw== +"@lerna/bootstrap@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.15.0.tgz#f53e0bbbbfb8367e609a06378409bfc673ff2930" + integrity sha512-4AxsPKKbgj2Ju03qDddQTpOHvpqnwd0yaiEU/aCcWv/4tDTe79NqUne2Z3+P2WZY0Zzb8+nUKcskwYBMTeq+Mw== dependencies: "@lerna/batch-packages" "3.14.0" - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" - "@lerna/has-npm-version" "3.13.3" - "@lerna/npm-install" "3.13.3" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/has-npm-version" "3.14.2" + "@lerna/npm-install" "3.14.2" "@lerna/package-graph" "3.14.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.13.3" + "@lerna/rimraf-dir" "3.14.2" "@lerna/run-lifecycle" "3.14.0" "@lerna/run-parallel-batches" "3.13.0" - "@lerna/symlink-binary" "3.14.0" - "@lerna/symlink-dependencies" "3.14.0" + "@lerna/symlink-binary" "3.14.2" + "@lerna/symlink-dependencies" "3.14.2" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^3.2.0" @@ -356,45 +428,45 @@ read-package-tree "^5.1.6" semver "^5.5.0" -"@lerna/changed@3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.14.1.tgz#274fa67a34f234546925c139aabe20765f07a8e4" - integrity sha512-G0RgYL/WLTFzbezRBLUO2J0v39EvgZIO5bHHUtYt7zUFSfzapkPfvpdpBj+5JlMtf0B2xfxwTk+lSA4LVnbfmA== +"@lerna/changed@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.15.0.tgz#20db9d992d697e4288c260aa38b989dcb93f4b40" + integrity sha512-Hns1ssI9T9xOTGVc7PT2jUaqzsSkxV3hV/Y7iFO0uKTk+fduyTwGTHU9A/ybQ/xi/9iaJbvaXyjxKiGoEnzmhg== dependencies: - "@lerna/collect-updates" "3.14.0" - "@lerna/command" "3.14.0" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/listable" "3.14.0" "@lerna/output" "3.13.0" - "@lerna/version" "3.14.1" + "@lerna/version" "3.15.0" -"@lerna/check-working-tree@3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.14.1.tgz#4102681c31e4cebed3968db27567e3180e519822" - integrity sha512-ae/sdZPNh4SS+6c4UDuWP/QKbtIFAn/TvKsPncA1Jdo0PqXLBlug4DzkHTGkvZ5F0nj+0JrSxYteInakJV99vg== +"@lerna/check-working-tree@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.14.2.tgz#5ce007722180a69643a8456766ed8a91fc7e9ae1" + integrity sha512-7safqxM/MYoAoxZxulUDtIJIbnBIgo0PB/FHytueG+9VaX7GMnDte2Bt1EKa0dz2sAyQdmQ3Q8ZXpf/6JDjaeg== dependencies: - "@lerna/collect-uncommitted" "3.14.1" - "@lerna/describe-ref" "3.13.3" + "@lerna/collect-uncommitted" "3.14.2" + "@lerna/describe-ref" "3.14.2" "@lerna/validation-error" "3.13.0" -"@lerna/child-process@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.13.3.tgz#6c084ee5cca9fc9e04d6bf4fc3f743ed26ff190c" - integrity sha512-3/e2uCLnbU+bydDnDwyadpOmuzazS01EcnOleAnuj9235CU2U97DH6OyoG1EW/fU59x11J+HjIqovh5vBaMQjQ== +"@lerna/child-process@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.14.2.tgz#950240cba83f7dfe25247cfa6c9cebf30b7d94f6" + integrity sha512-xnq+W5yQb6RkwI0p16ZQnrn6HkloH/MWTw4lGE1nKsBLAUbmSU5oTE93W1nrG0X3IMF/xWc9UYvNdUGMWvZZ4w== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.14.0.tgz#4399f4a3289106b0b8ffbffd4a6cfd2e3fe935f2" - integrity sha512-wEuAqOS9VMqh2C20KD63IySzyEnyVDqDI3LUsXw+ByUf9AJDgEHv0TCOxbDjDYaaQw1tjSBNZMyYInNeoASwhA== +"@lerna/clean@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.15.0.tgz#a94da50908a80ba443a0a682706aca79ac2ecf27" + integrity sha512-D1BN7BnJk6YjrSR7E7RiCmWiFVWDo3L+OSe6zDq6rNNYexPBtSi2JOCeF/Dibi3jd2luVu0zkVpUtuEEdPiD+A== dependencies: - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.13.3" + "@lerna/rimraf-dir" "3.14.2" p-map "^1.2.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" @@ -409,35 +481,35 @@ npmlog "^4.1.2" yargs "^12.0.1" -"@lerna/collect-uncommitted@3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.14.1.tgz#b3498c4c7f46efc79092ce4aa0a24edc535e5d1a" - integrity sha512-hQ67S+nlSJwsPylXbWlrQSZUcWa8tTNIdcMd9OY4+QxdJlZUG7CLbWSyaxi0g11WdoRJHT163mr9xQyAvIVT1A== +"@lerna/collect-uncommitted@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.14.2.tgz#b5ed00d800bea26bb0d18404432b051eee8d030e" + integrity sha512-4EkQu4jIOdNL2BMzy/N0ydHB8+Z6syu6xiiKXOoFl0WoWU9H1jEJCX4TH7CmVxXL1+jcs8FIS2pfQz4oew99Eg== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" chalk "^2.3.1" figgy-pudding "^3.5.1" npmlog "^4.1.2" -"@lerna/collect-updates@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.14.0.tgz#64d64ff1ec05ac53dfe6851be49d2ad261e6795e" - integrity sha512-siRHo2atAwj5KpKVOo6QTVIYDYbNs7dzTG6ow9VcFMLKX5shuaEyFA22Z3LmnxQ3sakVFdgvvVeediEz6cM3VA== +"@lerna/collect-updates@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.14.2.tgz#396201f6568ec5916bf2c11e7a29b0931fcd3e5b" + integrity sha512-+zSQ2ZovH8Uc0do5dR+sk8VvRJc6Xl+ZnJJGESIl17KSpEw/lVjcOyt6f3BP+WHn+iSOjMWcGvUVA601FIEdZw== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/describe-ref" "3.13.3" + "@lerna/child-process" "3.14.2" + "@lerna/describe-ref" "3.14.2" minimatch "^3.0.4" npmlog "^4.1.2" slash "^1.0.0" -"@lerna/command@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.14.0.tgz#5f5e68293c0ff1e85a20b4e96fa6bea33b7632df" - integrity sha512-PtFi5EtXB2VuSruoLsjfZdus56d7oKlZAI4iSRoaS/BBxE2Wyfn7//vW7Ow4hZCzuqb9tBcpDq+4u2pdXN1d2Q== +"@lerna/command@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.15.0.tgz#e1dc1319054f1cf0b135aa0c5730f3335641a0ca" + integrity sha512-dZqr4rKFN+veuXakIQ1DcGUpzBgcWKaYFNN4O6/skOdVQaEfGefzo1sZET+q7k/BkypxkhXHXpv5UqqSuL/EHQ== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@lerna/package-graph" "3.14.0" - "@lerna/project" "3.13.1" + "@lerna/project" "3.15.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" dedent "^0.7.0" @@ -471,13 +543,14 @@ fs-extra "^7.0.0" npmlog "^4.1.2" -"@lerna/create@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.14.0.tgz#ec7a0d4aa81e60c918ea2ba06f3c71ee2855a936" - integrity sha512-J4PeGnzVBOSV7Cih8Uhv9xIauljR9bGcfSDN9aMzFtJhSX0xFXNvmnpXRORp7xNHV2lbxk7mNxRQxzR9CQRMuw== +"@lerna/create@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.15.0.tgz#27bfadcbdf71d34226aa82432293f5290f7ab1aa" + integrity sha512-doXGt0HTwTQl8GkC2tOrraA/5OWbz35hJqi7Dsl3Fl0bAxiv9XmF3LykHFJ+YTDHfGpdoJ8tKu66f/VKP16G0w== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.14.0" + "@evocateur/pacote" "^9.6.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/npm-conf" "3.13.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" @@ -487,7 +560,6 @@ init-package-json "^1.10.3" npm-package-arg "^6.1.0" p-reduce "^1.0.0" - pacote "^9.5.0" pify "^3.0.0" semver "^5.5.0" slash "^1.0.0" @@ -495,42 +567,42 @@ validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" -"@lerna/describe-ref@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.13.3.tgz#13318513613f6a407d37fc5dc025ec2cfb705606" - integrity sha512-5KcLTvjdS4gU5evW8ESbZ0BF44NM5HrP3dQNtWnOUSKJRgsES8Gj0lq9AlB2+YglZfjEftFT03uOYOxnKto4Uw== +"@lerna/describe-ref@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.14.2.tgz#edc3c973f5ca9728d23358c4f4d3b55a21f65be5" + integrity sha512-qa5pzDRK2oBQXNjyRmRnN7E8a78NMYfQjjlRFB0KNHMsT6mCiL9+8kIS39sSE2NqT8p7xVNo2r2KAS8R/m3CoQ== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" npmlog "^4.1.2" -"@lerna/diff@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.14.0.tgz#a4860c062faf990dd3c208dcf1c6fbde5a042bdb" - integrity sha512-H6FSj0jOiQ6unVCwOK6ReT5uZN6ZIn/j/cx4YwuOtU3SMcs3UfuQRIFNeKg/tKmOcQGd39Mn9zDhmt3TAYGROA== +"@lerna/diff@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.15.0.tgz#573d6f58f6809d16752dcfab74c5e286b6678371" + integrity sha512-N1Pr0M554Bt+DlVoD+DXWGh92gcq6G9icn8sH5GSqfwi0XCpPNJ2i1BNEZpUQ6ulLWOMa1YHR4PypPxecRGBjA== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.14.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" -"@lerna/exec@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.14.0.tgz#da632dac4a86d59f7fe8c566af8648f8272241ff" - integrity sha512-cNFO8hWsBVLeqVQ7LsQ4rYKbbQ2eN+Ne+hWKTlUQoyRbYzgJ22TXhjKR6IMr68q0xtclcDlasfcNO+XEWESh0g== +"@lerna/exec@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.15.0.tgz#b31510f47255367eb0d3e4a4f7b6ef8f7e41b985" + integrity sha512-YuXPd64TNG9wbb3lRvyMARQbdlbMZ1bJZ+GCm0enivnIWUyg0qtBDcfPY2dWpIgOif04zx+K/gmOX4lCaGM4UQ== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/run-topologically" "3.14.0" "@lerna/validation-error" "3.13.0" p-map "^1.2.0" -"@lerna/filter-options@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.14.0.tgz#6a2e60708633f54973bf31262b58e53efb537ef2" - integrity sha512-ZmNZK9m8evxHc+2ZnDyCm8XFIKVDKpIASG1wtizr3R14t49fuYE7nR+rm4t82u9oSSmER8gb8bGzh0SKZme/jg== +"@lerna/filter-options@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.14.2.tgz#7ba91cb54ff3fd9f4650ad8d7c40bc1075e44c2d" + integrity sha512-Ct8oYvRttbYB9JalngHhirb8o9ZVyLm5a9MpXNevXoHiu6j0vNhI19BQCwNnrL6wZvEHJnzPuUl/jO23tWxemg== dependencies: - "@lerna/collect-updates" "3.14.0" + "@lerna/collect-updates" "3.14.2" "@lerna/filter-packages" "3.13.0" dedent "^0.7.0" @@ -559,37 +631,46 @@ ssri "^6.0.1" tar "^4.4.8" -"@lerna/github-client@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.13.3.tgz#bcf9b4ff40bdd104cb40cd257322f052b41bb9ce" - integrity sha512-fcJkjab4kX0zcLLSa/DCUNvU3v8wmy2c1lhdIbL7s7gABmDcV0QZq93LhnEee3VkC9UpnJ6GKG4EkD7eIifBnA== +"@lerna/github-client@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.14.2.tgz#a743792b51cd9bdfb785186e429568827a6372eb" + integrity sha512-+2Xh7t4qVmXiXE2utPnh5T7YwSltG74JP7c+EiooRY5+3zjh9MpPOcTKxVY3xKclzpsyXMohk2KpTF4tzA5rrg== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@octokit/plugin-enterprise-rest" "^2.1.1" "@octokit/rest" "^16.16.0" git-url-parse "^11.1.2" npmlog "^4.1.2" +"@lerna/gitlab-client@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-3.15.0.tgz#91f4ec8c697b5ac57f7f25bd50fe659d24aa96a6" + integrity sha512-OsBvRSejHXUBMgwWQqNoioB8sgzL/Pf1pOUhHKtkiMl6aAWjklaaq5HPMvTIsZPfS6DJ9L5OK2GGZuooP/5c8Q== + dependencies: + node-fetch "^2.5.0" + npmlog "^4.1.2" + whatwg-url "^7.0.0" + "@lerna/global-options@3.13.0": version "3.13.0" resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== -"@lerna/has-npm-version@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.13.3.tgz#167e3f602a2fb58f84f93cf5df39705ca6432a2d" - integrity sha512-mQzoghRw4dBg0R9FFfHrj0TH0glvXyzdEZmYZ8Isvx5BSuEEwpsryoywuZSdppcvLu8o7NAdU5Tac8cJ/mT52w== +"@lerna/has-npm-version@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.14.2.tgz#ac17f7c68e92114b8332b95ae6cffec9c0d67a7b" + integrity sha512-cG+z5bB8JPd5f+nT2eLN2LmKg06O11AxlnUxgw2W7cLyc7cnsmMSp/rxt2JBMwW2r4Yn+CLLJIRwJZ2Es8jFSw== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" semver "^5.5.0" -"@lerna/import@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.14.0.tgz#de5727dc18d21c50af14b481e47b424c5bbe107c" - integrity sha512-j8z/m85FX1QYPgl5TzMNupdxsQF/NFZSmdCR19HQzqiVKC8ULGzF30WJEk66+KeZ94wYMSakINtYD+41s34pNQ== +"@lerna/import@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.15.0.tgz#47f2da52059a96bb08a4c09e18d985258fce9ce1" + integrity sha512-4GKQgeTXBTwMbZNkYyPdQIVA41HIISD7D6XRNrDaG0falUfvoPsknijQPCBmGqeh66u1Fcn2+4lkL3OCTj2FMg== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.14.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" @@ -597,35 +678,35 @@ fs-extra "^7.0.0" p-map-series "^1.0.0" -"@lerna/init@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.14.0.tgz#f5b92f171f9ed4168bd3d9305fffe6a46460a1d2" - integrity sha512-X3PQkQZds5ozA1xiarmVzAK6LPLNK3bBu24Api0w2KJXO7Ccs9ob/VcGdevZuzqdJo1Xg2H6oBhEqIClU9Uqqw== +"@lerna/init@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.15.0.tgz#bda36de44c365972f87cbd287fe85b6fb7bb1070" + integrity sha512-VOqH6kFbFtfUbXxhSqXKY6bjnVp9nLuLRI6x9tVHOANX2LmSlXm17OUGBnNt+eM4uJLuiUsAR8nTlpCiz//lPQ== dependencies: - "@lerna/child-process" "3.13.3" - "@lerna/command" "3.14.0" + "@lerna/child-process" "3.14.2" + "@lerna/command" "3.15.0" fs-extra "^7.0.0" p-map "^1.2.0" write-json-file "^2.3.0" -"@lerna/link@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.14.0.tgz#817243559b3d460a08bd65582e7632b1dbc6df69" - integrity sha512-xlwQhWTVOZrgAuoONY3/OIBWehDfZXmf5qFhnOy7lIxByRhEX5Vwx0ApaGxHTv3Flv7T+oI4s8UZVq5F6dT8Aw== +"@lerna/link@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.15.0.tgz#718b4116a8eacb3fc73414ae8d97f8fdaf8125da" + integrity sha512-yKHuifADINobvDOLljBGkVGpVwy6J3mg5p9lQXBdOLXBoIKC8o/UKBR9JvZMFvT/Iy6zn6FPy1v5lz9iU1Ib0Q== dependencies: - "@lerna/command" "3.14.0" + "@lerna/command" "3.15.0" "@lerna/package-graph" "3.14.0" - "@lerna/symlink-dependencies" "3.14.0" + "@lerna/symlink-dependencies" "3.14.2" p-map "^1.2.0" slash "^1.0.0" -"@lerna/list@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.14.0.tgz#cfe826937c63a3652003639eb7fd36bf4b0a3660" - integrity sha512-Gp+9gaIkBfXBwc9Ng0Y74IEfAqpQpLiXwOP4IOpdINxOeDpllhMaYP6SzLaMvrfSyHRayM7Cq5/PRnHkXQ5uuQ== +"@lerna/list@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.15.0.tgz#4e401c1ad990bb12bd38298cb61d21136420ff68" + integrity sha512-8SvxnlfAnbEzQDf2NL0IxWyUuqWTykF9cHt5/f5TOzgESClpaOkDtqwh/UlE8nVTzWMnxnQUPQi3UTKyJD3i3g== dependencies: - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" "@lerna/listable" "3.14.0" "@lerna/output" "3.13.0" @@ -656,23 +737,23 @@ config-chain "^1.1.11" pify "^3.0.0" -"@lerna/npm-dist-tag@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.14.0.tgz#69b1f99ce9d777782afe646522cb14293d986eb5" - integrity sha512-DEyYEdufTGIC6E4RTJUsYPgqlz1Bs/XPeEQ5fd+ojWnICevj7dRrr2DfHucPiUCADlm2jbAraAQc3QPU0dXRhw== +"@lerna/npm-dist-tag@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.15.0.tgz#262dd1e67a4cf82ae78fadfe02622ebce4add078" + integrity sha512-lnbdwc4Ebs7/EI9fTIgbH3dxXnP+SuCcGhG7P5ZjOqo67SY09sRZGcygEzabpvIwXvKpBF8vCd4xxzjnF2u+PA== dependencies: + "@evocateur/npm-registry-fetch" "^3.9.1" "@lerna/otplease" "3.14.0" figgy-pudding "^3.5.1" npm-package-arg "^6.1.0" - npm-registry-fetch "^3.9.0" npmlog "^4.1.2" -"@lerna/npm-install@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.13.3.tgz#9b09852732e51c16d2e060ff2fd8bfbbb49cf7ba" - integrity sha512-7Jig9MLpwAfcsdQ5UeanAjndChUjiTjTp50zJ+UZz4CbIBIDhoBehvNMTCL2G6pOEC7sGEg6sAqJINAqred6Tg== +"@lerna/npm-install@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.14.2.tgz#fd22ff432f8b7cbe05bedfd36b0506482f1a4732" + integrity sha512-JYJJRtLETrGpcQZa8Rj16vbye399RqnaXmJlZuZ2twjJ2DYVYtwkfsGEOdvdaKw5KVOEpWcAxBA9OMmKQtCLQw== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^7.0.0" npm-package-arg "^6.1.0" @@ -680,27 +761,27 @@ signal-exit "^3.0.2" write-pkg "^3.1.0" -"@lerna/npm-publish@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.14.0.tgz#e3fc5613a2dd08cdd3323347ba87fad5dc5f11fb" - integrity sha512-ShG0qEnGkWxtjQvIRATgm/CzeoVaSyyoNRag5t8gDSR/r2u9ux72oROKQUEaE8OwcTS4rL2cyBECts8XMNmyYw== +"@lerna/npm-publish@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.15.0.tgz#89126d74ec97186475767b852954a5f55b732a71" + integrity sha512-G7rcNcSGjG0La8eHPXDvCvoNXbwNnP6XJ+GPh3CH5xiR/nikfLOa+Bfm4ytdjVWWxnKfCT4qyMTCoV1rROlqQQ== dependencies: + "@evocateur/libnpmpublish" "^1.2.0" "@lerna/otplease" "3.14.0" "@lerna/run-lifecycle" "3.14.0" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpmpublish "^1.1.1" npm-package-arg "^6.1.0" npmlog "^4.1.2" pify "^3.0.0" read-package-json "^2.0.13" -"@lerna/npm-run-script@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.13.3.tgz#9bb6389ed70cd506905d6b05b6eab336b4266caf" - integrity sha512-qR4o9BFt5hI8Od5/DqLalOJydnKpiQFEeN0h9xZi7MwzuX1Ukwh3X22vqsX4YRbipIelSFtrDzleNVUm5jj0ow== +"@lerna/npm-run-script@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.14.2.tgz#8c518ea9d241a641273e77aad6f6fddc16779c3f" + integrity sha512-LbVFv+nvAoRTYLMrJlJ8RiakHXrLslL7Jp/m1R18vYrB8LYWA3ey+nz5Tel2OELzmjUiemAKZsD9h6i+Re5egg== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" @@ -719,13 +800,13 @@ dependencies: npmlog "^4.1.2" -"@lerna/pack-directory@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.14.0.tgz#229446c2e3f307a7932f2f779d7fb8b8ff7d93b0" - integrity sha512-E9PmC1oWYjYN8Z0Oeoj7X98NruMg/pcdDiRxnwJ5awnB0d/kyfoquHXCYwCQQFCnWUfto7m5lM4CSostcolEVQ== +"@lerna/pack-directory@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.14.2.tgz#577b8ebf867c9b636a2e4659a27552ee24d83b9d" + integrity sha512-b3LnJEmIml3sDj94TQT8R+kVyrDlmE7Su0WwcBYZDySXPMSZ38WA2/2Xjy/EWhXlFxp/nUJKyUG78nDrZ/00Uw== dependencies: "@lerna/get-packed" "3.13.0" - "@lerna/package" "3.13.0" + "@lerna/package" "3.14.2" "@lerna/run-lifecycle" "3.14.0" figgy-pudding "^3.5.1" npm-packlist "^1.4.1" @@ -744,10 +825,10 @@ npmlog "^4.1.2" semver "^5.5.0" -"@lerna/package@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.13.0.tgz#4baeebc49a57fc9b31062cc59f5ee38384429fc8" - integrity sha512-kSKO0RJQy093BufCQnkhf1jB4kZnBvL7kK5Ewolhk5gwejN+Jofjd8DGRVUDUJfQ0CkW1o6GbUeZvs8w8VIZDg== +"@lerna/package@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.14.2.tgz#f893cb42e26c869df272dafbe1dd5a3473b0bd4d" + integrity sha512-YR/+CzYdufJYfsUlrfuhTjA35iSZpXK7mVOZmeR9iRWhSaqesm4kq2zfxm9vCpZV2oAQQZOwi4eo5h0rQBtdiw== dependencies: load-json-file "^4.0.0" npm-package-arg "^6.1.0" @@ -760,12 +841,12 @@ dependencies: semver "^5.5.0" -"@lerna/project@3.13.1": - version "3.13.1" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.13.1.tgz#bce890f60187bd950bcf36c04b5260642e295e79" - integrity sha512-/GoCrpsCCTyb9sizk1+pMBrIYchtb+F1uCOn3cjn9yenyG/MfYEnlfrbV5k/UDud0Ei75YBLbmwCbigHkAKazQ== +"@lerna/project@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.15.0.tgz#733b0993a849dcf5b68fcd0ec11d8f7de38a6999" + integrity sha512-eNGUWiMbQ9kh9kGkomtMnsLypS0rfLqxKgZP2+VnNVtIXjnLv4paeTm+1lkL+naNJUwhnpMk2NSLEeoxT/20QA== dependencies: - "@lerna/package" "3.13.0" + "@lerna/package" "3.14.2" "@lerna/validation-error" "3.13.0" cosmiconfig "^5.1.0" dedent "^0.7.0" @@ -786,39 +867,39 @@ inquirer "^6.2.0" npmlog "^4.1.2" -"@lerna/publish@3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.14.1.tgz#c1f7ad8d152947bb88a1755b4305a5a431d3e610" - integrity sha512-p+By/P84XJkndBzrmcnVLMcFpGAE+sQZCQK4e3aKQrEMLDrEwXkWt/XJxzeQskPxInFA/7Icj686LOADO7p0qg== - dependencies: - "@lerna/check-working-tree" "3.14.1" - "@lerna/child-process" "3.13.3" - "@lerna/collect-updates" "3.14.0" - "@lerna/command" "3.14.0" - "@lerna/describe-ref" "3.13.3" +"@lerna/publish@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.15.0.tgz#54f93f8f0820d2d419d0b65df1eb55d8277090c9" + integrity sha512-6tRRBJ8olLSXfrUsR4f7vSfx0cT1oPi6/v06yI3afDSsUX6eQ3ooZh7gMY4RWmd+nM/IJHTUzhlKF6WhTvo+9g== + dependencies: + "@evocateur/libnpmaccess" "^3.1.0" + "@evocateur/npm-registry-fetch" "^3.9.1" + "@evocateur/pacote" "^9.6.0" + "@lerna/check-working-tree" "3.14.2" + "@lerna/child-process" "3.14.2" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" + "@lerna/describe-ref" "3.14.2" "@lerna/log-packed" "3.13.0" "@lerna/npm-conf" "3.13.0" - "@lerna/npm-dist-tag" "3.14.0" - "@lerna/npm-publish" "3.14.0" + "@lerna/npm-dist-tag" "3.15.0" + "@lerna/npm-publish" "3.15.0" "@lerna/output" "3.13.0" - "@lerna/pack-directory" "3.14.0" + "@lerna/pack-directory" "3.14.2" "@lerna/prerelease-id-from-version" "3.14.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/run-lifecycle" "3.14.0" "@lerna/run-topologically" "3.14.0" "@lerna/validation-error" "3.13.0" - "@lerna/version" "3.14.1" + "@lerna/version" "3.15.0" figgy-pudding "^3.5.1" fs-extra "^7.0.0" - libnpmaccess "^3.0.1" npm-package-arg "^6.1.0" - npm-registry-fetch "^3.9.0" npmlog "^4.1.2" p-finally "^1.0.0" p-map "^1.2.0" p-pipe "^1.2.0" - pacote "^9.5.0" semver "^5.5.0" "@lerna/pulse-till-done@3.13.0": @@ -845,12 +926,12 @@ npmlog "^4.1.2" read-cmd-shim "^1.0.1" -"@lerna/rimraf-dir@3.13.3": - version "3.13.3" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.13.3.tgz#3a8e71317fde853893ef0262bc9bba6a180b7227" - integrity sha512-d0T1Hxwu3gpYVv73ytSL+/Oy8JitsmvOYUR5ouRSABsmqS7ZZCh5t6FgVDDGVXeuhbw82+vuny1Og6Q0k4ilqw== +"@lerna/rimraf-dir@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.14.2.tgz#103a49882abd85d42285d05cc76869b89f21ffd2" + integrity sha512-eFNkZsy44Bu9v1Hrj5Zk6omzg8O9h/7W6QYK1TTUHeyrjTEwytaNQlqF0lrTLmEvq55sviV42NC/8P3M2cvq8Q== dependencies: - "@lerna/child-process" "3.13.3" + "@lerna/child-process" "3.14.2" npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" @@ -882,38 +963,38 @@ figgy-pudding "^3.5.1" p-queue "^4.0.0" -"@lerna/run@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.14.0.tgz#1a5d3330149fbf5092012707b775d5f57d9d0057" - integrity sha512-kGGFGLYPKozAN07CSJ7kOyLY6W3oLCQcxCathg1isSkBqQH29tWUg8qNduOlhIFLmnq/nf1JEJxxoXnF6IRLjQ== +"@lerna/run@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.15.0.tgz#465028b5b561a050bd760924e4a0749de3f43172" + integrity sha512-KQBkzZYoEKmzILKjbjsm1KKVWFBXwAdwzqJWj/lfxxd3V5LRF8STASk8aiw8bSpB0bUL9TU/pbXakRxiNzjDwQ== dependencies: - "@lerna/command" "3.14.0" - "@lerna/filter-options" "3.14.0" - "@lerna/npm-run-script" "3.13.3" + "@lerna/command" "3.15.0" + "@lerna/filter-options" "3.14.2" + "@lerna/npm-run-script" "3.14.2" "@lerna/output" "3.13.0" "@lerna/run-topologically" "3.14.0" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" p-map "^1.2.0" -"@lerna/symlink-binary@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.14.0.tgz#db1c3204b83d91c4b43386302ee76cea4d20bc3f" - integrity sha512-AHFb4NlazxYmC+7guoamM3laIRbMSeKERMooKHJ7moe0ayGPBWsCGOH+ZFKZ+eXSDek+FnxdzayR3wf8B3LkTg== +"@lerna/symlink-binary@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.14.2.tgz#a832fdc6c4b1e5aaf9e6ac9c7e6c322746965eb0" + integrity sha512-tqMwuWi6z1da0AFFbleWyu3H9fqayiV50rjj4anFTfayel9jSjlA1xPG+56sGIP6zUUNuUSc9kLh7oRRmlauoA== dependencies: "@lerna/create-symlink" "3.14.0" - "@lerna/package" "3.13.0" + "@lerna/package" "3.14.2" fs-extra "^7.0.0" p-map "^1.2.0" -"@lerna/symlink-dependencies@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.14.0.tgz#f17e5cd704a0f067636038dafeaf42b5d2f28802" - integrity sha512-kuSXxwAWiVZqFcXfUBKH4yLUH3lrnGyZmCYon7UnZitw3AK3LQY7HvV2LNNw/oatfjOAiKhPBxnYjYijKiV4oA== +"@lerna/symlink-dependencies@3.14.2": + version "3.14.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.14.2.tgz#e6b2a9544ff26addc1f4324734595e2f71dfc795" + integrity sha512-Ox7WKXnHZ7IwWlejcCq3n0Hd/yMLv8AwIryhvWxM/RauAge+ML4wg578SsdCyKob8ecgm/R0ytHiU06j81iL1w== dependencies: "@lerna/create-symlink" "3.14.0" "@lerna/resolve-symlink" "3.13.0" - "@lerna/symlink-binary" "3.14.0" + "@lerna/symlink-binary" "3.14.2" fs-extra "^7.0.0" p-finally "^1.0.0" p-map "^1.2.0" @@ -931,18 +1012,18 @@ dependencies: npmlog "^4.1.2" -"@lerna/version@3.14.1": - version "3.14.1" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.14.1.tgz#df081fec70fcfdcd3c470648c49b035b44a373bf" - integrity sha512-H/jykoxVIt4oDEYkBgwDfO5dmZFl3G6vP1UEttRVP1FIkI+gCN+olby8S0Qd8XprDuR5OrLboiDWQs3p7nJhLw== +"@lerna/version@3.15.0": + version "3.15.0" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.15.0.tgz#3c65d223d94f211312995266abb07ee6606d5f73" + integrity sha512-vReYX1NMXZ9PwzTZm97wAl/k3bmRnRZhnQi3mq/m49xTnDavq7p4sbUdFpvu8cVZNKnYS02pNIVGHrQw+K8ZCw== dependencies: - "@lerna/batch-packages" "3.14.0" - "@lerna/check-working-tree" "3.14.1" - "@lerna/child-process" "3.13.3" - "@lerna/collect-updates" "3.14.0" - "@lerna/command" "3.14.0" + "@lerna/check-working-tree" "3.14.2" + "@lerna/child-process" "3.14.2" + "@lerna/collect-updates" "3.14.2" + "@lerna/command" "3.15.0" "@lerna/conventional-commits" "3.14.0" - "@lerna/github-client" "3.13.3" + "@lerna/github-client" "3.14.2" + "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" "@lerna/prerelease-id-from-version" "3.14.0" "@lerna/prompt" "3.13.0" @@ -4428,25 +4509,25 @@ left-pad@^1.3.0: integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== lerna@^3.6.0: - version "3.14.1" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.14.1.tgz#6bce5d2d4958e853f51387f8f41a8f2d9aa4a8ea" - integrity sha512-lQxmGeEECjOMI3pRh2+I6jazoEWhEfvZNIs7XaX71op33AVwyjlY/nQ1GJGrPhxYBuQnlPgH0vH/nC/lcLaVkw== - dependencies: - "@lerna/add" "3.14.0" - "@lerna/bootstrap" "3.14.0" - "@lerna/changed" "3.14.1" - "@lerna/clean" "3.14.0" + version "3.15.0" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.15.0.tgz#b044dba8138d7a1a8dd48ac1d80e7541bdde0d1f" + integrity sha512-kRIQ3bgzkmew5/WZQ0C9WjH0IUf3ZmTNnBwTHfXgLkVY7td0lbwMQFD7zehflUn0zG4ou54o/gn+IfjF0ti/5A== + dependencies: + "@lerna/add" "3.15.0" + "@lerna/bootstrap" "3.15.0" + "@lerna/changed" "3.15.0" + "@lerna/clean" "3.15.0" "@lerna/cli" "3.13.0" - "@lerna/create" "3.14.0" - "@lerna/diff" "3.14.0" - "@lerna/exec" "3.14.0" - "@lerna/import" "3.14.0" - "@lerna/init" "3.14.0" - "@lerna/link" "3.14.0" - "@lerna/list" "3.14.0" - "@lerna/publish" "3.14.1" - "@lerna/run" "3.14.0" - "@lerna/version" "3.14.1" + "@lerna/create" "3.15.0" + "@lerna/diff" "3.15.0" + "@lerna/exec" "3.15.0" + "@lerna/import" "3.15.0" + "@lerna/init" "3.15.0" + "@lerna/link" "3.15.0" + "@lerna/list" "3.15.0" + "@lerna/publish" "3.15.0" + "@lerna/run" "3.15.0" + "@lerna/version" "3.15.0" import-local "^1.0.0" npmlog "^4.1.2" @@ -4463,31 +4544,6 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -libnpmaccess@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-3.0.1.tgz#5b3a9de621f293d425191aa2e779102f84167fa8" - integrity sha512-RlZ7PNarCBt+XbnP7R6PoVgOq9t+kou5rvhaInoNibhPO7eMlRfS0B8yjatgn2yaHIwWNyoJDolC/6Lc5L/IQA== - dependencies: - aproba "^2.0.0" - get-stream "^4.0.0" - npm-package-arg "^6.1.0" - npm-registry-fetch "^3.8.0" - -libnpmpublish@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-1.1.1.tgz#ff0c6bb0b4ad2bda2ad1f5fba6760a4af37125f0" - integrity sha512-nefbvJd/wY38zdt+b9SHL6171vqBrMtZ56Gsgfd0duEKb/pB8rDT4/ObUQLrHz1tOfht1flt2zM+UGaemzAG5g== - dependencies: - aproba "^2.0.0" - figgy-pudding "^3.5.1" - get-stream "^4.0.0" - lodash.clonedeep "^4.5.0" - normalize-package-data "^2.4.0" - npm-package-arg "^6.1.0" - npm-registry-fetch "^3.8.0" - semver "^5.5.1" - ssri "^6.0.1" - lint-staged@^8.1.0: version "8.2.0" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.0.tgz#3d4149a229580815c955047a7acd8f09054be5a9" @@ -5075,6 +5131,11 @@ node-fetch@^2.3.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.3.0.tgz#1a1d940bbfb916a1d3e0219f037e89e71f8c5fa5" integrity sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA== +node-fetch@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" + integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== + node-gyp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-4.0.0.tgz#972654af4e5dd0cd2a19081b4b46fe0442ba6f45" @@ -5236,18 +5297,6 @@ npm-pick-manifest@^2.2.3: npm-package-arg "^6.0.0" semver "^5.4.1" -npm-registry-fetch@^3.8.0, npm-registry-fetch@^3.9.0: - version "3.9.0" - resolved "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-3.9.0.tgz#44d841780e2833f06accb34488f8c7450d1a6856" - integrity sha512-srwmt8YhNajAoSAaDWndmZgx89lJwIZ1GWxOuckH4Coek4uHv5S+o/l9FLQe/awA+JwTnj4FJHldxhlXdZEBmw== - dependencies: - JSONStream "^1.3.4" - bluebird "^3.5.1" - figgy-pudding "^3.4.1" - lru-cache "^4.1.3" - make-fetch-happen "^4.0.1" - npm-package-arg "^6.1.0" - npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" @@ -5525,39 +5574,6 @@ p-waterfall@^1.0.0: dependencies: p-reduce "^1.0.0" -pacote@^9.5.0: - version "9.5.0" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-9.5.0.tgz#85f3013a3f6dd51c108b0ccabd3de8102ddfaeda" - integrity sha512-aUplXozRbzhaJO48FaaeClmN+2Mwt741MC6M3bevIGZwdCaP7frXzbUOfOWa91FPHoLITzG0hYaKY363lxO3bg== - dependencies: - bluebird "^3.5.3" - cacache "^11.3.2" - figgy-pudding "^3.5.1" - get-stream "^4.1.0" - glob "^7.1.3" - lru-cache "^5.1.1" - make-fetch-happen "^4.0.1" - minimatch "^3.0.4" - minipass "^2.3.5" - mississippi "^3.0.0" - mkdirp "^0.5.1" - normalize-package-data "^2.4.0" - npm-package-arg "^6.1.0" - npm-packlist "^1.1.12" - npm-pick-manifest "^2.2.3" - npm-registry-fetch "^3.8.0" - osenv "^0.1.5" - promise-inflight "^1.0.1" - promise-retry "^1.1.1" - protoduck "^5.0.1" - rimraf "^2.6.2" - safe-buffer "^5.1.2" - semver "^5.6.0" - ssri "^6.0.1" - tar "^4.4.8" - unique-filename "^1.1.1" - which "^1.3.1" - parallel-transform@^1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" From 2cbad5cc548169f06a0802fea78cb5c39ad42ebe Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 18 Jun 2019 21:24:29 +0000 Subject: [PATCH 13/24] chore(deps-dev): bump @typescript-eslint/parser from 1.9.0 to 1.10.2 Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 1.9.0 to 1.10.2. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v1.10.2/packages/parser) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4da18c0..5de46bcf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1064,6 +1064,11 @@ dependencies: "@babel/types" "^7.3.0" +"@types/eslint-visitor-keys@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" + integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag== + "@types/events@*": version "3.0.0" resolved "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -1182,21 +1187,14 @@ "@typescript-eslint/typescript-estree" "1.10.2" eslint-scope "^4.0.0" -"@typescript-eslint/experimental-utils@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz#a92777d0c92d7bc8627abd7cdb06cdbcaf2b39e8" - integrity sha512-1s2dY9XxBwtS9IlSnRIlzqILPyeMly5tz1bfAmQ84Ul687xBBve5YsH5A5EKeIcGurYYqY2w6RkHETXIwnwV0A== - dependencies: - "@typescript-eslint/typescript-estree" "1.9.0" - "@typescript-eslint/parser@^1.2.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.9.0.tgz#5796cbfcb9a3a5757aeb671c1ac88d7a94a95962" - integrity sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA== + version "1.10.2" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.10.2.tgz#36cfe8c6bf1b6c1dd81da56f88c8588f4b1a852b" + integrity sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ== dependencies: - "@typescript-eslint/experimental-utils" "1.9.0" - "@typescript-eslint/typescript-estree" "1.9.0" - eslint-scope "^4.0.0" + "@types/eslint-visitor-keys" "^1.0.0" + "@typescript-eslint/experimental-utils" "1.10.2" + "@typescript-eslint/typescript-estree" "1.10.2" eslint-visitor-keys "^1.0.0" "@typescript-eslint/typescript-estree@1.10.2": @@ -1207,14 +1205,6 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@typescript-eslint/typescript-estree@1.9.0": - version "1.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz#5d6d49be936e96fb0f859673480f89b070a5dd9b" - integrity sha512-7Eg0TEQpCkTsEwsl1lIzd6i7L3pJLQFWesV08dS87bNz0NeSjbL78gNAP1xCKaCejkds4PhpLnZkaAjx9SU8OA== - dependencies: - lodash.unescape "4.0.1" - semver "5.5.0" - JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" From 4580e7c1baaf015fd327ccb2c1424825431315d0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 18 Jun 2019 21:24:34 +0000 Subject: [PATCH 14/24] chore(deps-dev): bump lint-staged from 8.2.0 to 8.2.1 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 8.2.0 to 8.2.1. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Commits](https://github.com/okonet/lint-staged/compare/v8.2.0...v8.2.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4da18c0..45af752f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4489,9 +4489,9 @@ libnpmpublish@^1.1.1: ssri "^6.0.1" lint-staged@^8.1.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.0.tgz#3d4149a229580815c955047a7acd8f09054be5a9" - integrity sha512-DxguyxGOIfb67wZ6EOrqzjAbw6ZH9XK3YS74HO+erJf6+SAQeJJPN//GBOG5xhdt2THeuXjVPaHcCYOWGZwRbA== + version "8.2.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.2.1.tgz#752fcf222d9d28f323a3b80f1e668f3654ff221f" + integrity sha512-n0tDGR/rTCgQNwXnUf/eWIpPNddGWxC32ANTNYsj2k02iZb7Cz5ox2tytwBu+2r0zDXMEMKw7Y9OD/qsav561A== dependencies: chalk "^2.3.1" commander "^2.14.1" From 0d89ce55450260a60cc9c885a17047a08d3f3900 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 18 Jun 2019 21:25:16 +0000 Subject: [PATCH 15/24] chore(deps-dev): bump husky from 2.4.0 to 2.4.1 Bumps [husky](https://github.com/typicode/husky) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/typicode/husky/releases) - [Changelog](https://github.com/typicode/husky/blob/master/CHANGELOG.md) - [Commits](https://github.com/typicode/husky/compare/v2.4.0...v2.4.1) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4da18c0..3e4abf7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3385,9 +3385,9 @@ humanize-ms@^1.2.1: ms "^2.0.0" husky@^2.1.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-2.4.0.tgz#1bac7c44588f6e91f808b72efc82d24a57194f36" - integrity sha512-3k1wuZU20gFkphNWMjh2ISCFaqfbaLY7R9FST2Mj9HeRhUK9ydj9qQR8qfXlog3EctVGsyeilcZkIT7uBZDDVA== + version "2.4.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-2.4.1.tgz#dd00f9646f8693b93f7b3a12ba4be00be0eff7ab" + integrity sha512-ZRwMWHr7QruR22dQ5l3rEGXQ7rAQYsJYqaeCd+NyOsIFczAtqaApZQP3P4HwLZjCtFbm3SUNYoKuoBXX3AYYfw== dependencies: cosmiconfig "^5.2.0" execa "^1.0.0" From 35fb4b387a0626c803a1c9422f22a21f8f187e5a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" Date: Tue, 18 Jun 2019 21:26:10 +0000 Subject: [PATCH 16/24] chore(deps-dev): bump typescript from 3.5.1 to 3.5.2 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.5.1 to 3.5.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.5.1...v3.5.2) Signed-off-by: dependabot-preview[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index b4da18c0..08775a1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7055,9 +7055,9 @@ typescript@3.2.x: integrity sha512-0RNDbSdEokBeEAkgNbxJ+BLwSManFy9TeXz8uW+48j/xhEXv1ePME60olyzw2XzUqUBNAYFeJadIqAgNqIACwg== typescript@^3.2.2: - version "3.5.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202" - integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw== + version "3.5.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.2.tgz#a09e1dc69bc9551cadf17dba10ee42cf55e5d56c" + integrity sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== uglify-js@^3.1.4: version "3.4.9" From 7382458266fb310cbc0fda37e0866f900c4131bc Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 19 Jun 2019 17:03:55 +0800 Subject: [PATCH 17/24] feat(rpc): update get blockchain info rpc remove warnings field and add alerts field BREAKING CHANGE: replace warnings field with alerts field in the response of get blockchain info rpc --- .../ckb-sdk-rpc/__tests__/formatters/fixtures.json | 4 ++-- packages/ckb-sdk-rpc/src/resultFormatter.ts | 11 ++++++++++- packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts | 9 ++++++++- packages/ckb-types/index.d.ts | 9 ++++++++- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json b/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json index d9709f00..e27ea62a 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json +++ b/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json @@ -451,7 +451,7 @@ "difficulty": "0x100", "median_time": "1557287480008", "chain": "ckb_dev", - "warnings": "" + "alerts": [] }, "target": { "isInitialBlockDownload": false, @@ -459,7 +459,7 @@ "difficulty": "0x100", "medianTime": "1557287480008", "chain": "ckb_dev", - "warnings": "" + "alerts": [] } }], "toNodeInfo": [{ diff --git a/packages/ckb-sdk-rpc/src/resultFormatter.ts b/packages/ckb-sdk-rpc/src/resultFormatter.ts index e951671f..19e6f9c7 100644 --- a/packages/ckb-sdk-rpc/src/resultFormatter.ts +++ b/packages/ckb-sdk-rpc/src/resultFormatter.ts @@ -93,12 +93,21 @@ const formatter = { ...rest, } }, + toAlertMessage: (alertMessage: CKB_RPC.AlertMessage): CKBComponents.AlertMessage => { + if (!alertMessage) return alertMessage + const { notice_until: noticeUntil, ...rest } = alertMessage + return { + noticeUntil, + ...rest, + } + }, toBlockchainInfo: (info: CKB_RPC.BlockchainInfo): CKBComponents.BlockchainInfo => { if (!info) return info - const { is_initial_block_download: isInitialBlockDownload, median_time: medianTime, ...rest } = info + const { is_initial_block_download: isInitialBlockDownload, median_time: medianTime, alerts, ...rest } = info return { isInitialBlockDownload, medianTime, + alerts: alerts.map(formatter.toAlertMessage), ...rest, } }, diff --git a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts index 40ef06d2..9b3c43f3 100644 --- a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts +++ b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts @@ -112,13 +112,20 @@ declare module CKB_RPC { proposals: ProposalShortId[] } + export interface AlertMessage { + id: string + priority: string + notice_until: Timestamp + message: string + } + export interface BlockchainInfo { is_initial_block_download: boolean epoch: string difficulty: string median_time: string chain: string - warnings: string + alerts: AlertMessage[] } export interface NodeInfo { diff --git a/packages/ckb-types/index.d.ts b/packages/ckb-types/index.d.ts index 5f483904..87047276 100644 --- a/packages/ckb-types/index.d.ts +++ b/packages/ckb-types/index.d.ts @@ -215,13 +215,20 @@ declare namespace CKBComponents { Unknown = 'unknown', } + export interface AlertMessage { + id: string + priority: string + noticeUntil: Timestamp + message: string + } + export interface BlockchainInfo { isInitialBlockDownload: boolean epoch: string difficulty: string medianTime: string chain: string - warnings: string + alerts: AlertMessage[] } export interface NodeInfo { From 2a7d403f51a72ba961915902bf9dae06e7d44858 Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 19 Jun 2019 16:05:27 +0800 Subject: [PATCH 18/24] feat(rpc): add index related rpc add rpc of deindex_lock_hash, get_live_cells_by_lock_hash, get_lock_hash_index_states, get_transactions_by_lock_hash, index_lock_hash --- .../ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js | 4 +- .../ckb-sdk-rpc/__tests__/ckb-rpc.test.js | 10 + .../__tests__/formatters/params.json | 186 ++++ .../__tests__/formatters/params.test.js | 33 +- .../__tests__/formatters/result.json | 963 ++++++++++++++++++ .../__tests__/formatters/result.test.js | 150 +-- packages/ckb-sdk-rpc/src/defaultRPC.ts | 98 +- packages/ckb-sdk-rpc/src/paramsFormatter.ts | 9 + packages/ckb-sdk-rpc/src/resultFormatter.ts | 38 + packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts | 26 + packages/ckb-types/index.d.ts | 39 + 11 files changed, 1387 insertions(+), 169 deletions(-) create mode 100644 packages/ckb-sdk-rpc/__tests__/formatters/params.json create mode 100644 packages/ckb-sdk-rpc/__tests__/formatters/result.json diff --git a/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js b/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js index d1e4e0ad..ff763d47 100644 --- a/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js +++ b/packages/ckb-sdk-rpc/__tests__/ckb-rpc-helpers.js @@ -40,8 +40,8 @@ describe('ckb-rpc settings and helpers', () => { expect(rpc.node).toEqual(node) }) - it('has 17 default rpc', () => { - expect(rpc.methods.length).toBe(17) + it('has 22 default rpc', () => { + expect(rpc.methods.length).toBe(22) }) it('set node url to http://test.localhost:8114', () => { diff --git a/packages/ckb-sdk-rpc/__tests__/ckb-rpc.test.js b/packages/ckb-sdk-rpc/__tests__/ckb-rpc.test.js index d113bea1..a8bf0724 100644 --- a/packages/ckb-sdk-rpc/__tests__/ckb-rpc.test.js +++ b/packages/ckb-sdk-rpc/__tests__/ckb-rpc.test.js @@ -85,6 +85,16 @@ describe('ckb-rpc success', () => { const cells = await rpc.getCellsByLockHash(lockHash, '0', '100') expect(Array.isArray(cells)).toBeTruthy() }) + + it('deindex lock hash', async () => {}) + + it('get live cells by lock hash', async () => {}) + + it('get lock hash index states', async () => {}) + + it('get transactions by lock hash', async () => {}) + + it('index lock hash', async () => {}) }) describe('send transaction', () => { diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/params.json b/packages/ckb-sdk-rpc/__tests__/formatters/params.json new file mode 100644 index 00000000..fabce3fd --- /dev/null +++ b/packages/ckb-sdk-rpc/__tests__/formatters/params.json @@ -0,0 +1,186 @@ +{ + "success": { + "toHash": [ + { + "source": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" + }, + { + "source": "e5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" + } + ], + "toCellOutPoint": [ + { + "source": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "target": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + } + } + ], + "toOutPoint": [ + { + "source": { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "target": { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "source": { + "cell": null, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "target": { + "cell": null, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + }, + { + "source": { + "cell": null, + "blockHash": null + }, + "target": { + "cell": null, + "block_hash": null + } + } + ], + "toNumber": [ + { + "source": "1", + "target": "1" + } + ], + "toRawTransaction": [ + { + "source": { + "deps": [ + { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "inputs": [ + { + "previousOutput": { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0" + }, + "target": { + "deps": [ + { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "inputs": [ + { + "previous_output": { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0" + } + } + ], + "toPageNumber": [ + { + "source": "12", + "target": "12" + }, + { + "source": 12, + "target": "12" + } + ], + "toPageSize": [ + { + "source": "12", + "target": "12" + }, + { + "source": 12, + "target": "12" + } + ], + "toReverseOrder": [ + { + "source": true, + "target": true + }, + { + "source": false, + "target": false + } + ] + }, + "failure": { + "toPageSize": [ + { + "source": "-1", + "error": "Page size is expected to be positive" + }, + { + "source": "51", + "error": "Page size is up to 50" + } + ] + } +} diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/params.test.js b/packages/ckb-sdk-rpc/__tests__/formatters/params.test.js index d75f9077..1d6a0083 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/params.test.js +++ b/packages/ckb-sdk-rpc/__tests__/formatters/params.test.js @@ -1,32 +1,21 @@ const paramsFmt = require('../../lib/paramsFormatter').default -const { params } = require('./fixtures.json') +const fixtures = require('./params.json') -describe('params formatter', () => { - it('toHash', () => { - params.toHash.forEach(fixture => { - const formatted = paramsFmt.toHash(fixture.source) - expect(formatted).toBe(fixture.target) - }) - }) +const { success, failure } = fixtures - it('toOutPoint', () => { - params.toOutPoint.forEach(fixture => { - const formatted = paramsFmt.toOutPoint(fixture.source) +describe('params formatter success', () => { + test.each(Object.keys(success))('%s', metohdName => { + success[metohdName].forEach(fixture => { + const formatted = paramsFmt[metohdName](fixture.source) expect(formatted).toEqual(fixture.target) }) }) +}) - it('toNumber', () => { - params.toNumber.forEach(fixture => { - const formatted = paramsFmt.toNumber(fixture.source) - expect(formatted).toBe(fixture.target) - }) - }) - - it('toRawTransaction', () => { - params.toRawTransaction.forEach(fixture => { - const formatted = paramsFmt.toRawTransaction(fixture.source) - expect(formatted).toEqual(fixture.target) +describe('param formatter failure', () => { + test.each(Object.keys(failure))('%s', methodName => { + failure[methodName].forEach(fixture => { + expect(() => paramsFmt[methodName](fixture.source)).toThrowError(fixture.error) }) }) }) diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/result.json b/packages/ckb-sdk-rpc/__tests__/formatters/result.json new file mode 100644 index 00000000..e884e50f --- /dev/null +++ b/packages/ckb-sdk-rpc/__tests__/formatters/result.json @@ -0,0 +1,963 @@ +{ + "success": { + "toNumber": [ + { + "source": "2", + "target": "2" + } + ], + "toHash": [ + { + "source": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" + } + ], + "toScript": [ + { + "source": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "target": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + } + ], + "toInput": [ + { + "source": { + "previous_output": { + "cell": { + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + }, + "target": { + "previousOutput": { + "cell": { + "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + } + ], + "toOutput": [ + { + "source": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + }, + "target": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + } + }, + { + "source": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + }, + "target": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + } + ], + "toCellOutPoint": [ + { + "source": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "target": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + } + } + ], + "toOutPoint": [ + { + "source": { + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + } + }, + "target": { + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + } + } + }, + { + "source": { + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "cell": null + }, + "target": { + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "cell": null + } + }, + { + "source": { + "block_hash": null, + "cell": null + }, + "target": { + "blockHash": null, + "cell": null + } + } + ], + "toTransaction": [ + { + "source": { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previous_output": { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + }, + "target": { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previousOutput": { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + } + } + ], + "toUncleBlock": [ + { + "source": { + "header": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "uncles_count": "0", + "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "proposals": [] + }, + "target": { + "header": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "unclesCount": "0", + "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "proposals": [] + } + } + ], + "toBlock": [ + { + "source": { + "header": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "uncles_count": "0", + "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "proposals": [], + "transactions": [ + { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previous_output": { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + } + ], + "uncles": [] + }, + "target": { + "header": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "unclesCount": "0", + "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "proposals": [], + "transactions": [ + { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previousOutput": { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + } + ], + "uncles": [] + } + } + ], + "toBlockchainInfo": [ + { + "source": { + "is_initial_block_download": false, + "epoch": "0", + "difficulty": "0x100", + "median_time": "1557287480008", + "chain": "ckb_dev", + "warnings": "" + }, + "target": { + "isInitialBlockDownload": false, + "epoch": "0", + "difficulty": "0x100", + "medianTime": "1557287480008", + "chain": "ckb_dev", + "warnings": "" + } + } + ], + "toNodeInfo": [ + { + "source": { + "addresses": [ + { + "address": "/ip4/192.168.0.2/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "score": "255" + }, + { + "address": "/ip4/0.0.0.0/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "score": "1" + } + ], + "is_outbound": null, + "node_id": "QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "version": "0.9.0" + }, + "target": { + "addresses": [ + { + "address": "/ip4/192.168.0.2/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "score": "255" + }, + { + "address": "/ip4/0.0.0.0/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "score": "1" + } + ], + "isOutbound": null, + "nodeId": "QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", + "version": "0.9.0" + } + } + ], + "toTxPoolInfo": [ + { + "source": { + "orphan": "33", + "pending": "34", + "proposed": "22", + "last_txs_updated_at": "1555507787683", + "total_tx_cycles": "12", + "total_tx_size": "156" + }, + "target": { + "orphan": "33", + "pending": "34", + "proposed": "22", + "lastTxsUpdatedAt": "1555507787683", + "totalTxCycles": "12", + "totalTxSize": "156" + } + } + ], + "toPeers": [ + { + "source": [ + { + "addresses": [ + { + "address": "/ip4/192.168.0.3/tcp/8115", + "score": "1" + } + ], + "node_id": "QmaaaLB4uPyDpZwTQGhV63zuYrKm4reyN2tF1j2ain4oE7", + "version": "unknown" + }, + { + "addresses": [ + { + "address": "/ip4/192.168.0.4/tcp/8113", + "score": "255" + } + ], + "node_id": "QmRuGcpVC3vE7aEoB6fhUdq9uzdHbyweCnn1sDBSjfmcbM", + "version": "unknown" + }, + { + "addresses": [], + "node_id": "QmUddxwRqgTmT6tFujXbYPMLGLAE2Tciyv6uHGfdYFyDVa", + "version": "unknown" + } + ], + "target": [ + { + "addresses": [ + { + "address": "/ip4/192.168.0.3/tcp/8115", + "score": "1" + } + ], + "nodeId": "QmaaaLB4uPyDpZwTQGhV63zuYrKm4reyN2tF1j2ain4oE7", + "version": "unknown" + }, + { + "addresses": [ + { + "address": "/ip4/192.168.0.4/tcp/8113", + "score": "255" + } + ], + "nodeId": "QmRuGcpVC3vE7aEoB6fhUdq9uzdHbyweCnn1sDBSjfmcbM", + "version": "unknown" + }, + { + "addresses": [], + "nodeId": "QmUddxwRqgTmT6tFujXbYPMLGLAE2Tciyv6uHGfdYFyDVa", + "version": "unknown" + } + ] + } + ], + "toPeersState": [ + { + "source": { + "last_updated": "1557289448237", + "blocks_in_flight": "86", + "peer": "1" + }, + "target": { + "lastUpdated": "1557289448237", + "blocksInFlight": "86", + "peer": "1" + } + } + ], + "toCell": [ + { + "source": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + }, + "target": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + } + } + ], + "toCellWithStatus": [ + { + "source": { + "cell": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + }, + "status": "live" + }, + "target": { + "cell": { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + }, + "status": "live" + } + } + ], + "toCellIncludingOutPoint": [ + { + "source": { + "lock": { + "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", + "args": ["0x7f52f0fccdd1d11391c441adfb174f87bca612b0"] + }, + "type": null, + "capacity": "5000000000000", + "out_point": { + "block_hash": null, + "cell": { + "index": "0", + "tx_hash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" + } + } + }, + "target": { + "lock": { + "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", + "args": ["0x7f52f0fccdd1d11391c441adfb174f87bca612b0"] + }, + "type": null, + "capacity": "5000000000000", + "outPoint": { + "blockHash": null, + "cell": { + "index": "0", + "txHash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" + } + } + } + } + ], + "toCells": [ + { + "source": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "target": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ] + } + ], + "toCellsIncludingOutPoint": [ + { + "source": [ + { + "lock": { + "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", + "args": ["0x7f52f0fccdd1d11391c441adfb174f87bca612b0"] + }, + "type": null, + "capacity": "5000000000000", + "out_point": { + "block_hash": null, + "cell": { + "index": "0", + "tx_hash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" + } + } + } + ], + "target": [ + { + "lock": { + "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", + "args": ["0x7f52f0fccdd1d11391c441adfb174f87bca612b0"] + }, + "type": null, + "capacity": "5000000000000", + "outPoint": { + "blockHash": null, + "cell": { + "index": "0", + "txHash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" + } + } + } + ] + } + ], + "toHeader": [ + { + "source": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "uncles_count": "0", + "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "target": { + "difficulty": "0x100", + "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", + "number": "2", + "epoch": "0", + "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", + "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "seal": { + "nonce": "9828930232171500901", + "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" + }, + "timestamp": "1556199760706", + "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "unclesCount": "0", + "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "version": "0", + "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + } + ], + "toTransactionWithStatus": [ + { + "source": { + "transaction": { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previous_output": { + "cell": { + "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + }, + "tx_status": { + "status": "committed", + "block_hash": "0xef285e5da29247ce39385cbd8dc36535f7ea1b5b0379db26e9d459a8b47d0d71" + } + }, + "target": { + "transaction": { + "deps": [], + "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", + "inputs": [ + { + "previousOutput": { + "cell": { + "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "index": "4294967295" + }, + "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "since": "0" + } + ], + "outputs": [ + { + "capacity": "5000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + "type": null + } + ], + "version": "0", + "witnesses": [] + }, + "txStatus": { + "status": "committed", + "blockHash": "0xef285e5da29247ce39385cbd8dc36535f7ea1b5b0379db26e9d459a8b47d0d71" + } + } + } + ], + "toEpoch": [ + { + "source": { + "block_reward": "5000000000000", + "difficulty": "0x100", + "last_block_hash_in_previous_epoch": "0x0000000000000000000000000000000000000000000000000000000000000000", + "length": "1000", + "number": "0", + "remainder_reward": "5000000000000", + "start_number": "0" + }, + "target": { + "blockReward": "5000000000000", + "difficulty": "0x100", + "lastBlockHashInPreviousEpoch": "0x0000000000000000000000000000000000000000000000000000000000000000", + "length": "1000", + "number": "0", + "remainderReward": "5000000000000", + "startNumber": "0" + } + } + ], + "toTransactionPoint": [ + { + "source": { + "block_number": "1", + "index": "0", + "tx_hash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + }, + "target": { + "blockNumber": "1", + "index": "0", + "txHash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + } + } + ], + "toTransactionsByLockHash": [ + { + "source": [ + { + "consumed_by": null, + "created_by": { + "block_number": "1", + "index": "0", + "tx_hash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + } + }, + { + "consumed_by": null, + "created_by": { + "block_number": "2", + "index": "0", + "tx_hash": "0x46ab01ddbbabef1af701f0843e11c7cfc0ce53f9aa9b554af74cadf8e3257d89" + } + } + ], + "target": [ + { + "consumedBy": null, + "createdBy": { + "blockNumber": "1", + "index": "0", + "txHash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + } + }, + { + "consumedBy": null, + "createdBy": { + "blockNumber": "2", + "index": "0", + "txHash": "0x46ab01ddbbabef1af701f0843e11c7cfc0ce53f9aa9b554af74cadf8e3257d89" + } + } + ] + } + ], + "toLiveCellsByLockHash": [ + { + "source": [ + { + "cell_output": { + "capacity": "50000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5" + }, + "type": null + }, + "created_by": { + "block_number": "1", + "index": "0", + "tx_hash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + } + }, + { + "cell_output": { + "capacity": "50000000000000", + "data": "0x", + "lock": { + "args": [], + "code_hash": "0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5" + }, + "type": null + }, + "created_by": { + "block_number": "2", + "index": "0", + "tx_hash": "0x46ab01ddbbabef1af701f0843e11c7cfc0ce53f9aa9b554af74cadf8e3257d89" + } + } + ], + "target": [ + { + "cellOutput": { + "capacity": "50000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5" + }, + "type": null + }, + "createdBy": { + "blockNumber": "1", + "index": "0", + "txHash": "0x41524669872de0ce874f926a9799b6944198571094fe94dc7ffa623a97c4f19f" + } + }, + { + "cellOutput": { + "capacity": "50000000000000", + "data": "0x", + "lock": { + "args": [], + "codeHash": "0x28e83a1277d48add8e72fadaa9248559e1b632bab2bd60b27955ebc4c03800a5" + }, + "type": null + }, + "createdBy": { + "blockNumber": "2", + "index": "0", + "txHash": "0x46ab01ddbbabef1af701f0843e11c7cfc0ce53f9aa9b554af74cadf8e3257d89" + } + } + ] + } + ], + "toLockHashIndexState": [ + { + "source": { + "block_hash": "0xf35168c2e2e0c494ec97233091d5de51b7e5af7376bbc3d7572fc6438e2bb032", + "block_number": "1024", + "lock_hash": "0x9a9a6bdbc38d4905eace1822f85237e3a1e238bb3f277aa7b7c8903441123510" + }, + "target": { + "blockHash": "0xf35168c2e2e0c494ec97233091d5de51b7e5af7376bbc3d7572fc6438e2bb032", + "blockNumber": "1024", + "lockHash": "0x9a9a6bdbc38d4905eace1822f85237e3a1e238bb3f277aa7b7c8903441123510" + } + } + ], + "toLockHashIndexStates": [ + { + "source": [ + { + "block_hash": "0xf35168c2e2e0c494ec97233091d5de51b7e5af7376bbc3d7572fc6438e2bb032", + "block_number": "1024", + "lock_hash": "0x9a9a6bdbc38d4905eace1822f85237e3a1e238bb3f277aa7b7c8903441123510" + } + ], + "target": [ + { + "blockHash": "0xf35168c2e2e0c494ec97233091d5de51b7e5af7376bbc3d7572fc6438e2bb032", + "blockNumber": "1024", + "lockHash": "0x9a9a6bdbc38d4905eace1822f85237e3a1e238bb3f277aa7b7c8903441123510" + } + ] + } + ] + }, + "failure": {} +} diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/result.test.js b/packages/ckb-sdk-rpc/__tests__/formatters/result.test.js index c09f862c..b5f5512c 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/result.test.js +++ b/packages/ckb-sdk-rpc/__tests__/formatters/result.test.js @@ -1,150 +1,12 @@ const resultFmt = require('../../lib/resultFormatter').default -const { result } = require('./fixtures.json') +const fixtures = require('./result.json') -describe('result formatter', () => { - it('toNumber', () => { - result.toNumber.forEach(fixture => { - const formatted = resultFmt.toNumber(fixture.source) - expect(formatted).toBe(fixture.target) - }) - }) - - it('toHash', () => { - result.toHash.forEach(fixture => { - const formatted = resultFmt.toHash(fixture.source) - expect(formatted).toBe(fixture.target) - }) - }) - - it('toScript', () => { - result.toScript.forEach(fixture => { - const formatted = resultFmt.toScript(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toOutput', () => { - result.toOutput.forEach(fixture => { - const formatted = resultFmt.toOutput(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toOutPoint', () => { - result.toOutPoint.forEach(fixture => { - const formatted = resultFmt.toOutPoint(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toTransaction', () => { - result.toTransaction.forEach(fixture => { - const formatted = resultFmt.toTransaction(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toTransactionWithStatus', () => { - result.toTransactionWithStatus.forEach(fixture => { - const formatted = resultFmt.toTransactionWithStatus(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toUncleBlock', () => { - result.toUncleBlock.forEach(fixture => { - const formatted = resultFmt.toUncleBlock(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toBlock', () => { - result.toBlock.forEach(fixture => { - const formatted = resultFmt.toBlock(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toBlockchainInfo', () => { - result.toBlockchainInfo.forEach(fixture => { - const formatted = resultFmt.toBlockchainInfo(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toNodeInfo', () => { - result.toNodeInfo.forEach(fixture => { - const formatted = resultFmt.toNodeInfo(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toTxPoolInfo', () => { - result.toTxPoolInfo.forEach(fixture => { - const formatted = resultFmt.toTxPoolInfo(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toPeers', () => { - result.toPeers.forEach(fixture => { - const formatted = resultFmt.toPeers(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toPeersState', () => { - result.toPeersState.forEach(fixture => { - const formatted = resultFmt.toPeersState(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toCell', () => { - result.toCell.forEach(fixture => { - const formatted = resultFmt.toCell(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toCellWithStatus', () => { - result.toCellWithStatus.forEach(fixture => { - const formatted = resultFmt.toCellWithStatus(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toCells', () => { - result.toCells.forEach(fixture => { - const formatted = resultFmt.toCells(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toCellIncludingOutPoint', () => { - result.toCellIncludingOutPoint.forEach(fixture => { - const formatted = resultFmt.toCellIncludingOutPoint(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toCellsIncludingOutPoint', () => { - result.toCellsIncludingOutPoint.forEach(fixture => { - const formatted = resultFmt.toCellsIncludingOutPoint(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) - - it('toHeader', () => { - result.toHeader.forEach(fixture => { - const formatted = resultFmt.toHeader(fixture.source) - expect(formatted).toEqual(fixture.target) - }) - }) +const { success } = fixtures - it('toEpoch', () => { - result.toEpoch.forEach(fixture => { - const formatted = resultFmt.toEpoch(fixture.source) +describe('result formatter success', () => { + test.each(Object.keys(success))('%s', methodName => { + success[methodName].forEach(fixture => { + const formatted = resultFmt[methodName](fixture.source) expect(formatted).toEqual(fixture.target) }) }) diff --git a/packages/ckb-sdk-rpc/src/defaultRPC.ts b/packages/ckb-sdk-rpc/src/defaultRPC.ts index 3d1cc0d0..6841b533 100644 --- a/packages/ckb-sdk-rpc/src/defaultRPC.ts +++ b/packages/ckb-sdk-rpc/src/defaultRPC.ts @@ -102,6 +102,35 @@ const defaultRPC: CKBComponents.Method[] = [ method: 'dry_run_transaction', paramsFormatters: [paramsFmts.toRawTransaction], }, + { + name: 'deindexLockHash', + method: 'deindex_lock_hash', + paramsFormatters: [paramsFmts.toHash], + }, + { + name: 'getLiveCellsByLockHash', + method: 'get_live_cells_by_lock_hash', + paramsFormatters: [paramsFmts.toHash, paramsFmts.toPageNumber, paramsFmts.toPageSize, paramsFmts.toReverseOrder], + resultFormatters: resultFmts.toLiveCellsByLockHash, + }, + { + name: 'getLockHashIndexStates', + method: 'get_lock_hash_index_states', + paramsFormatters: [], + resultFormatters: resultFmts.toLockHashIndexStates, + }, + { + name: 'getTransactionsByLockHash', + method: 'get_transactions_by_lock_hash', + paramsFormatters: [paramsFmts.toHash, paramsFmts.toPageNumber, paramsFmts.toPageSize, paramsFmts.toReverseOrder], + resultFormatters: resultFmts.toTransactionsByLockHash, + }, + { + name: 'indexLockHash', + method: 'index_lock_hash', + paramsFormatters: [paramsFmts.toHash], + resultFormatters: resultFmts.toLockHashIndexState, + }, ] export class DefaultRPC { @@ -162,7 +191,7 @@ export class DefaultRPC { * @return {object[]} array of objects including lock script, capacity, outPoint */ public getCellsByLockHash!: ( - hash: string, + hash: CKBComponents.Hash256, from: CKBComponents.BlockNumber, to: CKBComponents.BlockNumber ) => Promise @@ -268,6 +297,73 @@ export class DefaultRPC { * @return {Promise} dry run result, including cycles the transaction used. */ public dryRunTransaction!: (tx: CKBComponents.RawTransaction) => Promise + + /** + * @method deindexLockHash + * @memberof DefaultRPC + * @description remove index for live cells and transaction by the hash of lock script, + * returns empty array when the `lock_hash` not indexed yet. + * @param {string} lockHash + * @retrun {Promise Promise + + /** + * @method getLiveCellsByLockHash + * @memberof DefaultRPC + * @description return the live cells collection by the hash of lock script + * @param {string} lockHash, the hash of lock script + * @param {string} pageNumber + * @param {string} pageSize, max value is 50 + * @param {boolean} [reverseOrder], return the live cells collection in reverse order, + * an optional parameter, default to be false + * @return {Promise} + */ + public getLiveCellsByLockHash!: ( + lockHash: CKBComponents.Hash256, + pageNumber: string, + pageSize: string, + reverseOrder?: boolean + ) => Promise + + /** + * @method getLockHashIndexStates + * @memberof DefaultRPC + * @description get lock hash index states + * @retrun {Promise} + */ + public getLockHashIndexStates!: () => Promise + + /** + * @method getTransactionsByLockHash + * @memberof DefaultRPC + * @description retrun the transactions collection by the hash of lock script. + * return empty array when the `lock_hash` not indexed yet. + * @param {string} lockHash, the hash of lock script + * @param {string} pageNumber + * @param {string} pageSize, max value is 50 + * @param {boolean} [reverseOrder], return the transactions collection in reverse order, + * an optional parameter, default to be false + */ + public getTransactionsByLockHash!: ( + lockHash: CKBComponents.Hash256, + pageNumber: string, + pageSize: string, + reverseOrder?: boolean + ) => Promise + + /** + * @method indexLockHash + * @memberof DefaultRPC + * @description create index for live cells and transactions by the hash of lock script + * @param {string} lockHash, the hash of lock script + * @param {string} [indexFrom], the starting block number(exclusive), an optional parameter, + * null means starting from the tip and 0 means starting from genesis + */ + public indexLockHash!: ( + lockHash: CKBComponents.Hash, + indexFrom?: CKBComponents.BlockNumber + ) => Promise } export default DefaultRPC diff --git a/packages/ckb-sdk-rpc/src/paramsFormatter.ts b/packages/ckb-sdk-rpc/src/paramsFormatter.ts index 3435fb28..7ee1b5ca 100644 --- a/packages/ckb-sdk-rpc/src/paramsFormatter.ts +++ b/packages/ckb-sdk-rpc/src/paramsFormatter.ts @@ -43,6 +43,15 @@ const formatter = { } return tx }, + toPageNumber: (pageNo: string | number = '1') => pageNo.toString(), + toPageSize: (pageSize: string | number = 50) => { + const size = +pageSize || 50 + if (size > 50) throw new Error('Page size is up to 50') + if (size < 0) throw new Error('Page size is expected to be positive') + return `${size}` + }, + toReverseOrder: (reverse: boolean = false) => !!reverse, } + export default formatter /* eslint-enable camelcase */ diff --git a/packages/ckb-sdk-rpc/src/resultFormatter.ts b/packages/ckb-sdk-rpc/src/resultFormatter.ts index 19e6f9c7..450daeb1 100644 --- a/packages/ckb-sdk-rpc/src/resultFormatter.ts +++ b/packages/ckb-sdk-rpc/src/resultFormatter.ts @@ -207,6 +207,44 @@ const formatter = { ...rest, } }, + toTransactionPoint: (transactionPoint: CKB_RPC.TransactionPoint): CKBComponents.TransactionPoint => { + if (!transactionPoint) return transactionPoint + const { block_number: blockNumber, tx_hash: txHash, ...rest } = transactionPoint + return { + blockNumber, + txHash, + ...rest, + } + }, + toTransactionsByLockHash: (transactions: CKB_RPC.TransactionsByLockHash): CKBComponents.TransactionsByLockHash => { + if (!transactions) return transactions + return transactions.map(tx => ({ + consumedBy: tx.consumed_by ? formatter.toTransactionPoint(tx.consumed_by) : tx.consumed_by, + createdBy: formatter.toTransactionPoint(tx.created_by), + })) + }, + toLiveCellsByLockHash: (cells: CKB_RPC.LiveCellsByLockHash): CKBComponents.LiveCellsByLockHash => { + if (!cells) return cells + return cells.map(cell => ({ + cellOutput: formatter.toCell(cell.cell_output), + createdBy: formatter.toTransactionPoint(cell.created_by), + })) + }, + toLockHashIndexState: (index: CKB_RPC.LockHashIndexState): CKBComponents.LockHashIndexState => { + if (!index) return index + const { block_hash: blockHash, block_number: blockNumber, lock_hash: lockHash, ...rest } = index + return { + blockHash, + blockNumber, + lockHash, + ...rest, + } + }, + toLockHashIndexStates: (states: CKB_RPC.LockHashIndexStates): CKBComponents.LockHashIndexStates => { + if (!states) return states + return states.map(formatter.toLockHashIndexState) + }, } + export default formatter /* eslint-enable camelcase */ diff --git a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts index 9b3c43f3..28274580 100644 --- a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts +++ b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts @@ -82,6 +82,24 @@ declare module CKB_RPC { } } + export interface TransactionPoint { + block_number: BlockNumber + index: Index + tx_hash: Hash256 + } + + export interface TransactionByLockHash { + consumed_by: null | TransactionPoint + created_by: TransactionPoint + } + export type TransactionsByLockHash = TransactionByLockHash[] + + export interface LiveCellByLockHash { + cell_output: CellOutput + created_by: TransactionPoint + } + export type LiveCellsByLockHash = LiveCellByLockHash[] + export type Seal = CKBComponents.Seal export interface Header { @@ -159,5 +177,13 @@ declare module CKB_RPC { remainder_reward: string start_number: string } + + export interface LockHashIndexState { + block_hash: Hash256 + block_number: BlockNumber + lock_hash: Hash256 + } + + export type LockHashIndexStates = LockHashIndexState[] } /* eslint-enable camelcase */ diff --git a/packages/ckb-types/index.d.ts b/packages/ckb-types/index.d.ts index 87047276..2119313c 100644 --- a/packages/ckb-types/index.d.ts +++ b/packages/ckb-types/index.d.ts @@ -122,6 +122,30 @@ declare namespace CKBComponents { hash: Hash256 } + /** + * @typeof TransactionPoint + * @property blockNumber + * @property index + * @property txHash + */ + export interface TransactionPoint { + blockNumber: BlockNumber + index: Index + txHash: Hash256 + } + + /** + * @TransactionByLockHash + * @property consumedBy + * @property createdBy + */ + export interface TransactionByLockHash { + consumedBy: null | TransactionPoint + createdBy: TransactionPoint + } + + export type TransactionsByLockHash = TransactionByLockHash[] + /** * @typedef @Seal * @property nonce @@ -215,6 +239,13 @@ declare namespace CKBComponents { Unknown = 'unknown', } + export interface LiveCellByLockHash { + cellOutput: CellOutput + createdBy: TransactionPoint + } + + export type LiveCellsByLockHash = LiveCellByLockHash[] + export interface AlertMessage { id: string priority: string @@ -271,4 +302,12 @@ declare namespace CKBComponents { export interface RunDryResult { cycles: Cycles } + + export interface LockHashIndexState { + blockHash: Hash256 + blockNumber: BlockNumber + lockHash: Hash256 + } + + export type LockHashIndexStates = LockHashIndexState[] } From cf8931bbd74bf85d5559db96b414869d43c676cc Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 19 Jun 2019 16:05:27 +0800 Subject: [PATCH 19/24] feat(rpc): add index related rpc add rpc of deindex_lock_hash, get_live_cells_by_lock_hash, get_lock_hash_index_states, get_transactions_by_lock_hash, index_lock_hash --- .../__tests__/formatters/fixtures.json | 833 ------------------ .../__tests__/formatters/result.json | 4 +- 2 files changed, 2 insertions(+), 835 deletions(-) delete mode 100644 packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json b/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json deleted file mode 100644 index e27ea62a..00000000 --- a/packages/ckb-sdk-rpc/__tests__/formatters/fixtures.json +++ /dev/null @@ -1,833 +0,0 @@ -{ - "params": { - "toHash": [{ - "source": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" - }, { - - "source": "e5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" - }], - "toCellOutPoint": [{ - "source": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "target": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - } - }], - "toOutPoint": [{ - "source": { - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "target": { - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, { - "source": { - "cell": null, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "target": { - "cell": null, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }, { - "source": { - "cell": null, - "blockHash": null - }, - "target": { - "cell": null, - "block_hash": null - } - }], - "toNumber": [{ - "source": "1", - "target": "1" - }], - "toRawTransaction": [{ - "source": { - "deps": [{ - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }], - "inputs": [{ - "previousOutput": { - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0" - }, - "target": { - "deps": [{ - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }], - "inputs": [{ - "previous_output": { - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0" - } - }] - }, - "result": { - "toNumber": [{ - "source": "2", - "target": "2" - }], - "toHash": [{ - "source": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "target": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1" - }], - "toScript": [{ - "source": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "target": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - }], - "toInput": [{ - "source": { - "previous_output": { - "cell": { - "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }, - "target": { - "previousOutput": { - "cell": { - "hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - } - }], - "toOutput": [{ - "source": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - }, - "target": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - } - }, { - "source": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }, - "target": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - } - }], - "toCellOutPoint": [{ - "source": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "target": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - } - }], - "toOutPoint": [{ - "source": { - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - } - }, - "target": { - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - } - } - }, { - "source": { - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "cell": null - }, - "target": { - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "cell": null - } - }, { - "source": { - "block_hash": null, - "cell": null - }, - "target": { - "blockHash": null, - "cell": null - } - }], - "toTransaction": [{ - "source": { - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previous_output": { - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - }, - "target": { - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previousOutput": { - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - } - }], - "toUncleBlock": [{ - "source": { - "header": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "uncles_count": "0", - "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" - - }, - "proposals": [] - }, - "target": { - "header": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "unclesCount": "0", - "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" - - }, - "proposals": [] - } - }], - "toBlock": [{ - "source": { - "header": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "uncles_count": "0", - "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "proposals": [], - "transactions": [{ - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previous_output": { - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - }], - "uncles": [] - }, - "target": { - "header": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "unclesCount": "0", - "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "proposals": [], - "transactions": [{ - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previousOutput": { - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - }], - "uncles": [] - } - }], - "toBlockchainInfo": [{ - "source": { - "is_initial_block_download": false, - "epoch": "0", - "difficulty": "0x100", - "median_time": "1557287480008", - "chain": "ckb_dev", - "alerts": [] - }, - "target": { - "isInitialBlockDownload": false, - "epoch": "0", - "difficulty": "0x100", - "medianTime": "1557287480008", - "chain": "ckb_dev", - "alerts": [] - } - }], - "toNodeInfo": [{ - "source": { - "addresses": [{ - "address": "/ip4/192.168.0.2/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "score": "255" - }, - { - "address": "/ip4/0.0.0.0/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "score": "1" - } - ], - "is_outbound": null, - "node_id": "QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "version": "0.9.0" - }, - "target": { - "addresses": [{ - "address": "/ip4/192.168.0.2/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "score": "255" - }, - { - "address": "/ip4/0.0.0.0/tcp/8112/p2p/QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "score": "1" - } - ], - "isOutbound": null, - "nodeId": "QmTRHCdrRtgUzYLNCin69zEvPvLYdxUZLLfLYyHVY3DZAS", - "version": "0.9.0" - } - }], - "toTxPoolInfo": [{ - "source": { - "orphan": "33", - "pending": "34", - "proposed": "22", - "last_txs_updated_at": "1555507787683", - "total_tx_cycles": "12", - "total_tx_size": "156" - }, - "target": { - "orphan": "33", - "pending": "34", - "proposed": "22", - "lastTxsUpdatedAt": "1555507787683", - "totalTxCycles": "12", - "totalTxSize": "156" - } - }], - "toPeers": [{ - "source": [{ - "addresses": [{ - "address": "/ip4/192.168.0.3/tcp/8115", - "score": "1" - }], - "node_id": "QmaaaLB4uPyDpZwTQGhV63zuYrKm4reyN2tF1j2ain4oE7", - "version": "unknown" - }, { - "addresses": [{ - "address": "/ip4/192.168.0.4/tcp/8113", - "score": "255" - }], - "node_id": "QmRuGcpVC3vE7aEoB6fhUdq9uzdHbyweCnn1sDBSjfmcbM", - "version": "unknown" - }, { - "addresses": [], - "node_id": "QmUddxwRqgTmT6tFujXbYPMLGLAE2Tciyv6uHGfdYFyDVa", - "version": "unknown" - }], - "target": [{ - "addresses": [{ - "address": "/ip4/192.168.0.3/tcp/8115", - "score": "1" - }], - "nodeId": "QmaaaLB4uPyDpZwTQGhV63zuYrKm4reyN2tF1j2ain4oE7", - "version": "unknown" - }, { - "addresses": [{ - "address": "/ip4/192.168.0.4/tcp/8113", - "score": "255" - }], - "nodeId": "QmRuGcpVC3vE7aEoB6fhUdq9uzdHbyweCnn1sDBSjfmcbM", - "version": "unknown" - }, { - "addresses": [], - "nodeId": "QmUddxwRqgTmT6tFujXbYPMLGLAE2Tciyv6uHGfdYFyDVa", - "version": "unknown" - }] - }], - "toPeersState": [{ - "source": { - "last_updated": "1557289448237", - "blocks_in_flight": "86", - "peer": "1" - }, - "target": { - "lastUpdated": "1557289448237", - "blocksInFlight": "86", - "peer": "1" - } - }], - "toCell": [{ - "source": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - }, - "target": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - } - } - }], - "toCellWithStatus": [{ - "source": { - "cell": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }, - "status": "live" - }, - "target": { - "cell": { - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }, - "status": "live" - } - }], - "toCellIncludingOutPoint": [{ - "source": { - "lock": { - "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", - "args": [ - "0x7f52f0fccdd1d11391c441adfb174f87bca612b0" - ] - }, - "type": null, - "capacity": "5000000000000", - "out_point": { - "block_hash": null, - "cell": { - "index": "0", - "tx_hash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" - } - } - }, - "target": { - "lock": { - "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", - "args": [ - "0x7f52f0fccdd1d11391c441adfb174f87bca612b0" - ] - }, - "type": null, - "capacity": "5000000000000", - "outPoint": { - "blockHash": null, - "cell": { - "index": "0", - "txHash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" - } - } - } - }], - "toCells": [{ - "source": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "target": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }] - }], - "toCellsIncludingOutPoint": [{ - "source": [{ - "lock": { - "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", - "args": [ - "0x7f52f0fccdd1d11391c441adfb174f87bca612b0" - ] - }, - "type": null, - "capacity": "5000000000000", - "out_point": { - "block_hash": null, - "cell": { - "index": "0", - "tx_hash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" - } - } - }], - "target": [{ - "lock": { - "codeHash": "0x9e3b3557f11b2b3532ce352bfe8017e9fd11d154c4c7f9b7aaaa1e621b539a08", - "args": [ - "0x7f52f0fccdd1d11391c441adfb174f87bca612b0" - ] - }, - "type": null, - "capacity": "5000000000000", - "outPoint": { - "blockHash": null, - "cell": { - "index": "0", - "txHash": "0xecd3917b7d9833a34d30da39b943b1811163f30771aae3165f60529955afb37f" - } - } - }] - }], - "toHeader": [{ - "source": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parent_hash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposals_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactions_root": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "uncles_count": "0", - "uncles_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnesses_root": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "target": { - "difficulty": "0x100", - "hash": "0xe5f2d07b747f38718293987a9175764d4c03229a8a69d0bd48f7bea6c18930b1", - "number": "2", - "epoch": "0", - "parentHash": "0xa1dba96cdebaa25f2be69316c943269e23c23fcc6e90eedd94ecd88b43f77170", - "proposalsHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "seal": { - "nonce": "9828930232171500901", - "proof": "0x7408000066230000942c00004735000028420000f046000059550000d56200005f640000f96a000043730000d3750000" - }, - "timestamp": "1556199760706", - "transactionsRoot": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "unclesCount": "0", - "unclesHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "version": "0", - "witnessesRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" - } - }], - "toTransactionWithStatus": [{ - "source": { - "transaction": { - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previous_output": { - "cell": { - "tx_hash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "block_hash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "code_hash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - }, - "tx_status": { - "status": "committed", - "block_hash": "0xef285e5da29247ce39385cbd8dc36535f7ea1b5b0379db26e9d459a8b47d0d71" - } - }, - "target": { - "transaction": { - "deps": [], - "hash": "0x8027376875e45318ed469bed6314408e8f1986de246cbd03a786b69073c948b8", - "inputs": [{ - "previousOutput": { - "cell": { - "txHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "index": "4294967295" - }, - "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000" - }, - "since": "0" - }], - "outputs": [{ - "capacity": "5000000000000", - "data": "0x", - "lock": { - "args": [], - "codeHash": "0x0000000000000000000000000000000000000000000000000000000000000001" - }, - "type": null - }], - "version": "0", - "witnesses": [] - - }, - "txStatus": { - "status": "committed", - "blockHash": "0xef285e5da29247ce39385cbd8dc36535f7ea1b5b0379db26e9d459a8b47d0d71" - } - } - }], - "toEpoch": [{ - "source": { - "block_reward": "5000000000000", - "difficulty": "0x100", - "last_block_hash_in_previous_epoch": "0x0000000000000000000000000000000000000000000000000000000000000000", - "length": "1000", - "number": "0", - "remainder_reward": "5000000000000", - "start_number": "0" - }, - "target": { - "blockReward": "5000000000000", - "difficulty": "0x100", - "lastBlockHashInPreviousEpoch": "0x0000000000000000000000000000000000000000000000000000000000000000", - "length": "1000", - "number": "0", - "remainderReward": "5000000000000", - "startNumber": "0" - } - }] - } -} diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/result.json b/packages/ckb-sdk-rpc/__tests__/formatters/result.json index e884e50f..846d0551 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/result.json +++ b/packages/ckb-sdk-rpc/__tests__/formatters/result.json @@ -372,7 +372,7 @@ "difficulty": "0x100", "median_time": "1557287480008", "chain": "ckb_dev", - "warnings": "" + "alerts": [] }, "target": { "isInitialBlockDownload": false, @@ -380,7 +380,7 @@ "difficulty": "0x100", "medianTime": "1557287480008", "chain": "ckb_dev", - "warnings": "" + "alerts": [] } } ], From e7c1853d39f76bb8005c788325e71201f5e3cfb5 Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 20 Jun 2019 09:45:53 +0800 Subject: [PATCH 20/24] test(rpc): add tests of toAlertMessage --- .../ckb-sdk-rpc/__tests__/formatters/result.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/result.json b/packages/ckb-sdk-rpc/__tests__/formatters/result.json index 846d0551..1397868c 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/result.json +++ b/packages/ckb-sdk-rpc/__tests__/formatters/result.json @@ -364,6 +364,22 @@ } } ], + "toAlertMessage": [ + { + "source": { + "id": "1111", + "priority": "1111", + "notice_until": "1557287480008", + "message": "alert message" + }, + "target": { + "id": "1111", + "priority": "1111", + "noticeUntil": "1557287480008", + "message": "alert message" + } + } + ], "toBlockchainInfo": [ { "source": { From 17a9aa9bcdd843e5e672eb317738891c0e43119e Mon Sep 17 00:00:00 2001 From: Keith Date: Thu, 20 Jun 2019 09:59:06 +0800 Subject: [PATCH 21/24] test(rpc): add tests of default value of toPageNumber, toPageSize and toReverseOrder --- packages/ckb-sdk-rpc/__tests__/formatters/params.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/params.json b/packages/ckb-sdk-rpc/__tests__/formatters/params.json index fabce3fd..e0923eee 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/params.json +++ b/packages/ckb-sdk-rpc/__tests__/formatters/params.json @@ -148,6 +148,9 @@ { "source": 12, "target": "12" + }, + { + "target": "1" } ], "toPageSize": [ @@ -158,6 +161,9 @@ { "source": 12, "target": "12" + }, + { + "target": "50" } ], "toReverseOrder": [ @@ -168,6 +174,9 @@ { "source": false, "target": false + }, + { + "target": false } ] }, From 509a79ba1b5bf8d10466325883928dbf26160244 Mon Sep 17 00:00:00 2001 From: Keith Date: Sun, 23 Jun 2019 02:37:05 +0800 Subject: [PATCH 22/24] feat(rpc): update the type of epoch remove block_reward, last_block_hash_in_previous_epoch, remainder_reward fields, add epoch_reward field BREAKING CHANGE: update the type of epoch, remove block_reward, last_block_hash_in_previous_epoch, remainder_reward fields, add epoch_reward field. --- .../ckb-sdk-rpc/__tests__/formatters/result.json | 8 ++------ packages/ckb-sdk-rpc/src/resultFormatter.ts | 12 ++---------- packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts | 4 +--- packages/ckb-types/index.d.ts | 4 +--- 4 files changed, 6 insertions(+), 22 deletions(-) diff --git a/packages/ckb-sdk-rpc/__tests__/formatters/result.json b/packages/ckb-sdk-rpc/__tests__/formatters/result.json index 1397868c..6f58bac3 100644 --- a/packages/ckb-sdk-rpc/__tests__/formatters/result.json +++ b/packages/ckb-sdk-rpc/__tests__/formatters/result.json @@ -797,21 +797,17 @@ "toEpoch": [ { "source": { - "block_reward": "5000000000000", + "epoch_reward": "125000000000000", "difficulty": "0x100", - "last_block_hash_in_previous_epoch": "0x0000000000000000000000000000000000000000000000000000000000000000", "length": "1000", "number": "0", - "remainder_reward": "5000000000000", "start_number": "0" }, "target": { - "blockReward": "5000000000000", + "epochReward": "125000000000000", "difficulty": "0x100", - "lastBlockHashInPreviousEpoch": "0x0000000000000000000000000000000000000000000000000000000000000000", "length": "1000", "number": "0", - "remainderReward": "5000000000000", "startNumber": "0" } } diff --git a/packages/ckb-sdk-rpc/src/resultFormatter.ts b/packages/ckb-sdk-rpc/src/resultFormatter.ts index 450daeb1..8ac429f8 100644 --- a/packages/ckb-sdk-rpc/src/resultFormatter.ts +++ b/packages/ckb-sdk-rpc/src/resultFormatter.ts @@ -192,17 +192,9 @@ const formatter = { }, toEpoch: (epoch: CKB_RPC.Epoch): CKBComponents.Epoch => { if (!epoch) return epoch - const { - block_reward: blockReward, - last_block_hash_in_previous_epoch: lastBlockHashInPreviousEpoch, - remainder_reward: remainderReward, - start_number: startNumber, - ...rest - } = epoch + const { epoch_reward: epochReward, start_number: startNumber, ...rest } = epoch return { - blockReward, - lastBlockHashInPreviousEpoch, - remainderReward, + epochReward, startNumber, ...rest, } diff --git a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts index 28274580..67858758 100644 --- a/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts +++ b/packages/ckb-sdk-rpc/types/CKB_RPC/index.d.ts @@ -169,12 +169,10 @@ declare module CKB_RPC { } export interface Epoch { - block_reward: string + epoch_reward: string difficulty: string - last_block_hash_in_previous_epoch: string length: string number: string - remainder_reward: string start_number: string } diff --git a/packages/ckb-types/index.d.ts b/packages/ckb-types/index.d.ts index 2119313c..a5f9903f 100644 --- a/packages/ckb-types/index.d.ts +++ b/packages/ckb-types/index.d.ts @@ -290,12 +290,10 @@ declare namespace CKBComponents { } export interface Epoch { - blockReward: String + epochReward: String difficulty: String - lastBlockHashInPreviousEpoch: String length: String number: String - remainderReward: String startNumber: String } From 77e21f208d5ad443801e758dc80c2ded32036c28 Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 24 Jun 2019 09:29:19 +0800 Subject: [PATCH 23/24] docs: update package version and changelogs --- CHANGELOG.md | 29 +++++++++++++++++++++++++++ lerna.json | 2 +- packages/ckb-cli/CHANGELOG.md | 11 ++++++++++ packages/ckb-cli/package.json | 4 ++-- packages/ckb-sdk-address/CHANGELOG.md | 8 ++++++++ packages/ckb-sdk-address/package.json | 6 +++--- packages/ckb-sdk-core/CHANGELOG.md | 21 +++++++++++++++++++ packages/ckb-sdk-core/package.json | 10 ++++----- packages/ckb-sdk-rpc/CHANGELOG.md | 26 ++++++++++++++++++++++++ packages/ckb-sdk-rpc/package.json | 6 +++--- packages/ckb-sdk-utils/CHANGELOG.md | 16 +++++++++++++++ packages/ckb-sdk-utils/package.json | 4 ++-- packages/ckb-types/CHANGELOG.md | 20 ++++++++++++++++++ packages/ckb-types/package.json | 2 +- 14 files changed, 148 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80bcdd72..5ae96db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,35 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Bug Fixes + +* **rpc:** binding the node of method instances to the one of rpc instance. ([f0b486a](https://github.com/nervosnetwork/ckb-sdk-js/commit/f0b486a)) + + +### Features + +* **cli:** add dashboard mode of ckb-cli ([9accdeb](https://github.com/nervosnetwork/ckb-sdk-js/commit/9accdeb)) +* **rpc:** add index related rpc ([cf8931b](https://github.com/nervosnetwork/ckb-sdk-js/commit/cf8931b)) +* **rpc:** add index related rpc ([2a7d403](https://github.com/nervosnetwork/ckb-sdk-js/commit/2a7d403)) +* **rpc:** update get blockchain info rpc ([7382458](https://github.com/nervosnetwork/ckb-sdk-js/commit/7382458)) +* **rpc:** update the type of epoch ([509a79b](https://github.com/nervosnetwork/ckb-sdk-js/commit/509a79b)) +* **utils:** add signRecoverable method to the ECPair class ([3c1f334](https://github.com/nervosnetwork/ckb-sdk-js/commit/3c1f334)) + + +### BREAKING CHANGES + +* **rpc:** update the type of epoch, remove block_reward, last_block_hash_in_previous_epoch, +remainder_reward fields, add epoch_reward field. +* **rpc:** replace warnings field with alerts field in the response of get blockchain info rpc +* **utils:** use signRecoverable instead of sign method to sign the transactions. + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) diff --git a/lerna.json b/lerna.json index 34bd4fb4..1da9f4c0 100644 --- a/lerna.json +++ b/lerna.json @@ -2,5 +2,5 @@ "packages": [ "packages/*" ], - "version": "0.14.0" + "version": "0.15.0" } diff --git a/packages/ckb-cli/CHANGELOG.md b/packages/ckb-cli/CHANGELOG.md index f9875e5d..5840f07e 100644 --- a/packages/ckb-cli/CHANGELOG.md +++ b/packages/ckb-cli/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.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Features + +* **cli:** add dashboard mode of ckb-cli ([9accdeb](https://github.com/nervosnetwork/ckb-sdk-js/commit/9accdeb)) + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) **Note:** Version bump only for package @nervosnetwork/ckb-cli diff --git a/packages/ckb-cli/package.json b/packages/ckb-cli/package.json index c4c0081a..d8806976 100644 --- a/packages/ckb-cli/package.json +++ b/packages/ckb-cli/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-cli", - "version": "0.14.0", + "version": "0.15.0", "description": "Command line package based on @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -34,7 +34,7 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-core": "0.14.0", + "@nervosnetwork/ckb-sdk-core": "0.15.0", "blessed": "0.1.81", "blessed-contrib": "4.8.16", "commander": "2.20.0", diff --git a/packages/ckb-sdk-address/CHANGELOG.md b/packages/ckb-sdk-address/CHANGELOG.md index bf2b66d1..982c2b34 100644 --- a/packages/ckb-sdk-address/CHANGELOG.md +++ b/packages/ckb-sdk-address/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.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + +**Note:** Version bump only for package @nervosnetwork/ckb-sdk-address + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) **Note:** Version bump only for package @nervosnetwork/ckb-sdk-address diff --git a/packages/ckb-sdk-address/package.json b/packages/ckb-sdk-address/package.json index 069f5f53..acf85b51 100644 --- a/packages/ckb-sdk-address/package.json +++ b/packages/ckb-sdk-address/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-sdk-address", - "version": "0.14.0", + "version": "0.15.0", "description": "Address module of @nervosnetwork/ckb-sdk-core", "keywords": [ "CKB", @@ -33,8 +33,8 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-utils": "0.14.0", - "@nervosnetwork/ckb-types": "0.14.0" + "@nervosnetwork/ckb-sdk-utils": "0.15.0", + "@nervosnetwork/ckb-types": "0.15.0" }, "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" } diff --git a/packages/ckb-sdk-core/CHANGELOG.md b/packages/ckb-sdk-core/CHANGELOG.md index 73060d4d..dd9fdbff 100644 --- a/packages/ckb-sdk-core/CHANGELOG.md +++ b/packages/ckb-sdk-core/CHANGELOG.md @@ -3,6 +3,27 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Bug Fixes + +* **rpc:** binding the node of method instances to the one of rpc instance. ([f0b486a](https://github.com/nervosnetwork/ckb-sdk-js/commit/f0b486a)) + + +### Features + +* **utils:** add signRecoverable method to the ECPair class ([3c1f334](https://github.com/nervosnetwork/ckb-sdk-js/commit/3c1f334)) + + +### BREAKING CHANGES + +* **utils:** use signRecoverable instead of sign method to sign the transactions. + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) * **core:** add signWitnesses and signTransaction methods in the core module ([c20d36c](https://github.com/nervosnetwork/ckb-sdk-js/commit/c20d36c)) diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index 43a9b649..69263cab 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.14.0", + "version": "0.15.0", "description": "JavaScript SDK for Nervos Network CKB Project", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", @@ -29,10 +29,10 @@ "url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" }, "dependencies": { - "@nervosnetwork/ckb-sdk-address": "0.14.0", - "@nervosnetwork/ckb-sdk-rpc": "0.14.0", - "@nervosnetwork/ckb-sdk-utils": "0.14.0", - "@nervosnetwork/ckb-types": "0.14.0" + "@nervosnetwork/ckb-sdk-address": "0.15.0", + "@nervosnetwork/ckb-sdk-rpc": "0.15.0", + "@nervosnetwork/ckb-sdk-utils": "0.15.0", + "@nervosnetwork/ckb-types": "0.15.0" }, "devDependencies": { "@types/crypto-js": "3.1.43" diff --git a/packages/ckb-sdk-rpc/CHANGELOG.md b/packages/ckb-sdk-rpc/CHANGELOG.md index 5b94777b..6ee97700 100644 --- a/packages/ckb-sdk-rpc/CHANGELOG.md +++ b/packages/ckb-sdk-rpc/CHANGELOG.md @@ -3,6 +3,32 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Bug Fixes + +* **rpc:** binding the node of method instances to the one of rpc instance. ([f0b486a](https://github.com/nervosnetwork/ckb-sdk-js/commit/f0b486a)) + + +### Features + +* **rpc:** add index related rpc ([cf8931b](https://github.com/nervosnetwork/ckb-sdk-js/commit/cf8931b)) +* **rpc:** add index related rpc ([2a7d403](https://github.com/nervosnetwork/ckb-sdk-js/commit/2a7d403)) +* **rpc:** update get blockchain info rpc ([7382458](https://github.com/nervosnetwork/ckb-sdk-js/commit/7382458)) +* **rpc:** update the type of epoch ([509a79b](https://github.com/nervosnetwork/ckb-sdk-js/commit/509a79b)) + + +### BREAKING CHANGES + +* **rpc:** update the type of epoch, remove block_reward, last_block_hash_in_previous_epoch, +remainder_reward fields, add epoch_reward field. +* **rpc:** replace warnings field with alerts field in the response of get blockchain info rpc + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index ad76e946..9b3ef827 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.14.0", + "version": "0.15.0", "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.14.0", + "@nervosnetwork/ckb-sdk-utils": "0.15.0", "axios": "0.19.0" }, "devDependencies": { - "@nervosnetwork/ckb-types": "0.14.0", + "@nervosnetwork/ckb-types": "0.15.0", "@types/crypto-js": "3.1.43" }, "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" diff --git a/packages/ckb-sdk-utils/CHANGELOG.md b/packages/ckb-sdk-utils/CHANGELOG.md index deea1516..0449397a 100644 --- a/packages/ckb-sdk-utils/CHANGELOG.md +++ b/packages/ckb-sdk-utils/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Features + +* **utils:** add signRecoverable method to the ECPair class ([3c1f334](https://github.com/nervosnetwork/ckb-sdk-js/commit/3c1f334)) + + +### BREAKING CHANGES + +* **utils:** use signRecoverable instead of sign method to sign the transactions. + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) **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 8236c723..93a04fee 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.14.0", + "version": "0.15.0", "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.14.0", + "@nervosnetwork/ckb-types": "0.15.0", "blake2b-wasm": "1.1.7", "elliptic": "6.4.1" }, diff --git a/packages/ckb-types/CHANGELOG.md b/packages/ckb-types/CHANGELOG.md index 097178aa..921976a4 100644 --- a/packages/ckb-types/CHANGELOG.md +++ b/packages/ckb-types/CHANGELOG.md @@ -3,6 +3,26 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [0.15.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.14.0...v0.15.0) (2019-06-29) + + +### Features + +* **rpc:** add index related rpc ([2a7d403](https://github.com/nervosnetwork/ckb-sdk-js/commit/2a7d403)) +* **rpc:** update get blockchain info rpc ([7382458](https://github.com/nervosnetwork/ckb-sdk-js/commit/7382458)) +* **rpc:** update the type of epoch ([509a79b](https://github.com/nervosnetwork/ckb-sdk-js/commit/509a79b)) + + +### BREAKING CHANGES + +* **rpc:** update the type of epoch, remove block_reward, last_block_hash_in_previous_epoch, +remainder_reward fields, add epoch_reward field. +* **rpc:** replace warnings field with alerts field in the response of get blockchain info rpc + + + + + # [0.14.0](https://github.com/nervosnetwork/ckb-sdk-js/compare/v0.13.0...v0.14.0) (2019-06-15) diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index c412f7db..68e8e1fa 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -1,6 +1,6 @@ { "name": "@nervosnetwork/ckb-types", - "version": "0.14.0", + "version": "0.15.0", "description": "Type module of @nervosnetwork/ckb-sdk-core", "author": "Nervos ", "homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", From 5981b1c112c4ec882c0afcb929f931ac96573d0c Mon Sep 17 00:00:00 2001 From: Keith Date: Sat, 29 Jun 2019 17:56:35 +0800 Subject: [PATCH 24/24] chore: update lerna hashes --- packages/ckb-cli/package.json | 2 +- packages/ckb-sdk-address/package.json | 2 +- 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 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/ckb-cli/package.json b/packages/ckb-cli/package.json index d8806976..91081035 100644 --- a/packages/ckb-cli/package.json +++ b/packages/ckb-cli/package.json @@ -45,5 +45,5 @@ "@types/crypto-js": "3.1.43", "@types/inquirer": "6.0.0" }, - "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" } diff --git a/packages/ckb-sdk-address/package.json b/packages/ckb-sdk-address/package.json index acf85b51..bcd35ba3 100644 --- a/packages/ckb-sdk-address/package.json +++ b/packages/ckb-sdk-address/package.json @@ -36,5 +36,5 @@ "@nervosnetwork/ckb-sdk-utils": "0.15.0", "@nervosnetwork/ckb-types": "0.15.0" }, - "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" } diff --git a/packages/ckb-sdk-core/package.json b/packages/ckb-sdk-core/package.json index 69263cab..2901d44f 100644 --- a/packages/ckb-sdk-core/package.json +++ b/packages/ckb-sdk-core/package.json @@ -37,5 +37,5 @@ "devDependencies": { "@types/crypto-js": "3.1.43" }, - "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" } diff --git a/packages/ckb-sdk-rpc/package.json b/packages/ckb-sdk-rpc/package.json index 9b3ef827..59185408 100644 --- a/packages/ckb-sdk-rpc/package.json +++ b/packages/ckb-sdk-rpc/package.json @@ -39,5 +39,5 @@ "@nervosnetwork/ckb-types": "0.15.0", "@types/crypto-js": "3.1.43" }, - "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" } diff --git a/packages/ckb-sdk-utils/package.json b/packages/ckb-sdk-utils/package.json index 93a04fee..82626efc 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": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" } diff --git a/packages/ckb-types/package.json b/packages/ckb-types/package.json index 68e8e1fa..5bbe3252 100644 --- a/packages/ckb-types/package.json +++ b/packages/ckb-types/package.json @@ -26,5 +26,5 @@ "devDependencies": { "@types/crypto-js": "3.1.43" }, - "gitHead": "4fcb80e6068f9219076005435445a41333c00ea9" + "gitHead": "77e21f208d5ad443801e758dc80c2ded32036c28" }