@ckb-ccc/core 0.0.12-alpha.1 → 0.0.12

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 (267) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/README.md +5 -5
  3. package/dist/address/index.d.ts +4 -0
  4. package/dist/address/index.d.ts.map +1 -1
  5. package/dist/address/index.js +1 -0
  6. package/dist/advancedBarrel.d.ts +1 -0
  7. package/dist/advancedBarrel.d.ts.map +1 -1
  8. package/dist/advancedBarrel.js +1 -0
  9. package/dist/bytes/advanced.d.ts +1 -0
  10. package/dist/bytes/advanced.d.ts.map +1 -1
  11. package/dist/bytes/index.d.ts +9 -0
  12. package/dist/bytes/index.d.ts.map +1 -1
  13. package/dist/bytes/index.js +3 -0
  14. package/dist/ckb/index.d.ts +1 -0
  15. package/dist/ckb/index.d.ts.map +1 -1
  16. package/dist/ckb/index.js +1 -0
  17. package/dist/ckb/script.d.ts +15 -0
  18. package/dist/ckb/script.d.ts.map +1 -1
  19. package/dist/ckb/script.js +6 -0
  20. package/dist/ckb/transaction.d.ts +65 -11
  21. package/dist/ckb/transaction.d.ts.map +1 -1
  22. package/dist/ckb/transaction.js +41 -14
  23. package/dist/ckb/transactionLumos.d.ts +29 -0
  24. package/dist/ckb/transactionLumos.d.ts.map +1 -0
  25. package/dist/ckb/transactionLumos.js +1 -0
  26. package/dist/client/client.d.ts +13 -1
  27. package/dist/client/client.d.ts.map +1 -1
  28. package/dist/client/client.js +10 -1
  29. package/dist/client/clientPublicMainnet.d.ts +3 -0
  30. package/dist/client/clientPublicMainnet.d.ts.map +1 -1
  31. package/dist/client/clientPublicMainnet.js +3 -0
  32. package/dist/client/clientPublicTestnet.d.ts +3 -0
  33. package/dist/client/clientPublicTestnet.d.ts.map +1 -1
  34. package/dist/client/clientPublicTestnet.js +3 -0
  35. package/dist/client/clientTypes.d.ts +45 -0
  36. package/dist/client/clientTypes.d.ts.map +1 -1
  37. package/dist/client/clientTypes.js +9 -0
  38. package/dist/client/jsonRpc/index.d.ts +6 -6
  39. package/dist/client/jsonRpc/index.d.ts.map +1 -1
  40. package/dist/client/jsonRpc/index.js +3 -3
  41. package/dist/fixedPoint/index.d.ts +6 -0
  42. package/dist/fixedPoint/index.d.ts.map +1 -1
  43. package/dist/fixedPoint/index.js +5 -0
  44. package/dist/hasher/hasher.d.ts +3 -0
  45. package/dist/hasher/hasher.d.ts.map +1 -1
  46. package/dist/hasher/hasherCkb.d.ts +6 -1
  47. package/dist/hasher/hasherCkb.d.ts.map +1 -1
  48. package/dist/hasher/hasherCkb.js +6 -1
  49. package/dist/hasher/hasherKeecak256.d.ts +3 -0
  50. package/dist/hasher/hasherKeecak256.d.ts.map +1 -1
  51. package/dist/hasher/hasherKeecak256.js +3 -0
  52. package/dist/hex/index.d.ts +3 -0
  53. package/dist/hex/index.d.ts.map +1 -1
  54. package/dist/hex/index.js +1 -0
  55. package/dist/keystore/index.d.ts +6 -0
  56. package/dist/keystore/index.d.ts.map +1 -1
  57. package/dist/keystore/index.js +6 -0
  58. package/dist/num/index.d.ts +11 -0
  59. package/dist/num/index.d.ts.map +1 -1
  60. package/dist/num/index.js +9 -0
  61. package/dist/package.json +1 -1
  62. package/dist/signer/btc/signerBtc.d.ts +1 -0
  63. package/dist/signer/btc/signerBtc.d.ts.map +1 -1
  64. package/dist/signer/btc/signerBtc.js +1 -0
  65. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
  66. package/dist/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
  67. package/dist/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
  68. package/dist/signer/btc/verify.d.ts +3 -0
  69. package/dist/signer/btc/verify.d.ts.map +1 -1
  70. package/dist/signer/btc/verify.js +3 -0
  71. package/dist/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
  72. package/dist/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
  73. package/dist/signer/ckb/signerCkbPrivateKey.js +3 -0
  74. package/dist/signer/ckb/signerCkbPublicKey.d.ts +3 -0
  75. package/dist/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
  76. package/dist/signer/ckb/signerCkbPublicKey.js +3 -0
  77. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
  78. package/dist/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
  79. package/dist/signer/ckb/signerCkbScriptReadonly.js +1 -0
  80. package/dist/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
  81. package/dist/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
  82. package/dist/signer/ckb/verifyCkbSecp256k1.js +6 -0
  83. package/dist/signer/ckb/verifyJoyId.d.ts +3 -0
  84. package/dist/signer/ckb/verifyJoyId.d.ts.map +1 -1
  85. package/dist/signer/ckb/verifyJoyId.js +3 -0
  86. package/dist/signer/dummy/alwaysError.d.ts +3 -0
  87. package/dist/signer/dummy/alwaysError.d.ts.map +1 -1
  88. package/dist/signer/dummy/alwaysError.js +3 -0
  89. package/dist/signer/dummy/dummy.d.ts +3 -0
  90. package/dist/signer/dummy/dummy.d.ts.map +1 -1
  91. package/dist/signer/dummy/dummy.js +3 -0
  92. package/dist/signer/dummy/openLink.d.ts +3 -0
  93. package/dist/signer/dummy/openLink.d.ts.map +1 -1
  94. package/dist/signer/dummy/openLink.js +3 -0
  95. package/dist/signer/evm/signerEvm.d.ts +1 -0
  96. package/dist/signer/evm/signerEvm.d.ts.map +1 -1
  97. package/dist/signer/evm/signerEvm.js +1 -0
  98. package/dist/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
  99. package/dist/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
  100. package/dist/signer/evm/signerEvmAddressReadonly.js +1 -0
  101. package/dist/signer/evm/verify.d.ts +3 -0
  102. package/dist/signer/evm/verify.d.ts.map +1 -1
  103. package/dist/signer/evm/verify.js +3 -0
  104. package/dist/signer/nostr/signerNostr.d.ts +6 -0
  105. package/dist/signer/nostr/signerNostr.d.ts.map +1 -1
  106. package/dist/signer/nostr/signerNostr.js +3 -0
  107. package/dist/signer/nostr/verify.d.ts +3 -0
  108. package/dist/signer/nostr/verify.d.ts.map +1 -1
  109. package/dist/signer/nostr/verify.js +3 -0
  110. package/dist/signer/signer/index.d.ts +26 -3
  111. package/dist/signer/signer/index.d.ts.map +1 -1
  112. package/dist/signer/signer/index.js +12 -3
  113. package/dist/utils/index.d.ts +12 -0
  114. package/dist/utils/index.d.ts.map +1 -1
  115. package/dist/utils/index.js +13 -0
  116. package/dist.commonjs/address/index.d.ts +4 -0
  117. package/dist.commonjs/address/index.d.ts.map +1 -1
  118. package/dist.commonjs/address/index.js +1 -0
  119. package/dist.commonjs/advancedBarrel.d.ts +1 -0
  120. package/dist.commonjs/advancedBarrel.d.ts.map +1 -1
  121. package/dist.commonjs/advancedBarrel.js +1 -0
  122. package/dist.commonjs/bytes/advanced.d.ts +1 -0
  123. package/dist.commonjs/bytes/advanced.d.ts.map +1 -1
  124. package/dist.commonjs/bytes/index.d.ts +9 -0
  125. package/dist.commonjs/bytes/index.d.ts.map +1 -1
  126. package/dist.commonjs/bytes/index.js +3 -0
  127. package/dist.commonjs/ckb/index.d.ts +1 -0
  128. package/dist.commonjs/ckb/index.d.ts.map +1 -1
  129. package/dist.commonjs/ckb/index.js +1 -0
  130. package/dist.commonjs/ckb/script.d.ts +15 -0
  131. package/dist.commonjs/ckb/script.d.ts.map +1 -1
  132. package/dist.commonjs/ckb/script.js +6 -0
  133. package/dist.commonjs/ckb/transaction.d.ts +65 -11
  134. package/dist.commonjs/ckb/transaction.d.ts.map +1 -1
  135. package/dist.commonjs/ckb/transaction.js +41 -14
  136. package/dist.commonjs/ckb/transactionLumos.d.ts +29 -0
  137. package/dist.commonjs/ckb/transactionLumos.d.ts.map +1 -0
  138. package/dist.commonjs/ckb/transactionLumos.js +2 -0
  139. package/dist.commonjs/client/client.d.ts +13 -1
  140. package/dist.commonjs/client/client.d.ts.map +1 -1
  141. package/dist.commonjs/client/client.js +10 -1
  142. package/dist.commonjs/client/clientPublicMainnet.d.ts +3 -0
  143. package/dist.commonjs/client/clientPublicMainnet.d.ts.map +1 -1
  144. package/dist.commonjs/client/clientPublicMainnet.js +3 -0
  145. package/dist.commonjs/client/clientPublicTestnet.d.ts +3 -0
  146. package/dist.commonjs/client/clientPublicTestnet.d.ts.map +1 -1
  147. package/dist.commonjs/client/clientPublicTestnet.js +3 -0
  148. package/dist.commonjs/client/clientTypes.d.ts +45 -0
  149. package/dist.commonjs/client/clientTypes.d.ts.map +1 -1
  150. package/dist.commonjs/client/clientTypes.js +9 -0
  151. package/dist.commonjs/client/jsonRpc/index.d.ts +6 -6
  152. package/dist.commonjs/client/jsonRpc/index.d.ts.map +1 -1
  153. package/dist.commonjs/client/jsonRpc/index.js +3 -3
  154. package/dist.commonjs/fixedPoint/index.d.ts +6 -0
  155. package/dist.commonjs/fixedPoint/index.d.ts.map +1 -1
  156. package/dist.commonjs/fixedPoint/index.js +5 -0
  157. package/dist.commonjs/hasher/hasher.d.ts +3 -0
  158. package/dist.commonjs/hasher/hasher.d.ts.map +1 -1
  159. package/dist.commonjs/hasher/hasherCkb.d.ts +6 -1
  160. package/dist.commonjs/hasher/hasherCkb.d.ts.map +1 -1
  161. package/dist.commonjs/hasher/hasherCkb.js +6 -1
  162. package/dist.commonjs/hasher/hasherKeecak256.d.ts +3 -0
  163. package/dist.commonjs/hasher/hasherKeecak256.d.ts.map +1 -1
  164. package/dist.commonjs/hasher/hasherKeecak256.js +3 -0
  165. package/dist.commonjs/hex/index.d.ts +3 -0
  166. package/dist.commonjs/hex/index.d.ts.map +1 -1
  167. package/dist.commonjs/hex/index.js +1 -0
  168. package/dist.commonjs/keystore/index.d.ts +6 -0
  169. package/dist.commonjs/keystore/index.d.ts.map +1 -1
  170. package/dist.commonjs/keystore/index.js +6 -0
  171. package/dist.commonjs/num/index.d.ts +11 -0
  172. package/dist.commonjs/num/index.d.ts.map +1 -1
  173. package/dist.commonjs/num/index.js +9 -0
  174. package/dist.commonjs/signer/btc/signerBtc.d.ts +1 -0
  175. package/dist.commonjs/signer/btc/signerBtc.d.ts.map +1 -1
  176. package/dist.commonjs/signer/btc/signerBtc.js +1 -0
  177. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts +1 -0
  178. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.d.ts.map +1 -1
  179. package/dist.commonjs/signer/btc/signerBtcPublicKeyReadonly.js +1 -0
  180. package/dist.commonjs/signer/btc/verify.d.ts +3 -0
  181. package/dist.commonjs/signer/btc/verify.d.ts.map +1 -1
  182. package/dist.commonjs/signer/btc/verify.js +3 -0
  183. package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts +3 -0
  184. package/dist.commonjs/signer/ckb/signerCkbPrivateKey.d.ts.map +1 -1
  185. package/dist.commonjs/signer/ckb/signerCkbPrivateKey.js +3 -0
  186. package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts +3 -0
  187. package/dist.commonjs/signer/ckb/signerCkbPublicKey.d.ts.map +1 -1
  188. package/dist.commonjs/signer/ckb/signerCkbPublicKey.js +3 -0
  189. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts +1 -0
  190. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.d.ts.map +1 -1
  191. package/dist.commonjs/signer/ckb/signerCkbScriptReadonly.js +1 -0
  192. package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts +6 -0
  193. package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.d.ts.map +1 -1
  194. package/dist.commonjs/signer/ckb/verifyCkbSecp256k1.js +6 -0
  195. package/dist.commonjs/signer/ckb/verifyJoyId.d.ts +3 -0
  196. package/dist.commonjs/signer/ckb/verifyJoyId.d.ts.map +1 -1
  197. package/dist.commonjs/signer/ckb/verifyJoyId.js +3 -0
  198. package/dist.commonjs/signer/dummy/alwaysError.d.ts +3 -0
  199. package/dist.commonjs/signer/dummy/alwaysError.d.ts.map +1 -1
  200. package/dist.commonjs/signer/dummy/alwaysError.js +3 -0
  201. package/dist.commonjs/signer/dummy/dummy.d.ts +3 -0
  202. package/dist.commonjs/signer/dummy/dummy.d.ts.map +1 -1
  203. package/dist.commonjs/signer/dummy/dummy.js +3 -0
  204. package/dist.commonjs/signer/dummy/openLink.d.ts +3 -0
  205. package/dist.commonjs/signer/dummy/openLink.d.ts.map +1 -1
  206. package/dist.commonjs/signer/dummy/openLink.js +3 -0
  207. package/dist.commonjs/signer/evm/signerEvm.d.ts +1 -0
  208. package/dist.commonjs/signer/evm/signerEvm.d.ts.map +1 -1
  209. package/dist.commonjs/signer/evm/signerEvm.js +1 -0
  210. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts +1 -0
  211. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.d.ts.map +1 -1
  212. package/dist.commonjs/signer/evm/signerEvmAddressReadonly.js +1 -0
  213. package/dist.commonjs/signer/evm/verify.d.ts +3 -0
  214. package/dist.commonjs/signer/evm/verify.d.ts.map +1 -1
  215. package/dist.commonjs/signer/evm/verify.js +3 -0
  216. package/dist.commonjs/signer/nostr/signerNostr.d.ts +6 -0
  217. package/dist.commonjs/signer/nostr/signerNostr.d.ts.map +1 -1
  218. package/dist.commonjs/signer/nostr/signerNostr.js +3 -0
  219. package/dist.commonjs/signer/nostr/verify.d.ts +3 -0
  220. package/dist.commonjs/signer/nostr/verify.d.ts.map +1 -1
  221. package/dist.commonjs/signer/nostr/verify.js +3 -0
  222. package/dist.commonjs/signer/signer/index.d.ts +26 -3
  223. package/dist.commonjs/signer/signer/index.d.ts.map +1 -1
  224. package/dist.commonjs/signer/signer/index.js +12 -3
  225. package/dist.commonjs/utils/index.d.ts +12 -0
  226. package/dist.commonjs/utils/index.d.ts.map +1 -1
  227. package/dist.commonjs/utils/index.js +13 -0
  228. package/package.json +8 -10
  229. package/src/address/index.ts +4 -1
  230. package/src/advancedBarrel.ts +1 -0
  231. package/src/bytes/advanced.ts +1 -0
  232. package/src/bytes/index.ts +9 -0
  233. package/src/ckb/index.ts +1 -0
  234. package/src/ckb/script.ts +15 -0
  235. package/src/ckb/transaction.ts +72 -16
  236. package/src/ckb/transactionLumos.ts +26 -0
  237. package/src/client/client.ts +13 -1
  238. package/src/client/clientPublicMainnet.ts +3 -0
  239. package/src/client/clientPublicTestnet.ts +3 -0
  240. package/src/client/clientTypes.ts +45 -0
  241. package/src/client/jsonRpc/index.ts +5 -6
  242. package/src/fixedPoint/index.ts +6 -0
  243. package/src/hasher/hasher.ts +3 -0
  244. package/src/hasher/hasherCkb.ts +6 -1
  245. package/src/hasher/hasherKeecak256.ts +3 -0
  246. package/src/hex/index.ts +3 -0
  247. package/src/keystore/index.ts +6 -0
  248. package/src/num/index.ts +11 -0
  249. package/src/signer/btc/signerBtc.ts +1 -0
  250. package/src/signer/btc/signerBtcPublicKeyReadonly.ts +1 -0
  251. package/src/signer/btc/verify.ts +3 -0
  252. package/src/signer/ckb/signerCkbPrivateKey.ts +3 -0
  253. package/src/signer/ckb/signerCkbPublicKey.ts +3 -0
  254. package/src/signer/ckb/signerCkbScriptReadonly.ts +1 -0
  255. package/src/signer/ckb/verifyCkbSecp256k1.ts +6 -0
  256. package/src/signer/ckb/verifyJoyId.ts +3 -0
  257. package/src/signer/dummy/alwaysError.ts +3 -0
  258. package/src/signer/dummy/dummy.ts +3 -0
  259. package/src/signer/dummy/openLink.ts +3 -0
  260. package/src/signer/evm/signerEvm.ts +1 -0
  261. package/src/signer/evm/signerEvmAddressReadonly.ts +1 -0
  262. package/src/signer/evm/verify.ts +3 -0
  263. package/src/signer/nostr/signerNostr.ts +6 -0
  264. package/src/signer/nostr/verify.ts +3 -0
  265. package/src/signer/signer/index.ts +26 -14
  266. package/src/utils/index.ts +22 -0
  267. package/typedoc.json +6 -0
@@ -1,14 +1,17 @@
1
1
  /**
2
2
  * Represents a fixed point value as a bigint.
3
+ * @public
3
4
  */
4
5
  export type FixedPoint = bigint;
5
6
  /**
6
7
  * Represents a value that can be converted to a fixed point value.
7
8
  * It can be a bigint, string, or number.
9
+ * @public
8
10
  */
9
11
  export type FixedPointLike = bigint | string | number;
10
12
  /**
11
13
  * Converts a FixedPointLike value to its string representation with fixed-point decimals.
14
+ * @public
12
15
  *
13
16
  * @param val - The value to convert, which can be a bigint, string, or number.
14
17
  * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
@@ -24,6 +27,7 @@ export type FixedPointLike = bigint | string | number;
24
27
  export declare function fixedPointToString(val: FixedPointLike, decimals?: number): string;
25
28
  /**
26
29
  * Converts a FixedPointLike value to a FixedPoint (bigint) with fixed-point decimals.
30
+ * @public
27
31
  *
28
32
  * @param val - The value to convert, which can be a bigint, string, or number.
29
33
  * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
@@ -39,11 +43,13 @@ export declare function fixedPointToString(val: FixedPointLike, decimals?: numbe
39
43
  export declare function fixedPointFrom(val: FixedPointLike, decimals?: number): FixedPoint;
40
44
  /**
41
45
  * Represents the fixed point value of zero as a bigint.
46
+ * @public
42
47
  */
43
48
  export declare const Zero: FixedPoint;
44
49
  /**
45
50
  * Represents the fixed point value of one as a FixedPoint (bigint).
46
51
  * Equivalent to 1 in fixed-point representation with default decimals (8).
52
+ * @public
47
53
  */
48
54
  export declare const One: FixedPoint;
49
55
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;GAGG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAa5E;AAED;;;;;;;;;;;;;GAaG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAc5E;AAED;;GAEG;AAEH,eAAO,MAAM,IAAI,EAAE,UAAe,CAAC;AAEnC;;;GAGG;AAEH,eAAO,MAAM,GAAG,EAAE,UAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fixedPoint/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,MAAM,CAa5E;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,EAAE,QAAQ,SAAI,GAAG,UAAU,CAc5E;AAED;;;GAGG;AAEH,eAAO,MAAM,IAAI,EAAE,UAAe,CAAC;AAEnC;;;;GAIG;AAEH,eAAO,MAAM,GAAG,EAAE,UAAgC,CAAC"}
@@ -1,8 +1,10 @@
1
1
  /**
2
2
  * Represents a fixed point value as a bigint.
3
+ * @public
3
4
  */
4
5
  /**
5
6
  * Converts a FixedPointLike value to its string representation with fixed-point decimals.
7
+ * @public
6
8
  *
7
9
  * @param val - The value to convert, which can be a bigint, string, or number.
8
10
  * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
@@ -29,6 +31,7 @@ export function fixedPointToString(val, decimals = 8) {
29
31
  }
30
32
  /**
31
33
  * Converts a FixedPointLike value to a FixedPoint (bigint) with fixed-point decimals.
34
+ * @public
32
35
  *
33
36
  * @param val - The value to convert, which can be a bigint, string, or number.
34
37
  * @param decimals - The number of decimal places for the fixed-point representation. Default is 8.
@@ -54,10 +57,12 @@ export function fixedPointFrom(val, decimals = 8) {
54
57
  }
55
58
  /**
56
59
  * Represents the fixed point value of zero as a bigint.
60
+ * @public
57
61
  */
58
62
  export const Zero = 0n;
59
63
  /**
60
64
  * Represents the fixed point value of one as a FixedPoint (bigint).
61
65
  * Equivalent to 1 in fixed-point representation with default decimals (8).
66
+ * @public
62
67
  */
63
68
  export const One = fixedPointFrom("1");
@@ -1,5 +1,8 @@
1
1
  import { BytesLike } from "../bytes/index.js";
2
2
  import { Hex } from "../hex/index.js";
3
+ /**
4
+ * @public
5
+ */
3
6
  export interface Hasher {
4
7
  /**
5
8
  * Updates the hash with the given data.
@@ -1 +1 @@
1
- {"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../src/hasher/hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAEhC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG,CAAC;CACf"}
1
+ {"version":3,"file":"hasher.d.ts","sourceRoot":"","sources":["../../src/hasher/hasher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IAEhC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG,CAAC;CACf"}
@@ -3,6 +3,9 @@ import { CellInputLike } from "../ckb/index.js";
3
3
  import { Hex } from "../hex/index.js";
4
4
  import { NumLike } from "../num/index.js";
5
5
  import { Hasher } from "./hasher.js";
6
+ /**
7
+ * @public
8
+ */
6
9
  export declare class HasherCkb implements Hasher {
7
10
  private readonly hasher;
8
11
  /**
@@ -42,6 +45,7 @@ export declare class HasherCkb implements Hasher {
42
45
  }
43
46
  /**
44
47
  * Computes the CKB hash of the given data using the Blake2b algorithm.
48
+ * @public
45
49
  *
46
50
  * @param data - The data to hash.
47
51
  * @returns The hexadecimal string representation of the hash.
@@ -54,8 +58,9 @@ export declare class HasherCkb implements Hasher {
54
58
  export declare function hashCkb(...data: BytesLike[]): Hex;
55
59
  /**
56
60
  * Computes the Type ID hash of the given data.
61
+ * @public
57
62
  *
58
- * @param cellInput - The first cell input of the transaction.
63
+ * @param cellInputLike - The first cell input of the transaction.
59
64
  * @param outputIndex - The output index of the Type ID cell.
60
65
  * @returns The hexadecimal string representation of the hash.
61
66
  *
@@ -1 +1 @@
1
- {"version":3,"file":"hasherCkb.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherCkb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAa,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,SAAU,YAAW,MAAM;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE;;;;;OAKG;gBAES,SAAS,SAAK,EAAE,QAAQ,SAAuB;IAO3D;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAKlC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd;AAED;;;;;;;;;;GAUG;AAEH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,CAIjD;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,UAAU,CACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,OAAO,GACnB,GAAG,CAKL"}
1
+ {"version":3,"file":"hasherCkb.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherCkb.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAa,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAgB,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,qBAAa,SAAU,YAAW,MAAM;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAEhE;;;;;OAKG;gBAES,SAAS,SAAK,EAAE,QAAQ,SAAuB;IAO3D;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAKlC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,OAAO,CAAC,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,CAIjD;AAED;;;;;;;;;;;;GAYG;AAEH,wBAAgB,UAAU,CACxB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,OAAO,GACnB,GAAG,CAKL"}
@@ -4,6 +4,9 @@ import { CellInput } from "../ckb/index.js";
4
4
  import { hexFrom } from "../hex/index.js";
5
5
  import { numLeToBytes } from "../num/index.js";
6
6
  import { CKB_BLAKE2B_PERSONAL } from "./advanced.js";
7
+ /**
8
+ * @public
9
+ */
7
10
  export class HasherCkb {
8
11
  /**
9
12
  * Creates an instance of Hasher.
@@ -52,6 +55,7 @@ export class HasherCkb {
52
55
  }
53
56
  /**
54
57
  * Computes the CKB hash of the given data using the Blake2b algorithm.
58
+ * @public
55
59
  *
56
60
  * @param data - The data to hash.
57
61
  * @returns The hexadecimal string representation of the hash.
@@ -68,8 +72,9 @@ export function hashCkb(...data) {
68
72
  }
69
73
  /**
70
74
  * Computes the Type ID hash of the given data.
75
+ * @public
71
76
  *
72
- * @param cellInput - The first cell input of the transaction.
77
+ * @param cellInputLike - The first cell input of the transaction.
73
78
  * @param outputIndex - The output index of the Type ID cell.
74
79
  * @returns The hexadecimal string representation of the hash.
75
80
  *
@@ -1,6 +1,9 @@
1
1
  import { BytesLike } from "../bytes/index.js";
2
2
  import { Hex } from "../hex/index.js";
3
3
  import { Hasher } from "./hasher.js";
4
+ /**
5
+ * @public
6
+ */
4
7
  export declare class HasherKeecak256 implements Hasher {
5
8
  private readonly hasher;
6
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hasherKeecak256.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherKeecak256.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,eAAgB,YAAW,MAAM;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAEnE;;OAEG;;IAMH;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe;IAKxC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd"}
1
+ {"version":3,"file":"hasherKeecak256.d.ts","sourceRoot":"","sources":["../../src/hasher/hasherKeecak256.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,GAAG,EAAW,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;GAEG;AACH,qBAAa,eAAgB,YAAW,MAAM;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAEnE;;OAEG;;IAMH;;;;;;;;;;;;OAYG;IAEH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,eAAe;IAKxC;;;;;;;;;;;OAWG;IAEH,MAAM,IAAI,GAAG;CAGd"}
@@ -1,6 +1,9 @@
1
1
  import { keccak_256 } from "@noble/hashes/sha3";
2
2
  import { bytesFrom } from "../bytes/index.js";
3
3
  import { hexFrom } from "../hex/index.js";
4
+ /**
5
+ * @public
6
+ */
4
7
  export class HasherKeecak256 {
5
8
  /**
6
9
  * Creates an instance of Hasher.
@@ -1,15 +1,18 @@
1
1
  import { BytesLike } from "../bytes/index.js";
2
2
  /**
3
3
  * Represents a hexadecimal string prefixed with "0x".
4
+ * @public
4
5
  */
5
6
  export type Hex = `0x${string}`;
6
7
  /**
7
8
  * Represents a value that can be converted to a hexadecimal string.
8
9
  * It extends the BytesLike type.
10
+ * @public
9
11
  */
10
12
  export type HexLike = BytesLike;
11
13
  /**
12
14
  * Converts a HexLike value to a Hex string.
15
+ * @public
13
16
  *
14
17
  * @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
15
18
  * @returns A Hex string representing the value.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAEzC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAW,MAAM,mBAAmB,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAEzC"}
package/dist/hex/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { bytesFrom, bytesTo } from "../bytes/index.js";
2
2
  /**
3
3
  * Converts a HexLike value to a Hex string.
4
+ * @public
4
5
  *
5
6
  * @param hex - The value to convert, which can be a string, Uint8Array, ArrayBuffer, or number array.
6
7
  * @returns A Hex string representing the value.
@@ -1,4 +1,7 @@
1
1
  import { Bytes, BytesLike } from "../bytes/index.js";
2
+ /**
3
+ * @public
4
+ */
2
5
  export declare function keystoreEncrypt(privateKeyLike: BytesLike, chainCodeLike: BytesLike, password: string): Promise<{
3
6
  id: string;
4
7
  crypto: {
@@ -18,6 +21,9 @@ export declare function keystoreEncrypt(privateKeyLike: BytesLike, chainCodeLike
18
21
  mac: string;
19
22
  };
20
23
  }>;
24
+ /**
25
+ * @public
26
+ */
21
27
  export declare function keystoreDecrypt(keystore: unknown, password: string): Promise<{
22
28
  privateKey: Bytes;
23
29
  chainCode: Bytes;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/keystore/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAgB7E,wBAAsB,eAAe,CACnC,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,SAAS,EACxB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IACT,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE;YACZ,EAAE,EAAE,MAAM,CAAC;SACZ,CAAC;QACF,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE;YACT,CAAC,EAAE,MAAM,C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@@ const DEFAULT_SCRYPT_PARAM_N = 262144;
13
13
  function mac(derivedKey, cipherText) {
14
14
  return hexFrom(keccak_256(bytesConcat(derivedKey.slice(16, 32), cipherText))).slice(2);
15
15
  }
16
+ /**
17
+ * @public
18
+ */
16
19
  export async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
17
20
  const salt = randomBytes(32);
18
21
  const iv = randomBytes(16);
@@ -45,6 +48,9 @@ export async function keystoreEncrypt(privateKeyLike, chainCodeLike, password) {
45
48
  },
46
49
  };
47
50
  }
51
+ /**
52
+ * @public
53
+ */
48
54
  export async function keystoreDecrypt(keystore, password) {
49
55
  if (typeof keystore !== "object" ||
50
56
  keystore === null ||
@@ -2,15 +2,18 @@ import { Bytes, BytesLike } from "../bytes/index.js";
2
2
  import { Hex, HexLike } from "../hex/index.js";
3
3
  /**
4
4
  * Represents a numeric value as a bigint.
5
+ * @public
5
6
  */
6
7
  export type Num = bigint;
7
8
  /**
8
9
  * Represents a value that can be converted to a numeric value.
9
10
  * It can be a string, number, bigint, or HexLike.
11
+ * @public
10
12
  */
11
13
  export type NumLike = string | number | bigint | HexLike;
12
14
  /**
13
15
  * Get the max among all numbers.
16
+ * @public
14
17
  *
15
18
  * @param numbers - numbers.
16
19
  * @returns The max numbers among them.
@@ -23,6 +26,7 @@ export type NumLike = string | number | bigint | HexLike;
23
26
  export declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
24
27
  /**
25
28
  * Converts a NumLike value to a Num (bigint).
29
+ * @public
26
30
  *
27
31
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
28
32
  * @returns A Num (bigint) representing the value.
@@ -36,6 +40,7 @@ export declare function numMax(a: NumLike, ...numbers: NumLike[]): Num;
36
40
  export declare function numFrom(val: NumLike): Num;
37
41
  /**
38
42
  * Converts a NumLike value to a hexadecimal string.
43
+ * @public
39
44
  *
40
45
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
41
46
  * @returns A Hex string representing the numeric value.
@@ -48,6 +53,7 @@ export declare function numFrom(val: NumLike): Num;
48
53
  export declare function numToHex(val: NumLike): Hex;
49
54
  /**
50
55
  * Converts a NumLike value to a byte array in little-endian order.
56
+ * @public
51
57
  *
52
58
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
53
59
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -61,6 +67,7 @@ export declare function numToHex(val: NumLike): Hex;
61
67
  export declare function numToBytes(val: NumLike, bytes?: number): Bytes;
62
68
  /**
63
69
  * Converts a NumLike value to a byte array in little-endian order.
70
+ * @public
64
71
  *
65
72
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
66
73
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -74,6 +81,7 @@ export declare function numToBytes(val: NumLike, bytes?: number): Bytes;
74
81
  export declare function numLeToBytes(val: NumLike, bytes?: number): Bytes;
75
82
  /**
76
83
  * Converts a NumLike value to a byte array in big-endian order.
84
+ * @public
77
85
  *
78
86
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
79
87
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -87,6 +95,7 @@ export declare function numLeToBytes(val: NumLike, bytes?: number): Bytes;
87
95
  export declare function numBeToBytes(val: NumLike, bytes?: number): Bytes;
88
96
  /**
89
97
  * Converts a byte array to a Num (bigint) assuming little-endian order.
98
+ * @public
90
99
  *
91
100
  * @param val - The byte array to convert.
92
101
  * @returns A Num (bigint) representing the numeric value.
@@ -99,6 +108,7 @@ export declare function numBeToBytes(val: NumLike, bytes?: number): Bytes;
99
108
  export declare function numFromBytes(val: BytesLike): Num;
100
109
  /**
101
110
  * Converts a byte array to a Num (bigint) assuming little-endian order.
111
+ * @public
102
112
  *
103
113
  * @param val - The byte array to convert.
104
114
  * @returns A Num (bigint) representing the numeric value.
@@ -111,6 +121,7 @@ export declare function numFromBytes(val: BytesLike): Num;
111
121
  export declare function numLeFromBytes(val: BytesLike): Num;
112
122
  /**
113
123
  * Converts a byte array to a Num (bigint) assuming big-endian order.
124
+ * @public
114
125
  *
115
126
  * @param val - The byte array to convert.
116
127
  * @returns A Num (bigint) representing the numeric value.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/num/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAA0B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,iBAAiB,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,GAAG,GAAG,CAS7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAUzC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAE1C;AAED;;;;;;;;;;;GAWG;AAEH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAE9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAEhE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAUhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAEhD;AAED;;;;;;;;;;GAUG;AAC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;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAElD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,GAAG,GAAG,CAElD"}
package/dist/num/index.js CHANGED
@@ -2,6 +2,7 @@ import { bytesConcat, bytesFrom } from "../bytes/index.js";
2
2
  import { hexFrom } from "../hex/index.js";
3
3
  /**
4
4
  * Get the max among all numbers.
5
+ * @public
5
6
  *
6
7
  * @param numbers - numbers.
7
8
  * @returns The max numbers among them.
@@ -23,6 +24,7 @@ export function numMax(a, ...numbers) {
23
24
  }
24
25
  /**
25
26
  * Converts a NumLike value to a Num (bigint).
27
+ * @public
26
28
  *
27
29
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
28
30
  * @returns A Num (bigint) representing the value.
@@ -44,6 +46,7 @@ export function numFrom(val) {
44
46
  }
45
47
  /**
46
48
  * Converts a NumLike value to a hexadecimal string.
49
+ * @public
47
50
  *
48
51
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
49
52
  * @returns A Hex string representing the numeric value.
@@ -58,6 +61,7 @@ export function numToHex(val) {
58
61
  }
59
62
  /**
60
63
  * Converts a NumLike value to a byte array in little-endian order.
64
+ * @public
61
65
  *
62
66
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
63
67
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -73,6 +77,7 @@ export function numToBytes(val, bytes) {
73
77
  }
74
78
  /**
75
79
  * Converts a NumLike value to a byte array in little-endian order.
80
+ * @public
76
81
  *
77
82
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
78
83
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -88,6 +93,7 @@ export function numLeToBytes(val, bytes) {
88
93
  }
89
94
  /**
90
95
  * Converts a NumLike value to a byte array in big-endian order.
96
+ * @public
91
97
  *
92
98
  * @param val - The value to convert, which can be a string, number, bigint, or HexLike.
93
99
  * @param bytes - The number of bytes to use for the representation. If not provided, the exact number of bytes needed is used.
@@ -107,6 +113,7 @@ export function numBeToBytes(val, bytes) {
107
113
  }
108
114
  /**
109
115
  * Converts a byte array to a Num (bigint) assuming little-endian order.
116
+ * @public
110
117
  *
111
118
  * @param val - The byte array to convert.
112
119
  * @returns A Num (bigint) representing the numeric value.
@@ -121,6 +128,7 @@ export function numFromBytes(val) {
121
128
  }
122
129
  /**
123
130
  * Converts a byte array to a Num (bigint) assuming little-endian order.
131
+ * @public
124
132
  *
125
133
  * @param val - The byte array to convert.
126
134
  * @returns A Num (bigint) representing the numeric value.
@@ -135,6 +143,7 @@ export function numLeFromBytes(val) {
135
143
  }
136
144
  /**
137
145
  * Converts a byte array to a Num (bigint) assuming big-endian order.
146
+ * @public
138
147
  *
139
148
  * @param val - The byte array to convert.
140
149
  * @returns A Num (bigint) representing the numeric value.
package/dist/package.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
2
  "type": "module"
3
- }
3
+ }
@@ -6,6 +6,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
6
6
  * An abstract class extending the Signer class for Bitcoin-like signing operations.
7
7
  * This class provides methods to get Bitcoin account, public key, and internal address,
8
8
  * as well as signing transactions.
9
+ * @public
9
10
  */
10
11
  export declare abstract class SignerBtc extends Signer {
11
12
  get type(): SignerType;
@@ -1 +1 @@
1
- {"version":3,"file":"signerBtc.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtc.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;GAIG;AACH,8BAAsB,SAA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AAM,CAAC;IAI3C;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAIpC;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAa1C;;;;;OAKG;IACG,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAQvE;;;;;OAKG;IACG,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CA+BzE"}
@@ -11,6 +11,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
11
11
  * An abstract class extending the Signer class for Bitcoin-like signing operations.
12
12
  * This class provides methods to get Bitcoin account, public key, and internal address,
13
13
  * as well as signing transactions.
14
+ * @public
14
15
  */
15
16
  export class SignerBtc extends Signer {
16
17
  get type() {
@@ -4,6 +4,7 @@ import { SignerBtc } from "./signerBtc.js";
4
4
  /**
5
5
  * A class extending SignerBtc that provides read-only access to a Bitcoin public key and account.
6
6
  * This class does not support signing operations.
7
+ * @public
7
8
  */
8
9
  export declare class SignerBtcPublicKeyReadonly extends SignerBtc {
9
10
  private readonly account;
@@ -1 +1 @@
1
- {"version":3,"file":"signerBtcPublicKeyReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtcPublicKeyReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;GAGG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;IAYrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAM;IAEhC;;;;;;OAMG;gBAED,MAAM,EAAE,MAAM,EACG,OAAO,EAAE,MAAM,EAChC,SAAS,EAAE,OAAO;IAOpB;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;CAGtC"}
1
+ {"version":3,"file":"signerBtcPublicKeyReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/signerBtcPublicKeyReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;IAYrD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAM;IAEhC;;;;;;OAMG;gBAED,MAAM,EAAE,MAAM,EACG,OAAO,EAAE,MAAM,EAChC,SAAS,EAAE,OAAO;IAOpB;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAItC;;;;;;;;;OASG;IACG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;CAGtC"}
@@ -3,6 +3,7 @@ import { SignerBtc } from "./signerBtc.js";
3
3
  /**
4
4
  * A class extending SignerBtc that provides read-only access to a Bitcoin public key and account.
5
5
  * This class does not support signing operations.
6
+ * @public
6
7
  */
7
8
  export class SignerBtcPublicKeyReadonly extends SignerBtc {
8
9
  /**
@@ -1,3 +1,6 @@
1
1
  import { BytesLike } from "../../bytes/index.js";
2
+ /**
3
+ * @public
4
+ */
2
5
  export declare function verifyMessageBtcEcdsa(message: string | BytesLike, signature: string, publicKey: string): boolean;
3
6
  //# sourceMappingURL=verify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAG5D,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAOT"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/signer/btc/verify.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAG5D;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAOT"}
@@ -2,6 +2,9 @@ import { secp256k1 } from "@noble/curves/secp256k1";
2
2
  import { magicHash } from "bitcoinjs-message";
3
3
  import { bytesFrom } from "../../bytes/index.js";
4
4
  import { hexFrom } from "../../hex/index.js";
5
+ /**
6
+ * @public
7
+ */
5
8
  export function verifyMessageBtcEcdsa(message, signature, publicKey) {
6
9
  const challenge = typeof message === "string" ? message : hexFrom(message).slice(2);
7
10
  const [_, ...rawSign] = bytesFrom(signature, "base64");
@@ -3,6 +3,9 @@ import { Transaction, TransactionLike } from "../../ckb/index.js";
3
3
  import { Client } from "../../client/index.js";
4
4
  import { Hex, HexLike } from "../../hex/index.js";
5
5
  import { SignerCkbPublicKey } from "./signerCkbPublicKey.js";
6
+ /**
7
+ * @public
8
+ */
6
9
  export declare class SignerCkbPrivateKey extends SignerCkbPublicKey {
7
10
  readonly privateKey: Hex;
8
11
  constructor(client: Client, privateKey: HexLike);
@@ -1 +1 @@
1
- {"version":3,"file":"signerCkbPrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPrivateKey.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,SAAgB,UAAU,EAAE,GAAG,CAAC;gBAEpB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;IAUzC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAezE"}
1
+ {"version":3,"file":"signerCkbPrivateKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPrivateKey.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAe,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAW,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,SAAgB,UAAU,EAAE,GAAG,CAAC;gBAEpB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO;IAUzC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5C,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAIzD,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAezE"}
@@ -5,6 +5,9 @@ import { hexFrom } from "../../hex/index.js";
5
5
  import { numBeToBytes } from "../../num/index.js";
6
6
  import { SignerCkbPublicKey } from "./signerCkbPublicKey.js";
7
7
  import { messageHashCkbSecp256k1 } from "./verifyCkbSecp256k1.js";
8
+ /**
9
+ * @public
10
+ */
8
11
  export class SignerCkbPrivateKey extends SignerCkbPublicKey {
9
12
  constructor(client, privateKey) {
10
13
  const pk = hexFrom(privateKey);
@@ -3,6 +3,9 @@ import { Transaction, TransactionLike } from "../../ckb/index.js";
3
3
  import { Client } from "../../client/index.js";
4
4
  import { Hex, HexLike } from "../../hex/index.js";
5
5
  import { Signer, SignerSignType, SignerType } from "../signer/index.js";
6
+ /**
7
+ * @public
8
+ */
6
9
  export declare class SignerCkbPublicKey extends Signer {
7
10
  get type(): SignerType;
8
11
  get signType(): SignerSignType;
@@ -1 +1 @@
1
- {"version":3,"file":"signerCkbPublicKey.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbPublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAe,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAE,OAAO,EAAW,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE,qBAAa,kBAAmB,SAAQ,MAAM;IAC5C,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,CAAC;IAI9B,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAUpC,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;CAUxE"}
@@ -5,6 +5,9 @@ import { KnownScript } from "../../client/index.js";
5
5
  import { hashCkb } from "../../hasher/index.js";
6
6
  import { hexFrom } from "../../hex/index.js";
7
7
  import { Signer, SignerSignType, SignerType } from "../signer/index.js";
8
+ /**
9
+ * @public
10
+ */
8
11
  export class SignerCkbPublicKey extends Signer {
9
12
  get type() {
10
13
  return SignerType.CKB;
@@ -5,6 +5,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
5
5
  /**
6
6
  * A class extending Signer that provides read-only access to a CKB script.
7
7
  * This class does not support signing operations.
8
+ * @public
8
9
  */
9
10
  export declare class SignerCkbScriptReadonly extends Signer {
10
11
  get type(): SignerType;
@@ -1 +1 @@
1
- {"version":3,"file":"signerCkbScriptReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbScriptReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,MAAM;IACjD,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAM9C;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;;;;;;OASG;IAEG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAG3C"}
1
+ {"version":3,"file":"signerCkbScriptReadonly.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/signerCkbScriptReadonly.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExE;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,MAAM;IACjD,IAAI,IAAI,IAAI,UAAU,CAErB;IAED,IAAI,QAAQ,IAAI,cAAc,CAE7B;IAED,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;;;OAKG;gBACS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;IAM9C;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;;;;;OASG;IACG,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;;;;;;;OASG;IAEG,cAAc,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAG3C"}
@@ -4,6 +4,7 @@ import { Signer, SignerSignType, SignerType } from "../signer/index.js";
4
4
  /**
5
5
  * A class extending Signer that provides read-only access to a CKB script.
6
6
  * This class does not support signing operations.
7
+ * @public
7
8
  */
8
9
  export class SignerCkbScriptReadonly extends Signer {
9
10
  get type() {
@@ -1,5 +1,11 @@
1
1
  import { BytesLike } from "../../bytes/index.js";
2
2
  import { Hex } from "../../hex/index.js";
3
+ /**
4
+ * @public
5
+ */
3
6
  export declare function messageHashCkbSecp256k1(message: string | BytesLike): Hex;
7
+ /**
8
+ * @public
9
+ */
4
10
  export declare function verifyMessageCkbSecp256k1(message: string | BytesLike, signature: string, publicKey: string): boolean;
5
11
  //# sourceMappingURL=verifyCkbSecp256k1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifyCkbSecp256k1.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/verifyCkbSecp256k1.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAW,MAAM,oBAAoB,CAAC;AAGlD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAIxE;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAUT"}
1
+ {"version":3,"file":"verifyCkbSecp256k1.d.ts","sourceRoot":"","sources":["../../../src/signer/ckb/verifyCkbSecp256k1.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAW,MAAM,oBAAoB,CAAC;AAGlD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,GAAG,CAIxE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAUT"}
@@ -3,11 +3,17 @@ import { bytesFrom } from "../../bytes/index.js";
3
3
  import { hashCkb } from "../../hasher/index.js";
4
4
  import { hexFrom } from "../../hex/index.js";
5
5
  import { numFrom } from "../../num/index.js";
6
+ /**
7
+ * @public
8
+ */
6
9
  export function messageHashCkbSecp256k1(message) {
7
10
  const msg = typeof message === "string" ? message : hexFrom(message);
8
11
  const buffer = bytesFrom(`Nervos Message:${msg}`, "utf8");
9
12
  return hashCkb(buffer);
10
13
  }
14
+ /**
15
+ * @public
16
+ */
11
17
  export function verifyMessageCkbSecp256k1(message, signature, publicKey) {
12
18
  const signatureBytes = bytesFrom(signature);
13
19
  return secp256k1.verify(new secp256k1.Signature(numFrom(signatureBytes.slice(0, 32)), numFrom(signatureBytes.slice(32, 64))).addRecoveryBit(Number(numFrom(signatureBytes.slice(64, 65)))), bytesFrom(messageHashCkbSecp256k1(message)), bytesFrom(publicKey));