@laceio/sdk 0.1.1-canary.2 → 0.1.1

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 (386) hide show
  1. package/dist/{TransactionBuilder-CCjOn7NA.cjs → TransactionBuilder-DrB3NVTi.cjs} +0 -42
  2. package/dist/{TransactionBuilder-CIzdw18M.js → TransactionBuilder-V6aLx4SV.js} +1 -1
  3. package/dist/{_polyfill-buffer-patch-CM8X7JiY.cjs → _polyfill-buffer-patch-BnPVerlG.cjs} +2 -21
  4. package/dist/account-guards.stable-B1DSSh9D.cjs +10 -0
  5. package/dist/account-guards.stable-JRQ5qx2V.js +5 -0
  6. package/dist/{activity-type-Ch6ljxBy.cjs → activity-type.stable-BJEfeLxL.cjs} +1 -2
  7. package/dist/{activity-type-GsJGWs-3.js → activity-type.stable-C76_hWd7.js} +1 -2
  8. package/dist/{address-book-address-validator-ByIZOdO-.js → address-book-address-validator-DIUolI-s.js} +2 -2
  9. package/dist/{address-book-address-validator-BjOWerRE.cjs → address-book-address-validator-DNwQGlOB.cjs} +2 -2
  10. package/dist/bitcoin.cjs +0 -45
  11. package/dist/bitcoin.d.ts +1 -29782
  12. package/dist/bitcoin.js +0 -20
  13. package/dist/{blockfrost-tx-submit-provider-CLNQ5ycR.cjs → blockfrost-tx-submit-provider-BAIzV5o3.cjs} +167 -3
  14. package/dist/{blockfrost-tx-submit-provider-CBWQ0wK9.js → blockfrost-tx-submit-provider-DPTrapz-.js} +157 -5
  15. package/dist/{secret-box-DrjLZuS1.cjs → bytes.vo-Ck5u40RA.cjs} +35 -1
  16. package/dist/{secret-box-DUR0ACYz.js → bytes.vo-TgiwogWF.js} +25 -3
  17. package/dist/{cardano-network-id.vo-wfLiAxpY.js → cardano-network-id.vo-CK1tNQDg.js} +1 -1
  18. package/dist/{cardano-network-id.vo-BEvFd_74.cjs → cardano-network-id.vo-DSxrFk9S.cjs} +1 -1
  19. package/dist/cardano.cjs +18 -22
  20. package/dist/cardano.d.ts +3982 -18409
  21. package/dist/cardano.js +11 -16
  22. package/dist/codecs-B7X9pAsK.cjs +1945 -0
  23. package/dist/codecs-CC1Xjntz.js +1882 -0
  24. package/dist/{const-oMF-TLow.cjs → const-BDEg2Trq.cjs} +4 -4
  25. package/dist/{const-iwzZEE_w.cjs → const-BY8B3_0_.cjs} +1 -1
  26. package/dist/{const-CBGn60yu.js → const-C84qHkjp.js} +4 -4
  27. package/dist/{const-CjmfjBP3.js → const-DXk2tFyv.js} +1 -1
  28. package/dist/{delegation-tx-builder-BR6bt1fE.js → delegation-tx-builder-CGVqlaFE.js} +5 -5
  29. package/dist/{delegation-tx-builder-DVwGfiV0.cjs → delegation-tx-builder-CRpLP6jH.cjs} +6 -6
  30. package/dist/{deregistration-tx-builder-BhJRGj1M.js → deregistration-tx-builder-B-CrUyX6.js} +5 -5
  31. package/dist/{deregistration-tx-builder-Cv_09HGf.cjs → deregistration-tx-builder-DZGwB4cz.cjs} +6 -6
  32. package/dist/{earn-rewards-tx-builder-RYzKsZ6-.js → earn-rewards-tx-builder-BDbTDZmD.js} +5 -5
  33. package/dist/{earn-rewards-tx-builder-52gJiJYa.cjs → earn-rewards-tx-builder-D5sUT5v8.cjs} +6 -6
  34. package/dist/{group-cardano-addresses-by-account-D06r7daZ.cjs → group-cardano-addresses-by-account-B533oVXR.cjs} +35 -19
  35. package/dist/{group-cardano-addresses-by-account-CxCqFDrX.js → group-cardano-addresses-by-account-RHKoEskR.js} +35 -19
  36. package/dist/{guarded-transaction-signer-BhnTBjf6.cjs → guarded-transaction-signer-Bxl6_XNd.cjs} +18 -17
  37. package/dist/{guarded-transaction-signer-BSEx83R-.js → guarded-transaction-signer-CpKLj8Kp.js} +15 -8
  38. package/dist/{in-memory-wallet-integration-CH4rcg92.cjs → in-memory-wallet-integration-CnLYeX4-.cjs} +108 -17
  39. package/dist/{in-memory-wallet-integration-BKu985Jz.js → in-memory-wallet-integration-Croiuopx.js} +104 -7
  40. package/dist/{in-memory-wallet-integration-B0blZBxM.js → in-memory-wallet-integration-D-qn65Kx.js} +2 -5
  41. package/dist/{in-memory-wallet-integration-CwPCDMIe.cjs → in-memory-wallet-integration-DVh9sRXa.cjs} +2 -3
  42. package/dist/index.cjs +47 -84
  43. package/dist/index.d.ts +13618 -40268
  44. package/dist/index.js +24 -52
  45. package/dist/{init-DUF4ar8P.cjs → init-B64zCLxG.cjs} +4 -4
  46. package/dist/{init-Y3mkB4XS.js → init-BAJJzBza.js} +2 -2
  47. package/dist/{init-BTzOjA8x.cjs → init-BJVU54pI.cjs} +1 -1
  48. package/dist/{init-D6BxBs7e.cjs → init-BKhH6mVR.cjs} +1 -1
  49. package/dist/{init-EP0CUWNK.cjs → init-BsCBAGWf.cjs} +2 -2
  50. package/dist/{init-Dy-05ktr.cjs → init-BtzMZ7Pk.cjs} +1 -1
  51. package/dist/init-Bv53hpLM.js +19 -0
  52. package/dist/{init-BopV9ed4.cjs → init-C-jErzp5.cjs} +2 -2
  53. package/dist/{init-CjT-WZcW.cjs → init-C4Bkib9u.cjs} +59 -49
  54. package/dist/{init-BEjCRHxU.cjs → init-C7IeJwQR.cjs} +61 -258
  55. package/dist/{init-C-G32J12.cjs → init-CB__aLD7.cjs} +2 -2
  56. package/dist/{init-CyAY4Lzl.js → init-CFYsq82V.js} +1 -1
  57. package/dist/{init-0zzs9aqU.js → init-CLHuAMB-.js} +4 -4
  58. package/dist/{init-DA7zmptx.js → init-CNLGJJRx.js} +1 -1
  59. package/dist/{init-B-YE57gg.js → init-CR6tpw1B.js} +33 -25
  60. package/dist/init-CRbjI7p1.js +3494 -0
  61. package/dist/{init-CSDpdu0Q.cjs → init-CSHwHnfg.cjs} +2 -2
  62. package/dist/{init-CNM5m7M2.js → init-Cg9XdAru.js} +4 -4
  63. package/dist/{init-B3-1ghyx.js → init-CigestoM.js} +2 -2
  64. package/dist/{init-Dv3zKj0r.cjs → init-D6DBUsD3.cjs} +4 -4
  65. package/dist/init-DAna1KCg.cjs +3495 -0
  66. package/dist/{init-D74mn8nH2.js → init-DDdhguVC.js} +2 -2
  67. package/dist/init-DGe47B22.cjs +364 -0
  68. package/dist/init-DMtyvYfC.cjs +21 -0
  69. package/dist/{init-BrdVzxei.cjs → init-DX4WyB0R.cjs} +3 -3
  70. package/dist/{init-C8URA2OX.js → init-DcYY6zMD.js} +1 -1
  71. package/dist/{init-DFMiP2ZH.cjs → init-DkIc5nqF.cjs} +1 -1
  72. package/dist/{init-vqxOQNZi.js → init-Dku4b2lG.js} +1 -1
  73. package/dist/{init-NdhG_VrF.cjs → init-DxUHsN53.cjs} +6 -6
  74. package/dist/{init-COMH3Hfo.js → init-FMGDET-9.js} +60 -259
  75. package/dist/{init-DrkOb-wd.cjs → init-LfyMo-sS.cjs} +2 -2
  76. package/dist/{init-NCjgwCZy.js → init-Rxohwpmu.js} +2 -2
  77. package/dist/init-TkPDD750.js +363 -0
  78. package/dist/{init-C2RgrfZe.js → init-TkPq_Ny_.js} +1 -1
  79. package/dist/{init-5KcGcBb5.cjs → init-U8c9yHYx.cjs} +1 -1
  80. package/dist/{init-CX0AMQUn.js → init-aJHl-7AO.js} +2 -2
  81. package/dist/{init-rmt7-fQE.cjs → init-anYu6XB7.cjs} +2 -2
  82. package/dist/{init-Fw89ZmrR.js → init-w9GEs73W.js} +2 -2
  83. package/dist/{init-Dnsv155v.js → init-y2Ra0vZP.js} +3 -3
  84. package/dist/{init-DFjT8YvT.js → init-zSzCjoor.js} +4 -4
  85. package/dist/{is-retriable-error-BUiVJDwH.js → is-retriable-error-BU0e3hVI.js} +1 -1
  86. package/dist/{is-retriable-error-Dpt860if.cjs → is-retriable-error-CeeuHqDa.cjs} +1 -1
  87. package/dist/{lace-context-BZciB9c7.js → lace-context-CZcNHr4M.js} +4 -4
  88. package/dist/{lace-context-DgR6vLli.cjs → lace-context-fJTDghdp.cjs} +4 -4
  89. package/dist/{libsodium-wrappers-BhbOA8dQ.js → libsodium-wrappers-UH0LaOUE.js} +1647 -3
  90. package/dist/modules-cardano-BDvuL4Xx.js +5248 -0
  91. package/dist/modules-cardano-D2G3De2P.cjs +5432 -0
  92. package/dist/{retry-config-Dmgt28wM.js → retry-config-BcUmMS--.js} +1 -1
  93. package/dist/{retry-config-BaCfVC1H.cjs → retry-config-DC5IMaH7.cjs} +1 -1
  94. package/dist/{seam-cardano-B_etH4F4.js → seam-cardano-CATqBEyK.js} +1 -1
  95. package/dist/{signer-factory-B7PMe3lQ.js → signer-factory-9URFliA5.js} +3 -6
  96. package/dist/{signer-factory-DduwpsQj.cjs → signer-factory-BWGUmnvm.cjs} +3 -4
  97. package/dist/{slice-CqVNnz-j.js → slice-B2PhoWAg.js} +125 -316
  98. package/dist/{slice-DyNs7oWp.js → slice-BNu73oBa.js} +2 -2
  99. package/dist/{slice-GwiiJRoq.js → slice-CB4SnzMm.js} +3 -3
  100. package/dist/slice-CGVHXHDt.cjs +125 -0
  101. package/dist/{slice-CU80pbiu.js → slice-CnyWevM9.js} +3 -3
  102. package/dist/{slice-CwyYrh1H.js → slice-CobanYgn.js} +2 -2
  103. package/dist/{slice-7G2xxYKJ.cjs → slice-CuHUaPZx.cjs} +3 -3
  104. package/dist/{slice-DayJvMRD.cjs → slice-D11m2EKl.cjs} +1 -1
  105. package/dist/{slice-Bg6HEr3K.cjs → slice-DGcNrbPR.cjs} +4 -4
  106. package/dist/{slice-B4CdYoPu.cjs → slice-DZmQJNV8.cjs} +2 -2
  107. package/dist/slice-DhvF7L6X.js +107 -0
  108. package/dist/{slice-C9TT5KhY.cjs → slice-Do2R2CYW.cjs} +6 -6
  109. package/dist/{slice-Bs2aMERu.cjs → slice-DtaO72qY.cjs} +3 -3
  110. package/dist/{slice-C34iOOUH.cjs → slice-HeHCv3bl.cjs} +7 -7
  111. package/dist/{slice-D-9aPKG-.js → slice-d0p6-xj5.js} +6 -6
  112. package/dist/{slice-CK07EBCo.js → slice-eIwcwKHI.js} +4 -4
  113. package/dist/{slice-DBpJ2QGf.js → slice-maaskdUn.js} +6 -6
  114. package/dist/{slice-6sP0Qs5V.cjs → slice-mxLQ_FeY.cjs} +127 -343
  115. package/dist/{slice-DnG-yvpI.cjs → slice-oqm_r1cS.cjs} +2 -2
  116. package/dist/{slice-Da426sf9.js → slice-zJ9XVYjZ.js} +1 -1
  117. package/dist/{sync-operation-utils-KT5Y9yFK.js → sync-operation-utils-BYXLO80m.js} +52 -1
  118. package/dist/{sync-operation-utils-C9kcmjKH.cjs → sync-operation-utils-SdPbwFoD.cjs} +87 -0
  119. package/dist/{token-id-mapper-qx7XfH0b.js → token-id-mapper-B2ivlLv3.js} +2 -2
  120. package/dist/{token-id-mapper-IApjwuJb.cjs → token-id-mapper-DsPAL6Nh.cjs} +2 -2
  121. package/dist/{util-D1e0skzp.js → util-BaLzwa32.js} +1 -1
  122. package/dist/{util-BeG7WXzM.cjs → util-CGzqQ8IV.cjs} +1 -1
  123. package/dist/{utils-DsElZgCI.cjs → utils-5JvjbqH3.cjs} +1 -7
  124. package/dist/{utils-BfBEUvWA.js → utils-o8aMjfln.js} +2 -2
  125. package/dist/{vote-delegation-tx-builder-CtdIgaIt.cjs → vote-delegation-tx-builder-BpEMSti4.cjs} +6 -6
  126. package/dist/{vote-delegation-tx-builder-CQjGvVNZ.js → vote-delegation-tx-builder-CmKv6GoG.js} +5 -5
  127. package/package.json +4 -96
  128. package/dist/_polyfill-buffer-patch-yNxN4d5E.js +0 -1467
  129. package/dist/_web-crypto-random-bytes-Bo-GTcRS.js +0 -197
  130. package/dist/acc-module-4iIUv6My.cjs +0 -27654
  131. package/dist/acc-module-Cmj8EsIb.js +0 -27624
  132. package/dist/account-BlYkEmcs.cjs +0 -11
  133. package/dist/account-DVX0F5_M.js +0 -6
  134. package/dist/account-call-D68oF6bh.js +0 -267
  135. package/dist/account-call-DIIa2rK_.cjs +0 -314
  136. package/dist/account-call-NgLhYein.cjs +0 -4
  137. package/dist/account-call-n-Nkp35e.js +0 -3
  138. package/dist/account-guards-BtjTGxDZ.cjs +0 -42
  139. package/dist/account-guards-D9Lu5T3W.js +0 -36
  140. package/dist/account-tokens-CtN2BaFy.js +0 -16
  141. package/dist/account-tokens-DXr8DlpW.cjs +0 -21
  142. package/dist/address-B9ntKL8K.js +0 -13761
  143. package/dist/address-BXp-mY8H.cjs +0 -11270
  144. package/dist/address-book-address-validator-DK0dnsRS.cjs +0 -41
  145. package/dist/address-book-address-validator-Di_ywo8M.js +0 -39
  146. package/dist/artefact-loader-54uK5RAa.js +0 -160
  147. package/dist/artefact-loader-DZPYrq-6.cjs +0 -183
  148. package/dist/auto-dismiss-failure-on-success-C-qoJuid.cjs +0 -37
  149. package/dist/auto-dismiss-failure-on-success-s8MGDEIu.js +0 -31
  150. package/dist/bip32-D6wd_QMn.cjs +0 -3851
  151. package/dist/bitcoin-data-provider-BYPSmuZS.js +0 -21
  152. package/dist/bitcoin-data-provider-w1oEDSU3.cjs +0 -26
  153. package/dist/bn-d3nSOIf7.cjs +0 -2553
  154. package/dist/browser-B1eMbDwh.js +0 -7468
  155. package/dist/bytes.vo-BB7_4JK6.js +0 -23
  156. package/dist/bytes.vo-BNRquqaO.cjs +0 -34
  157. package/dist/cardano-DfPwhwm-.js +0 -3
  158. package/dist/client-DXBLHk7K.cjs +0 -808
  159. package/dist/codecs-Cswkg7Tm.cjs +0 -4051
  160. package/dist/codecs-Dc1Krpbt.js +0 -3903
  161. package/dist/const-BfEnY8fg.js +0 -153
  162. package/dist/const-BhYOdznB.cjs +0 -42
  163. package/dist/const-CUnCl5U0.js +0 -13
  164. package/dist/const-DLrX5SD9.cjs +0 -31995
  165. package/dist/contract-C_CBwwiC.cjs +0 -189
  166. package/dist/contract-s_x-9-lz.js +0 -171
  167. package/dist/create-add-accounts-Brqk84vF.js +0 -102
  168. package/dist/create-add-accounts-DzXIh7Ot.cjs +0 -114
  169. package/dist/device-commitment-hex.vo-5wFtQvDS.js +0 -26
  170. package/dist/device-commitment-hex.vo-CT3RmAug.cjs +0 -31
  171. package/dist/device-readers-70i7tQqU.cjs +0 -8
  172. package/dist/device-readers-B7--ezKM.js +0 -4
  173. package/dist/device-readers-BWOmz9eD.js +0 -145
  174. package/dist/device-readers-CIgYZN7f.cjs +0 -168
  175. package/dist/dist-BMi5ZjEq.cjs +0 -43175
  176. package/dist/dist-BtIq4XFn.cjs +0 -535
  177. package/dist/dist-C3SHC_Ho.cjs +0 -1394
  178. package/dist/dist-CykEjYEX.cjs +0 -3814
  179. package/dist/dist-Dcsxh3be.cjs +0 -3452
  180. package/dist/dist-DqJfSlTd.cjs +0 -4413
  181. package/dist/dist-nTZ70qj7.cjs +0 -1306
  182. package/dist/enc-key-circuits-C8fGAMEF.cjs +0 -24
  183. package/dist/enc-key-circuits-DA2Xs3vZ.js +0 -13
  184. package/dist/english-Byb9M0E_.cjs +0 -2057
  185. package/dist/envelopes-BkH1Qdxk.js +0 -1620
  186. package/dist/envelopes-ETZEJS_O.cjs +0 -1721
  187. package/dist/errors-BZ8hnhCM.cjs +0 -584
  188. package/dist/errors-DIJTAsLa.js +0 -392
  189. package/dist/esm-HBSUQw3w.js +0 -384
  190. package/dist/esm-LZuaZjMf.cjs +0 -389
  191. package/dist/experimental.cjs +0 -7073
  192. package/dist/experimental.d.ts +0 -84347
  193. package/dist/experimental.js +0 -6915
  194. package/dist/gated-call-Boy6rXdC.js +0 -3
  195. package/dist/gated-call-DJWY299W.cjs +0 -736
  196. package/dist/gated-call-DjoRPqn1.js +0 -695
  197. package/dist/gated-call-SomdJ5nj.cjs +0 -4
  198. package/dist/grant-circuits-_1x--moV.cjs +0 -49
  199. package/dist/grant-circuits-swuzEdUl.js +0 -26
  200. package/dist/grant-rules-7Zqi_3BN.cjs +0 -7114
  201. package/dist/grant-rules-_xJHAT2M.js +0 -6833
  202. package/dist/grant-status-B2y49iIu.js +0 -2688
  203. package/dist/grant-status-DOr3t_u8.cjs +0 -2820
  204. package/dist/grants--b0LQQzZ.cjs +0 -266
  205. package/dist/grants-BIs6qm3b.js +0 -213
  206. package/dist/grants-CSgfYlOO.js +0 -5
  207. package/dist/grants-D61131nK.cjs +0 -17
  208. package/dist/hex-D9ITYbwt.cjs +0 -263
  209. package/dist/hex-mkXcV3pN.js +0 -191
  210. package/dist/http-client-B3N-TMxu.cjs +0 -167
  211. package/dist/http-client-TRlhDZGh.js +0 -155
  212. package/dist/identity-BMLuufva.cjs +0 -263
  213. package/dist/identity-DII6f-h7.js +0 -233
  214. package/dist/in-memory-wallet-integration-B2xzxORj.cjs +0 -20741
  215. package/dist/in-memory-wallet-integration-CUKesGG1.js +0 -130
  216. package/dist/in-memory-wallet-integration-CoPx69lQ.cjs +0 -240
  217. package/dist/in-memory-wallet-integration-TM9bBphA.js +0 -20738
  218. package/dist/init-B5X_sGj9.cjs +0 -6
  219. package/dist/init-BJn-8_hf.js +0 -141
  220. package/dist/init-Bp6yJk31.js +0 -1142
  221. package/dist/init-Bu4iXcTH.cjs +0 -34
  222. package/dist/init-C00gw1zi.js +0 -422
  223. package/dist/init-CIjZaQvL.js +0 -3584
  224. package/dist/init-CR7BfztQ.cjs +0 -18
  225. package/dist/init-Cp8EJGbm.js +0 -5
  226. package/dist/init-CpIadSUb.js +0 -33
  227. package/dist/init-D5UiYI12.cjs +0 -106
  228. package/dist/init-DAikR9qU.js +0 -1177
  229. package/dist/init-DGjXwWs2.cjs +0 -143
  230. package/dist/init-DHrCbpkW.cjs +0 -121
  231. package/dist/init-DU5yYX5u.js +0 -2374
  232. package/dist/init-DWvkFDkc.cjs +0 -1176
  233. package/dist/init-DY1unoGb.cjs +0 -1141
  234. package/dist/init-DlqJuHhl.js +0 -119
  235. package/dist/init-DuYENxci.js +0 -17
  236. package/dist/init-E7c40ddW.cjs +0 -3585
  237. package/dist/init-GsT2AEa4.cjs +0 -424
  238. package/dist/init-KQnIdm39.js +0 -104
  239. package/dist/init-ZjNDDC-T.cjs +0 -2375
  240. package/dist/jubjub-authoriser-BxE3oN2y.js +0 -86
  241. package/dist/jubjub-authoriser-C6SDEP9I.cjs +0 -87
  242. package/dist/key-source-5oUBFiC7.cjs +0 -583
  243. package/dist/key-source-B08HukZg.js +0 -2550
  244. package/dist/keyDerivation-D3k9XyHg.js +0 -4077
  245. package/dist/keyDerivation-u0nBA93T.cjs +0 -274
  246. package/dist/lib--iqvW4O_.js +0 -2354
  247. package/dist/lib-Yk6Upl5D.cjs +0 -2359
  248. package/dist/midnight-account-id.vo-0x9X-r3l.cjs +0 -10
  249. package/dist/midnight-account-id.vo-DjCAGcqc.js +0 -5
  250. package/dist/midnight-engine-DpemplKO.js +0 -5
  251. package/dist/midnight-engine-xU1wotne.cjs +0 -6
  252. package/dist/midnight-wallet-DIsAlSn6.js +0 -18
  253. package/dist/midnight-wallet-XTZc2li7.cjs +0 -24
  254. package/dist/midnight.cjs +0 -1406
  255. package/dist/midnight.d.ts +0 -28586
  256. package/dist/midnight.js +0 -1350
  257. package/dist/modules-cardano-CtWLntet.cjs +0 -1108
  258. package/dist/modules-cardano-D2dkeKHY.js +0 -995
  259. package/dist/node-relay-Cv0cNknM.js +0 -48
  260. package/dist/node-relay-DblH5fKv.cjs +0 -49
  261. package/dist/outputs-Bd2yZVjx.js +0 -720
  262. package/dist/outputs-CJoQBIA2.cjs +0 -990
  263. package/dist/pbkdf2-CIW-oWrm.cjs +0 -1337
  264. package/dist/pending-operation-B0_P78Jo.cjs +0 -26
  265. package/dist/pending-operation-BIS6mpjB.js +0 -21
  266. package/dist/providers-BLgJ0uQs.cjs +0 -366
  267. package/dist/providers-CwnT4vEE.js +0 -343
  268. package/dist/redacted-BmE2aXqr.js +0 -81
  269. package/dist/redacted-CRZJLS3w.cjs +0 -86
  270. package/dist/safe-buffer-B_vMqJWU.js +0 -43
  271. package/dist/safe-buffer-DYOwEfHB.cjs +0 -48
  272. package/dist/sdk-DIcjlgLF.js +0 -1241
  273. package/dist/sdk-Dgal10kG.cjs +0 -1439
  274. package/dist/sdk-init-BKkqFtWZ.cjs +0 -3791
  275. package/dist/sdk-init-DNd-oQXp.js +0 -1044
  276. package/dist/send-proof-progress-DTK3ZuYB.js +0 -22
  277. package/dist/send-proof-progress-dDoqIohG.cjs +0 -33
  278. package/dist/side-effects-BnqYz7Nl.js +0 -768
  279. package/dist/side-effects-CngaeXi0.cjs +0 -804
  280. package/dist/sign-bitcoin-transaction-with-seed-D4z62-jV.js +0 -147
  281. package/dist/sign-bitcoin-transaction-with-seed-DsLYXnCY.cjs +0 -158
  282. package/dist/signer-3fk8lZtE.cjs +0 -7
  283. package/dist/signer-CsL28DrK.cjs +0 -121
  284. package/dist/signer-DGluibtn.js +0 -92
  285. package/dist/signer-RqB5pu3K.js +0 -2
  286. package/dist/signer-factory-BA7WFJVZ.js +0 -282
  287. package/dist/signer-factory-CORIG4Yl.cjs +0 -130
  288. package/dist/signer-factory-Cd2TwD50.js +0 -129
  289. package/dist/signer-factory-Cwd6o-lG.cjs +0 -281
  290. package/dist/slice-BOyAAaj0.cjs +0 -378
  291. package/dist/slice-BnTJeMOb.js +0 -354
  292. package/dist/slice-C4uXUT7S.js +0 -9013
  293. package/dist/slice-CxKWDuBP.js +0 -87
  294. package/dist/slice-DQv_RhsI.cjs +0 -9031
  295. package/dist/slice-HjLXJyQG2.cjs +0 -105
  296. package/dist/src-BDzYIksE.cjs +0 -20637
  297. package/dist/src-BFoefPv_.js +0 -20755
  298. package/dist/store-B1Lq3cEf.cjs +0 -66
  299. package/dist/store-DuBG8qh5.js +0 -37
  300. package/dist/submit-BBYjnZu8.cjs +0 -87
  301. package/dist/submit-D_yxYM_T.js +0 -70
  302. package/dist/submit-bitcoin-tx-BkZIeF4b.js +0 -983
  303. package/dist/submit-bitcoin-tx-DZNQgihl.cjs +0 -1049
  304. package/dist/token-id-mapper-Bnds3xKH.cjs +0 -18
  305. package/dist/token-id-mapper-CnKHQ8DV.js +0 -16
  306. package/dist/tokens-Cevp7rdU.cjs +0 -62
  307. package/dist/tokens-Diw4MLRM.js +0 -44
  308. package/dist/types-B8uiJn-X.js +0 -12
  309. package/dist/types-CJT6XF2c.js +0 -10
  310. package/dist/types-CLRUYpfe.cjs +0 -23
  311. package/dist/types-DWbVZpnF.cjs +0 -15
  312. package/dist/types-T0cjaR75.js +0 -33
  313. package/dist/types-Zj78LtYu.cjs +0 -50
  314. package/dist/unwrap-provider-result-BZSiwabU.js +0 -32
  315. package/dist/unwrap-provider-result-ZqfBsTkk.cjs +0 -39
  316. package/dist/utils-BfMdr_1w.cjs +0 -112
  317. package/dist/utils-CvAW5Yw7.js +0 -65
  318. package/dist/v8Signatures-CO_Uloy7.cjs +0 -71
  319. package/dist/watch-Cz1J42um.cjs +0 -52205
  320. package/dist/watch-Z53L4yoK.js +0 -13054
  321. /package/dist/{account-id.vo-DwqFjK5u.cjs → account-id.vo-LvCBVn5r.cjs} +0 -0
  322. /package/dist/{account-id.vo-OPz2v-JZ.js → account-id.vo-MYSI7YFm.js} +0 -0
  323. /package/dist/{actions-iLXdgL5Y.js → actions-9QSQR-GB.js} +0 -0
  324. /package/dist/{actions-B2BJ4RTy.cjs → actions-DdGbj7c7.cjs} +0 -0
  325. /package/dist/{apply-vkey-witnesses-ZnFS0jnJ.cjs → apply-vkey-witnesses-CLzVSWxl.cjs} +0 -0
  326. /package/dist/{apply-vkey-witnesses-BKx3lcs0.js → apply-vkey-witnesses-ClZbpk5w.js} +0 -0
  327. /package/dist/{asyncoption-CruEYOBI.js → asyncoption-Cw07zPH7.js} +0 -0
  328. /package/dist/{asyncoption-i0VbqVTq.cjs → asyncoption-DYoGuQfP.cjs} +0 -0
  329. /package/dist/{bignum.vo-CEXOIew0.js → bignum.vo-B0rK_PQ1.js} +0 -0
  330. /package/dist/{bignum.vo-hx2kuqlA.cjs → bignum.vo-DsG3kNiZ.cjs} +0 -0
  331. /package/dist/{bip32ed25519-B7Yat217.cjs → bip32ed25519-1ApqeAZk.cjs} +0 -0
  332. /package/dist/{bip32ed25519-FQ8qvdcq.js → bip32ed25519-DetAdGwD.js} +0 -0
  333. /package/dist/{blake2b-DEeVUdKR.cjs → blake2b-B9tftbvG.cjs} +0 -0
  334. /package/dist/{blake2b-BiQTw3GC.js → blake2b-DOEVc57D.js} +0 -0
  335. /package/dist/{blockchain-network-id.vo-BAKEwGjG.cjs → blockchain-network-id.vo-BXpZhvvQ.cjs} +0 -0
  336. /package/dist/{blockchain-network-id.vo-CiVykuqG.js → blockchain-network-id.vo-DNRkuT5B.js} +0 -0
  337. /package/dist/{blockingWithLatestFrom-Cd8c8EPG.js → blockingWithLatestFrom-C5wp_uA-.js} +0 -0
  338. /package/dist/{blockingWithLatestFrom-D8kBPBMX.cjs → blockingWithLatestFrom-DY8OPg0w.cjs} +0 -0
  339. /package/dist/{cardano-network-id-to-network-type-C0ufJOyE.cjs → cardano-network-id-to-network-type-BDTF-HmK.cjs} +0 -0
  340. /package/dist/{cardano-network-id-to-network-type-BWwzeEtM.js → cardano-network-id-to-network-type-CrZfUcyP.js} +0 -0
  341. /package/dist/{cardano-tx-id.vo-D3ASTIMd.cjs → cardano-tx-id.vo-BPhV-AmZ.cjs} +0 -0
  342. /package/dist/{cardano-tx-id.vo-BXLo1b7Q.js → cardano-tx-id.vo-DF9NzZXk.js} +0 -0
  343. /package/dist/{composite-signer-factory-m5cVs9h_.cjs → composite-signer-factory-BpF1mIYA.cjs} +0 -0
  344. /package/dist/{composite-signer-factory-CR8YHA1y.js → composite-signer-factory-_46QsNBz.js} +0 -0
  345. /package/dist/{error-DIZOY2Lw.js → error-BCp9NkPi.js} +0 -0
  346. /package/dist/{error-Cb3EnD0u.cjs → error-CNIquqT5.cjs} +0 -0
  347. /package/dist/{esm-browser-MG97cre9.js → esm-browser-C93Q-EOI.js} +0 -0
  348. /package/dist/{esm-browser-bweqfBlL.cjs → esm-browser-DTc9IK3D.cjs} +0 -0
  349. /package/dist/{feature-flag-key.vo-RlfHL3hq.cjs → feature-flag-key.vo-BPz-ZAp6.cjs} +0 -0
  350. /package/dist/{feature-flag-key.vo-DN_-4-sG.js → feature-flag-key.vo-ofrB6ZVQ.js} +0 -0
  351. /package/dist/{first-state-of-status-unPynOuM.js → first-state-of-status-DQnMT3ya.js} +0 -0
  352. /package/dist/{first-state-of-status-CbT7hPa4.cjs → first-state-of-status-OROkXcRv.cjs} +0 -0
  353. /package/dist/{init-zUoRG_EC2.cjs → init-C5CEZ1m0.cjs} +0 -0
  354. /package/dist/{init-DHaMxHM1.js → init-CKipPE_c.js} +0 -0
  355. /package/dist/{init-Atisw4x2.cjs → init-DFQQ9dTW.cjs} +0 -0
  356. /package/dist/{init-829HRYcz.js → init-Es3wHW7D.js} +0 -0
  357. /package/dist/{init-BgNobbNq.cjs → init-IAk_CkGa.cjs} +0 -0
  358. /package/dist/{init-atCFur0v.js → init-cqN3uX2j.js} +0 -0
  359. /package/dist/{is-redux-persist-state-BCFnSm36.cjs → is-redux-persist-state-CTn3WZVh.cjs} +0 -0
  360. /package/dist/{is-redux-persist-state-yBfq0h_E.js → is-redux-persist-state-Cxcd0_bM.js} +0 -0
  361. /package/dist/{key-value-store--W3SrMaw.js → key-value-store-8cMzeNyG.js} +0 -0
  362. /package/dist/{key-value-store-C2Xt5Emp.cjs → key-value-store-DUAepXQf.cjs} +0 -0
  363. /package/dist/{repo-slice-RxFm0zDZ.js → repo-slice-DwyMhCR1.js} +0 -0
  364. /package/dist/{repo-slice-7X4AYYVm.cjs → repo-slice-WxetRhMY.cjs} +0 -0
  365. /package/dist/{reselect-CGoLzEPv.js → reselect-C06X06oX.js} +0 -0
  366. /package/dist/{reselect-Bd94u0K-.cjs → reselect-CRDqmQY9.cjs} +0 -0
  367. /package/dist/{serializable-BHdKIgk3.js → serializable-B8GahgE1.js} +0 -0
  368. /package/dist/{serializable-BxHkoPdk.cjs → serializable-CRdnFaLZ.cjs} +0 -0
  369. /package/dist/{slice-obCSLm1x.js → slice-B87b52iM.js} +0 -0
  370. /package/dist/{slice-Bk0Sv05J.js → slice-Be7hj4Iy.js} +0 -0
  371. /package/dist/{slice-BiRsDKOK.cjs → slice-D11FHQuQ.cjs} +0 -0
  372. /package/dist/{slice-Dqw1ecum.cjs → slice-FioKeHtA.cjs} +0 -0
  373. /package/dist/{src-Cqp0B2M_.cjs → src-BTPIvlDI.cjs} +0 -0
  374. /package/dist/{src-BlxEp6Mm.js → src-vq1wS9sZ.js} +0 -0
  375. /package/dist/{time.vo-D3wWRw9L.cjs → time.vo-CQ8pSXz2.cjs} +0 -0
  376. /package/dist/{time.vo-tNheinXm.js → time.vo-DkYYGYp6.js} +0 -0
  377. /package/dist/{toEmpty-8Zax1MPd.js → toEmpty-CgAl3097.js} +0 -0
  378. /package/dist/{toEmpty-CYAbupM4.cjs → toEmpty-DAMmNB5r.cjs} +0 -0
  379. /package/dist/{token-id.vo-DXv5uS9n.cjs → token-id.vo-BxG9TG0O.cjs} +0 -0
  380. /package/dist/{token-id.vo-Bvwhr3ZE.js → token-id.vo-ClsroxHO.js} +0 -0
  381. /package/dist/{util-CzeB3hfa.cjs → util-CmdAhheh.cjs} +0 -0
  382. /package/dist/{util-C8a4fA9p.js → util-DxzlYNS5.js} +0 -0
  383. /package/dist/{util-selector-BWPH68_l.cjs → util-selector-BcAncU4L.cjs} +0 -0
  384. /package/dist/{util-selector-BSTsxgne.js → util-selector-CcK-GAdE.js} +0 -0
  385. /package/dist/{while-active-B0lWy_6l.js → while-active-BpppWuCs.js} +0 -0
  386. /package/dist/{while-active-Dsowp0Fi.cjs → while-active-Dhc2LwOm.cjs} +0 -0
@@ -1,1394 +0,0 @@
1
- require("./rolldown-runtime-Br2OG8yv.cjs");
2
- const require_bip32 = require("./bip32-D6wd_QMn.cjs");
3
- const require_english = require("./english-Byb9M0E_.cjs");
4
- //#region ../../node_modules/@scure/bip39/node_modules/@noble/hashes/utils.js
5
- /**
6
- * Checks if something is Uint8Array. Be careful: nodejs Buffer will return true.
7
- * @param a - value to test
8
- * @returns `true` when the value is a Uint8Array-compatible view.
9
- * @example
10
- * Check whether a value is a Uint8Array-compatible view.
11
- * ```ts
12
- * isBytes(new Uint8Array([1, 2, 3]));
13
- * ```
14
- */
15
- function isBytes$1(a) {
16
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
17
- }
18
- /**
19
- * Asserts something is a non-negative integer.
20
- * @param n - number to validate
21
- * @param title - label included in thrown errors
22
- * @throws On wrong argument types. {@link TypeError}
23
- * @throws On wrong argument ranges or values. {@link RangeError}
24
- * @example
25
- * Validate a non-negative integer option.
26
- * ```ts
27
- * anumber(32, 'length');
28
- * ```
29
- */
30
- function anumber$1(n, title = "") {
31
- if (typeof n !== "number") {
32
- const prefix = title && `"${title}" `;
33
- throw new TypeError(`${prefix}expected number, got ${typeof n}`);
34
- }
35
- if (!Number.isSafeInteger(n) || n < 0) {
36
- const prefix = title && `"${title}" `;
37
- throw new RangeError(`${prefix}expected integer >= 0, got ${n}`);
38
- }
39
- }
40
- /**
41
- * Asserts something is Uint8Array.
42
- * @param value - value to validate
43
- * @param length - optional exact length constraint
44
- * @param title - label included in thrown errors
45
- * @returns The validated byte array.
46
- * @throws On wrong argument types. {@link TypeError}
47
- * @throws On wrong argument ranges or values. {@link RangeError}
48
- * @example
49
- * Validate that a value is a byte array.
50
- * ```ts
51
- * abytes(new Uint8Array([1, 2, 3]));
52
- * ```
53
- */
54
- function abytes$1(value, length, title = "") {
55
- const bytes = isBytes$1(value);
56
- const len = value?.length;
57
- const needsLen = length !== void 0;
58
- if (!bytes || needsLen && len !== length) {
59
- const prefix = title && `"${title}" `;
60
- const ofLen = needsLen ? ` of length ${length}` : "";
61
- const got = bytes ? `length=${len}` : `type=${typeof value}`;
62
- const message = prefix + "expected Uint8Array" + ofLen + ", got " + got;
63
- if (!bytes) throw new TypeError(message);
64
- throw new RangeError(message);
65
- }
66
- return value;
67
- }
68
- /**
69
- * Asserts a hash instance has not been destroyed or finished.
70
- * @param instance - hash instance to validate
71
- * @param checkFinished - whether to reject finalized instances
72
- * @throws If the hash instance has already been destroyed or finalized. {@link Error}
73
- * @example
74
- * Validate that a hash instance is still usable.
75
- * ```ts
76
- * import { aexists } from '@noble/hashes/utils.js';
77
- * import { sha256 } from '@noble/hashes/sha2.js';
78
- * const hash = sha256.create();
79
- * aexists(hash);
80
- * ```
81
- */
82
- function aexists(instance, checkFinished = true) {
83
- if (instance.destroyed) throw new Error("Hash instance has been destroyed");
84
- if (checkFinished && instance.finished) throw new Error("Hash#digest() has already been called");
85
- }
86
- /**
87
- * Asserts output is a sufficiently-sized byte array.
88
- * @param out - destination buffer
89
- * @param instance - hash instance providing output length
90
- * Oversized buffers are allowed; downstream code only promises to fill the first `outputLen` bytes.
91
- * @throws On wrong argument types. {@link TypeError}
92
- * @throws On wrong argument ranges or values. {@link RangeError}
93
- * @example
94
- * Validate a caller-provided digest buffer.
95
- * ```ts
96
- * import { aoutput } from '@noble/hashes/utils.js';
97
- * import { sha256 } from '@noble/hashes/sha2.js';
98
- * const hash = sha256.create();
99
- * aoutput(new Uint8Array(hash.outputLen), hash);
100
- * ```
101
- */
102
- function aoutput(out, instance) {
103
- abytes$1(out, void 0, "digestInto() output");
104
- const min = instance.outputLen;
105
- if (out.length < min) throw new RangeError("\"digestInto() output\" expected to be of length >=" + min);
106
- }
107
- /**
108
- * Zeroizes typed arrays in place. Warning: JS provides no guarantees.
109
- * @param arrays - arrays to overwrite with zeros
110
- * @example
111
- * Zeroize sensitive buffers in place.
112
- * ```ts
113
- * clean(new Uint8Array([1, 2, 3]));
114
- * ```
115
- */
116
- function clean(...arrays) {
117
- for (let i = 0; i < arrays.length; i++) arrays[i].fill(0);
118
- }
119
- /**
120
- * Creates a DataView for byte-level manipulation.
121
- * @param arr - source typed array
122
- * @returns DataView over the same buffer region.
123
- * @example
124
- * Create a DataView over an existing buffer.
125
- * ```ts
126
- * createView(new Uint8Array(4));
127
- * ```
128
- */
129
- function createView(arr) {
130
- return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
131
- }
132
- /**
133
- * Rotate-right operation for uint32 values.
134
- * @param word - source word
135
- * @param shift - shift amount in bits
136
- * @returns Rotated word.
137
- * @example
138
- * Rotate a 32-bit word to the right.
139
- * ```ts
140
- * rotr(0x12345678, 8);
141
- * ```
142
- */
143
- function rotr(word, shift) {
144
- return word << 32 - shift | word >>> shift;
145
- }
146
- new Uint8Array(new Uint32Array([287454020]).buffer)[0];
147
- typeof Uint8Array.from([]).toHex === "function" && Uint8Array.fromHex;
148
- /**
149
- * Creates a callable hash function from a stateful class constructor.
150
- * @param hashCons - hash constructor or factory
151
- * @param info - optional metadata such as DER OID
152
- * @returns Frozen callable hash wrapper with `.create()`.
153
- * Wrapper construction eagerly calls `hashCons(undefined)` once to read
154
- * `outputLen` / `blockLen`, so constructor side effects happen at module
155
- * init time.
156
- * @example
157
- * Wrap a stateful hash constructor into a callable helper.
158
- * ```ts
159
- * import { createHasher } from '@noble/hashes/utils.js';
160
- * import { sha256 } from '@noble/hashes/sha2.js';
161
- * const wrapped = createHasher(sha256.create, { oid: sha256.oid });
162
- * wrapped(new Uint8Array([1]));
163
- * ```
164
- */
165
- function createHasher(hashCons, info = {}) {
166
- const hashC = (msg, opts) => hashCons(opts).update(msg).digest();
167
- const tmp = hashCons(void 0);
168
- hashC.outputLen = tmp.outputLen;
169
- hashC.blockLen = tmp.blockLen;
170
- hashC.canXOF = tmp.canXOF;
171
- hashC.create = (opts) => hashCons(opts);
172
- Object.assign(hashC, info);
173
- return Object.freeze(hashC);
174
- }
175
- /**
176
- * Cryptographically secure PRNG backed by `crypto.getRandomValues`.
177
- * @param bytesLength - number of random bytes to generate
178
- * @returns Random bytes.
179
- * The platform `getRandomValues()` implementation still defines any
180
- * single-call length cap, and this helper rejects oversize requests
181
- * with a stable library `RangeError` instead of host-specific errors.
182
- * @throws On wrong argument types. {@link TypeError}
183
- * @throws On wrong argument ranges or values. {@link RangeError}
184
- * @throws If the current runtime does not provide `crypto.getRandomValues`. {@link Error}
185
- * @example
186
- * Generate a fresh random key or nonce.
187
- * ```ts
188
- * const key = randomBytes(16);
189
- * ```
190
- */
191
- function randomBytes(bytesLength = 32) {
192
- anumber$1(bytesLength, "bytesLength");
193
- const cr = typeof globalThis === "object" ? globalThis.crypto : null;
194
- if (typeof cr?.getRandomValues !== "function") throw new Error("crypto.getRandomValues must be defined");
195
- if (bytesLength > 65536) throw new RangeError(`"bytesLength" expected <= 65536, got ${bytesLength}`);
196
- return cr.getRandomValues(new Uint8Array(bytesLength));
197
- }
198
- /**
199
- * Creates OID metadata for NIST hashes with prefix `06 09 60 86 48 01 65 03 04 02`.
200
- * @param suffix - final OID byte for the selected hash.
201
- * The helper accepts any byte even though only the documented NIST hash
202
- * suffixes are meaningful downstream.
203
- * @returns Object containing the DER-encoded OID.
204
- * @example
205
- * Build OID metadata for a NIST hash.
206
- * ```ts
207
- * oidNist(0x01);
208
- * ```
209
- */
210
- const oidNist = (suffix) => ({ oid: Uint8Array.from([
211
- 6,
212
- 9,
213
- 96,
214
- 134,
215
- 72,
216
- 1,
217
- 101,
218
- 3,
219
- 4,
220
- 2,
221
- suffix
222
- ]) });
223
- //#endregion
224
- //#region ../../node_modules/@scure/bip39/node_modules/@noble/hashes/_md.js
225
- /**
226
- * Internal Merkle-Damgard hash utils.
227
- * @module
228
- */
229
- /**
230
- * Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.
231
- * Returns bits from `b` when `a` is set, otherwise from `c`.
232
- * The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never
233
- * set the same bit.
234
- * @param a - selector word
235
- * @param b - word chosen when selector bit is set
236
- * @param c - word chosen when selector bit is clear
237
- * @returns Mixed 32-bit word.
238
- * @example
239
- * Combine three words with the shared 32-bit choice primitive.
240
- * ```ts
241
- * Chi(0xffffffff, 0x12345678, 0x87654321);
242
- * ```
243
- */
244
- function Chi(a, b, c) {
245
- return a & b ^ ~a & c;
246
- }
247
- /**
248
- * Shared 32-bit majority primitive reused by SHA-256 and SHA-1.
249
- * Returns bits shared by at least two inputs.
250
- * @param a - first input word
251
- * @param b - second input word
252
- * @param c - third input word
253
- * @returns Mixed 32-bit word.
254
- * @example
255
- * Combine three words with the shared 32-bit majority primitive.
256
- * ```ts
257
- * Maj(0xffffffff, 0x12345678, 0x87654321);
258
- * ```
259
- */
260
- function Maj(a, b, c) {
261
- return a & b ^ a & c ^ b & c;
262
- }
263
- /**
264
- * Merkle-Damgard hash construction base class.
265
- * Could be used to create MD5, RIPEMD, SHA1, SHA2.
266
- * Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit
267
- * strings with partial-byte tails.
268
- * @param blockLen - internal block size in bytes
269
- * @param outputLen - digest size in bytes
270
- * @param padOffset - trailing length field size in bytes
271
- * @param isLE - whether length and state words are encoded in little-endian
272
- * @example
273
- * Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.
274
- * ```ts
275
- * import { _SHA1 } from '@noble/hashes/legacy.js';
276
- * const hash = new _SHA1();
277
- * hash.update(new Uint8Array([97, 98, 99]));
278
- * hash.digest();
279
- * ```
280
- */
281
- var HashMD = class {
282
- blockLen;
283
- outputLen;
284
- canXOF = false;
285
- padOffset;
286
- isLE;
287
- buffer;
288
- view;
289
- finished = false;
290
- length = 0;
291
- pos = 0;
292
- destroyed = false;
293
- constructor(blockLen, outputLen, padOffset, isLE) {
294
- this.blockLen = blockLen;
295
- this.outputLen = outputLen;
296
- this.padOffset = padOffset;
297
- this.isLE = isLE;
298
- this.buffer = new Uint8Array(blockLen);
299
- this.view = createView(this.buffer);
300
- }
301
- update(data) {
302
- aexists(this);
303
- abytes$1(data);
304
- const { view, buffer, blockLen } = this;
305
- const len = data.length;
306
- for (let pos = 0; pos < len;) {
307
- const take = Math.min(blockLen - this.pos, len - pos);
308
- if (take === blockLen) {
309
- const dataView = createView(data);
310
- for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
311
- continue;
312
- }
313
- buffer.set(data.subarray(pos, pos + take), this.pos);
314
- this.pos += take;
315
- pos += take;
316
- if (this.pos === blockLen) {
317
- this.process(view, 0);
318
- this.pos = 0;
319
- }
320
- }
321
- this.length += data.length;
322
- this.roundClean();
323
- return this;
324
- }
325
- digestInto(out) {
326
- aexists(this);
327
- aoutput(out, this);
328
- this.finished = true;
329
- const { buffer, view, blockLen, isLE } = this;
330
- let { pos } = this;
331
- buffer[pos++] = 128;
332
- clean(this.buffer.subarray(pos));
333
- if (this.padOffset > blockLen - pos) {
334
- this.process(view, 0);
335
- pos = 0;
336
- }
337
- for (let i = pos; i < blockLen; i++) buffer[i] = 0;
338
- view.setBigUint64(blockLen - 8, BigInt(this.length * 8), isLE);
339
- this.process(view, 0);
340
- const oview = createView(out);
341
- const len = this.outputLen;
342
- if (len % 4) throw new Error("_sha2: outputLen must be aligned to 32bit");
343
- const outLen = len / 4;
344
- const state = this.get();
345
- if (outLen > state.length) throw new Error("_sha2: outputLen bigger than state");
346
- for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
347
- }
348
- digest() {
349
- const { buffer, outputLen } = this;
350
- this.digestInto(buffer);
351
- const res = buffer.slice(0, outputLen);
352
- this.destroy();
353
- return res;
354
- }
355
- _cloneInto(to) {
356
- to ||= new this.constructor();
357
- to.set(...this.get());
358
- const { blockLen, buffer, length, finished, destroyed, pos } = this;
359
- to.destroyed = destroyed;
360
- to.finished = finished;
361
- to.length = length;
362
- to.pos = pos;
363
- if (length % blockLen) to.buffer.set(buffer);
364
- return to;
365
- }
366
- clone() {
367
- return this._cloneInto();
368
- }
369
- };
370
- /**
371
- * Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
372
- * Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
373
- */
374
- /** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the
375
- * square roots of the first eight prime numbers. Exported as a shared table; callers must treat
376
- * it as read-only because constructors copy words from it by index. */
377
- const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
378
- 1779033703,
379
- 3144134277,
380
- 1013904242,
381
- 2773480762,
382
- 1359893119,
383
- 2600822924,
384
- 528734635,
385
- 1541459225
386
- ]);
387
- //#endregion
388
- //#region ../../node_modules/@scure/bip39/node_modules/@noble/hashes/_u64.js
389
- const U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);
390
- const _32n = /* @__PURE__ */ BigInt(32);
391
- function fromBig(n, le = false) {
392
- if (le) return {
393
- h: Number(n & U32_MASK64),
394
- l: Number(n >> _32n & U32_MASK64)
395
- };
396
- return {
397
- h: Number(n >> _32n & U32_MASK64) | 0,
398
- l: Number(n & U32_MASK64) | 0
399
- };
400
- }
401
- function split(lst, le = false) {
402
- const len = lst.length;
403
- let Ah = new Uint32Array(len);
404
- let Al = new Uint32Array(len);
405
- for (let i = 0; i < len; i++) {
406
- const { h, l } = fromBig(lst[i], le);
407
- [Ah[i], Al[i]] = [h, l];
408
- }
409
- return [Ah, Al];
410
- }
411
- //#endregion
412
- //#region ../../node_modules/@scure/bip39/node_modules/@noble/hashes/sha2.js
413
- /**
414
- * SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
415
- * SHA256 is the fastest hash implementable in JS, even faster than Blake3.
416
- * Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and
417
- * {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.
418
- * @module
419
- */
420
- /**
421
- * SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits
422
- * of the cube roots of the first 64 primes (2..311).
423
- */
424
- const SHA256_K = /* @__PURE__ */ Uint32Array.from([
425
- 1116352408,
426
- 1899447441,
427
- 3049323471,
428
- 3921009573,
429
- 961987163,
430
- 1508970993,
431
- 2453635748,
432
- 2870763221,
433
- 3624381080,
434
- 310598401,
435
- 607225278,
436
- 1426881987,
437
- 1925078388,
438
- 2162078206,
439
- 2614888103,
440
- 3248222580,
441
- 3835390401,
442
- 4022224774,
443
- 264347078,
444
- 604807628,
445
- 770255983,
446
- 1249150122,
447
- 1555081692,
448
- 1996064986,
449
- 2554220882,
450
- 2821834349,
451
- 2952996808,
452
- 3210313671,
453
- 3336571891,
454
- 3584528711,
455
- 113926993,
456
- 338241895,
457
- 666307205,
458
- 773529912,
459
- 1294757372,
460
- 1396182291,
461
- 1695183700,
462
- 1986661051,
463
- 2177026350,
464
- 2456956037,
465
- 2730485921,
466
- 2820302411,
467
- 3259730800,
468
- 3345764771,
469
- 3516065817,
470
- 3600352804,
471
- 4094571909,
472
- 275423344,
473
- 430227734,
474
- 506948616,
475
- 659060556,
476
- 883997877,
477
- 958139571,
478
- 1322822218,
479
- 1537002063,
480
- 1747873779,
481
- 1955562222,
482
- 2024104815,
483
- 2227730452,
484
- 2361852424,
485
- 2428436474,
486
- 2756734187,
487
- 3204031479,
488
- 3329325298
489
- ]);
490
- /** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */
491
- const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
492
- /** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */
493
- var SHA2_32B = class extends HashMD {
494
- constructor(outputLen) {
495
- super(64, outputLen, 8, false);
496
- }
497
- get() {
498
- const { A, B, C, D, E, F, G, H } = this;
499
- return [
500
- A,
501
- B,
502
- C,
503
- D,
504
- E,
505
- F,
506
- G,
507
- H
508
- ];
509
- }
510
- set(A, B, C, D, E, F, G, H) {
511
- this.A = A | 0;
512
- this.B = B | 0;
513
- this.C = C | 0;
514
- this.D = D | 0;
515
- this.E = E | 0;
516
- this.F = F | 0;
517
- this.G = G | 0;
518
- this.H = H | 0;
519
- }
520
- process(view, offset) {
521
- for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
522
- for (let i = 16; i < 64; i++) {
523
- const W15 = SHA256_W[i - 15];
524
- const W2 = SHA256_W[i - 2];
525
- const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
526
- SHA256_W[i] = (rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10) + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
527
- }
528
- let { A, B, C, D, E, F, G, H } = this;
529
- for (let i = 0; i < 64; i++) {
530
- const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
531
- const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
532
- const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
533
- H = G;
534
- G = F;
535
- F = E;
536
- E = D + T1 | 0;
537
- D = C;
538
- C = B;
539
- B = A;
540
- A = T1 + T2 | 0;
541
- }
542
- A = A + this.A | 0;
543
- B = B + this.B | 0;
544
- C = C + this.C | 0;
545
- D = D + this.D | 0;
546
- E = E + this.E | 0;
547
- F = F + this.F | 0;
548
- G = G + this.G | 0;
549
- H = H + this.H | 0;
550
- this.set(A, B, C, D, E, F, G, H);
551
- }
552
- roundClean() {
553
- clean(SHA256_W);
554
- }
555
- destroy() {
556
- this.destroyed = true;
557
- this.set(0, 0, 0, 0, 0, 0, 0, 0);
558
- clean(this.buffer);
559
- }
560
- };
561
- /** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */
562
- var _SHA256 = class extends SHA2_32B {
563
- A = SHA256_IV[0] | 0;
564
- B = SHA256_IV[1] | 0;
565
- C = SHA256_IV[2] | 0;
566
- D = SHA256_IV[3] | 0;
567
- E = SHA256_IV[4] | 0;
568
- F = SHA256_IV[5] | 0;
569
- G = SHA256_IV[6] | 0;
570
- H = SHA256_IV[7] | 0;
571
- constructor() {
572
- super(32);
573
- }
574
- };
575
- const K512 = split([
576
- "0x428a2f98d728ae22",
577
- "0x7137449123ef65cd",
578
- "0xb5c0fbcfec4d3b2f",
579
- "0xe9b5dba58189dbbc",
580
- "0x3956c25bf348b538",
581
- "0x59f111f1b605d019",
582
- "0x923f82a4af194f9b",
583
- "0xab1c5ed5da6d8118",
584
- "0xd807aa98a3030242",
585
- "0x12835b0145706fbe",
586
- "0x243185be4ee4b28c",
587
- "0x550c7dc3d5ffb4e2",
588
- "0x72be5d74f27b896f",
589
- "0x80deb1fe3b1696b1",
590
- "0x9bdc06a725c71235",
591
- "0xc19bf174cf692694",
592
- "0xe49b69c19ef14ad2",
593
- "0xefbe4786384f25e3",
594
- "0x0fc19dc68b8cd5b5",
595
- "0x240ca1cc77ac9c65",
596
- "0x2de92c6f592b0275",
597
- "0x4a7484aa6ea6e483",
598
- "0x5cb0a9dcbd41fbd4",
599
- "0x76f988da831153b5",
600
- "0x983e5152ee66dfab",
601
- "0xa831c66d2db43210",
602
- "0xb00327c898fb213f",
603
- "0xbf597fc7beef0ee4",
604
- "0xc6e00bf33da88fc2",
605
- "0xd5a79147930aa725",
606
- "0x06ca6351e003826f",
607
- "0x142929670a0e6e70",
608
- "0x27b70a8546d22ffc",
609
- "0x2e1b21385c26c926",
610
- "0x4d2c6dfc5ac42aed",
611
- "0x53380d139d95b3df",
612
- "0x650a73548baf63de",
613
- "0x766a0abb3c77b2a8",
614
- "0x81c2c92e47edaee6",
615
- "0x92722c851482353b",
616
- "0xa2bfe8a14cf10364",
617
- "0xa81a664bbc423001",
618
- "0xc24b8b70d0f89791",
619
- "0xc76c51a30654be30",
620
- "0xd192e819d6ef5218",
621
- "0xd69906245565a910",
622
- "0xf40e35855771202a",
623
- "0x106aa07032bbd1b8",
624
- "0x19a4c116b8d2d0c8",
625
- "0x1e376c085141ab53",
626
- "0x2748774cdf8eeb99",
627
- "0x34b0bcb5e19b48a8",
628
- "0x391c0cb3c5c95a63",
629
- "0x4ed8aa4ae3418acb",
630
- "0x5b9cca4f7763e373",
631
- "0x682e6ff3d6b2b8a3",
632
- "0x748f82ee5defb2fc",
633
- "0x78a5636f43172f60",
634
- "0x84c87814a1f0ab72",
635
- "0x8cc702081a6439ec",
636
- "0x90befffa23631e28",
637
- "0xa4506cebde82bde9",
638
- "0xbef9a3f7b2c67915",
639
- "0xc67178f2e372532b",
640
- "0xca273eceea26619c",
641
- "0xd186b8c721c0c207",
642
- "0xeada7dd6cde0eb1e",
643
- "0xf57d4f7fee6ed178",
644
- "0x06f067aa72176fba",
645
- "0x0a637dc5a2c898a6",
646
- "0x113f9804bef90dae",
647
- "0x1b710b35131c471b",
648
- "0x28db77f523047d84",
649
- "0x32caab7b40c72493",
650
- "0x3c9ebe0a15c9bebc",
651
- "0x431d67c49c100d4c",
652
- "0x4cc5d4becb3e42b6",
653
- "0x597f299cfc657e2a",
654
- "0x5fcb6fab3ad6faec",
655
- "0x6c44198c4a475817"
656
- ].map((n) => BigInt(n)));
657
- K512[0];
658
- K512[1];
659
- /**
660
- * SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:
661
- *
662
- * - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.
663
- * - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
664
- * - Each sha256 hash is executing 2^18 bit operations.
665
- * - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.
666
- * @param msg - message bytes to hash
667
- * @returns Digest bytes.
668
- * @example
669
- * Hash a message with SHA2-256.
670
- * ```ts
671
- * sha256(new Uint8Array([97, 98, 99]));
672
- * ```
673
- */
674
- const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), /* @__PURE__ */ oidNist(1));
675
- //#endregion
676
- //#region ../../node_modules/@scure/bip39/node_modules/@scure/base/index.js
677
- /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
678
- function isBytes(a) {
679
- return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
680
- }
681
- function isArrayOf(isString, arr) {
682
- if (!Array.isArray(arr)) return false;
683
- if (arr.length === 0) return true;
684
- if (isString) return arr.every((item) => typeof item === "string");
685
- else return arr.every((item) => Number.isSafeInteger(item));
686
- }
687
- function afn(input) {
688
- if (typeof input !== "function") throw new TypeError("function expected");
689
- return true;
690
- }
691
- function astr(label, input) {
692
- if (typeof input !== "string") throw new TypeError(`${label}: string expected`);
693
- return true;
694
- }
695
- function anumber(n) {
696
- if (typeof n !== "number") throw new TypeError(`number expected, got ${typeof n}`);
697
- if (!Number.isSafeInteger(n)) throw new RangeError(`invalid integer: ${n}`);
698
- }
699
- function aArr(input) {
700
- if (!Array.isArray(input)) throw new TypeError("array expected");
701
- }
702
- function astrArr(label, input) {
703
- if (!isArrayOf(true, input)) throw new TypeError(`${label}: array of strings expected`);
704
- }
705
- function anumArr(label, input) {
706
- if (!isArrayOf(false, input)) throw new TypeError(`${label}: array of numbers expected`);
707
- }
708
- /**
709
- * @__NO_SIDE_EFFECTS__
710
- */
711
- function chain(...args) {
712
- const id = (a) => a;
713
- const wrap = (a, b) => (c) => a(b(c));
714
- return {
715
- encode: args.map((x) => x.encode).reduceRight(wrap, id),
716
- decode: args.map((x) => x.decode).reduce(wrap, id)
717
- };
718
- }
719
- /**
720
- * Encodes integer radix representation to array of strings using alphabet and back.
721
- * Could also be array of strings.
722
- * @__NO_SIDE_EFFECTS__
723
- */
724
- function alphabet(letters) {
725
- const lettersA = typeof letters === "string" ? letters.split("") : letters;
726
- const len = lettersA.length;
727
- astrArr("alphabet", lettersA);
728
- const indexes = new Map(lettersA.map((l, i) => [l, i]));
729
- return {
730
- encode: (digits) => {
731
- aArr(digits);
732
- return digits.map((i) => {
733
- if (!Number.isSafeInteger(i) || i < 0 || i >= len) throw new Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${letters}`);
734
- return lettersA[i];
735
- });
736
- },
737
- decode: (input) => {
738
- aArr(input);
739
- return input.map((letter) => {
740
- astr("alphabet.decode", letter);
741
- const i = indexes.get(letter);
742
- if (i === void 0) throw new Error(`Unknown letter: "${letter}". Allowed: ${letters}`);
743
- return i;
744
- });
745
- }
746
- };
747
- }
748
- /**
749
- * @__NO_SIDE_EFFECTS__
750
- */
751
- function join(separator = "") {
752
- astr("join", separator);
753
- return {
754
- encode: (from) => {
755
- astrArr("join.decode", from);
756
- return from.join(separator);
757
- },
758
- decode: (to) => {
759
- astr("join.decode", to);
760
- return to.split(separator);
761
- }
762
- };
763
- }
764
- /**
765
- * Pad strings array so it has integer number of bits
766
- * @__NO_SIDE_EFFECTS__
767
- */
768
- function padding(bits, chr = "=") {
769
- anumber(bits);
770
- astr("padding", chr);
771
- return {
772
- encode(data) {
773
- astrArr("padding.encode", data);
774
- while (data.length * bits % 8) data.push(chr);
775
- return data;
776
- },
777
- decode(input) {
778
- astrArr("padding.decode", input);
779
- let end = input.length;
780
- if (end * bits % 8) throw new Error("padding: invalid, string should have whole number of bytes");
781
- for (; end > 0 && input[end - 1] === chr; end--) if ((end - 1) * bits % 8 === 0) throw new Error("padding: invalid, string has too much padding");
782
- return input.slice(0, end);
783
- }
784
- };
785
- }
786
- /**
787
- * @__NO_SIDE_EFFECTS__
788
- */
789
- function normalize$1(fn) {
790
- afn(fn);
791
- return {
792
- encode: (from) => from,
793
- decode: (to) => fn(to)
794
- };
795
- }
796
- /**
797
- * Slow: O(n^2) time complexity
798
- */
799
- function convertRadix(data, from, to) {
800
- if (from < 2) throw new RangeError(`convertRadix: invalid from=${from}, base cannot be less than 2`);
801
- if (to < 2) throw new RangeError(`convertRadix: invalid to=${to}, base cannot be less than 2`);
802
- aArr(data);
803
- if (!data.length) return [];
804
- let pos = 0;
805
- const res = [];
806
- const digits = Array.from(data, (d) => {
807
- anumber(d);
808
- if (d < 0 || d >= from) throw new Error(`invalid integer: ${d}`);
809
- return d;
810
- });
811
- const dlen = digits.length;
812
- while (true) {
813
- let carry = 0;
814
- let done = true;
815
- for (let i = pos; i < dlen; i++) {
816
- const digit = digits[i];
817
- const fromCarry = from * carry;
818
- const digitBase = fromCarry + digit;
819
- if (!Number.isSafeInteger(digitBase) || fromCarry / from !== carry || digitBase - digit !== fromCarry) throw new Error("convertRadix: carry overflow");
820
- const div = digitBase / to;
821
- carry = digitBase % to;
822
- const rounded = Math.floor(div);
823
- digits[i] = rounded;
824
- if (!Number.isSafeInteger(rounded) || rounded * to + carry !== digitBase) throw new Error("convertRadix: carry overflow");
825
- if (!done) continue;
826
- else if (!rounded) pos = i;
827
- else done = false;
828
- }
829
- res.push(carry);
830
- if (done) break;
831
- }
832
- for (let i = 0; i < data.length - 1 && data[i] === 0; i++) res.push(0);
833
- return res.reverse();
834
- }
835
- const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
836
- const radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - gcd(from, to));
837
- const powers = /* @__PURE__ */ (() => {
838
- let res = [];
839
- for (let i = 0; i < 40; i++) res.push(2 ** i);
840
- return res;
841
- })();
842
- /**
843
- * Implemented with numbers, because BigInt is 5x slower
844
- */
845
- function convertRadix2(data, from, to, padding) {
846
- aArr(data);
847
- if (from <= 0 || from > 32) throw new RangeError(`convertRadix2: wrong from=${from}`);
848
- if (to <= 0 || to > 32) throw new RangeError(`convertRadix2: wrong to=${to}`);
849
- if (/* @__PURE__ */ radix2carry(from, to) > 32) throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${/* @__PURE__ */ radix2carry(from, to)}`);
850
- let carry = 0;
851
- let pos = 0;
852
- const max = powers[from];
853
- const mask = powers[to] - 1;
854
- const res = [];
855
- for (const n of data) {
856
- anumber(n);
857
- if (n >= max) throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);
858
- carry = carry << from | n;
859
- if (pos + from > 32) throw new Error(`convertRadix2: carry overflow pos=${pos} from=${from}`);
860
- pos += from;
861
- for (; pos >= to; pos -= to) res.push((carry >> pos - to & mask) >>> 0);
862
- const pow = powers[pos];
863
- if (pow === void 0) throw new Error("invalid carry");
864
- carry &= pow - 1;
865
- }
866
- carry = carry << to - pos & mask;
867
- if (!padding && pos >= from) throw new Error("Excess padding");
868
- if (!padding && carry > 0) throw new Error(`Non-zero padding: ${carry}`);
869
- if (padding && pos > 0) res.push(carry >>> 0);
870
- return res;
871
- }
872
- /**
873
- * @__NO_SIDE_EFFECTS__
874
- */
875
- function radix(num) {
876
- anumber(num);
877
- const _256 = 2 ** 8;
878
- return {
879
- encode: (bytes) => {
880
- if (!isBytes(bytes)) throw new TypeError("radix.encode input should be Uint8Array");
881
- return convertRadix(Array.from(bytes), _256, num);
882
- },
883
- decode: (digits) => {
884
- anumArr("radix.decode", digits);
885
- return Uint8Array.from(convertRadix(digits, num, _256));
886
- }
887
- };
888
- }
889
- /**
890
- * If both bases are power of same number (like `2**8 <-> 2**64`),
891
- * there is a linear algorithm. For now we have implementation for power-of-two bases only.
892
- * @__NO_SIDE_EFFECTS__
893
- */
894
- function radix2(bits, revPadding = false) {
895
- anumber(bits);
896
- if (bits <= 0 || bits > 32) throw new RangeError("radix2: bits should be in (0..32]");
897
- if (/* @__PURE__ */ radix2carry(8, bits) > 32 || /* @__PURE__ */ radix2carry(bits, 8) > 32) throw new RangeError("radix2: carry overflow");
898
- return {
899
- encode: (bytes) => {
900
- if (!isBytes(bytes)) throw new TypeError("radix2.encode input should be Uint8Array");
901
- return convertRadix2(Array.from(bytes), 8, bits, !revPadding);
902
- },
903
- decode: (digits) => {
904
- anumArr("radix2.decode", digits);
905
- return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));
906
- }
907
- };
908
- }
909
- function unsafeWrapper(fn) {
910
- afn(fn);
911
- return function(...args) {
912
- try {
913
- return fn.apply(null, args);
914
- } catch (e) {}
915
- };
916
- }
917
- function checksum(len, fn) {
918
- anumber(len);
919
- if (len <= 0) throw new RangeError(`checksum length must be positive: ${len}`);
920
- afn(fn);
921
- const _fn = fn;
922
- return {
923
- encode(data) {
924
- if (!isBytes(data)) throw new TypeError("checksum.encode: input should be Uint8Array");
925
- const sum = _fn(data).slice(0, len);
926
- const res = new Uint8Array(data.length + len);
927
- res.set(data);
928
- res.set(sum, data.length);
929
- return res;
930
- },
931
- decode(data) {
932
- if (!isBytes(data)) throw new TypeError("checksum.decode: input should be Uint8Array");
933
- const payload = data.slice(0, -len);
934
- const oldChecksum = data.slice(-len);
935
- const newChecksum = _fn(payload).slice(0, len);
936
- for (let i = 0; i < len; i++) if (newChecksum[i] !== oldChecksum[i]) throw new Error("Invalid checksum");
937
- return payload;
938
- }
939
- };
940
- }
941
- /**
942
- * Low-level building blocks used by the exported codecs.
943
- * @example
944
- * Build a radix-32 coder from the low-level helpers.
945
- * ```ts
946
- * import { utils } from '@scure/base';
947
- * utils.radix2(5).encode(Uint8Array.from([1, 2, 3]));
948
- * ```
949
- */
950
- const utils = /* @__PURE__ */ Object.freeze({
951
- alphabet,
952
- chain,
953
- checksum,
954
- convertRadix,
955
- convertRadix2,
956
- radix,
957
- radix2,
958
- join,
959
- padding
960
- });
961
- chain(radix2(4), alphabet("0123456789ABCDEF"), join(""));
962
- chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join(""));
963
- chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), join(""));
964
- chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join(""));
965
- chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), join(""));
966
- chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join(""), normalize$1((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1")));
967
- const hasBase64Builtin = typeof Uint8Array.from([]).toBase64 === "function" && typeof Uint8Array.fromBase64 === "function";
968
- hasBase64Builtin || chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join(""));
969
- chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), join(""));
970
- hasBase64Builtin || chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join(""));
971
- chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), join(""));
972
- const BECH_ALPHABET = chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join(""));
973
- const POLYMOD_GENERATORS = [
974
- 996825010,
975
- 642813549,
976
- 513874426,
977
- 1027748829,
978
- 705979059
979
- ];
980
- function bech32Polymod(pre) {
981
- const b = pre >> 25;
982
- let chk = (pre & 33554431) << 5;
983
- for (let i = 0; i < POLYMOD_GENERATORS.length; i++) if ((b >> i & 1) === 1) chk ^= POLYMOD_GENERATORS[i];
984
- return chk;
985
- }
986
- function bechChecksum(prefix, words, encodingConst = 1) {
987
- const len = prefix.length;
988
- let chk = 1;
989
- for (let i = 0; i < len; i++) {
990
- const c = prefix.charCodeAt(i);
991
- if (c < 33 || c > 126) throw new Error(`Invalid prefix (${prefix})`);
992
- chk = bech32Polymod(chk) ^ c >> 5;
993
- }
994
- chk = bech32Polymod(chk);
995
- for (let i = 0; i < len; i++) chk = bech32Polymod(chk) ^ prefix.charCodeAt(i) & 31;
996
- for (let v of words) chk = bech32Polymod(chk) ^ v;
997
- for (let i = 0; i < 6; i++) chk = bech32Polymod(chk);
998
- chk ^= encodingConst;
999
- return BECH_ALPHABET.encode(convertRadix2([chk % powers[30]], 30, 5, false));
1000
- }
1001
- /**
1002
- * @__NO_SIDE_EFFECTS__
1003
- */
1004
- function genBech32(encoding) {
1005
- const ENCODING_CONST = encoding === "bech32" ? 1 : 734539939;
1006
- const _words = radix2(5);
1007
- const fromWords = _words.decode;
1008
- const toWords = _words.encode;
1009
- const fromWordsUnsafe = unsafeWrapper(fromWords);
1010
- function encode(prefix, words, limit = 90) {
1011
- astr("bech32.encode prefix", prefix);
1012
- if (isBytes(words)) words = Array.from(words);
1013
- anumArr("bech32.encode", words);
1014
- const plen = prefix.length;
1015
- if (plen === 0) throw new TypeError(`Invalid prefix length ${plen}`);
1016
- const actualLength = plen + 7 + words.length;
1017
- if (limit !== false && actualLength > limit) throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);
1018
- const lowered = prefix.toLowerCase();
1019
- const sum = bechChecksum(lowered, words, ENCODING_CONST);
1020
- return `${lowered}1${BECH_ALPHABET.encode(words)}${sum}`;
1021
- }
1022
- function decode(str, limit = 90) {
1023
- astr("bech32.decode input", str);
1024
- const slen = str.length;
1025
- if (slen < 8 || limit !== false && slen > limit) throw new TypeError(`invalid string length: ${slen} (${str}). Expected (8..${limit})`);
1026
- const lowered = str.toLowerCase();
1027
- if (str !== lowered && str !== str.toUpperCase()) throw new Error(`String must be lowercase or uppercase`);
1028
- const sepIndex = lowered.lastIndexOf("1");
1029
- if (sepIndex === 0 || sepIndex === -1) throw new Error(`Letter "1" must be present between prefix and data only`);
1030
- const prefix = lowered.slice(0, sepIndex);
1031
- const data = lowered.slice(sepIndex + 1);
1032
- if (data.length < 6) throw new Error("Data must be at least 6 characters long");
1033
- const words = BECH_ALPHABET.decode(data).slice(0, -6);
1034
- const sum = bechChecksum(prefix, words, ENCODING_CONST);
1035
- if (!data.endsWith(sum)) throw new Error(`Invalid checksum in ${str}: expected "${sum}"`);
1036
- return {
1037
- prefix,
1038
- words
1039
- };
1040
- }
1041
- const decodeUnsafe = unsafeWrapper(decode);
1042
- function decodeToBytes(str) {
1043
- const { prefix, words } = decode(str, false);
1044
- return {
1045
- prefix,
1046
- words,
1047
- bytes: fromWords(words)
1048
- };
1049
- }
1050
- function encodeFromBytes(prefix, bytes) {
1051
- return encode(prefix, toWords(bytes));
1052
- }
1053
- return {
1054
- encode,
1055
- decode,
1056
- encodeFromBytes,
1057
- decodeToBytes,
1058
- decodeUnsafe,
1059
- fromWords,
1060
- fromWordsUnsafe,
1061
- toWords
1062
- };
1063
- }
1064
- genBech32("bech32");
1065
- genBech32("bech32m");
1066
- "".isWellFormed;
1067
- typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function" || chain(radix2(4), alphabet("0123456789abcdef"), join(""), normalize$1((s) => {
1068
- if (typeof s !== "string" || s.length % 2 !== 0) throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);
1069
- return s.toLowerCase();
1070
- }));
1071
- //#endregion
1072
- //#region ../../node_modules/@scure/bip39/index.js
1073
- const isJapanese = (wordlist) => wordlist[0] === "あいこくしん";
1074
- function nfkd(str) {
1075
- if (typeof str !== "string") throw new TypeError("invalid mnemonic type: " + typeof str);
1076
- return str.normalize("NFKD");
1077
- }
1078
- function normalize(str) {
1079
- const norm = nfkd(str);
1080
- const words = norm.split(" ");
1081
- if (![
1082
- 12,
1083
- 15,
1084
- 18,
1085
- 21,
1086
- 24
1087
- ].includes(words.length)) throw new Error("Invalid mnemonic");
1088
- return {
1089
- nfkd: norm,
1090
- words
1091
- };
1092
- }
1093
- function aentropy(ent) {
1094
- abytes$1(ent);
1095
- if (![
1096
- 16,
1097
- 20,
1098
- 24,
1099
- 28,
1100
- 32
1101
- ].includes(ent.length)) throw new RangeError("invalid entropy length");
1102
- }
1103
- /**
1104
- * Generate x random words. Uses Cryptographically-Secure Random Number Generator.
1105
- * @param wordlist - Imported wordlist for a specific language.
1106
- * @param strength - Mnemonic strength, from 128 to 256 bits.
1107
- * @returns 12-24 word mnemonic phrase.
1108
- * @throws On wrong argument types. {@link TypeError}
1109
- * @throws On wrong argument ranges or values. {@link RangeError}
1110
- * @example
1111
- * Generate a new English mnemonic.
1112
- * ```ts
1113
- * import { generateMnemonic } from '@scure/bip39';
1114
- * import { wordlist } from '@scure/bip39/wordlists/english.js';
1115
- * const mnemonic = generateMnemonic(wordlist, 128);
1116
- * // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
1117
- * ```
1118
- */
1119
- function generateMnemonic(wordlist, strength = 128) {
1120
- anumber$1(strength);
1121
- if (strength % 32 !== 0 || strength > 256) throw new RangeError("Invalid entropy");
1122
- return entropyToMnemonic(randomBytes(strength / 8), wordlist);
1123
- }
1124
- const calcChecksum = (entropy) => {
1125
- const bitsLeft = 8 - entropy.length / 4;
1126
- return new Uint8Array([sha256(entropy)[0] >> bitsLeft << bitsLeft]);
1127
- };
1128
- function getCoder(wordlist) {
1129
- if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== "string") throw new TypeError("Wordlist: expected array of 2048 strings");
1130
- wordlist.forEach((i) => {
1131
- if (typeof i !== "string") throw new TypeError("wordlist: non-string element: " + i);
1132
- });
1133
- return utils.chain(utils.checksum(1, calcChecksum), utils.radix2(11, true), utils.alphabet(wordlist));
1134
- }
1135
- /**
1136
- * Reversible: Converts mnemonic string to raw entropy in form of byte array.
1137
- * @param mnemonic - 12-24 words.
1138
- * @param wordlist - Imported wordlist for a specific language.
1139
- * @returns Raw entropy bytes.
1140
- * @throws If the mnemonic shape or checksum is invalid. {@link Error}
1141
- * @throws On wrong argument types. {@link TypeError}
1142
- * @throws On wrong argument ranges or values. {@link RangeError}
1143
- * @example
1144
- * Decode a mnemonic back into its original entropy bytes.
1145
- * ```ts
1146
- * import { mnemonicToEntropy } from '@scure/bip39';
1147
- * import { wordlist } from '@scure/bip39/wordlists/english.js';
1148
- * const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
1149
- * const entropy = mnemonicToEntropy(mnem, wordlist);
1150
- * // Produces the original 16-byte entropy payload.
1151
- * new Uint8Array([
1152
- * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
1153
- * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
1154
- * ])
1155
- * ```
1156
- */
1157
- function mnemonicToEntropy(mnemonic, wordlist) {
1158
- const { words } = normalize(mnemonic);
1159
- const entropy = getCoder(wordlist).decode(words);
1160
- aentropy(entropy);
1161
- return entropy;
1162
- }
1163
- /**
1164
- * Reversible: Converts raw entropy in form of byte array to mnemonic string.
1165
- * @param entropy - Byte array.
1166
- * @param wordlist - Imported wordlist for a specific language.
1167
- * @returns 12-24 words.
1168
- * @throws On wrong argument types. {@link TypeError}
1169
- * @throws On wrong argument ranges or values. {@link RangeError}
1170
- * @example
1171
- * Convert raw entropy into an English mnemonic.
1172
- * ```ts
1173
- * import { entropyToMnemonic } from '@scure/bip39';
1174
- * import { wordlist } from '@scure/bip39/wordlists/english.js';
1175
- * const ent = new Uint8Array([
1176
- * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
1177
- * 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
1178
- * ]);
1179
- * const mnemonic = entropyToMnemonic(ent, wordlist);
1180
- * // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
1181
- * ```
1182
- */
1183
- function entropyToMnemonic(entropy, wordlist) {
1184
- aentropy(entropy);
1185
- return getCoder(wordlist).encode(entropy).join(isJapanese(wordlist) ? " " : " ");
1186
- }
1187
- /**
1188
- * Validates mnemonic for being 12-24 words contained in `wordlist`.
1189
- * @param mnemonic - 12-24 words.
1190
- * @param wordlist - Imported wordlist for a specific language.
1191
- * @returns `true` when mnemonic checksum and words are valid.
1192
- * @example
1193
- * Validate one English mnemonic.
1194
- * ```ts
1195
- * import { validateMnemonic } from '@scure/bip39';
1196
- * import { wordlist } from '@scure/bip39/wordlists/english.js';
1197
- * const ok = validateMnemonic(
1198
- * 'legal winner thank year wave sausage worth useful legal winner thank yellow',
1199
- * wordlist
1200
- * );
1201
- * // => true
1202
- * ```
1203
- */
1204
- function validateMnemonic$1(mnemonic, wordlist) {
1205
- try {
1206
- mnemonicToEntropy(mnemonic, wordlist);
1207
- } catch (e) {
1208
- return false;
1209
- }
1210
- return true;
1211
- }
1212
- //#endregion
1213
- //#region ../../packages/module/passport-account/node_modules/@midnightntwrk/wallet-sdk-hd/dist/HDWallet.js
1214
- const Roles = {
1215
- NightExternal: 0,
1216
- NightInternal: 1,
1217
- Dust: 2,
1218
- Zswap: 3,
1219
- EcdsaUnshielded: 4
1220
- };
1221
- const PURPOSE = 44;
1222
- const COIN_TYPE = 2400;
1223
- const isValidChildIndex = (value) => Number.isSafeInteger(value) && value >= 0 && value < 2147483648;
1224
- const CompositeDerivationResult = { fromResults: (results) => {
1225
- const { succeededKeys, failedRoles } = results.reduce((acc, result) => {
1226
- if (result.result.type === "keyDerived") acc.succeededKeys[result.role] = result.result.key;
1227
- else acc.failedRoles.push(result.role);
1228
- return acc;
1229
- }, {
1230
- succeededKeys: {},
1231
- failedRoles: []
1232
- });
1233
- if (failedRoles.length > 0) return {
1234
- type: "keyOutOfBounds",
1235
- roles: failedRoles
1236
- };
1237
- else return {
1238
- type: "keysDerived",
1239
- keys: succeededKeys
1240
- };
1241
- } };
1242
- var HDWallet = class HDWallet {
1243
- rootKey;
1244
- constructor(key) {
1245
- this.rootKey = key;
1246
- }
1247
- static fromSeed(seed) {
1248
- try {
1249
- return {
1250
- type: "seedOk",
1251
- hdWallet: new HDWallet(require_bip32.HDKey.fromMasterSeed(seed))
1252
- };
1253
- } catch (e) {
1254
- return {
1255
- type: "seedError",
1256
- error: e
1257
- };
1258
- }
1259
- }
1260
- selectAccount(account) {
1261
- return new AccountKey(this.rootKey, account);
1262
- }
1263
- /**
1264
- * Wipes the root key's private-key buffer, narrowing the window in which the seed is reachable.
1265
- *
1266
- * It does not reach the intermediate keys BIP32 allocates at each level of a derivation path, nor the derived keys
1267
- * already handed to callers — neither is reachable from here, so both are left to the garbage collector. Call this
1268
- * once all keys are derived, but do not read it as a guarantee that the seed is gone from the process.
1269
- */
1270
- clear() {
1271
- this.rootKey.wipePrivateData();
1272
- }
1273
- };
1274
- var AccountKey = class {
1275
- rootKey;
1276
- account;
1277
- constructor(rootKey, account) {
1278
- this.account = account;
1279
- this.rootKey = rootKey;
1280
- }
1281
- selectRole(role) {
1282
- return new RoleKey(this.rootKey, this.account, role);
1283
- }
1284
- selectRoles(roles) {
1285
- return new CompositeRoleKey(this.rootKey, this.account, roles);
1286
- }
1287
- };
1288
- var RoleKey = class {
1289
- rootKey;
1290
- account;
1291
- role;
1292
- constructor(rootKey, account, role) {
1293
- this.role = role;
1294
- this.account = account;
1295
- this.rootKey = rootKey;
1296
- }
1297
- deriveKeyAt(index) {
1298
- if (![
1299
- this.account,
1300
- this.role,
1301
- index
1302
- ].every(isValidChildIndex)) return { type: "keyOutOfBounds" };
1303
- const path = `m/${PURPOSE}'/${COIN_TYPE}'/${this.account}'/${this.role}/${index}`;
1304
- const derivedKey = this.rootKey.derive(path);
1305
- return derivedKey.privateKey ? {
1306
- type: "keyDerived",
1307
- key: derivedKey.privateKey
1308
- } : { type: "keyOutOfBounds" };
1309
- }
1310
- };
1311
- var CompositeRoleKey = class {
1312
- rootKey;
1313
- account;
1314
- roles;
1315
- constructor(rootKey, account, roles) {
1316
- this.roles = roles;
1317
- this.rootKey = rootKey;
1318
- this.account = account;
1319
- }
1320
- deriveKeysAt(index) {
1321
- const results = this.roles.map((role) => ({
1322
- role,
1323
- result: new RoleKey(this.rootKey, this.account, role).deriveKeyAt(index)
1324
- }));
1325
- return CompositeDerivationResult.fromResults(results);
1326
- }
1327
- };
1328
- //#endregion
1329
- //#region ../../packages/module/passport-account/node_modules/@midnightntwrk/wallet-sdk-hd/dist/MnemonicUtils.js
1330
- const mnemonicToWords = (mnemonic) => mnemonic.split(" ");
1331
- /** A wrapper around the bip39 package function, with default strength applied to produce 24 words */
1332
- const generateMnemonicWords = (strength = 256) => mnemonicToWords(generateMnemonic(require_english.wordlist, strength));
1333
- const joinMnemonicWords = (mnenomic) => mnenomic.join(" ");
1334
- const generateRandomSeed = (strength = 256) => {
1335
- return crypto.getRandomValues(new Uint8Array(Math.ceil(strength / 8)));
1336
- };
1337
- /** A wrapper around the bip39 package function */
1338
- const validateMnemonic = (mnemonic) => validateMnemonic$1(mnemonic, require_english.wordlist);
1339
- //#endregion
1340
- //#region ../../packages/module/passport-account/node_modules/@midnightntwrk/wallet-sdk-hd/dist/WalletSeeds.js
1341
- /**
1342
- * The one seed an application holds, and the three the wallets are started from.
1343
- *
1344
- * @remarks
1345
- * A Midnight wallet is three wallets, and each is started from its own seed derived from one master seed at its own
1346
- * place in the BIP32 tree. Everything needed to walk that tree has always been here — {@link HDWallet}, {@link Roles} —
1347
- * but the walk itself was left to callers, and every caller wrote it out again: select account zero, select the role,
1348
- * derive at index zero, wipe the tree. Naming it once is what this is.
1349
- */
1350
- /** Raised when a master seed cannot be walked down to the three per-wallet seeds. */
1351
- var SeedDerivationError = class extends Error {
1352
- name = "SeedDerivationError";
1353
- constructor(message, options) {
1354
- super(message, options);
1355
- }
1356
- };
1357
- /**
1358
- * The seeds an application starts its three wallets from.
1359
- *
1360
- * @remarks
1361
- * Throws rather than returning a result, because this sits at the boundary an application calls directly and its
1362
- * failures are programming errors rather than ordinary states: a master seed BIP32 rejects, or an index outside the
1363
- * tree. {@link HDWallet} remains available for a caller that would rather branch on a tagged result than catch.
1364
- */
1365
- const WalletSeeds = { fromMasterSeed: (masterSeed, options = {}) => {
1366
- const { account = 0, addressIndex = 0, unshieldedRole = Roles.NightExternal } = options;
1367
- const opened = HDWallet.fromSeed(masterSeed);
1368
- if (opened.type !== "seedOk") throw new SeedDerivationError("This master seed is not one a BIP32 tree can be built from, so no wallet seed can be derived from it.", { cause: opened.error });
1369
- const derived = opened.hdWallet.selectAccount(account).selectRoles([
1370
- Roles.Zswap,
1371
- unshieldedRole,
1372
- Roles.Dust
1373
- ]).deriveKeysAt(addressIndex);
1374
- opened.hdWallet.clear();
1375
- if (derived.type !== "keysDerived") throw new SeedDerivationError(`No key exists at account ${account}, address index ${addressIndex} for ${derived.roles.length === 1 ? "role" : "roles"} ${derived.roles.join(", ")}: a BIP32 account, role and index are each whole numbers below 2^31.`);
1376
- return {
1377
- shielded: derived.keys[Roles.Zswap],
1378
- unshielded: derived.keys[unshieldedRole],
1379
- dust: derived.keys[Roles.Dust]
1380
- };
1381
- } };
1382
- //#endregion
1383
- exports.AccountKey = AccountKey;
1384
- exports.CompositeRoleKey = CompositeRoleKey;
1385
- exports.HDWallet = HDWallet;
1386
- exports.RoleKey = RoleKey;
1387
- exports.Roles = Roles;
1388
- exports.SeedDerivationError = SeedDerivationError;
1389
- exports.WalletSeeds = WalletSeeds;
1390
- exports.generateMnemonicWords = generateMnemonicWords;
1391
- exports.generateRandomSeed = generateRandomSeed;
1392
- exports.joinMnemonicWords = joinMnemonicWords;
1393
- exports.mnemonicToWords = mnemonicToWords;
1394
- exports.validateMnemonic = validateMnemonic;