@ckb-ccc/core 1.19.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/advanced.d.mts +2 -2
  3. package/dist/advanced.mjs +1 -1
  4. package/{dist.commonjs/advancedBarrel-B565UuhW.d.ts → dist/advancedBarrel-CZxkR1dk.d.mts} +2501 -2121
  5. package/dist/advancedBarrel-CZxkR1dk.d.mts.map +1 -0
  6. package/dist/advancedBarrel.d.mts +2 -2
  7. package/dist/advancedBarrel.mjs +1 -1
  8. package/dist/advancedBarrel.mjs.map +1 -1
  9. package/dist/barrel-CqiwnGqc.mjs +7 -0
  10. package/dist/barrel-CqiwnGqc.mjs.map +1 -0
  11. package/dist/barrel.d.mts +2 -2
  12. package/dist/barrel.mjs +1 -1
  13. package/dist/index.d.mts +2 -2
  14. package/dist/index.mjs +1 -1
  15. package/dist/transformers-BJyj6caX.mjs +2 -0
  16. package/dist/transformers-BJyj6caX.mjs.map +1 -0
  17. package/dist.commonjs/advanced.d.ts +2 -2
  18. package/dist.commonjs/advanced.js +1 -1
  19. package/{dist/advancedBarrel-mPY1Rl-S.d.mts → dist.commonjs/advancedBarrel-Czsr2VlG.d.ts} +2502 -2120
  20. package/dist.commonjs/advancedBarrel-Czsr2VlG.d.ts.map +1 -0
  21. package/dist.commonjs/advancedBarrel.d.ts +2 -2
  22. package/dist.commonjs/advancedBarrel.js +1 -1
  23. package/dist.commonjs/advancedBarrel.js.map +1 -1
  24. package/dist.commonjs/barrel-BCS94_-c.js +23 -0
  25. package/dist.commonjs/barrel-BCS94_-c.js.map +1 -0
  26. package/dist.commonjs/barrel.d.ts +2 -2
  27. package/dist.commonjs/barrel.js +1 -1
  28. package/dist.commonjs/index.d.ts +2 -2
  29. package/dist.commonjs/index.js +1 -1
  30. package/dist.commonjs/{rolldown-runtime-DWNI8pZO.js → rolldown-runtime-Chgba0Kb.js} +1 -1
  31. package/dist.commonjs/transformers-Cue1Z8Up.js +2 -0
  32. package/dist.commonjs/transformers-Cue1Z8Up.js.map +1 -0
  33. package/package.json +8 -7
  34. package/src/advancedBarrel.ts +1 -0
  35. package/src/bytes/advanced.ts +1 -6
  36. package/src/bytes/index.ts +37 -10
  37. package/src/ckb/transaction.ts +5 -5
  38. package/src/client/client.ts +75 -19
  39. package/src/client/clientPublicMainnet.ts +75 -36
  40. package/src/client/clientPublicTestnet.ts +75 -36
  41. package/src/client/jsonRpc/client.ts +77 -30
  42. package/src/client/jsonRpc/transformers.ts +4 -4
  43. package/src/jsonRpc/index.ts +1 -0
  44. package/src/jsonRpc/requestor.ts +74 -21
  45. package/src/jsonRpc/transports/advanced.ts +0 -4
  46. package/src/jsonRpc/transports/factory.ts +12 -5
  47. package/src/jsonRpc/transports/fallback.ts +9 -5
  48. package/src/jsonRpc/transports/http.ts +21 -17
  49. package/src/jsonRpc/transports/index.ts +4 -0
  50. package/src/jsonRpc/transports/transport.ts +32 -6
  51. package/src/jsonRpc/transports/webSocket.ts +67 -20
  52. package/src/keystore/index.ts +3 -3
  53. package/src/molecule/codec.ts +20 -17
  54. package/src/signer/advanced.ts +1 -0
  55. package/src/signer/btc/verify.ts +2 -2
  56. package/src/signer/ckb/secp256k1Signing.ts +3 -3
  57. package/src/signer/doge/signerDoge.ts +1 -1
  58. package/src/signer/doge/signerDogePrivateKey.ts +1 -1
  59. package/src/signer/index.ts +1 -0
  60. package/src/signer/jsonRpc/handler.ts +217 -0
  61. package/src/signer/jsonRpc/index.ts +2 -0
  62. package/src/signer/jsonRpc/network.ts +15 -0
  63. package/src/signer/jsonRpc/signer.ts +181 -0
  64. package/src/signer/jsonRpc/transformers.ts +67 -0
  65. package/src/signer/signer/index.ts +5 -13
  66. package/src/utils/abortSignal.ts +42 -0
  67. package/src/utils/index.ts +2 -0
  68. package/src/utils/owner/aggregated.ts +56 -0
  69. package/src/utils/owner/index.ts +4 -0
  70. package/src/utils/owner/owner.ts +141 -0
  71. package/src/utils/owner/refCount.ts +78 -0
  72. package/src/utils/owner/unique.ts +30 -0
  73. package/tsdown.config.mts +1 -0
  74. package/dist/address.advanced-Cka_9tcR.mjs +0 -2
  75. package/dist/address.advanced-Cka_9tcR.mjs.map +0 -1
  76. package/dist/advancedBarrel-mPY1Rl-S.d.mts.map +0 -1
  77. package/dist/barrel-DsK2p-Rh.mjs +0 -7
  78. package/dist/barrel-DsK2p-Rh.mjs.map +0 -1
  79. package/dist.commonjs/address.advanced-BTrmYDic.js +0 -2
  80. package/dist.commonjs/address.advanced-BTrmYDic.js.map +0 -1
  81. package/dist.commonjs/advancedBarrel-B565UuhW.d.ts.map +0 -1
  82. package/dist.commonjs/barrel-D8_wJLfr.js +0 -23
  83. package/dist.commonjs/barrel-D8_wJLfr.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @ckb-ccc/core
2
2
 
3
+ ## 1.20.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#498](https://github.com/ckb-devrel/ccc/pull/498) [`6cfe9e1`](https://github.com/ckb-devrel/ccc/commit/6cfe9e1db55e520cf4347b45b704df90f7dfe331) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): add `Owner.map` and `OwnerAggregated`
8
+
9
+ - [#498](https://github.com/ckb-devrel/ccc/pull/498) [`88c8df6`](https://github.com/ckb-devrel/ccc/commit/88c8df68d75b36d7adf0cfb8598091056ac0c798) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): add ownership-aware `open` APIs for JSON-RPC clients and transports
10
+
11
+ - [#496](https://github.com/ckb-devrel/ccc/pull/496) [`095fb8f`](https://github.com/ckb-devrel/ccc/commit/095fb8fc754ba54e89aec8c3e58b88b6c373ec2a) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): json rpc id can be string
12
+
13
+ - [#503](https://github.com/ckb-devrel/ccc/pull/503) [`eff7117`](https://github.com/ckb-devrel/ccc/commit/eff7117b84b008ac9b7835d355a92f85a19c634e) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): add `SignerJsonRpc` and `buildSignerJsonRpcHandler` for remote
14
+ signers, plus an `AbortSignal.any` compatibility helper.
15
+
16
+ - [#487](https://github.com/ckb-devrel/ccc/pull/487) [`5f2a6ab`](https://github.com/ckb-devrel/ccc/commit/5f2a6ab0a41b9b0c819c7fc62d6eb0b22a8288e6) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): improve JSON-RPC transport types and cleanup
17
+
18
+ Clear HTTP/WebSocket request timers and pending state.
19
+
20
+ - [#498](https://github.com/ckb-devrel/ccc/pull/498) [`4fabb6a`](https://github.com/ckb-devrel/ccc/commit/4fabb6afbd58aee7d4bfb792660f82fe673ffbb9) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): add `OwnerRefCount` for shared resource ownership
21
+
22
+ - [#497](https://github.com/ckb-devrel/ccc/pull/497) [`235cd97`](https://github.com/ckb-devrel/ccc/commit/235cd9788543e300e4dceef20ad664a4666feba2) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core)!: replace `Buffer`-based byte encoding with `uint8array-extras`
23
+
24
+ - Remove the legacy `ascii`, `binary`, `latin1`, `ucs2`, and `utf16le` encodings
25
+ - Use consistent strict validation for implicit and explicit hex input
26
+
27
+ - [#498](https://github.com/ckb-devrel/ccc/pull/498) [`463846d`](https://github.com/ckb-devrel/ccc/commit/463846d99e7123846286b3c6a9811b75e5a58437) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(core): add `Owner` and `OwnerUnique` for explicit resource ownership
28
+
29
+ - [#494](https://github.com/ckb-devrel/ccc/pull/494) [`f6aafb2`](https://github.com/ckb-devrel/ccc/commit/f6aafb2886ad747fed24e218f9b9b54e15071ee9) Thanks [@Hanssen0](https://github.com/Hanssen0)! - refactor(core): rename JSON-RPC transport APIs with the `JsonRpcTransport` prefix
30
+
31
+ - `Transport` is now `JsonRpcTransport`
32
+ - `TransportHttp` is now `JsonRpcTransportHttp`
33
+ - `TransportWebSocket` is now `JsonRpcTransportWebSocket`
34
+ - `TransportFallback` is now `JsonRpcTransportFallback`
35
+
36
+ ### Patch Changes
37
+
38
+ - [#516](https://github.com/ckb-devrel/ccc/pull/516) [`1c74033`](https://github.com/ckb-devrel/ccc/commit/1c74033df94fc11b61296c6fc00e9955ff602c72) Thanks [@Hanssen0](https://github.com/Hanssen0)! - Fix DAO claim epoch calculation when the deposit and withdrawal epoch fractions are equal.
39
+
40
+ - [#489](https://github.com/ckb-devrel/ccc/pull/489) [`cdc5b1a`](https://github.com/ckb-devrel/ccc/commit/cdc5b1ac13ce73fa60d79b90cb0400f860f93f27) Thanks [@github-actions](https://github.com/apps/github-actions)! - perf([#495](https://github.com/ckb-devrel/ccc/issues/495)): replace `Uint8Array.slice` with `subarray`
41
+
42
+ ## 1.19.1
43
+
44
+ ### Patch Changes
45
+
46
+ - [#485](https://github.com/ckb-devrel/ccc/pull/485) [`9b5e9c6`](https://github.com/ckb-devrel/ccc/commit/9b5e9c6439f0bbb4c24f9e8bd99e94c3c374dff1) Thanks [@Hanssen0](https://github.com/Hanssen0)! - feat(connector): expose selectable wallet networks as separate signers
47
+
3
48
  ## 1.19.0
4
49
 
5
50
  ### Minor Changes
@@ -1,2 +1,2 @@
1
- import { A as DEP_TYPES, C as DEFAULT_CONFIRMED_BLOCK_TIME, Cn as ClientCollectableSearchKeyLike, D as filterNumByRange, E as filterData, En as clientSearchKeyRangeFrom, F as NUM_TO_HASH_TYPE, Fr as TransportWebSocket, I as ADDRESS_BECH32_LIMIT, Ir as TransportHttp, L as AddressFormat, Lr as JsonRpcPayload, M as NUM_TO_DEP_TYPE, N as HASH_TYPES, Nr as TransportFallback, O as filterScript, P as HASH_TYPE_TO_NUM, Pr as transportFromUri, R as addressFromPayload, Rr as Transport, S as CellRecord, Sn as ClientCollectableSearchKeyFilterLike, T as filterCell, Tn as DEFAULT_MIN_FEE_RATE, _ as JsonRpcOutPoint, a as JsonRpcBlockHeader, b as TESTNET_SCRIPTS, c as JsonRpcCellInput, d as JsonRpcHashType, f as JsonRpcIndexerFindTransactionsGroupedResponse, g as JsonRpcIndexerSearchKeyTransaction, h as JsonRpcIndexerSearchKeyFilter, ha as BytesFromEncoding, i as JsonRpcBlock, j as DEP_TYPE_TO_NUM, k as filterScriptByLenRange, l as JsonRpcCellOutput, m as JsonRpcIndexerSearchKey, n as CKB_BLAKE2B_PERSONAL, o as JsonRpcBlockUncle, p as JsonRpcIndexerFindTransactionsResponse, r as JsonRpcTransformers, s as JsonRpcCellDep, t as advancedBarrel_d_exports, u as JsonRpcDepType, v as JsonRpcScript, w as MapLru, wn as DEFAULT_MAX_FEE_RATE, x as MAINNET_SCRIPTS, y as JsonRpcTransaction, z as addressPayloadFromString } from "./advancedBarrel-mPY1Rl-S.mjs";
2
- export { ADDRESS_BECH32_LIMIT, AddressFormat, BytesFromEncoding, CKB_BLAKE2B_PERSONAL, CellRecord, ClientCollectableSearchKeyFilterLike, ClientCollectableSearchKeyLike, DEFAULT_CONFIRMED_BLOCK_TIME, DEFAULT_MAX_FEE_RATE, DEFAULT_MIN_FEE_RATE, DEP_TYPES, DEP_TYPE_TO_NUM, HASH_TYPES, HASH_TYPE_TO_NUM, JsonRpcBlock, JsonRpcBlockHeader, JsonRpcBlockUncle, JsonRpcCellDep, JsonRpcCellInput, JsonRpcCellOutput, JsonRpcDepType, JsonRpcHashType, JsonRpcIndexerFindTransactionsGroupedResponse, JsonRpcIndexerFindTransactionsResponse, JsonRpcIndexerSearchKey, JsonRpcIndexerSearchKeyFilter, JsonRpcIndexerSearchKeyTransaction, JsonRpcOutPoint, JsonRpcPayload, JsonRpcScript, JsonRpcTransaction, JsonRpcTransformers, MAINNET_SCRIPTS, MapLru, NUM_TO_DEP_TYPE, NUM_TO_HASH_TYPE, TESTNET_SCRIPTS, Transport, TransportFallback, TransportHttp, TransportWebSocket, addressFromPayload, addressPayloadFromString, advancedBarrel_d_exports as cccA, clientSearchKeyRangeFrom, filterCell, filterData, filterNumByRange, filterScript, filterScriptByLenRange, transportFromUri };
1
+ import { A as filterScriptByLenRange, B as addressPayloadFromString, C as CellRecord, D as filterData, Dn as DEFAULT_MIN_FEE_RATE, E as filterCell, En as DEFAULT_MAX_FEE_RATE, F as HASH_TYPE_TO_NUM, Gn as SignerJsonRpcMessageToSign, I as NUM_TO_HASH_TYPE, Ia as BytesFromEncoding, Kn as SignerJsonRpcTransformers, L as ADDRESS_BECH32_LIMIT, M as DEP_TYPE_TO_NUM, N as NUM_TO_DEP_TYPE, O as filterNumByRange, On as clientSearchKeyRangeFrom, P as HASH_TYPES, R as AddressFormat, S as MAINNET_SCRIPTS, T as MapLru, Tn as ClientCollectableSearchKeyLike, Un as SignerJsonRpcInfo, Wn as SignerJsonRpcInfoPayload, _ as JsonRpcIndexerSearchKeyTransaction, a as JsonRpcBlock, b as JsonRpcTransaction, c as JsonRpcCellDep, d as JsonRpcDepType, f as JsonRpcHashType, g as JsonRpcIndexerSearchKeyFilter, h as JsonRpcIndexerSearchKey, i as JsonRpcTransformers, j as DEP_TYPES, k as filterScript, l as JsonRpcCellInput, m as JsonRpcIndexerFindTransactionsResponse, n as jsonRpcTransportFromUri, o as JsonRpcBlockHeader, p as JsonRpcIndexerFindTransactionsGroupedResponse, r as CKB_BLAKE2B_PERSONAL, s as JsonRpcBlockUncle, t as advancedBarrel_d_exports, u as JsonRpcCellOutput, v as JsonRpcOutPoint, w as DEFAULT_CONFIRMED_BLOCK_TIME, wn as ClientCollectableSearchKeyFilterLike, x as TESTNET_SCRIPTS, y as JsonRpcScript, z as addressFromPayload } from "./advancedBarrel-CZxkR1dk.mjs";
2
+ export { ADDRESS_BECH32_LIMIT, AddressFormat, BytesFromEncoding, CKB_BLAKE2B_PERSONAL, CellRecord, ClientCollectableSearchKeyFilterLike, ClientCollectableSearchKeyLike, DEFAULT_CONFIRMED_BLOCK_TIME, DEFAULT_MAX_FEE_RATE, DEFAULT_MIN_FEE_RATE, DEP_TYPES, DEP_TYPE_TO_NUM, HASH_TYPES, HASH_TYPE_TO_NUM, JsonRpcBlock, JsonRpcBlockHeader, JsonRpcBlockUncle, JsonRpcCellDep, JsonRpcCellInput, JsonRpcCellOutput, JsonRpcDepType, JsonRpcHashType, JsonRpcIndexerFindTransactionsGroupedResponse, JsonRpcIndexerFindTransactionsResponse, JsonRpcIndexerSearchKey, JsonRpcIndexerSearchKeyFilter, JsonRpcIndexerSearchKeyTransaction, JsonRpcOutPoint, JsonRpcScript, JsonRpcTransaction, JsonRpcTransformers, MAINNET_SCRIPTS, MapLru, NUM_TO_DEP_TYPE, NUM_TO_HASH_TYPE, SignerJsonRpcInfo, SignerJsonRpcInfoPayload, SignerJsonRpcMessageToSign, SignerJsonRpcTransformers, TESTNET_SCRIPTS, addressFromPayload, addressPayloadFromString, advancedBarrel_d_exports as cccA, clientSearchKeyRangeFrom, filterCell, filterData, filterNumByRange, filterScript, filterScriptByLenRange, jsonRpcTransportFromUri };
package/dist/advanced.mjs CHANGED
@@ -1 +1 @@
1
- import{$ as e,A as t,B as n,G as r,H as i,K as a,O as o,Q as s,R as c,U as l,V as u,W as d,X as f,Y as p,Z as m,bt as h,et as g,gr as _,i as v,k as y,n as b,q as x,r as S,t as C,tt as w,vt as T,yt as E,z as D}from"./address.advanced-Cka_9tcR.mjs";import{t as O}from"./advancedBarrel.mjs";export{C as ADDRESS_BECH32_LIMIT,b as AddressFormat,_ as CKB_BLAKE2B_PERSONAL,p as DEFAULT_CONFIRMED_BLOCK_TIME,T as DEFAULT_MAX_FEE_RATE,E as DEFAULT_MIN_FEE_RATE,o as DEP_TYPES,y as DEP_TYPE_TO_NUM,c as HASH_TYPES,D as HASH_TYPE_TO_NUM,i as JsonRpcTransformers,x as MAINNET_SCRIPTS,f as MapLru,t as NUM_TO_DEP_TYPE,n as NUM_TO_HASH_TYPE,u as TESTNET_SCRIPTS,l as TransportFallback,a as TransportHttp,r as TransportWebSocket,S as addressFromPayload,v as addressPayloadFromString,O as cccA,h as clientSearchKeyRangeFrom,m as filterCell,s as filterData,e as filterNumByRange,g as filterScript,w as filterScriptByLenRange,d as transportFromUri};
1
+ import{$ as e,H as t,Q as n,U as r,W as i,_ as a,a as o,bt as s,c,d as l,et as u,f as d,g as f,h as p,i as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,v as S,vt as C,yr as w,yt as T}from"./transformers-BJyj6caX.mjs";import{t as E}from"./advancedBarrel.mjs";export{g as ADDRESS_BECH32_LIMIT,y as AddressFormat,w as CKB_BLAKE2B_PERSONAL,d as DEFAULT_CONFIRMED_BLOCK_TIME,C as DEFAULT_MAX_FEE_RATE,T as DEFAULT_MIN_FEE_RATE,t as DEP_TYPES,r as DEP_TYPE_TO_NUM,n as HASH_TYPES,e as HASH_TYPE_TO_NUM,b as JsonRpcTransformers,l as MAINNET_SCRIPTS,v as MapLru,i as NUM_TO_DEP_TYPE,u as NUM_TO_HASH_TYPE,x as SignerJsonRpcTransformers,_ as TESTNET_SCRIPTS,m as addressFromPayload,o as addressPayloadFromString,E as cccA,s as clientSearchKeyRangeFrom,h as filterCell,p as filterData,f as filterNumByRange,a as filterScript,S as filterScriptByLenRange,c as jsonRpcTransportFromUri};