From 194baf50a632ec937a1c0e53ea3edaef4ba156d4 Mon Sep 17 00:00:00 2001 From: Chen Yu Date: Thu, 14 Dec 2023 17:56:26 +0900 Subject: [PATCH 1/2] chore: bump ts-jest to 29.1.1 (#2982) --- package.json | 2 +- yarn.lock | 88 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 63 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 184cad7b1f..21b80bd5ec 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "lint-staged": "13.3.0", "ncp": "2.0.0", "prettier": "2.8.8", - "ts-jest": "27.1.5", + "ts-jest": "29.1.1", "typescript": "5.3.2", "wait-on": "7.0.1" }, diff --git a/yarn.lock b/yarn.lock index 47c64148aa..364f4a01a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2646,6 +2646,13 @@ dependencies: "@sinclair/typebox" "^0.25.16" +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + "@jest/source-map@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-27.5.1.tgz#6608391e465add4205eae073b55e7f279e04e8cf" @@ -2794,6 +2801,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" + integrity sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw== + dependencies: + "@jest/schemas" "^29.6.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" @@ -3454,6 +3473,11 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.24.tgz#8c7688559979f7079aacaf31aa881c3aa410b718" integrity sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + "@sindresorhus/is@^4.0.0": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" @@ -12242,7 +12266,7 @@ jest-util@^25.5.0: is-ci "^2.0.0" make-dir "^3.0.0" -jest-util@^27.0.0, jest-util@^27.5.1: +jest-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.5.1.tgz#3ba9771e8e31a0b85da48fe0b0891fb86c01c2f9" integrity sha512-Kv2o/8jNvX1MQ0KGtw480E/w4fBCDOnH6+6DmeKi6LZUIlKA5kwY0YNdlzaWTiVgxqAqik11QyxDOKk543aKXw== @@ -12266,6 +12290,18 @@ jest-util@^28.1.3: graceful-fs "^4.2.9" picomatch "^2.2.3" +jest-util@^29.0.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc" + integrity sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA== + dependencies: + "@jest/types" "^29.6.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + jest-util@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" @@ -12553,11 +12589,6 @@ json-stringify-safe@^5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@2.x, json5@^2.1.2, json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - json5@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" @@ -12565,6 +12596,11 @@ json5@^1.0.2: dependencies: minimist "^1.2.0" +json5@^2.1.2, json5@^2.2.0, json5@^2.2.2, json5@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + jsonc-parser@3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" @@ -16739,18 +16775,18 @@ semver@7.3.4: dependencies: lru-cache "^6.0.0" -semver@7.x, semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^7.0.0, semver@^7.1.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8, semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0, semver@^6.3.1: - version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== - semver@~7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" @@ -18002,19 +18038,19 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== -ts-jest@27.1.5: - version "27.1.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-27.1.5.tgz#0ddf1b163fbaae3d5b7504a1e65c914a95cff297" - integrity sha512-Xv6jBQPoBEvBq/5i2TeSG9tt/nqkbpcurrEG1b+2yfBrcJelOZF9Ml6dmyMh7bcW9JyFbRYpR5rxROSlBLTZHA== +ts-jest@29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" - jest-util "^27.0.0" - json5 "2.x" + jest-util "^29.0.0" + json5 "^2.2.3" lodash.memoize "4.x" make-error "1.x" - semver "7.x" - yargs-parser "20.x" + semver "^7.5.3" + yargs-parser "^21.0.1" ts-pnp@^1.1.6: version "1.2.0" @@ -19252,16 +19288,16 @@ yargs-parser@20.2.4: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@20.x, yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@21.1.1, yargs-parser@^21.1.1: +yargs-parser@21.1.1, yargs-parser@^21.0.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== +yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs@16.2.0, yargs@^16.0.0, yargs@^16.2.0: version "16.2.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" From f598a0fcd97551253539e240a9d8017464525897 Mon Sep 17 00:00:00 2001 From: homura Date: Thu, 14 Dec 2023 16:56:45 +0800 Subject: [PATCH 2/2] refactor: upgrade lumos to 0.21 (#2964) * chore: upgrade lumos to 0.21 * refactor: fetch with keepalive to replace the http agent * refactor: rename variable for more clear * chore: upgrade lumos to 0.21.1 * refactor: remove unnecessary http agent * refactor: remove unnecessary global declaration --- packages/neuron-ui/package.json | 4 +- packages/neuron-wallet/package.json | 18 +- .../neuron-wallet/src/services/sdk-core.ts | 27 +- .../src/services/transaction-sender.ts | 4 +- .../src/types/ckbComponents.d.ts | 542 +++++++++--------- packages/neuron-wallet/src/utils/ckb-rpc.ts | 42 +- .../neuron-wallet/tests/utils/ckb-rpc.test.ts | 13 +- yarn.lock | 142 ++--- 8 files changed, 378 insertions(+), 414 deletions(-) diff --git a/packages/neuron-ui/package.json b/packages/neuron-ui/package.json index 4e02b16de6..6a8520f77e 100644 --- a/packages/neuron-ui/package.json +++ b/packages/neuron-ui/package.json @@ -50,8 +50,8 @@ "last 2 chrome versions" ], "dependencies": { - "@ckb-lumos/base": "0.21.0-next.2", - "@ckb-lumos/codec": "0.21.0-next.2", + "@ckb-lumos/base": "0.21.1", + "@ckb-lumos/codec": "0.21.1", "@nervosnetwork/ckb-sdk-core": "0.109.0", "@nervosnetwork/ckb-sdk-utils": "0.109.0", "canvg": "2.0.0", diff --git a/packages/neuron-wallet/package.json b/packages/neuron-wallet/package.json index 521a628e8c..e7d7aca14f 100644 --- a/packages/neuron-wallet/package.json +++ b/packages/neuron-wallet/package.json @@ -42,15 +42,15 @@ ] }, "dependencies": { - "@ckb-lumos/base": "0.21.0-next.2", - "@ckb-lumos/bi": "0.21.0-next.2", - "@ckb-lumos/ckb-indexer": "0.21.0-next.2", - "@ckb-lumos/codec": "0.21.0-next.2", - "@ckb-lumos/common-scripts": "0.21.0-next.2", - "@ckb-lumos/config-manager": "0.21.0-next.2", - "@ckb-lumos/hd": "0.21.0-next.2", - "@ckb-lumos/helpers": "0.21.0-next.2", - "@ckb-lumos/rpc": "0.21.0-next.2", + "@ckb-lumos/base": "0.21.1", + "@ckb-lumos/bi": "0.21.1", + "@ckb-lumos/ckb-indexer": "0.21.1", + "@ckb-lumos/codec": "0.21.1", + "@ckb-lumos/common-scripts": "0.21.1", + "@ckb-lumos/config-manager": "0.21.1", + "@ckb-lumos/hd": "0.21.1", + "@ckb-lumos/helpers": "0.21.1", + "@ckb-lumos/rpc": "0.21.1", "@iarna/toml": "2.2.5", "@ledgerhq/hw-transport-node-hid": "6.27.22", "@spore-sdk/core": "0.1.0-beta.9", diff --git a/packages/neuron-wallet/src/services/sdk-core.ts b/packages/neuron-wallet/src/services/sdk-core.ts index a951c08ff6..36017e078c 100644 --- a/packages/neuron-wallet/src/services/sdk-core.ts +++ b/packages/neuron-wallet/src/services/sdk-core.ts @@ -1,32 +1,7 @@ import { CKBRPC } from '@ckb-lumos/rpc' -import https from 'https' -import http from 'http' - -let httpsAgent: https.Agent -let httpAgent: http.Agent - -const getHttpsAgent = () => { - if (!httpsAgent) { - httpsAgent = new https.Agent({ keepAlive: true }) - } - return httpsAgent -} - -const getHttpAgent = () => { - if (!httpAgent) { - httpAgent = new http.Agent({ keepAlive: true }) - } - return httpAgent -} export const generateCKB = (url: string): CKBRPC => { - const rpc = new CKBRPC(url) - if (url.startsWith('https')) { - rpc.setNode({ url, httpsAgent: getHttpsAgent() }) - } else { - rpc.setNode({ url, httpAgent: getHttpAgent() }) - } - return rpc + return new CKBRPC(url, { fetch: (request, init) => globalThis.fetch(request, { ...init, keepalive: true }) }) } export default { diff --git a/packages/neuron-wallet/src/services/transaction-sender.ts b/packages/neuron-wallet/src/services/transaction-sender.ts index 8955281951..208739a2d0 100644 --- a/packages/neuron-wallet/src/services/transaction-sender.ts +++ b/packages/neuron-wallet/src/services/transaction-sender.ts @@ -855,7 +855,9 @@ export default class TransactionSender { const rpc = generateRPC(currentNetwork.remote, currentNetwork.type) let tx = await rpc.getTransaction(depositOutPoint.txHash) - if (tx.txStatus.status !== 'committed') throw new Error('Transaction is not committed yet') + if (tx.txStatus.status !== 'committed' || !tx.txStatus.blockHash) { + throw new Error('Transaction is not committed yet') + } const depositBlockHash = tx.txStatus.blockHash const cellOutput = tx.transaction.outputs[+depositOutPoint.index] diff --git a/packages/neuron-wallet/src/types/ckbComponents.d.ts b/packages/neuron-wallet/src/types/ckbComponents.d.ts index 56e2ff19b7..0bd03bb762 100644 --- a/packages/neuron-wallet/src/types/ckbComponents.d.ts +++ b/packages/neuron-wallet/src/types/ckbComponents.d.ts @@ -1,280 +1,272 @@ -import type { Agent as HttpsAgent } from 'node:https' -import type { Agent as HttpAgent } from 'node:http' - -declare global { - declare namespace CKBComponents { - type DAO = string - type Hash = string - type Number = string - type Hash256 = string - type UInt32 = string - type UInt64 = string - type U256 = string - type Index = string - type Version = string - type Count = string - type Difficulty = string - type BlockNumber = string - type EpochInHeader = string - type Capacity = string - type ProposalShortId = string - type Timestamp = string - type Nonce = string - type Cycles = string - type Size = string - type OutputsValidator = 'default' | 'passthrough' | undefined - type RationalU256 = Record<'denom' | 'numer', string> - type ProposalWindow = Record<'closest' | 'farthest', BlockNumber> - type EpochNumberWithFraction = string - type EpochNumber = string - enum TransactionStatus { - Pending = 'pending', - Proposed = 'proposed', - Committed = 'committed', - } - type ScriptHashType = api.HashType - type DepType = 'code' | 'depGroup' - type JsonBytes = string - /** - * @typedef Bytes, keep consistent with CKB - * @description Bytes will be serialized to string - * @see https://github.com/nervosnetwork/ckb/blob/develop/util/jsonrpc-types/src/blockchain.rs#L19 - */ - type Bytes = string - type Since = string - interface Node { - url: string - httpAgent?: HttpAgent - httpsAgent?: HttpsAgent - } - interface Method { - name: string - method: string - paramsFormatters: function[] - resultFormatters?: function - } - /** - * RPC Units - */ - type Witness = Bytes - type Script = api.Script - type CellInput = api.Input - type CellOutput = api.Output - type Cell = CellOutput - type OutPoint = api.OutPoint - type CellDep = api.CellDep - type RawTransaction = api.RawTransaction & { - witnesses: Witness[] - } - type Transaction = Required - type TransactionWithStatus = api.TransactionWithStatus - type BlockHeader = api.Header - type Block = api.Block - type UncleBlock = api.UncleBlock - type LiveCell = api.LiveCell - type AlertMessage = api.AlertMessage - type BlockchainInfo = api.ChainInfo - type LocalNodeInfo = api.LocalNode - type RemoteNodeInfo = api.RemoteNode - type TxPoolInfo = api.TxPoolInfo - type Epoch = api.Epoch - type RunDryResult = api.DryRunResult - type BannedAddress = api.BannedAddr - type WitnessArgs = api.WitnessArgs - type BlockEconomicState = api.BlockEconomicState - type SyncState = api.SyncState - type TransactionProof = api.TransactionProof - type TxVerbosity = api.TxVerbosity - type TxPoolVerbosity = api.TxPoolVerbosity - type RawTxPool = api.RawTxPool - type Consensus = api.Consensus - type HardForks = api.HardForks - type HardForkFeature = api.HardforkFeature - type SoftForkStatus = api.SoftForkStatus - type SoftFork = api.SoftFork - type Buried = api.Buried - type Rfc0043 = api.Rfc0043 - type Ratio = api.Ratio - type Deployment = api.Deployment - type QueryOptions = api.QueryOptions - interface TransactionPoint { - blockNumber: BlockNumber - index: Index - txHash: Hash256 - } - interface TransactionByLockHash { - consumedBy: undefined | TransactionPoint - createdBy: TransactionPoint - } - type TransactionsByLockHash = TransactionByLockHash[] - interface FeeRate { - feeRate: string - } - interface CellIncludingOutPoint { - blockHash: Hash256 +declare namespace CKBComponents { + type DAO = string + type Hash = string + type Number = string + type Hash256 = string + type UInt32 = string + type UInt64 = string + type U256 = string + type Index = string + type Version = string + type Count = string + type Difficulty = string + type BlockNumber = string + type EpochInHeader = string + type Capacity = string + type ProposalShortId = string + type Timestamp = string + type Nonce = string + type Cycles = string + type Size = string + type OutputsValidator = 'default' | 'passthrough' | undefined + type RationalU256 = Record<'denom' | 'numer', string> + type ProposalWindow = Record<'closest' | 'farthest', BlockNumber> + type EpochNumberWithFraction = string + type EpochNumber = string + enum TransactionStatus { + Pending = 'pending', + Proposed = 'proposed', + Committed = 'committed', + } + type ScriptHashType = api.HashType + type DepType = 'code' | 'depGroup' + type JsonBytes = string + /** + * @typedef Bytes, keep consistent with CKB + * @description Bytes will be serialized to string + * @see https://github.com/nervosnetwork/ckb/blob/develop/util/jsonrpc-types/src/blockchain.rs#L19 + */ + type Bytes = string + type Since = string + interface Node { + url: string + } + interface Method { + name: string + method: string + paramsFormatters: function[] + resultFormatters?: function + } + /** + * RPC Units + */ + type Witness = Bytes + type Script = api.Script + type CellInput = api.Input + type CellOutput = api.Output + type Cell = CellOutput + type OutPoint = api.OutPoint + type CellDep = api.CellDep + type RawTransaction = api.RawTransaction & { + witnesses: Witness[] + } + type Transaction = Required + type TransactionWithStatus = api.TransactionWithStatus + type BlockHeader = api.Header + type Block = api.Block + type UncleBlock = api.UncleBlock + type LiveCell = api.LiveCell + type AlertMessage = api.AlertMessage + type BlockchainInfo = api.ChainInfo + type LocalNodeInfo = api.LocalNode + type RemoteNodeInfo = api.RemoteNode + type TxPoolInfo = api.TxPoolInfo + type Epoch = api.Epoch + type RunDryResult = api.DryRunResult + type BannedAddress = api.BannedAddr + type WitnessArgs = api.WitnessArgs + type BlockEconomicState = api.BlockEconomicState + type SyncState = api.SyncState + type TransactionProof = api.TransactionProof + type TxVerbosity = api.TxVerbosity + type TxPoolVerbosity = api.TxPoolVerbosity + type RawTxPool = api.RawTxPool + type Consensus = api.Consensus + type HardForks = api.HardForks + type HardForkFeature = api.HardforkFeature + type SoftForkStatus = api.SoftForkStatus + type SoftFork = api.SoftFork + type Buried = api.Buried + type Rfc0043 = api.Rfc0043 + type Ratio = api.Ratio + type Deployment = api.Deployment + type QueryOptions = api.QueryOptions + interface TransactionPoint { + blockNumber: BlockNumber + index: Index + txHash: Hash256 + } + interface TransactionByLockHash { + consumedBy: undefined | TransactionPoint + createdBy: TransactionPoint + } + type TransactionsByLockHash = TransactionByLockHash[] + interface FeeRate { + feeRate: string + } + interface CellIncludingOutPoint { + blockHash: Hash256 + capacity: Capacity + lock: Script + outPoint: OutPoint + cellbase: boolean + outputDataLen: string + } + type TransactionTrace = { + action: string + info: string + time: Timestamp + }[] + enum CellStatus { + Live = 'live', + Unknown = 'unknown', + } + interface LiveCellByLockHash { + cellOutput: CellOutput + createdBy: TransactionPoint + cellbase: boolean + outputDataLen: string + } + type LiveCellsByLockHash = LiveCellByLockHash[] + interface PeersState { + lastUpdated: string + blocksInFlight: string + peer: string + } + interface LockHashIndexState { + blockHash: Hash256 + blockNumber: BlockNumber + lockHash: Hash256 + } + type LockHashIndexStates = LockHashIndexState[] + type BannedAddresses = BannedAddress[] + interface CellbaseOutputCapacityDetails { + primary: string + proposalReward: string + secondary: string + total: string + txFee: string + } + interface RawTransactionToSign extends Omit { + witnesses: (WitnessArgs | Witness)[] + } + interface CapacityByLockHash { + blockNumber: BlockNumber + capacity: Capacity + cellsCount: string + } + type TxPoolIds = Record<'pending' | 'proposed', Array> + interface Tip { + blockNumber: BlockNumber + blockHash: Hash256 + } + type ScriptType = 'type' | 'lock' + type Order = 'asc' | 'desc' + type IOType = 'input' | 'output' | 'both' + type ScriptSearchMode = 'prefix' | 'exact' + interface IndexerCell { + blockNumber: BlockNumber + outPoint: OutPoint + output: { capacity: Capacity lock: Script - outPoint: OutPoint - cellbase: boolean - outputDataLen: string - } - type TransactionTrace = { - action: string - info: string - time: Timestamp - }[] - enum CellStatus { - Live = 'live', - Unknown = 'unknown', - } - interface LiveCellByLockHash { - cellOutput: CellOutput - createdBy: TransactionPoint - cellbase: boolean - outputDataLen: string - } - type LiveCellsByLockHash = LiveCellByLockHash[] - interface PeersState { - lastUpdated: string - blocksInFlight: string - peer: string - } - interface LockHashIndexState { - blockHash: Hash256 - blockNumber: BlockNumber - lockHash: Hash256 - } - type LockHashIndexStates = LockHashIndexState[] - type BannedAddresses = BannedAddress[] - interface CellbaseOutputCapacityDetails { - primary: string - proposalReward: string - secondary: string - total: string - txFee: string - } - interface RawTransactionToSign extends Omit { - witnesses: (WitnessArgs | Witness)[] - } - interface CapacityByLockHash { - blockNumber: BlockNumber - capacity: Capacity - cellsCount: string - } - type TxPoolIds = Record<'pending' | 'proposed', Array> - interface Tip { - blockNumber: BlockNumber - blockHash: Hash256 - } - type ScriptType = 'type' | 'lock' - type Order = 'asc' | 'desc' - type IOType = 'input' | 'output' | 'both' - type ScriptSearchMode = 'prefix' | 'exact' - interface IndexerCell { - blockNumber: BlockNumber - outPoint: OutPoint - output: { - capacity: Capacity - lock: Script - type?: Script - } - outputData: string - txIndex: string - } - interface IndexerCellWithoutData extends Omit { - outputData: null - } - interface GetCellsResult { - lastCursor: string - objects: WithData extends true ? IndexerCell[] : IndexerCellWithoutData[] + type?: Script } - type IndexerTransaction = Grouped extends true - ? GroupedIndexerTransaction - : UngroupedIndexerTransaction - type UngroupedIndexerTransaction = { - txHash: Hash256 - blockNumber: BlockNumber - ioIndex: number - ioType: IOType - txIndex: number - } - type GroupedIndexerTransaction = { - txHash: Hash256 - blockNumber: BlockNumber - txIndex: number - cells: Array<[IOType, number]> - } - interface GetTransactionsResult { - lastCursor: Hash256 - objects: IndexerTransaction[] - } - interface CKBIndexerQueryOptions extends QueryOptions { - outputDataLenRange?: HexadecimalRange - outputCapacityRange?: HexadecimalRange - scriptLenRange?: HexadecimalRange - bufferSize?: number - withData?: boolean - groupByTransaction?: boolean - } - type HexadecimalRange = [string, string] - interface SearchFilter { - script?: Script - scriptLenRange?: HexadecimalRange - outputDataLenRange?: HexadecimalRange - outputCapacityRange?: HexadecimalRange - blockRange?: HexadecimalRange - } - interface SearchKey { - script: Script - scriptType: ScriptType - filter?: SearchFilter - scriptSearchMode?: ScriptSearchMode - } - interface GetLiveCellsResult { - lastCursor: string - objects: WithData extends true ? IndexerCell[] : IndexerCellWithoutData[] - } - interface GetCellsSearchKey extends SearchKey { - withData?: WithData - } - interface GetTransactionsSearchKey extends SearchKey { - groupByTransaction?: Group - } - interface CellsCapacity { - capacity: Capacity - blockHash: Hash256 - blockNumber: BlockNumber - } - interface BlockFilter { - data: api.HexString - hash: api.Hash - } - interface TransactionAndWitnessProof { - blockHash: Hash256 - transactionsProof: api.MerkleProof - witnessesProof: api.MerkleProof - } - type TransactionView = api.Transaction & { - hash: api.Hash - } - interface BlockView { - header: BlockHeader - uncles: UncleBlock[] - transactions: TransactionView[] - proposals: ProposalShortId[] - } - type SerializedBlock = api.HexString - interface FeeRateStatistics { - mean: UInt64 - median: UInt64 - } - interface EstimateCycles { - cycles: UInt64 - } - type DeploymentPos = api.DeploymentPos - type DeploymentState = api.DeploymentState - type DeploymentInfo = api.DeploymentInfo - type DeploymentsInfo = api.DeploymentsInfo + outputData: string + txIndex: string + } + interface IndexerCellWithoutData extends Omit { + outputData: null + } + interface GetCellsResult { + lastCursor: string + objects: WithData extends true ? IndexerCell[] : IndexerCellWithoutData[] + } + type IndexerTransaction = Grouped extends true + ? GroupedIndexerTransaction + : UngroupedIndexerTransaction + type UngroupedIndexerTransaction = { + txHash: Hash256 + blockNumber: BlockNumber + ioIndex: number + ioType: IOType + txIndex: number + } + type GroupedIndexerTransaction = { + txHash: Hash256 + blockNumber: BlockNumber + txIndex: number + cells: Array<[IOType, number]> + } + interface GetTransactionsResult { + lastCursor: Hash256 + objects: IndexerTransaction[] + } + interface CKBIndexerQueryOptions extends QueryOptions { + outputDataLenRange?: HexadecimalRange + outputCapacityRange?: HexadecimalRange + scriptLenRange?: HexadecimalRange + bufferSize?: number + withData?: boolean + groupByTransaction?: boolean + } + type HexadecimalRange = [string, string] + interface SearchFilter { + script?: Script + scriptLenRange?: HexadecimalRange + outputDataLenRange?: HexadecimalRange + outputCapacityRange?: HexadecimalRange + blockRange?: HexadecimalRange + } + interface SearchKey { + script: Script + scriptType: ScriptType + filter?: SearchFilter + scriptSearchMode?: ScriptSearchMode + } + interface GetLiveCellsResult { + lastCursor: string + objects: WithData extends true ? IndexerCell[] : IndexerCellWithoutData[] + } + interface GetCellsSearchKey extends SearchKey { + withData?: WithData + } + interface GetTransactionsSearchKey extends SearchKey { + groupByTransaction?: Group + } + interface CellsCapacity { + capacity: Capacity + blockHash: Hash256 + blockNumber: BlockNumber + } + interface BlockFilter { + data: api.HexString + hash: api.Hash + } + interface TransactionAndWitnessProof { + blockHash: Hash256 + transactionsProof: api.MerkleProof + witnessesProof: api.MerkleProof + } + type TransactionView = api.Transaction & { + hash: api.Hash + } + interface BlockView { + header: BlockHeader + uncles: UncleBlock[] + transactions: TransactionView[] + proposals: ProposalShortId[] + } + type SerializedBlock = api.HexString + interface FeeRateStatistics { + mean: UInt64 + median: UInt64 + } + interface EstimateCycles { + cycles: UInt64 } - //# sourceMappingURL=api.d.ts.map + type DeploymentPos = api.DeploymentPos + type DeploymentState = api.DeploymentState + type DeploymentInfo = api.DeploymentInfo + type DeploymentsInfo = api.DeploymentsInfo } diff --git a/packages/neuron-wallet/src/utils/ckb-rpc.ts b/packages/neuron-wallet/src/utils/ckb-rpc.ts index 95f4f60ba0..0d4c69b4d2 100644 --- a/packages/neuron-wallet/src/utils/ckb-rpc.ts +++ b/packages/neuron-wallet/src/utils/ckb-rpc.ts @@ -3,7 +3,7 @@ import type { Block } from '@ckb-lumos/base' import type { Script } from '@ckb-lumos/base' import { HexString } from '@ckb-lumos/base' import { CKBRPC } from '@ckb-lumos/rpc' -import { Method } from '@ckb-lumos/rpc/lib/method' +import { Method as SdkRpcMethod } from '@ckb-lumos/rpc/lib/method' import * as resultFormatter from '@ckb-lumos/rpc/lib/resultFormatter' import { formatter as paramsFormatter } from '@ckb-lumos/rpc/lib/paramsFormatter' import { Base } from '@ckb-lumos/rpc/lib/Base' @@ -12,11 +12,11 @@ import { PayloadInBatchException, IdNotMatchedInBatchException, } from '@ckb-lumos/rpc/lib/exceptions' -import https from 'https' -import http from 'http' import { request } from 'undici' import CommonUtils from './common' import { NetworkType } from '../models/network' +import type { RPCConfig } from '@ckb-lumos/rpc/lib/types/common' +import type { CKBComponents } from '@ckb-lumos/rpc/lib/types/api' export interface LightScriptFilter { script: Script @@ -132,6 +132,12 @@ export class FullCKBRPC extends CKBRPC { } } +class Method extends SdkRpcMethod { + constructor(node: CKBComponents.Node, options: CKBComponents.Method) { + super(node, options, rpcConfig) + } +} + export type FetchTransactionReturnType = { status: 'fetched' | 'fetching' | 'added' | 'not_found' txWithStatus?: CKBComponents.TransactionWithStatus @@ -193,14 +199,14 @@ export class LightRPC extends Base { this.getTransactionInLight = new Method(this.node, { name: 'getTransaction', ...this.rpcProperties['getTransaction'], - }).call + }).call as Base['getTransaction'] this.fetchTransaction = new Method(this.node, { name: 'fetchTransaction', ...lightRPCProperties['fetchTransaction'], }).call } - getTransaction = async (hash: string): Promise => { + getTransaction: Base['getTransaction'] = (async (hash: string) => { let tx = await this.getTransactionInLight(hash) if (!tx?.transaction) { tx = await CommonUtils.retry(3, 100, async () => { @@ -215,7 +221,7 @@ export class LightRPC extends Base { } } return tx - } + }) as Base['getTransaction'] getTipBlockNumber = async () => { const headerTip = await this.getTipHeader() @@ -360,21 +366,8 @@ export class LightRPC extends Base { } } -let httpsAgent: https.Agent -let httpAgent: http.Agent - -const getHttpsAgent = () => { - if (!httpsAgent) { - httpsAgent = new https.Agent({ keepAlive: true }) - } - return httpsAgent -} - -const getHttpAgent = () => { - if (!httpAgent) { - httpAgent = new http.Agent({ keepAlive: true }) - } - return httpAgent +const rpcConfig: Partial = { + fetch: (request, init) => globalThis.fetch(request, { ...init, keepalive: true }), } export const generateRPC = (url: string, type: NetworkType) => { @@ -382,12 +375,7 @@ export const generateRPC = (url: string, type: NetworkType) => { if (type === NetworkType.Light) { rpc = new LightRPC(url) } else { - rpc = new FullCKBRPC(url) - } - if (url?.startsWith('https')) { - rpc.setNode({ url, httpsAgent: getHttpsAgent() }) - } else { - rpc.setNode({ url, httpAgent: getHttpAgent() }) + rpc = new FullCKBRPC(url, rpcConfig) } return rpc } diff --git a/packages/neuron-wallet/tests/utils/ckb-rpc.test.ts b/packages/neuron-wallet/tests/utils/ckb-rpc.test.ts index ab04ab664a..8fc9e61e9d 100644 --- a/packages/neuron-wallet/tests/utils/ckb-rpc.test.ts +++ b/packages/neuron-wallet/tests/utils/ckb-rpc.test.ts @@ -12,9 +12,16 @@ describe('test ckb rpc file', () => { const result = generateRPC(BUNDLED_CKB_URL, NetworkType.Default) expect(result instanceof FullCKBRPC).toBeTruthy() }) - it('url is https', () => { - const result = generateRPC('https://localhost:8114', NetworkType.Default) - expect(result.node.httpsAgent).toBeDefined() + it('fetch should be keepalive', async () => { + const fetch = globalThis.fetch + globalThis.fetch = jest.fn() + + const rpc = generateRPC('https://localhost:8114', NetworkType.Default) + await rpc.getTipBlockNumber().catch(() => {}) + + expect((globalThis.fetch as unknown as jest.Mock).mock.calls[0][1]).toMatchObject({ keepalive: true }) + + globalThis.fetch = fetch }) }) }) diff --git a/yarn.lock b/yarn.lock index 364f4a01a7..cc6b605164 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1757,14 +1757,14 @@ js-xxhash "^1.0.4" lodash.isequal "^4.5.0" -"@ckb-lumos/base@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/base/-/base-0.21.0-next.2.tgz#8d7ba32aa98f63de64f0140ef2e530a16450a382" - integrity sha512-1QiuVR7BD6RV2oq3CpM1RBMoPQ0E+F4e4MLwtg1kWRkN0UQWLin8OIDewb7hXsifU/ZpoTdluoCOGGV0CY1DkQ== - dependencies: - "@ckb-lumos/bi" "0.21.0-next.2" - "@ckb-lumos/codec" "0.21.0-next.2" - "@ckb-lumos/toolkit" "0.21.0-next.2" +"@ckb-lumos/base@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/base/-/base-0.21.1.tgz#1faf7909b5a68a124256d937cfb0fa03bb6b5457" + integrity sha512-7O+jBl7pqMsRbYTMNnbpamgaQzvaLZq+ftMtnKZ3A+Zbs6hZcGbz/6nfbRZnyJitPXQHRPT5KAQz6g+TiYqJGg== + dependencies: + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" "@types/blake2b" "^2.1.0" "@types/lodash.isequal" "^4.5.5" blake2b "^2.1.3" @@ -1778,10 +1778,10 @@ dependencies: jsbi "^4.1.0" -"@ckb-lumos/bi@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/bi/-/bi-0.21.0-next.2.tgz#0797e8774c00d3f4e609833050529e0f6e022620" - integrity sha512-3c8jC94eO57vFFo30g9Rh6qrfk5EF+7OD58hX1GknXaHwykMs3EBQodmA7DUV517dswkHy5IzI5gt5ROn9asjQ== +"@ckb-lumos/bi@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/bi/-/bi-0.21.1.tgz#dfaa0968a9ffd990c1c4fcfc0711f20f09eb0485" + integrity sha512-6q8uesvu3DAM7GReei9H5seino4tnakTeg8uXtZBPDC6rboMohLCPQvEwhl1iHmsybXvBYVQt4Te1BPPZtuaRw== dependencies: jsbi "^4.1.0" @@ -1797,16 +1797,16 @@ cross-fetch "^3.1.5" events "^3.3.0" -"@ckb-lumos/ckb-indexer@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/ckb-indexer/-/ckb-indexer-0.21.0-next.2.tgz#b151ffaea0b53ca989b336d6e9b539017450a475" - integrity sha512-Niwx2LPU0jH9La7ItSA1IHpX8Z025+qZHcUs1hDLIDHhxtqV5OiPRDrBAPn6B8iJMf1WqyaGLuqHZ6S5R1sEWw== +"@ckb-lumos/ckb-indexer@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/ckb-indexer/-/ckb-indexer-0.21.1.tgz#a0e0ac3261c98181dc8c72e9e726030bb210779d" + integrity sha512-592pMVP3lwTXF7TmlOcayvGYKOhkYpjbLHUDo7By4yWbm7ZpdexaN5hn0X1sjJgMuee5prxGr9/fY684VTpJQw== dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" - "@ckb-lumos/codec" "0.21.0-next.2" - "@ckb-lumos/rpc" "0.21.0-next.2" - "@ckb-lumos/toolkit" "0.21.0-next.2" + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/rpc" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" cross-fetch "^3.1.5" events "^3.3.0" @@ -1817,12 +1817,12 @@ dependencies: "@ckb-lumos/bi" "0.20.0" -"@ckb-lumos/codec@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/codec/-/codec-0.21.0-next.2.tgz#d29465fc22c2b98182b6079453be7deb7d3fd1ba" - integrity sha512-yTtWIG9LESLTU3tBb9fHREWo2mO0Ts7SSL1Jp3MSqYbnl90JZeYr/skvn+vaV9/2Cl/6qEgeKYa1AnHNSLchkw== +"@ckb-lumos/codec@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/codec/-/codec-0.21.1.tgz#160f21efa0cded6ea461eb6476f9af6010b682e0" + integrity sha512-z6IUUxVZrx663iC7VM9CmaQZL8jsdM3ybgz0UCS24JgBXTNec+Uz0/Zrl7yeH6fBpVls44C2wObcHKigKaNVAA== dependencies: - "@ckb-lumos/bi" "0.21.0-next.2" + "@ckb-lumos/bi" "0.21.1" "@ckb-lumos/common-scripts@0.20.0": version "0.20.0" @@ -1838,18 +1838,18 @@ "@ckb-lumos/toolkit" "0.20.0" immutable "^4.0.0-rc.12" -"@ckb-lumos/common-scripts@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/common-scripts/-/common-scripts-0.21.0-next.2.tgz#222e58a96d92a4ddfa9e501fe2f0a5428c036e96" - integrity sha512-43r7DvXSccsi80NcXh0jaZT0MdQ+rhsElWBO2U3zRUt/55rV4HBaoo26Rj8h7esi0tVfDbiDrnc16ymN1V+B3w== - dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" - "@ckb-lumos/codec" "0.21.0-next.2" - "@ckb-lumos/config-manager" "0.21.0-next.2" - "@ckb-lumos/helpers" "0.21.0-next.2" - "@ckb-lumos/rpc" "0.21.0-next.2" - "@ckb-lumos/toolkit" "0.21.0-next.2" +"@ckb-lumos/common-scripts@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/common-scripts/-/common-scripts-0.21.1.tgz#64776b5ce55d8c66898a3ab592c7f77fe13d865e" + integrity sha512-EfZQ9wdxPmEsxVVwtBjhpZVKbYCm1FJkMt59ABsIO1Ub7yi0qap7AQl0MMbuLwWIGKwS2w0U3wx/oJPm7z1RXg== + dependencies: + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/config-manager" "0.21.1" + "@ckb-lumos/helpers" "0.21.1" + "@ckb-lumos/rpc" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" immutable "^4.3.0" "@ckb-lumos/config-manager@0.20.0", "@ckb-lumos/config-manager@^0.20.0": @@ -1863,14 +1863,14 @@ "@types/deep-freeze-strict" "^1.1.0" deep-freeze-strict "^1.1.1" -"@ckb-lumos/config-manager@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/config-manager/-/config-manager-0.21.0-next.2.tgz#ef08003193a49b248440fc73ce9207b1bb6a2a5f" - integrity sha512-dVyMcd5hbnTpN2nuukLOWv2J73hpuMf3ZRSO3asqAodKGZek74JhwOtZD9saCOItLYeOWdRRmzfXad34lDgHXg== +"@ckb-lumos/config-manager@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/config-manager/-/config-manager-0.21.1.tgz#857050ebf2ca38096d8fae26b6a8927164798ca3" + integrity sha512-BmrNqYyaksdCKHWagyC8+R8GUxhIO+sOM5S925jlkpjju2sUbH0Id2/zmdb7I9KxdKnbx3WsR+hqy7/bYqw1lA== dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" - "@ckb-lumos/codec" "0.21.0-next.2" + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" "@types/deep-freeze-strict" "^1.1.0" deep-freeze-strict "^1.1.1" @@ -1887,13 +1887,13 @@ sha3 "^2.1.3" uuid "^8.3.0" -"@ckb-lumos/hd@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/hd/-/hd-0.21.0-next.2.tgz#03239f9d31cd9daf70f224563e7733089194dbb6" - integrity sha512-wj6k0d39yJEKWlC1cjXezZ4Qjf0u6rG+R6zQdqRXZ2dUJ/n82+fX+hLSAcjOgm1mGNft/6c55IfCs5dag/xQVw== +"@ckb-lumos/hd@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/hd/-/hd-0.21.1.tgz#406026ac2b570f72b4407149cb941d09bb8a0ab6" + integrity sha512-BnfpJf/sx/dJzL5BrOxPeKbKgv2x74KWd0xwjw1/gBQ2IMhu0S1mLwFsOT3Zu2nuhpQYvZGvr0cd3vD/SoMDow== dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" bn.js "^5.1.3" elliptic "^6.5.4" scrypt-js "^3.0.1" @@ -1912,16 +1912,16 @@ bech32 "^2.0.0" immutable "^4.0.0-rc.12" -"@ckb-lumos/helpers@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/helpers/-/helpers-0.21.0-next.2.tgz#4a3ac9ff9e52f2063ce2c3670e2c72bb94acad45" - integrity sha512-pZkJwn4jV9uFICtS0Un0ftBnRvlC5BHAueeIBXwa7uclSFHxAejqr2lsM0KLavLBjK/kerOq182mejK9ejX/fQ== +"@ckb-lumos/helpers@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/helpers/-/helpers-0.21.1.tgz#fffd455071f51556b2cd2539a255b3759893da08" + integrity sha512-jFN6DtWzwVNEY4kmnzczRaQqtyRJQwzAEuHRUQ0LqTiIGM+SlfgjH/l/InAG4cIhDOurMudnUJ4ex68wmbkhVw== dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" - "@ckb-lumos/codec" "0.21.0-next.2" - "@ckb-lumos/config-manager" "0.21.0-next.2" - "@ckb-lumos/toolkit" "0.21.0-next.2" + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" + "@ckb-lumos/codec" "0.21.1" + "@ckb-lumos/config-manager" "0.21.1" + "@ckb-lumos/toolkit" "0.21.1" bech32 "^2.0.0" immutable "^4.3.0" @@ -1951,13 +1951,13 @@ axios "0.27.2" tslib "2.3.1" -"@ckb-lumos/rpc@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/rpc/-/rpc-0.21.0-next.2.tgz#a840f18535c419448e982807f49ede7012ac7daf" - integrity sha512-WWV1x+I2mS8/CFlstSC2POrQ64TIgr7H8YjdA0jMT7o8Pt7qo2KXO4bFwSuPMgtdo2DKPSxTUS9zFjiZsWmXRw== +"@ckb-lumos/rpc@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/rpc/-/rpc-0.21.1.tgz#f6a6b3ed6d76adfb84c148e4b4acadb7fbaa7d7a" + integrity sha512-gZWXYCyQ98s84Pb+buOiYL3HOIxQPLHQdCyo96GFerNw9lB1XsbaGWzfHPYpZvOQqYtnJ1GUfTkQkADrQ7hmew== dependencies: - "@ckb-lumos/base" "0.21.0-next.2" - "@ckb-lumos/bi" "0.21.0-next.2" + "@ckb-lumos/base" "0.21.1" + "@ckb-lumos/bi" "0.21.1" abort-controller "^3.0.0" cross-fetch "^3.1.5" @@ -1966,12 +1966,12 @@ resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.20.0.tgz#8f71043324e50c8a3e94c65414325482d874cfca" integrity sha512-nLNXRPG20NqUdXwHAnKwr0T7nZyDrf4fGwIrsxo+7ffqWeg9wNEhZoqTBJLgxEpoe0I+WHRLwYLiwUbkkqR1SQ== -"@ckb-lumos/toolkit@0.21.0-next.2": - version "0.21.0-next.2" - resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.21.0-next.2.tgz#13a4b0c39cd8240dde24647ac50890f2f7ef1970" - integrity sha512-pTTXn6NwwNv3Ms3uj9ywzA4UtiI84IDBw5TEWCAlz4JVwh2dqlncci0O0YboaNA0gg1cVYCITQFLJBQvXQkDRw== +"@ckb-lumos/toolkit@0.21.1": + version "0.21.1" + resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.21.1.tgz#bcf4bf05615375087e3dd02fb087b797a8c67f37" + integrity sha512-awrFos7uQXEVGbqKSv/8Fc8B8XAfxdYoyYak4zFyAAmxxA0NiTTvk9V8TsOA7zVXpxct4Jal22+qUe+4Jg8T/g== dependencies: - "@ckb-lumos/bi" "0.21.0-next.2" + "@ckb-lumos/bi" "0.21.1" "@cnakazawa/watch@^1.0.3": version "1.0.4"