@laceio/sdk 0.1.0 → 0.1.1-canary.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 (411) hide show
  1. package/README.md +1 -1
  2. package/dist/{Ed25519PublicKey-lvu1s54U.cjs → Address-AMKTo-dA.cjs} +17150 -61
  3. package/dist/{Ed25519PublicKey-CjnuAYRR.js → Address-_c_-9hLC.js} +16955 -264
  4. package/dist/{Bip32Account-r3KAhCgU.js → Bip32Account-CaW1zC9Y.js} +4 -5
  5. package/dist/{Bip32Account-Cz3h0ZUa.cjs → Bip32Account-DOaGmKpv.cjs} +4 -5
  6. package/dist/Cardano-B-gyqBBD.js +311 -0
  7. package/dist/Cardano-BQ_af0Y3.cjs +322 -0
  8. package/dist/Ed25519PublicKey-B3QcR0J2.cjs +88 -0
  9. package/dist/Ed25519PublicKey-DIE19xHg.js +83 -0
  10. package/dist/InMemoryKeyAgent-Bc_xZY-v.cjs +652 -0
  11. package/dist/InMemoryKeyAgent-D8T3vtXy.js +631 -0
  12. package/dist/{PaymentAddress-DhbtuYb7.cjs → PaymentAddress-B4n1KZMx.cjs} +1 -2
  13. package/dist/{PaymentAddress-xSmGUQ-8.js → PaymentAddress-Cml3EA1n.js} +1 -2
  14. package/dist/Percent-Cfuw5YyL.cjs +11 -0
  15. package/dist/Percent-DpvyJ_93.js +5 -0
  16. package/dist/SodiumBip32Ed25519-BaD-kjyx.cjs +380 -0
  17. package/dist/SodiumBip32Ed25519-DCikAMsl.js +363 -0
  18. package/dist/{TransactionBuilder-CeJTNzm-.cjs → TransactionBuilder-BakTJvsJ.cjs} +59 -89
  19. package/dist/{TransactionBuilder-DGNDM4kt.js → TransactionBuilder-D2ErwVWv.js} +5 -71
  20. package/dist/_md-6zV2Cme0.cjs +684 -0
  21. package/dist/_md-gbUqlhqd.js +399 -0
  22. package/dist/_web-crypto-random-bytes-BvzwTYPG.js +197 -0
  23. package/dist/acc-module-NL_8mEHH.cjs +27654 -0
  24. package/dist/acc-module-ur8CkBd1.js +27624 -0
  25. package/dist/account-call-BDdWqMAY.js +267 -0
  26. package/dist/account-call-BExOpZoo.js +3 -0
  27. package/dist/account-call-CYYoAS1E.cjs +314 -0
  28. package/dist/account-call-Cvj7viaq.cjs +4 -0
  29. package/dist/account-guards-BeKbV9D1.cjs +41 -0
  30. package/dist/account-guards-qnFXuXSE.js +36 -0
  31. package/dist/{activity-type.stable-ClO9j_PH.cjs → activity-type-BPXxdHBP.cjs} +2 -1
  32. package/dist/{activity-type.stable-Ml0SOYv9.js → activity-type-C1geyPsH.js} +2 -1
  33. package/dist/address-OxwXIwbF.js +15502 -0
  34. package/dist/address-book-address-validator-BqYM0Uyp.cjs +41 -0
  35. package/dist/{address-book-address-validator-BhqRfmlL.cjs → address-book-address-validator-CGIcqn5W.cjs} +5 -4
  36. package/dist/{address-book-address-validator-VqIOB8PY.js → address-book-address-validator-FkkYim3z.js} +6 -4
  37. package/dist/address-book-address-validator-RSx2Jozy.js +39 -0
  38. package/dist/address-lECYBd9-.cjs +13043 -0
  39. package/dist/{apply-vkey-witnesses-Ctzk7eye.cjs → apply-vkey-witnesses-1jyczTkw.cjs} +1 -1
  40. package/dist/{apply-vkey-witnesses-Dfo7XfhL.js → apply-vkey-witnesses-Byb40-yJ.js} +1 -1
  41. package/dist/artefact-loader-De9WJH1J.cjs +183 -0
  42. package/dist/artefact-loader-nlsYFjxU.js +160 -0
  43. package/dist/auto-dismiss-failure-on-success-BWJceNXd.cjs +37 -0
  44. package/dist/auto-dismiss-failure-on-success-Bpod-v4r.js +31 -0
  45. package/dist/bip32-EPpcFrpH.cjs +3851 -0
  46. package/dist/{bip32ed25519-D2In8WzR.cjs → bip32ed25519-CRiG-Kjg.cjs} +5 -4
  47. package/dist/{bip32ed25519-qsLH_eWO.js → bip32ed25519-E-fCUZNv.js} +6 -4
  48. package/dist/bip39-DZomfqeY.js +9 -0
  49. package/dist/bip39-MAck9iod.cjs +26 -0
  50. package/dist/bitcoin-data-provider-D0OT_Uiu.cjs +26 -0
  51. package/dist/bitcoin-data-provider-LN_8oamW.js +21 -0
  52. package/dist/bitcoin.cjs +48 -0
  53. package/dist/bitcoin.d.ts +29805 -1
  54. package/dist/bitcoin.js +22 -0
  55. package/dist/{blake2b-BGHUWMsV.js → blake2b-BL-eR5G2.js} +6 -4
  56. package/dist/{blake2b-DspUqw68.cjs → blake2b-Iy324FwH.cjs} +5 -4
  57. package/dist/{blockfrost-tx-submit-provider-BUEOmdvc.js → blockfrost-tx-submit-provider-BHDLgOIE.js} +9 -162
  58. package/dist/{blockfrost-tx-submit-provider-B5dWbdrZ.cjs → blockfrost-tx-submit-provider-BxC19smv.cjs} +7 -171
  59. package/dist/{blockingWithLatestFrom-BhaE7pnA.js → blockingWithLatestFrom-FUfZFEUG.js} +1 -1
  60. package/dist/{blockingWithLatestFrom-DkuT3G2a.cjs → blockingWithLatestFrom-bmCPgA3c.cjs} +1 -1
  61. package/dist/bn-BFq5a4dk.cjs +2553 -0
  62. package/dist/{SodiumBip32Ed25519-BEfo1Q9m.js → browser-D5jRKv_L.js} +4 -401
  63. package/dist/bytes.vo-CziaOsba.js +24 -0
  64. package/dist/bytes.vo-hecRu3YZ.cjs +35 -0
  65. package/dist/{cardano-network-id-to-network-type-PXvn1ycQ.cjs → cardano-network-id-to-network-type-BwG_d6QP.cjs} +1 -1
  66. package/dist/{cardano-network-id-to-network-type-DHgKhDAK.js → cardano-network-id-to-network-type-CYJheetp.js} +1 -1
  67. package/dist/{cardano-network-id.vo-CbNNKd-k.cjs → cardano-network-id.vo-C5VuBXT3.cjs} +2 -2
  68. package/dist/{cardano-network-id.vo-CTYe-Oix.js → cardano-network-id.vo-CeLJqmb_.js} +2 -2
  69. package/dist/{cardano-tx-id.vo-BMwemq5x.js → cardano-tx-id.vo-DJ70NC0-.js} +1 -1
  70. package/dist/{cardano-tx-id.vo-NY-gCOWJ.cjs → cardano-tx-id.vo-lnyO9XaW.cjs} +1 -1
  71. package/dist/cardano.cjs +31 -24
  72. package/dist/cardano.d.ts +27612 -8128
  73. package/dist/cardano.js +21 -13
  74. package/dist/client-Bw2foG5E.cjs +808 -0
  75. package/dist/const-BB3MccLt.js +153 -0
  76. package/dist/{const-BErUlcZw.cjs → const-BWBAzOmN.cjs} +1 -1
  77. package/dist/const-CSWmOyzn.cjs +42 -0
  78. package/dist/{const-Dy8Ctnpd.cjs → const-D3mCkwrM.cjs} +5 -5
  79. package/dist/const-DW7z3R5k.js +13 -0
  80. package/dist/{const-DeUA7zYl.js → const-DbuUHSzR.js} +5 -5
  81. package/dist/const-DgBzKfz6.cjs +31995 -0
  82. package/dist/{const-DVW6DGkZ.js → const-xGSNCtwQ.js} +1 -1
  83. package/dist/contract-2KVxlHyu.cjs +189 -0
  84. package/dist/contract-DjQqqZLo.js +171 -0
  85. package/dist/create-add-accounts-2mQA0ST2.js +102 -0
  86. package/dist/create-add-accounts-B6mR2NMn.cjs +114 -0
  87. package/dist/{delegation-tx-builder-CF0VunDW.cjs → delegation-tx-builder-Cp30jtj9.cjs} +9 -8
  88. package/dist/{delegation-tx-builder-C8LQxU2R.js → delegation-tx-builder-DUMikSTg.js} +9 -7
  89. package/dist/{deregistration-tx-builder-DcUXA3Ls.cjs → deregistration-tx-builder-B-ZeY-dR.cjs} +10 -9
  90. package/dist/{deregistration-tx-builder-BOBPP8m_.js → deregistration-tx-builder-CRLrK99U.js} +10 -8
  91. package/dist/device-commitment-hex.vo-BIUYUNz1.cjs +31 -0
  92. package/dist/device-commitment-hex.vo-D9FsYLn7.js +26 -0
  93. package/dist/device-key-BToCoS4D.js +2394 -0
  94. package/dist/device-key-D6euvxFi.cjs +2489 -0
  95. package/dist/device-readers-BPDz2oqa.js +3 -0
  96. package/dist/device-readers-CVqmvmLZ.js +145 -0
  97. package/dist/device-readers-DzkDMjPn.cjs +7 -0
  98. package/dist/device-readers-XMZMfFvZ.cjs +168 -0
  99. package/dist/dist-B00GN41m.js +141 -0
  100. package/dist/dist-BA1xnF9O.cjs +4413 -0
  101. package/dist/dist-BmHOXLe8.cjs +3814 -0
  102. package/dist/dist-Br0OVXKt.cjs +535 -0
  103. package/dist/dist-C1JK9C1I.cjs +3452 -0
  104. package/dist/dist-DKEViNEI.cjs +1306 -0
  105. package/dist/dist-Dwqx184a.cjs +43175 -0
  106. package/dist/dist-MJof_Ky1.cjs +145 -0
  107. package/dist/dist-p84sVVJ9.cjs +1394 -0
  108. package/dist/{earn-rewards-tx-builder-BRlTueHS.js → earn-rewards-tx-builder-8G_rouIk.js} +9 -7
  109. package/dist/{earn-rewards-tx-builder-RgO0QUY8.cjs → earn-rewards-tx-builder-cOUNV58E.cjs} +9 -8
  110. package/dist/enc-key-circuits-0Dud78IB.js +13 -0
  111. package/dist/enc-key-circuits-yjPHbuo_.cjs +24 -0
  112. package/dist/english-BZ_ebp2-.cjs +2057 -0
  113. package/dist/envelopes-BmL7onAK.cjs +1721 -0
  114. package/dist/envelopes-CfWTR2uy.js +1620 -0
  115. package/dist/errors-BA3b8aVu.cjs +584 -0
  116. package/dist/errors-pkQdxW-7.js +392 -0
  117. package/dist/experimental.cjs +6875 -0
  118. package/dist/experimental.d.ts +63670 -0
  119. package/dist/experimental.js +6725 -0
  120. package/dist/fees-6C2uEWFK.js +653 -0
  121. package/dist/fees-DtC71fOx.cjs +820 -0
  122. package/dist/gated-call-DLC5PBlN.cjs +736 -0
  123. package/dist/gated-call-DQhT7v2J.js +695 -0
  124. package/dist/gated-call-DdNOQh_Z.js +3 -0
  125. package/dist/gated-call-wAB15GtN.cjs +4 -0
  126. package/dist/grant-circuits-BKJrMSNo.cjs +49 -0
  127. package/dist/grant-circuits-D53wmGyr.js +26 -0
  128. package/dist/grant-rules-fYt80KB1.cjs +7114 -0
  129. package/dist/grant-rules-rG1kJq6l.js +6833 -0
  130. package/dist/grant-status-CDmZpx32.js +296 -0
  131. package/dist/grant-status-CQtwjLsA.cjs +337 -0
  132. package/dist/grants-C5wpNvZJ.cjs +266 -0
  133. package/dist/grants-DY3sN9We.cjs +16 -0
  134. package/dist/grants-ngFtS52g.js +213 -0
  135. package/dist/grants-qpXC94Rk.js +4 -0
  136. package/dist/{group-cardano-addresses-by-account-C-1GHUu8.cjs → group-cardano-addresses-by-account-BGOtPV-Y.cjs} +4 -40
  137. package/dist/{group-cardano-addresses-by-account-p4dXmCoj.js → group-cardano-addresses-by-account-TqvESg9x.js} +6 -37
  138. package/dist/{guarded-transaction-signer-DZSGHp1K.js → guarded-transaction-signer-BbVDE9Nn.js} +12 -18
  139. package/dist/{guarded-transaction-signer-BLSezbfV.cjs → guarded-transaction-signer-DTLjAkif.cjs} +26 -26
  140. package/dist/hex-BVtOKJki.cjs +263 -0
  141. package/dist/hex-CGYJPK_Z.js +192 -0
  142. package/dist/http-client-B7_kBTYn.js +155 -0
  143. package/dist/http-client-DYQ_7Rdf.cjs +167 -0
  144. package/dist/identity-DxPhxkZs.js +239 -0
  145. package/dist/identity-y41Yle03.cjs +274 -0
  146. package/dist/in-memory-wallet-integration-5BKiAvPT.js +20861 -0
  147. package/dist/{in-memory-wallet-integration-CUTa68ET.js → in-memory-wallet-integration-BCOqDgbt.js} +10 -107
  148. package/dist/in-memory-wallet-integration-Bi8I9Dso.js +128 -0
  149. package/dist/in-memory-wallet-integration-Bsl2ONua.cjs +239 -0
  150. package/dist/in-memory-wallet-integration-DZ0CAyvY.cjs +20865 -0
  151. package/dist/{in-memory-wallet-integration-Dw_S7amX.cjs → in-memory-wallet-integration-DsFm8gLk.cjs} +21 -112
  152. package/dist/{in-memory-wallet-integration-Z4Bp_DTv.cjs → in-memory-wallet-integration-aW_SF-go.cjs} +8 -5
  153. package/dist/{in-memory-wallet-integration-B6cbAlvD.js → in-memory-wallet-integration-mIEc8EfR.js} +9 -5
  154. package/dist/index.cjs +95 -58
  155. package/dist/index.d.ts +45146 -13439
  156. package/dist/index.js +55 -28
  157. package/dist/{init-CVi8J0zk.cjs → init-5SfWgCYD.cjs} +3 -3
  158. package/dist/{init-Ci7aqWCf2.cjs → init-8NVWbo302.cjs} +2 -2
  159. package/dist/init-B-C7n6u6.js +5 -0
  160. package/dist/{init-BFMWRf-L.js → init-B-ppfGO-.js} +1 -1
  161. package/dist/{init-IiR093Jw.cjs → init-B2OUhY5T.cjs} +2 -2
  162. package/dist/{init-DXnus199.cjs → init-B6Eg_o6G.cjs} +5 -5
  163. package/dist/{init-4hDl5bpr.js → init-BAWMHL1k.js} +2 -2
  164. package/dist/init-BC2CZZOu2.cjs +2002 -0
  165. package/dist/{init-a228hXnS.cjs → init-BF-a2p6E.cjs} +65 -73
  166. package/dist/{init-fFirX8OY.cjs → init-BFxlQAD8.cjs} +1 -1
  167. package/dist/init-BJE1ry0O.js +17 -0
  168. package/dist/{init-BVnI4z2J.js → init-BPKBVOHU.js} +2 -2
  169. package/dist/{init-bdqZBd-o.js → init-BSP_xcpB.js} +2 -2
  170. package/dist/{init-CFNOn3lo.js → init-BSd7mznK.js} +3 -3
  171. package/dist/{init-MjR4swi6.js → init-BUJTT0MN.js} +36 -43
  172. package/dist/init-BUpFzYsD.cjs +143 -0
  173. package/dist/{init-BvpYHyLH.cjs → init-BZ-WyAIL.cjs} +3 -3
  174. package/dist/init-BZdfdLX7.js +422 -0
  175. package/dist/{init-CJeOys1w.cjs → init-B_HWNXMD.cjs} +2 -2
  176. package/dist/init-BbIMt6xU.cjs +6 -0
  177. package/dist/{init-BYdN1aqE.cjs → init-BewG6swt.cjs} +2 -2
  178. package/dist/{init-Tpn9VkFu.cjs → init-BpwlQ6wF.cjs} +1 -1
  179. package/dist/{init-D5-P0HXK.js → init-BtQOzUjX.js} +1 -1
  180. package/dist/{init-BvGz3qUd2.js → init-CCTscPaY2.js} +2 -2
  181. package/dist/{init-D4hPipCD.cjs → init-CH0yyBof.cjs} +1 -1
  182. package/dist/{init-BX0AZAVH2.js → init-CS98M3iD.js} +2 -2
  183. package/dist/init-CaIkrXal.cjs +121 -0
  184. package/dist/init-CkZy4IMf.cjs +107 -0
  185. package/dist/{init-Drr2f_Pr.js → init-CmfcY7SV.js} +1 -1
  186. package/dist/{init-Kf3_OLv6.js → init-CnJAlks_.js} +1 -1
  187. package/dist/{init-Cdjt_z-b.cjs → init-CqqmtAIK.cjs} +4 -4
  188. package/dist/{init-Bb0avZeZ.js → init-Cu2znmIc.js} +5 -5
  189. package/dist/{init-lcaUSOOG.js → init-CwLZXfTl.js} +1 -1
  190. package/dist/init-Cz5LAizN.js +2001 -0
  191. package/dist/init-D4WM3-Mn.cjs +18 -0
  192. package/dist/init-DJzEpODO.js +2373 -0
  193. package/dist/init-DMi2FGpf.cjs +424 -0
  194. package/dist/{init-BTYLMF9F2.cjs → init-DexLSprL2.cjs} +258 -61
  195. package/dist/init-DfKPgD21.js +106 -0
  196. package/dist/init-DgzRsI-C.js +141 -0
  197. package/dist/init-Dj4Cn7-P.js +4789 -0
  198. package/dist/{init-DFwhgert.cjs → init-DnELgrhn.cjs} +1 -1
  199. package/dist/init-DypZuehC.cjs +2374 -0
  200. package/dist/{init-CX_zLXc6.js → init-IBnizp1U.js} +5 -5
  201. package/dist/init-MDKB6tGI2.cjs +4790 -0
  202. package/dist/{init-DbZ5byj42.js → init-TbB38KNt2.js} +258 -60
  203. package/dist/{init-BgrY29gW.js → init-dsYkC_0B.js} +4 -4
  204. package/dist/{init-DvVgKCaP2.cjs → init-kVOOiU0-.cjs} +2 -2
  205. package/dist/{init-B5BsI3DR.cjs → init-kvn5FlPS.cjs} +7 -7
  206. package/dist/init-vfy9DW_E.js +119 -0
  207. package/dist/{init-BE_6Jyc4.js → init-w7xl6LsP.js} +3 -3
  208. package/dist/{init-DEsWVyn5.cjs → init-wgiBUmyW.cjs} +1 -1
  209. package/dist/{is-retriable-error-DWv_ob-f.js → is-retriable-error-CmFR20pe.js} +1 -1
  210. package/dist/{is-retriable-error-Dtb4JGjd.cjs → is-retriable-error-D2yo0_lS.cjs} +1 -1
  211. package/dist/jubjub-authoriser-BBJcD2uC.js +85 -0
  212. package/dist/jubjub-authoriser-BlXt4Z-D.cjs +86 -0
  213. package/dist/key-source-CcLTx8HK.js +2761 -0
  214. package/dist/key-source-D2tTAag-.cjs +806 -0
  215. package/dist/{key-value-store-DTX1quRS.js → key-value-store-DZcNDB3n.js} +1 -1
  216. package/dist/{key-value-store-B-XRIwaM.cjs → key-value-store-Htj4RgMe.cjs} +1 -1
  217. package/dist/keyDerivation-DcKRUCVh.cjs +274 -0
  218. package/dist/keyDerivation-QGesIMbS.js +4077 -0
  219. package/dist/{lace-context-FpU3iG3f.cjs → lace-context-BN0b_ury.cjs} +4 -4
  220. package/dist/{lace-context-BQvvxVLm.js → lace-context-DMRJ87Vg.js} +4 -4
  221. package/dist/lib-BC-62Byh.cjs +2359 -0
  222. package/dist/lib-JYqcAX0c.js +2354 -0
  223. package/dist/midnight-account-id.vo--Vcx34Xk.cjs +10 -0
  224. package/dist/midnight-account-id.vo-BuB8fiVO.js +5 -0
  225. package/dist/midnight-engine-B7D2hbHo.js +5 -0
  226. package/dist/midnight-engine-D5ikN_5F.cjs +6 -0
  227. package/dist/midnight-wallet-BOdFD6SX.cjs +24 -0
  228. package/dist/midnight-wallet-CAqZrNVe.js +18 -0
  229. package/dist/midnight.cjs +1412 -0
  230. package/dist/midnight.d.ts +28609 -0
  231. package/dist/midnight.js +1355 -0
  232. package/dist/modules-cardano-4IgYsKeN.js +999 -0
  233. package/dist/modules-cardano-Baqj2GZH.cjs +1112 -0
  234. package/dist/node-relay-BEtqi_vU.cjs +49 -0
  235. package/dist/node-relay-CkgpDObu.js +48 -0
  236. package/dist/outputs-5qdW8s-f.js +196 -0
  237. package/dist/outputs-BEM1GPMf.cjs +339 -0
  238. package/dist/{SodiumBip32Ed25519-BQUcrQWX.cjs → pbkdf2-B1veireP.cjs} +6 -411
  239. package/dist/pending-operation-CfTUNQVD.cjs +26 -0
  240. package/dist/pending-operation-Ljijb1Uh.js +21 -0
  241. package/dist/providers--Hg9iF5v.cjs +366 -0
  242. package/dist/providers-DQ5_3h2l.js +343 -0
  243. package/dist/redacted-4SJPqt-G.js +81 -0
  244. package/dist/redacted-DwxIDdIF.cjs +86 -0
  245. package/dist/{reselect-DPML1uFN.cjs → reselect-kP4DaAII.cjs} +1 -1
  246. package/dist/{retry-config-oNtfdyrG.cjs → retry-config-BGv5q5QM.cjs} +1 -1
  247. package/dist/{retry-config-VdbuqBsI.js → retry-config-Bu5Yn5ua.js} +1 -1
  248. package/dist/safe-buffer-CqGpSFCQ.js +43 -0
  249. package/dist/safe-buffer-DbXbwhUQ.cjs +48 -0
  250. package/dist/sdk-Bm9-P0L-.cjs +1445 -0
  251. package/dist/sdk-Cf__6dDe.js +1249 -0
  252. package/dist/sdk-init-9TG1ZvHF.cjs +3795 -0
  253. package/dist/sdk-init-Ce3mD-8F.js +1047 -0
  254. package/dist/secret-box-CSmRp6Tt.js +3777 -0
  255. package/dist/secret-box-ZfbYwBgS.cjs +6970 -0
  256. package/dist/send-proof-progress-DtAcrMP6.cjs +33 -0
  257. package/dist/send-proof-progress-Dx2cUz1B.js +22 -0
  258. package/dist/sha2-DaRJZOjk.cjs +390 -0
  259. package/dist/sha2-c4sB6peD.js +378 -0
  260. package/dist/side-effects-C3BhLrdP.js +768 -0
  261. package/dist/side-effects-DG0R-KFc.cjs +804 -0
  262. package/dist/sign-bitcoin-transaction-with-seed-C7vq9om8.js +147 -0
  263. package/dist/sign-bitcoin-transaction-with-seed-Ds1dwzan.cjs +158 -0
  264. package/dist/signer--2I6poMD.js +2 -0
  265. package/dist/signer-CX21Ups_.cjs +121 -0
  266. package/dist/signer-Cnn9q9oY.js +92 -0
  267. package/dist/signer-DbSxjk0F.cjs +7 -0
  268. package/dist/signer-factory-B5oFuUZ-.cjs +130 -0
  269. package/dist/signer-factory-BAt8FPNc.cjs +281 -0
  270. package/dist/signer-factory-BGE4nL4k.js +129 -0
  271. package/dist/signer-factory-C4pgsiJi.js +281 -0
  272. package/dist/{signer-factory-DySc1wRX.cjs → signer-factory-D95jQIPV.cjs} +9 -6
  273. package/dist/{signer-factory-D4HrwFPl.js → signer-factory-PrpsGX-8.js} +10 -6
  274. package/dist/{slice-BZTQgYSs.js → slice-B-xJcuT1.js} +4 -4
  275. package/dist/slice-B4QOYaOG.cjs +105 -0
  276. package/dist/{slice-CtIMw2YT.cjs → slice-B9QKuhi0.cjs} +3 -3
  277. package/dist/{slice-Bhwmqn1p.cjs → slice-Bf4enJKZ.cjs} +8 -8
  278. package/dist/{slice-DaNVz7_l.js → slice-ByNWnxKS.js} +8 -8
  279. package/dist/{slice-C2UDQrdt.js → slice-C1zOeseG.js} +449 -355
  280. package/dist/{slice-DFLyKRm5.cjs → slice-C4toRM6A.cjs} +2 -2
  281. package/dist/{slice-Cx4dULDA.cjs → slice-C8YVv4Qn.cjs} +1 -1
  282. package/dist/{slice-jnpOgiSZ.cjs → slice-CaMfviYu.cjs} +3 -3
  283. package/dist/{slice-DFvrwUur.js → slice-CgeRsYRg.js} +6 -6
  284. package/dist/{slice-zNEspZND.js → slice-D0VzpMbY.js} +2 -2
  285. package/dist/slice-D14F78Ca.js +87 -0
  286. package/dist/slice-DJelVt0i.js +9013 -0
  287. package/dist/{slice-F6A1YKOF.cjs → slice-DLflttAu.cjs} +479 -366
  288. package/dist/{slice-C96EdeY1.js → slice-DcO-iNz2.js} +1 -1
  289. package/dist/{slice-C19quNWM.cjs → slice-DimtxfAT.cjs} +2 -2
  290. package/dist/{slice-KiNoGwD9.js → slice-DlTEqIoI.js} +1 -1
  291. package/dist/{slice-ws8PccRX.js → slice-Dn0WojD7.js} +3 -3
  292. package/dist/{slice-BLSxLmie.cjs → slice-Dongunf7.cjs} +4 -4
  293. package/dist/{slice-B6vPum19.js → slice-DpufJAjJ.js} +2 -2
  294. package/dist/{slice-exhhmucR.cjs → slice-DtitVc9L.cjs} +7 -7
  295. package/dist/slice-RQRLciQc.cjs +9031 -0
  296. package/dist/{slice-Bjj2t2ut.cjs → slice-WMMMc1Xv.cjs} +2 -2
  297. package/dist/slice-a8VuIqzS.cjs +378 -0
  298. package/dist/slice-bRASyM-m.js +354 -0
  299. package/dist/{slice-CBFrgHSH.js → slice-hNyKbDry.js} +3 -3
  300. package/dist/{InMemoryKeyAgent-pyB2gA-N.cjs → src-BayYMIjw.cjs} +20 -8228
  301. package/dist/{InMemoryKeyAgent-D-3HejxN.js → src-CgINPlSx.js} +29 -4811
  302. package/dist/store-AUlTfcI_.js +37 -0
  303. package/dist/store-C7AneHEY.cjs +66 -0
  304. package/dist/submit-BuBCVi-l.cjs +87 -0
  305. package/dist/submit-D37lxFrK.js +70 -0
  306. package/dist/submit-bitcoin-tx-CE0AD-xH.js +983 -0
  307. package/dist/submit-bitcoin-tx-CK10OTfQ.cjs +1049 -0
  308. package/dist/{subtractValueQuantities-DfZg6oiG.js → subtractValueQuantities-BuDJVxq6.js} +3 -22
  309. package/dist/{subtractValueQuantities-C8qDTtgH.cjs → subtractValueQuantities-CqR606HV.cjs} +2 -32
  310. package/dist/{sync-operation-utils-BrQyWFS_.cjs → sync-operation-utils--Z_IQfyW.cjs} +0 -66
  311. package/dist/{sync-operation-utils-CAaCGvEN.js → sync-operation-utils-BimBpvI3.js} +1 -37
  312. package/dist/token-id-mapper-BVau2RXa.js +16 -0
  313. package/dist/token-id-mapper-CSeLzM4o.cjs +18 -0
  314. package/dist/{token-id-mapper-pDaTxpw2.js → token-id-mapper-ClBeIdJR.js} +2 -2
  315. package/dist/{token-id-mapper-DYcd8hhQ.cjs → token-id-mapper-D0wFdbOy.cjs} +2 -2
  316. package/dist/types-46lh8O9r.js +33 -0
  317. package/dist/types-BhhNR1_B.cjs +50 -0
  318. package/dist/types-BhzypKMS.cjs +15 -0
  319. package/dist/types-DTE1ctDB.js +10 -0
  320. package/dist/types-DXSxXGz0.js +12 -0
  321. package/dist/types-Dls6Z5gV.cjs +23 -0
  322. package/dist/{util-P4PX2muj.cjs → util-D1YlKzrc.cjs} +2 -2
  323. package/dist/{util-CQSJU0wT.js → util-DHxtzUzY.js} +2 -2
  324. package/dist/{utils-Bv4OHT4S.cjs → utils-DYf4iZKX.cjs} +7 -1
  325. package/dist/{utils-DrtzChYN.js → utils-DcnoETEP.js} +2 -2
  326. package/dist/utils-Du0YXRcU.cjs +112 -0
  327. package/dist/utils-fF_rnZe3.js +65 -0
  328. package/dist/v8Signatures-ClGpA8mS.cjs +71 -0
  329. package/dist/{vote-delegation-tx-builder-69gOEkCB.cjs → vote-delegation-tx-builder-BjZxCOd3.cjs} +9 -8
  330. package/dist/{vote-delegation-tx-builder-BRJ_pf-c.js → vote-delegation-tx-builder-DRJwPXkD.js} +9 -7
  331. package/dist/watch-FGE4B_Ge.js +13056 -0
  332. package/dist/watch-imlsRZDp.cjs +52207 -0
  333. package/package.json +95 -3
  334. package/dist/Address-4KjeDt_x.cjs +0 -17269
  335. package/dist/Address-_VPkf7Xh.js +0 -17101
  336. package/dist/account-guards.stable-BKyYPj4z.cjs +0 -10
  337. package/dist/account-guards.stable-BdmQ43vC.js +0 -5
  338. package/dist/init-BR9ZIbED.cjs +0 -378
  339. package/dist/init-B_k1RUN_.cjs +0 -21
  340. package/dist/init-Bs3b5ZQH.js +0 -378
  341. package/dist/init-ChfcrHgG2.cjs +0 -4354
  342. package/dist/init-D1uUMMpG.js +0 -19
  343. package/dist/init-DV1OSZiK.js +0 -4352
  344. package/dist/modules-cardano-BINzpXpk.js +0 -5454
  345. package/dist/modules-cardano-Dt8OwoQb.cjs +0 -5640
  346. package/dist/slice-Caf98m0d2.js +0 -107
  347. package/dist/slice-PM6llajQ2.cjs +0 -125
  348. /package/dist/{BigIntMath-CoJWXt1h.cjs → BigIntMath-CBciEQn2.cjs} +0 -0
  349. /package/dist/{BigIntMath-BWUJOsOW.js → BigIntMath-X3EniYDo.js} +0 -0
  350. /package/dist/{ChainId-sdLmlIRk.cjs → ChainId-CNPSU9nn.cjs} +0 -0
  351. /package/dist/{ChainId-CKbm87yQ.js → ChainId-CeoG8Sov.js} +0 -0
  352. /package/dist/{_polyfill-node.process-4fnlkbBi.cjs → _polyfill-node.process-5UxyjoHG.cjs} +0 -0
  353. /package/dist/{account-id.vo-Xpgnu-av.cjs → account-id.vo-DYZBZQsz.cjs} +0 -0
  354. /package/dist/{account-id.vo-DP0BtOoF.js → account-id.vo-KDTWJ-W5.js} +0 -0
  355. /package/dist/{actions-BNagEO6m.cjs → actions-BnHFVSr_.cjs} +0 -0
  356. /package/dist/{actions-BWTyAr7B.js → actions-Cwj0ApZf.js} +0 -0
  357. /package/dist/{asyncoption-po7-RiA5.cjs → asyncoption-CYcZNBRM.cjs} +0 -0
  358. /package/dist/{asyncoption-CzIVH5Y1.js → asyncoption-DZQGfznq.js} +0 -0
  359. /package/dist/{bignum.vo-DhhZ9HP1.js → bignum.vo-Co6tMH2q.js} +0 -0
  360. /package/dist/{bignum.vo-CpkrIXjH.cjs → bignum.vo-Du-bpvar.cjs} +0 -0
  361. /package/dist/{blockchain-network-id.vo-CbgrAY_K.js → blockchain-network-id.vo-C6Jowh8t.js} +0 -0
  362. /package/dist/{blockchain-network-id.vo-5iC6Kffo.cjs → blockchain-network-id.vo-DEQ14dYj.cjs} +0 -0
  363. /package/dist/{composite-signer-factory-DABpCe1_.js → composite-signer-factory-D9RWY-1V.js} +0 -0
  364. /package/dist/{composite-signer-factory-BizuNPP7.cjs → composite-signer-factory-v4Pxn8bA.cjs} +0 -0
  365. /package/dist/{error-ggOihIfv.cjs → error-B6wj9nPv.cjs} +0 -0
  366. /package/dist/{error-DHKO2iS4.js → error-CvEYL98P.js} +0 -0
  367. /package/dist/{esm-browser-DnXNvpcn.cjs → esm-browser-CZbMeVod.cjs} +0 -0
  368. /package/dist/{esm-browser-BBVQuyQv.js → esm-browser-DpAD_RKv.js} +0 -0
  369. /package/dist/{feature-flag-key.vo-DoGK5Bfh.js → feature-flag-key.vo-9reURsOQ.js} +0 -0
  370. /package/dist/{feature-flag-key.vo-CP1Z9s8e.cjs → feature-flag-key.vo-KTIdnzYX.cjs} +0 -0
  371. /package/dist/{first-state-of-status-Bx4-QQ5m.cjs → first-state-of-status-9ICeDNSa.cjs} +0 -0
  372. /package/dist/{first-state-of-status-D7XzEuSa.js → first-state-of-status-BscbKj_t.js} +0 -0
  373. /package/dist/{init-ZX90nEJe2.js → init-B0hAl9w6.js} +0 -0
  374. /package/dist/{init-4319psUJ.cjs → init-BT67pd9x.cjs} +0 -0
  375. /package/dist/{init-AFUM1TSg.js → init-CHk1fvJ2.js} +0 -0
  376. /package/dist/{init-Dt1Xifg_2.cjs → init-CSURGyW_.cjs} +0 -0
  377. /package/dist/{init-CTQ2g6Xt.js → init-DtxxFaCx.js} +0 -0
  378. /package/dist/{init-BNewLCqw.cjs → init-xzZPlQwB.cjs} +0 -0
  379. /package/dist/{is-redux-persist-state-DxJSsvxB.cjs → is-redux-persist-state-C5luvPEH.cjs} +0 -0
  380. /package/dist/{is-redux-persist-state-Bl2n4VMr.js → is-redux-persist-state-CjcqyCoh.js} +0 -0
  381. /package/dist/{isNotNil-CZxBMfL5.js → isNotNil-Be7gCY0m.js} +0 -0
  382. /package/dist/{isNotNil-C_SO1tcC.cjs → isNotNil-CrYIUFry.cjs} +0 -0
  383. /package/dist/{logging-BvMDKgl0.js → logging-BAMMfn5j.js} +0 -0
  384. /package/dist/{logging-Bh9ikph3.cjs → logging-CbxgIX9V.cjs} +0 -0
  385. /package/dist/{metadatum-B-sxBnSY.cjs → metadatum-BGvFqGPt.cjs} +0 -0
  386. /package/dist/{metadatum-Ego4jVas.js → metadatum-BVocMYy_.js} +0 -0
  387. /package/dist/{repo-slice-BzZQUTj8.cjs → repo-slice-BB_W-6OL.cjs} +0 -0
  388. /package/dist/{repo-slice-vCcQJotS.js → repo-slice-BQlssw9M.js} +0 -0
  389. /package/dist/{reselect-BPkMzw3k.js → reselect-JIgawvPe.js} +0 -0
  390. /package/dist/{serializable-BxFUShKY.js → serializable-F7OtYl8d.js} +0 -0
  391. /package/dist/{serializable-DWgkHhv_.cjs → serializable-n3UoxbZc.cjs} +0 -0
  392. /package/dist/{slice-DY-DNtSi.js → slice-5dGBAz6w.js} +0 -0
  393. /package/dist/{slice-BEFoeqgr.cjs → slice-BzJgg9FS.cjs} +0 -0
  394. /package/dist/{src-CPmX4KUh.cjs → src-CeBNkonz.cjs} +0 -0
  395. /package/dist/{src-XOZXPKxe.js → src-Cv1ifqbe.js} +0 -0
  396. /package/dist/{time-CQPt4FdU.js → time-ByoKevdZ.js} +0 -0
  397. /package/dist/{time-Blvoyh9G.cjs → time-qD7edGU0.cjs} +0 -0
  398. /package/dist/{time.vo-Xln4yGBU.js → time.vo-C17-tYq3.js} +0 -0
  399. /package/dist/{time.vo-rwWwJzmP.cjs → time.vo-TmYE-_Y2.cjs} +0 -0
  400. /package/dist/{toEmpty-CzmoZVLN.cjs → toEmpty-Db6V94Mf.cjs} +0 -0
  401. /package/dist/{toEmpty-DzLd-ZCi.js → toEmpty-Djj-QbpI.js} +0 -0
  402. /package/dist/{token-id.vo-l8fuSpem.cjs → token-id.vo-CZ622zcZ.cjs} +0 -0
  403. /package/dist/{token-id.vo-DMKSaMlc.js → token-id.vo-IDI9C_Qm.js} +0 -0
  404. /package/dist/{types-B61DQoFW.js → types-By-XeXWg.js} +0 -0
  405. /package/dist/{types-CUC-Kcqh.cjs → types-Cn6WlQV6.cjs} +0 -0
  406. /package/dist/{util-BV3iGOrz.cjs → util-Cp1h58uD.cjs} +0 -0
  407. /package/dist/{util-BsQKLorV.js → util-DHppXj7U.js} +0 -0
  408. /package/dist/{util-selector-CKIyoAOz.js → util-selector-BWmHpo92.js} +0 -0
  409. /package/dist/{util-selector-C9H5RsNw.cjs → util-selector-glXkO-jR.cjs} +0 -0
  410. /package/dist/{while-active-CNXeLxre.js → while-active-CDBnUlQA.js} +0 -0
  411. /package/dist/{while-active-BsDWSNrO.cjs → while-active-I2TlHtm7.cjs} +0 -0
@@ -0,0 +1,1112 @@
1
+ const require_chunk = require("./chunk-9hOWP6kD.cjs");
2
+ const require_Address = require("./Address-AMKTo-dA.cjs");
3
+ const require_SodiumBip32Ed25519 = require("./SodiumBip32Ed25519-BaD-kjyx.cjs");
4
+ const require_ChainId = require("./ChainId-CNPSU9nn.cjs");
5
+ const require_PaymentAddress = require("./PaymentAddress-B4n1KZMx.cjs");
6
+ const require_slice = require("./slice-DLflttAu.cjs");
7
+ const require_types = require("./types-Cn6WlQV6.cjs");
8
+ const require_InMemoryKeyAgent = require("./InMemoryKeyAgent-Bc_xZY-v.cjs");
9
+ const require_sdk = require("./sdk-Bm9-P0L-.cjs");
10
+ const require__md = require("./_md-6zV2Cme0.cjs");
11
+ const require_util = require("./util-D1YlKzrc.cjs");
12
+ const require_bytes_vo = require("./bytes.vo-hecRu3YZ.cjs");
13
+ const require_guarded_transaction_signer = require("./guarded-transaction-signer-DTLjAkif.cjs");
14
+ const require_asyncoption = require("./asyncoption-CYcZNBRM.cjs");
15
+ const require_key_source = require("./key-source-D2tTAag-.cjs");
16
+ const require_sha2 = require("./sha2-DaRJZOjk.cjs");
17
+ const require_store = require("./store-C7AneHEY.cjs");
18
+ const require_in_memory_wallet_integration = require("./in-memory-wallet-integration-DsFm8gLk.cjs");
19
+ const require_cardano_tx_id_vo = require("./cardano-tx-id.vo-lnyO9XaW.cjs");
20
+ const require_const = require("./const-D3mCkwrM.cjs");
21
+ const require_TransactionBuilder = require("./TransactionBuilder-BakTJvsJ.cjs");
22
+ const require_composite_signer_factory = require("./composite-signer-factory-v4Pxn8bA.cjs");
23
+ const require_contract = require("./contract-2KVxlHyu.cjs");
24
+ let rxjs = require("rxjs");
25
+ let ts_log = require("ts-log");
26
+ //#region src/cardano-lazy-in-memory-signer-factory.ts
27
+ /**
28
+ * Signer factory for {@link WalletType.LazyInMemory} Cardano accounts.
29
+ *
30
+ * The mnemonic is never persisted by Lace. Its derived account key must match
31
+ * the selected account before signing, regardless of the mnemonic source.
32
+ */
33
+ var CardanoLazyInMemorySignerFactory = class {
34
+ #withMnemonicWords;
35
+ constructor(props) {
36
+ this.#withMnemonicWords = props.withMnemonicWords;
37
+ }
38
+ canSign(account) {
39
+ return account.accountType === "LazyInMemory" && account.blockchainName === "Cardano";
40
+ }
41
+ createTransactionSigner(context) {
42
+ this.#assertSupported(context);
43
+ const { knownAddresses, utxo, auth } = context;
44
+ const accountProps = this.#extractAccountProps(context);
45
+ return require_guarded_transaction_signer.withCollateralOwnershipGuard(new require_guarded_transaction_signer.CardanoInMemoryTransactionSigner({
46
+ withKeyAgent$: this.#buildWithKeyAgent$(accountProps),
47
+ knownAddresses,
48
+ utxo,
49
+ auth
50
+ }), context);
51
+ }
52
+ createDataSigner(context) {
53
+ this.#assertSupported(context);
54
+ const { knownAddresses, auth } = context;
55
+ const accountProps = this.#extractAccountProps(context);
56
+ return new require_guarded_transaction_signer.CardanoInMemoryDataSigner({
57
+ withKeyAgent$: this.#buildWithKeyAgent$(accountProps),
58
+ dRepKeyHash$: (0, rxjs.defer)(() => (0, rxjs.from)(require_guarded_transaction_signer.deriveDRepKeyHash(accountProps))),
59
+ knownAddresses,
60
+ auth
61
+ });
62
+ }
63
+ #buildWithKeyAgent$(accountProps) {
64
+ return (use) => new rxjs.Observable((subscriber) => {
65
+ const cancelled$ = new rxjs.Subject();
66
+ const assertActive = () => {
67
+ if (subscriber.closed) throw new Error("Signing request cancelled.");
68
+ };
69
+ this.#withMnemonicWords(async (words) => {
70
+ assertActive();
71
+ const mnemonicWords = [...words];
72
+ const keyAgent = await require_guarded_transaction_signer.createCardanoKeyAgentFromMnemonic({
73
+ accountIndex: accountProps.accountIndex,
74
+ chainId: accountProps.chainId,
75
+ mnemonicWords
76
+ });
77
+ try {
78
+ assertActive();
79
+ if (keyAgent.extendedAccountPublicKey !== accountProps.extendedAccountPublicKey) throw new require_contract.LazyWalletMismatchError();
80
+ return await (0, rxjs.lastValueFrom)(use(keyAgent).pipe((0, rxjs.takeUntil)(cancelled$)));
81
+ } finally {
82
+ keyAgent.dispose?.();
83
+ }
84
+ }).then((result) => {
85
+ if (!subscriber.closed) {
86
+ subscriber.next(result);
87
+ subscriber.complete();
88
+ }
89
+ }, (error) => {
90
+ if (!subscriber.closed) subscriber.error(error);
91
+ });
92
+ return () => {
93
+ cancelled$.next();
94
+ cancelled$.complete();
95
+ };
96
+ });
97
+ }
98
+ #assertSupported(context) {
99
+ const account = context.wallet.accounts.find((a) => a.accountId === context.accountId);
100
+ if (!account || !this.canSign(account)) throw new Error(`CardanoLazyInMemorySignerFactory does not support account type: ${account?.accountType ?? "unknown"}`);
101
+ }
102
+ #extractAccountProps(context) {
103
+ const { wallet, accountId } = context;
104
+ const account = wallet.accounts.find((a) => a.accountId === accountId);
105
+ if (!account) throw new Error(`Account ${accountId} not found in wallet`);
106
+ if (account.blockchainName !== "Cardano") throw new Error(`Account ${accountId} is not a Cardano account`);
107
+ const { accountIndex, chainId, extendedAccountPublicKey } = account.blockchainSpecific;
108
+ return {
109
+ accountIndex,
110
+ chainId,
111
+ extendedAccountPublicKey
112
+ };
113
+ }
114
+ };
115
+ //#endregion
116
+ //#region src/create-lazy-in-memory-vault-module.ts
117
+ /**
118
+ * Builds a vault module that signs for {@link WalletType.LazyInMemory}
119
+ * Cardano accounts by asking `withMnemonicWords` for the recovery words at
120
+ * each signature. The words must derive the account's stored key, or signing
121
+ * fails with `LazyWalletMismatchError`.
122
+ *
123
+ * Pass the returned module to `createLaceWallet({ modules: [...] })`. Only the
124
+ * `signer-factory-addon` contract is implemented — `vaultContract` is
125
+ * intentionally omitted because the SDK has no encrypted vault to expose to
126
+ * features such as account management or password verification.
127
+ *
128
+ * @param props - The source of the recovery words.
129
+ * @returns A module for the `modules` array of `createLaceWallet`.
130
+ */
131
+ const createLazyInMemoryVaultModule = (props) => {
132
+ const signerFactory = new CardanoLazyInMemorySignerFactory(props);
133
+ const implementsContracts = require_store.combineContracts([require_sdk.signerFactoryAddonContract]);
134
+ return require_store.inferModuleContext({
135
+ moduleName: require_sdk.ModuleName("lazy-in-memory-vault"),
136
+ implements: implementsContracts,
137
+ addons: { loadSignerFactory: async () => ({ default: () => signerFactory }) }
138
+ });
139
+ };
140
+ //#endregion
141
+ //#region src/passkey-vault-module.ts
142
+ /**
143
+ * A lazy vault module whose recovery words come from a fresh assertion of a
144
+ * passkey at each signature: the words derive from the passkey and are
145
+ * checked against the account's stored key before anything is signed. The
146
+ * assertion stays open until the Cardano signature completes.
147
+ *
148
+ * @param props - The passkey.
149
+ * @returns A module for the `modules` array of `createLaceWallet`.
150
+ */
151
+ const createPasskeyVaultModule = ({ keySource }) => createLazyInMemoryVaultModule({ withMnemonicWords: async (use) => keySource.withPasskeyMnemonic(use) });
152
+ //#endregion
153
+ //#region src/passkey-account-public-key.ts
154
+ /** Use the same CIP-3 Icarus account derivation as Cardano's wallet integration. */
155
+ const passkeyAccountPublicKey = async (words) => {
156
+ const passphrase = crypto.getRandomValues(new Uint8Array(32));
157
+ try {
158
+ return (await require_InMemoryKeyAgent.InMemoryKeyAgent.fromBip39MnemonicWords({
159
+ accountIndex: 0,
160
+ chainId: require_ChainId.ChainIds.Mainnet,
161
+ getPassphrase: async () => passphrase,
162
+ mnemonicWords: [...words],
163
+ purpose: require_types.KeyPurpose.STANDARD
164
+ }, {
165
+ bip32Ed25519: await require_SodiumBip32Ed25519.SodiumBip32Ed25519.create(),
166
+ logger: ts_log.dummyLogger
167
+ })).serializableData.extendedAccountPublicKey;
168
+ } finally {
169
+ passphrase.fill(0);
170
+ }
171
+ };
172
+ //#endregion
173
+ //#region src/passkey-wallet-mismatch-error.ts
174
+ /**
175
+ * The passkey, or the signer, serves another account than the one expected:
176
+ * another credential, relying party or account key than the saved binding or
177
+ * public key names.
178
+ */
179
+ var PasskeyWalletMismatchError = class extends Error {
180
+ constructor() {
181
+ super("Passkey does not match the saved Cardano wallet.");
182
+ this.name = "PasskeyWalletMismatchError";
183
+ }
184
+ };
185
+ //#endregion
186
+ //#region src/passkey-wallet-entity.ts
187
+ const fingerprint = (publicKey) => require__md.bytesToHex(require_sha2.sha256(new TextEncoder().encode(publicKey)));
188
+ /**
189
+ * Derives the Cardano wallet of a passkey in one assertion, checks it against
190
+ * an expected binding, and returns its wallet entity with the binding to
191
+ * persist. The entity is a `LazyInMemoryWallet`: it stores only public keys,
192
+ * and `createPasskeyVaultModule` signs for it.
193
+ *
194
+ * @param wallet - The wallet the entity is for.
195
+ * @param props - The key source, the name and the saved binding.
196
+ * @returns The entity, for `wallets.addWallet`, and the binding to persist.
197
+ * Rejects with `PasskeyWalletMismatchError` when the passkey serves another
198
+ * account than `expectedBinding`.
199
+ */
200
+ const createPasskeyWalletEntity = async (wallet, { keySource, walletName, expectedBinding }) => {
201
+ const ref = keySource.credentialRef();
202
+ if (expectedBinding && ref && (ref.credentialId !== expectedBinding.credentialId || ref.rpId !== expectedBinding.rpId || ref.recipeVersion !== expectedBinding.recipeVersion)) throw new PasskeyWalletMismatchError();
203
+ return keySource.withPasskeyMnemonic(async (words) => {
204
+ const assertedRef = keySource.credentialRef();
205
+ if (!assertedRef || ref && assertedRef.credentialId !== ref.credentialId) throw new PasskeyWalletMismatchError();
206
+ const publicKey = await passkeyAccountPublicKey(words);
207
+ const binding = {
208
+ ...assertedRef,
209
+ fingerprint: fingerprint(publicKey)
210
+ };
211
+ if (expectedBinding && (binding.credentialId !== expectedBinding.credentialId || binding.rpId !== expectedBinding.rpId || binding.recipeVersion !== expectedBinding.recipeVersion || binding.fingerprint !== expectedBinding.fingerprint)) throw new PasskeyWalletMismatchError();
212
+ const entity = await require_sdk.createBlockchainWalletEntity(wallet, "Cardano", {
213
+ mnemonicWords: [...words],
214
+ walletName
215
+ });
216
+ const accounts = entity.accounts.filter((account) => account.blockchainName === "Cardano");
217
+ if (accounts.length === 0 || accounts.some((account) => account.blockchainSpecific.extendedAccountPublicKey !== publicKey)) throw new PasskeyWalletMismatchError();
218
+ return {
219
+ entity: {
220
+ ...entity,
221
+ accounts
222
+ },
223
+ binding
224
+ };
225
+ });
226
+ };
227
+ //#endregion
228
+ //#region ../../packages/lib/passkey/src/remote/protocol.ts
229
+ /** Whether a channel message is shaped like a signer response. */
230
+ const isSignerResponse = (data) => typeof data === "object" && data !== null && "id" in data && typeof data.id === "number" && "ok" in data && typeof data.ok === "boolean";
231
+ /** Whether a window or channel message carries the given `type` tag. */
232
+ const hasMessageType = (data, type) => typeof data === "object" && data !== null && "type" in data && data.type === type;
233
+ //#endregion
234
+ //#region ../../packages/lib/passkey/src/remote/client.ts
235
+ const POPUP_NAME = "lace-signer";
236
+ const POPUP_FEATURES = "popup,width=420,height=600";
237
+ const POPUP_CLOSED_POLL_INTERVAL = 500;
238
+ /**
239
+ * The low-level client underneath `createRemotePasskeySigner`: it opens the
240
+ * hosted signer page in a popup, completes the handshake over a message
241
+ * channel and carries typed requests to it.
242
+ *
243
+ * Only messages whose origin is the signer's and whose source is the popup
244
+ * this client opened are trusted: any other page that can reach the dApp
245
+ * window could otherwise complete the handshake and receive the port.
246
+ * The hello message is posted to the signer origin alone, so a popup that
247
+ * navigated elsewhere never receives the port either.
248
+ *
249
+ * The popup's loaded message is awaited from `open`, not from `connect`,
250
+ * so a dApp that awaits anything between the two cannot miss it.
251
+ */
252
+ const createSignerClient = ({ signerUrl, host = window }) => {
253
+ const signerOrigin = new URL(signerUrl).origin;
254
+ const pending = /* @__PURE__ */ new Map();
255
+ let nextId = 1;
256
+ let opened;
257
+ let port;
258
+ let didClose = false;
259
+ const close = () => {
260
+ const closing = opened;
261
+ opened = void 0;
262
+ if (closing) didClose = true;
263
+ closing?.stop();
264
+ if (closing && !closing.popup.closed) closing.popup.close();
265
+ port?.close();
266
+ port = void 0;
267
+ closing?.settleClosed();
268
+ const error = new require_key_source.SignerClosedError();
269
+ for (const request of pending.values()) request.reject(error);
270
+ pending.clear();
271
+ };
272
+ const trackPopup = (popup) => {
273
+ let stopListening = () => {};
274
+ const loaded = new Promise((resolve) => {
275
+ const onMessage = (event) => {
276
+ if (event.origin !== signerOrigin || event.source !== popup) return;
277
+ if (!hasMessageType(event.data, "signer-loaded")) return;
278
+ stopListening();
279
+ resolve();
280
+ };
281
+ host.addEventListener("message", onMessage);
282
+ stopListening = () => {
283
+ host.removeEventListener("message", onMessage);
284
+ };
285
+ });
286
+ let settleClosed = () => {};
287
+ const closed = new Promise((_, reject) => {
288
+ settleClosed = () => {
289
+ reject(new require_key_source.SignerClosedError());
290
+ };
291
+ });
292
+ closed.catch(() => {});
293
+ const interval = setInterval(() => {
294
+ if (popup.closed) close();
295
+ }, POPUP_CLOSED_POLL_INTERVAL);
296
+ return {
297
+ popup,
298
+ loaded,
299
+ closed,
300
+ settleClosed,
301
+ stop: () => {
302
+ clearInterval(interval);
303
+ stopListening();
304
+ }
305
+ };
306
+ };
307
+ const open = () => {
308
+ close();
309
+ const popup = host.open(signerUrl, POPUP_NAME, POPUP_FEATURES);
310
+ if (!popup) throw new require_key_source.SignerPopupBlockedError();
311
+ opened = trackPopup(popup);
312
+ didClose = false;
313
+ return popup;
314
+ };
315
+ const onResponse = (event) => {
316
+ if (!isSignerResponse(event.data)) return;
317
+ const response = event.data;
318
+ const request = pending.get(response.id);
319
+ if (!request) return;
320
+ pending.delete(response.id);
321
+ if (response.ok) request.resolve(response.result);
322
+ else request.reject(new require_key_source.RemoteSignerError(response.code, response.message, response.details));
323
+ };
324
+ const handshake = async ({ popup, loaded, closed }) => {
325
+ await Promise.race([loaded, closed]);
326
+ const channel = new MessageChannel();
327
+ const ready = new Promise((resolve) => {
328
+ const onReady = (event) => {
329
+ if (!hasMessageType(event.data, "ready")) return;
330
+ channel.port1.removeEventListener("message", onReady);
331
+ resolve();
332
+ };
333
+ channel.port1.addEventListener("message", onReady);
334
+ });
335
+ channel.port1.addEventListener("message", onResponse);
336
+ channel.port1.start();
337
+ port = channel.port1;
338
+ popup.postMessage({ type: "hello" }, signerOrigin, [channel.port2]);
339
+ await Promise.race([ready, closed]);
340
+ };
341
+ const connect = async () => {
342
+ if (!opened) throw new Error("The signer popup is not open.");
343
+ opened.handshake ??= handshake(opened);
344
+ return opened.handshake;
345
+ };
346
+ const request = async (kind, payload) => {
347
+ const activePort = port;
348
+ if (!activePort) {
349
+ if (didClose) throw new require_key_source.SignerClosedError();
350
+ throw new Error("The signer is not connected.");
351
+ }
352
+ const id = nextId;
353
+ nextId += 1;
354
+ return new Promise((resolve, reject) => {
355
+ pending.set(id, {
356
+ resolve,
357
+ reject
358
+ });
359
+ try {
360
+ activePort.postMessage({
361
+ id,
362
+ kind,
363
+ payload
364
+ });
365
+ } catch (error) {
366
+ pending.delete(id);
367
+ throw error;
368
+ }
369
+ });
370
+ };
371
+ return {
372
+ open,
373
+ connect,
374
+ request,
375
+ close
376
+ };
377
+ };
378
+ //#endregion
379
+ //#region src/cardano-remote-signer-factory.ts
380
+ /** The signer answered a request with a result of the wrong shape. */
381
+ var RemoteSignerResultError = class extends Error {
382
+ constructor() {
383
+ super("The signer returned a malformed result.");
384
+ this.name = "RemoteSignerResultError";
385
+ }
386
+ };
387
+ const isRecord$1 = (value) => typeof value === "object" && value !== null;
388
+ const parseSignResult = (result) => {
389
+ if (!isRecord$1(result) || typeof result.serializedTx !== "string" || typeof result.signatureCount !== "number") throw new RemoteSignerResultError();
390
+ return {
391
+ serializedTx: require_bytes_vo.HexBytes(result.serializedTx),
392
+ signatureCount: result.signatureCount
393
+ };
394
+ };
395
+ const parseSignDataResult = (result) => {
396
+ if (!isRecord$1(result) || typeof result.signature !== "string" || typeof result.key !== "string") throw new RemoteSignerResultError();
397
+ return {
398
+ signature: require_bytes_vo.HexBytes(result.signature),
399
+ key: require_bytes_vo.HexBytes(result.key)
400
+ };
401
+ };
402
+ /**
403
+ * Signer factory for {@link WalletType.LazyInMemory} Cardano accounts whose
404
+ * passkey lives with the Lace signer page. Each sign request travels to the
405
+ * signer with the transaction and the public account data, and only the
406
+ * signed transaction or signature comes back; the mnemonic never reaches
407
+ * the dApp. Consent is the Approve click inside the signer, so no local
408
+ * authentication prompt runs.
409
+ */
410
+ var CardanoRemoteSignerFactory = class {
411
+ #client;
412
+ constructor(props) {
413
+ this.#client = props.client;
414
+ }
415
+ canSign(account) {
416
+ return account.accountType === "LazyInMemory" && account.blockchainName === "Cardano";
417
+ }
418
+ createTransactionSigner(context) {
419
+ const { knownAddresses, utxo } = context;
420
+ const account = this.#resolveAccountProps(context);
421
+ return require_guarded_transaction_signer.withCollateralOwnershipGuard({ sign: ({ serializedTx }) => (0, rxjs.defer)(() => (0, rxjs.from)(this.#client.request("sign-cardano-tx", {
422
+ serializedTx,
423
+ knownAddresses,
424
+ utxo,
425
+ ...account
426
+ }))).pipe((0, rxjs.map)(parseSignResult)) }, context);
427
+ }
428
+ createDataSigner(context) {
429
+ const { knownAddresses } = context;
430
+ const account = this.#resolveAccountProps(context);
431
+ return { signData: ({ signWith, payload }) => (0, rxjs.defer)(() => (0, rxjs.from)(this.#client.request("sign-cardano-data", {
432
+ signWith,
433
+ payload,
434
+ knownAddresses,
435
+ ...account
436
+ }))).pipe((0, rxjs.map)(parseSignDataResult)) };
437
+ }
438
+ /** Reads the public account data the signer needs from the context. */
439
+ #resolveAccountProps(context) {
440
+ const account = context.wallet.accounts.find((a) => a.accountId === context.accountId);
441
+ if (!account || !this.canSign(account)) throw new Error(`CardanoRemoteSignerFactory does not support account type: ${account?.accountType ?? "unknown"}`);
442
+ const { accountIndex, chainId, extendedAccountPublicKey } = account.blockchainSpecific;
443
+ return {
444
+ accountIndex,
445
+ chainId: {
446
+ networkId: chainId.networkId,
447
+ networkMagic: chainId.networkMagic
448
+ },
449
+ extendedAccountPublicKey
450
+ };
451
+ }
452
+ };
453
+ //#endregion
454
+ //#region src/remote-cardano-vault-module.ts
455
+ /**
456
+ * Builds a vault module that signs for
457
+ * {@link WalletType.LazyInMemory} Cardano accounts through the Lace signer
458
+ * page instead of a local mnemonic. Pass the returned module to
459
+ * `createLaceWallet({ modules: [...] })`. Only the `signer-factory-addon`
460
+ * contract is implemented, as with the local lazy vault: the SDK has no
461
+ * encrypted vault to expose. A `RemotePasskeySigner` carries one ready-made,
462
+ * as `cardanoVaultModule`.
463
+ *
464
+ * @param props - The connected signer client.
465
+ * @returns A module for the `modules` array of `createLaceWallet`.
466
+ */
467
+ const createRemoteCardanoVaultModule = (props) => {
468
+ const signerFactory = new CardanoRemoteSignerFactory(props);
469
+ const implementsContracts = require_store.combineContracts([require_sdk.signerFactoryAddonContract]);
470
+ return require_store.inferModuleContext({
471
+ moduleName: require_sdk.ModuleName("remote-cardano-vault"),
472
+ implements: implementsContracts,
473
+ addons: { loadSignerFactory: async () => ({ default: () => signerFactory }) }
474
+ });
475
+ };
476
+ //#endregion
477
+ //#region src/remote-cardano-account-public-key.ts
478
+ const isRecord = (value) => typeof value === "object" && value !== null;
479
+ const parseAccountPublicKeyResult = (result, accountIndex) => {
480
+ if (!isRecord(result) || result.accountIndex !== accountIndex || typeof result.extendedAccountPublicKey !== "string") throw new RemoteSignerResultError();
481
+ try {
482
+ return require_Address.Bip32PublicKeyHex(result.extendedAccountPublicKey);
483
+ } catch {
484
+ throw new RemoteSignerResultError();
485
+ }
486
+ };
487
+ /**
488
+ * Asks the signer for the extended public key of one Cardano account. The
489
+ * signer asks the user to share it, so it is one consent per call; the
490
+ * result is public and safe for the dApp to persist.
491
+ */
492
+ const requestRemoteCardanoAccountPublicKey = async (client, accountIndex) => parseAccountPublicKeyResult(await client.request("cardano-account-public-key", { accountIndex }), accountIndex);
493
+ //#endregion
494
+ //#region src/remote-passkey-signer.ts
495
+ /**
496
+ * Creates one connection to the hosted Lace signer page and everything a dApp
497
+ * signs Cardano transactions and data with through it: the connection's
498
+ * `open`, `connect`, `close` and `request`, the `cardanoVaultModule` and
499
+ * `accountPublicKey(index)`.
500
+ *
501
+ * It composes {@link createSignerClient} with the remote Cardano vault
502
+ * module, so a dApp gets one connection to the Lace signer page instead of
503
+ * building its own key source. The hosted signer is a self-custodial wallet:
504
+ * wallet keys are derived and used in its window in the user's browser, and
505
+ * the passkey stays in the user's authenticator. The dApp receives public
506
+ * keys and signatures only.
507
+ *
508
+ * `open` must run synchronously inside the user's click handler: browsers
509
+ * refuse a popup opened after an await. Call `connect` right after `open`
510
+ * to complete the handshake; calling it before the popup is open rejects.
511
+ *
512
+ * Each Cardano signature is its own Approve click in the signer window and
513
+ * its own fresh passkey assertion.
514
+ *
515
+ * @param props - The signer page's URL and the window that opens it.
516
+ * @returns The signer. Call `open()` synchronously in a click handler, then
517
+ * `await connect()`.
518
+ */
519
+ const createRemotePasskeySigner = ({ signerUrl, host }) => {
520
+ const client = createSignerClient({
521
+ signerUrl,
522
+ host
523
+ });
524
+ return {
525
+ open: client.open,
526
+ connect: client.connect,
527
+ close: client.close,
528
+ request: client.request,
529
+ cardanoVaultModule: createRemoteCardanoVaultModule({ client }),
530
+ accountPublicKey: async (accountIndex) => requestRemoteCardanoAccountPublicKey(client, accountIndex)
531
+ };
532
+ };
533
+ //#endregion
534
+ //#region ../../packages/module/blockchain-cardano/src/sdk-contracts.ts
535
+ const implementsContracts = require_store.combineContracts([
536
+ require_sdk.inMemoryIntegrationAddonContract,
537
+ require_sdk.tokensStoreContract,
538
+ require_sdk.addressesStoreContract,
539
+ require_sdk.signerFactoryAddonContract,
540
+ require_sdk.syncStoreContract,
541
+ require_contract.addressBookAddressValidatorAddonContract,
542
+ require_sdk.delegationTxBuilderAddonContract,
543
+ require_sdk.cardanoInMemorySigningDependencyContract,
544
+ require_contract.tokenIdMapperAddonContract,
545
+ require_sdk.deregistrationTxBuilderAddonContract,
546
+ require_sdk.voteDelegationTxBuilderAddonContract,
547
+ require_sdk.earnRewardsTxBuilderAddonContract
548
+ ]);
549
+ const dependsOnContracts = require_store.combineContracts([
550
+ require_sdk.featureStoreContract,
551
+ require_sdk.cardanoProviderStoreContract,
552
+ require_sdk.walletRepoStoreContract
553
+ ]);
554
+ //#endregion
555
+ //#region ../../packages/module/blockchain-cardano/src/store/index.ts
556
+ var store_default$1 = require_store.inferStoreContext({
557
+ load: async () => Promise.resolve().then(() => require("./init-MDKB6tGI2.cjs")),
558
+ context: {
559
+ actions: {},
560
+ selectors: {}
561
+ }
562
+ });
563
+ //#endregion
564
+ //#region ../../packages/module/blockchain-cardano/src/sdk.ts
565
+ /**
566
+ * Cardano accounts: their addresses, tokens and sync, signing, and the
567
+ * transaction builders for delegation, voting and rewards. Loads when
568
+ * `FEATURE_FLAG_CARDANO` is enabled, and needs a Cardano provider module such
569
+ * as `m.cardanoProviderBlockfrost`.
570
+ */
571
+ var sdk_default$2 = require_store.inferModuleContext({
572
+ moduleName: require_sdk.ModuleName("blockchain-cardano"),
573
+ implements: implementsContracts,
574
+ dependsOn: dependsOnContracts,
575
+ feature: {
576
+ willLoad: (featureFlags) => featureFlags.some((flag) => flag.key === require_const.FEATURE_FLAG_CARDANO),
577
+ metadata: {
578
+ name: "Cardano",
579
+ description: "Cardano blockchain support"
580
+ }
581
+ },
582
+ store: store_default$1,
583
+ addons: {
584
+ loadInMemoryWalletIntegration: async () => Promise.resolve().then(() => require("./in-memory-wallet-integration-aW_SF-go.cjs")),
585
+ loadAddressBookAddressValidators: async () => Promise.resolve().then(() => require("./address-book-address-validator-CGIcqn5W.cjs")),
586
+ loadDelegationTxBuilder: async () => Promise.resolve().then(() => require("./delegation-tx-builder-Cp30jtj9.cjs")),
587
+ loadTokenIdMapper: async () => Promise.resolve().then(() => require("./token-id-mapper-D0wFdbOy.cjs")),
588
+ loadDeregistrationTxBuilder: async () => Promise.resolve().then(() => require("./deregistration-tx-builder-B-ZeY-dR.cjs")),
589
+ loadVoteDelegationTxBuilder: async () => Promise.resolve().then(() => require("./vote-delegation-tx-builder-BjZxCOd3.cjs")),
590
+ loadEarnRewardsTxBuilder: async () => Promise.resolve().then(() => require("./earn-rewards-tx-builder-cOUNV58E.cjs")),
591
+ loadSignerFactory: async () => Promise.resolve().then(() => require("./signer-factory-D95jQIPV.cjs"))
592
+ }
593
+ });
594
+ //#endregion
595
+ //#region src/remote-passkey-wallet-entity.ts
596
+ /**
597
+ * Builds a Cardano wallet entity from the public account key the user agrees
598
+ * to share through the hosted self-custodial passkey wallet. It fails
599
+ * closed with {@link PasskeyWalletMismatchError} when that key differs from
600
+ * `expectedPublicKey`.
601
+ *
602
+ * The entity is a {@link WalletType.LazyInMemory} wallet built from the
603
+ * public account key alone:
604
+ * no mnemonic, PRF output or encrypted root ever reaches the dApp, so there
605
+ * is nothing secret to persist. Wallet keys stay in the signer's window in
606
+ * the user's browser. The wallet id is derived from the public key.
607
+ *
608
+ * Mainnet and testnet accounts are returned; consumers choose which to expose.
609
+ *
610
+ * @param props - The signer, the name, the account and the saved key.
611
+ * @returns The entity and the public key to persist.
612
+ */
613
+ const createRemotePasskeyWalletEntity = async ({ signer, walletName, accountIndex = 0, expectedPublicKey, order = 0 }) => {
614
+ const publicKey = await signer.accountPublicKey(accountIndex);
615
+ if (expectedPublicKey !== void 0 && publicKey !== expectedPublicKey) throw new PasskeyWalletMismatchError();
616
+ const walletId = require_sdk.WalletId.deriveFromBip32PublicKey(publicKey);
617
+ return {
618
+ entity: {
619
+ accounts: require_in_memory_wallet_integration.createLazyAccountsFromAccountPublicKey({
620
+ walletId,
621
+ accountIndex,
622
+ extendedAccountPublicKey: publicKey
623
+ }),
624
+ blockchainSpecific: {},
625
+ metadata: {
626
+ name: walletName,
627
+ order
628
+ },
629
+ type: require_sdk.WalletType.LazyInMemory,
630
+ walletId
631
+ },
632
+ publicKey
633
+ };
634
+ };
635
+ //#endregion
636
+ //#region src/create-tx-builder.ts
637
+ /**
638
+ * Creates a {@link TransactionBuilder} pre-configured with the active Cardano
639
+ * network and protocol parameters from the wallet's Redux state.
640
+ *
641
+ * Call {@link waitForNetworkInfo} first to ensure the state is ready.
642
+ *
643
+ * @param wallet - A wallet with the Cardano modules loaded (see
644
+ * {@link WalletWithCardanoContext}), whose network info has arrived.
645
+ * @returns `Ok` with the builder, or `Err` until the chain ID and protocol
646
+ * parameters are in the wallet's state.
647
+ */
648
+ const createTxBuilder = (wallet) => {
649
+ const state = wallet.getState();
650
+ const chainId = require_slice.cardanoContextSelectors.cardanoContext.selectChainId(state);
651
+ if (!chainId) return require_asyncoption.Err(/* @__PURE__ */ new Error("Cardano network not initialized — ensure a wallet entity has been created and the Cardano blockchain module is loaded"));
652
+ const protocolParameters = require_slice.cardanoContextSelectors.cardanoContext.selectProtocolParameters(state);
653
+ if (!protocolParameters) return require_asyncoption.Err(/* @__PURE__ */ new Error("Protocol parameters not available — ensure the Cardano provider has synced"));
654
+ return require_asyncoption.Ok(new require_TransactionBuilder.TransactionBuilder(chainId.networkMagic, protocolParameters));
655
+ };
656
+ /**
657
+ * Returns a promise that resolves once the Cardano network info (chain ID and
658
+ * protocol parameters) is available in the wallet state. Await this before
659
+ * calling {@link createTxBuilder} to guarantee it succeeds.
660
+ *
661
+ * @param wallet - A wallet with the Cardano modules loaded (see
662
+ * {@link WalletWithCardanoContext}).
663
+ * @param options - Optional configuration.
664
+ * @returns The chain ID and protocol parameters, once both are in state.
665
+ */
666
+ const waitForNetworkInfo = async (wallet, options) => (0, rxjs.firstValueFrom)((0, rxjs.combineLatest)([wallet.stateObservables.cardanoContext.selectChainId$, wallet.stateObservables.cardanoContext.selectProtocolParameters$]).pipe((0, rxjs.filter)((pair) => pair[0] != null && pair[1] != null), (0, rxjs.map)(([chainId, protocolParameters]) => ({
667
+ chainId,
668
+ protocolParameters
669
+ })), options?.timeout != null ? (0, rxjs.timeout)({ first: options.timeout }) : passthrough()));
670
+ const passthrough = () => (source$) => source$;
671
+ //#endregion
672
+ //#region src/sign-cardano-tx.ts
673
+ const isSignableCardanoWallet = (wallet) => wallet.type === require_sdk.WalletType.InMemory || wallet.type === require_sdk.WalletType.LazyInMemory;
674
+ /**
675
+ * Signs a Cardano transaction with the wallet's keys, through the signer of
676
+ * its wallet kind, with no confirmation prompt of the SDK's own: confirm with
677
+ * the user before calling it. The account is `props.accountId`, or the only
678
+ * signable Cardano account on the active network.
679
+ *
680
+ * @param wallet - A wallet holding the signing account (see
681
+ * {@link WalletWithCardanoSigning}).
682
+ * @param props - The unsigned transaction, and the password and account when
683
+ * needed.
684
+ * @returns `Ok` with the signed transaction, ready for `submitCardanoTx`, or
685
+ * `Err` when no account matches, the password is missing or signing fails.
686
+ * It never rejects.
687
+ */
688
+ const signCardanoTx = async (wallet, props) => {
689
+ const { serializedTx, password, accountId: requestedAccountId } = props;
690
+ try {
691
+ const { stateObservables: obs } = wallet;
692
+ const allWallets = await (0, rxjs.firstValueFrom)(obs.wallets.selectAll$);
693
+ const activeNetworkIds = await (0, rxjs.firstValueFrom)(obs.network.selectAllActiveNetworkIds$);
694
+ const allAddresses = await (0, rxjs.firstValueFrom)(obs.addresses.selectAllAddresses$);
695
+ const accountUtxos = await (0, rxjs.firstValueFrom)(obs.cardanoContext.selectCollateralOwnershipUtxos$);
696
+ const signableWallets = allWallets.filter(isSignableCardanoWallet);
697
+ const cardanoAccounts = signableWallets.flatMap((w) => w.accounts.filter((a) => a.blockchainName === "Cardano" && activeNetworkIds.includes(a.blockchainNetworkId)));
698
+ let accountId;
699
+ let walletEntity;
700
+ if (requestedAccountId) {
701
+ const found = cardanoAccounts.find((a) => a.accountId === requestedAccountId);
702
+ if (!found) return require_asyncoption.Err(/* @__PURE__ */ new Error(`Cardano account "${requestedAccountId}" not found on the active network`));
703
+ accountId = found.accountId;
704
+ walletEntity = signableWallets.find((w) => w.walletId === found.walletId);
705
+ } else {
706
+ if (cardanoAccounts.length === 0) return require_asyncoption.Err(/* @__PURE__ */ new Error("No Cardano accounts found on the active network"));
707
+ if (cardanoAccounts.length > 1) return require_asyncoption.Err(/* @__PURE__ */ new Error(`Multiple Cardano accounts found (${cardanoAccounts.length}) — specify accountId to disambiguate`));
708
+ const account = cardanoAccounts[0];
709
+ accountId = account.accountId;
710
+ walletEntity = signableWallets.find((w) => w.walletId === account.walletId);
711
+ }
712
+ if (walletEntity.type === require_sdk.WalletType.InMemory && !password) return require_asyncoption.Err(/* @__PURE__ */ new Error("password is required for InMemory wallets — supply props.password or use a LazyInMemory wallet"));
713
+ const knownAddresses = allAddresses.filter((addr) => addr.accountId === accountId && addr.blockchainName === "Cardano").filter(require_util.isCardanoAddress).map((addr) => ({
714
+ data: addr.data,
715
+ address: addr.address
716
+ })).filter((addr) => !!addr.data).map((addr) => ({
717
+ type: addr.data.type,
718
+ index: addr.data.index,
719
+ networkId: addr.data.networkId,
720
+ accountIndex: addr.data.accountIndex,
721
+ address: require_PaymentAddress.PaymentAddress(addr.address),
722
+ rewardAccount: require_Address.RewardAccount(addr.data.rewardAccount),
723
+ stakeKeyDerivationPath: addr.data.stakeKeyDerivationPath
724
+ }));
725
+ const utxo = accountUtxos[accountId] ?? [];
726
+ const auth = {
727
+ authenticate: () => (0, rxjs.of)(true),
728
+ accessAuthSecret: (callback) => password ? callback(require_sdk.AuthSecret(require_bytes_vo.ByteArray(password))) : (0, rxjs.throwError)(() => /* @__PURE__ */ new Error("accessAuthSecret called on a wallet that has no password — this is a LazyInMemory wallet; signer factories must not access the auth secret"))
729
+ };
730
+ const signerFactory = new require_composite_signer_factory.CompositeSignerFactory(await wallet._loadModules("addons.loadSignerFactory"));
731
+ const context = {
732
+ wallet: walletEntity,
733
+ accountId,
734
+ knownAddresses,
735
+ utxo,
736
+ collateralInputResolver: require_util.createInputResolver(utxo),
737
+ auth
738
+ };
739
+ return require_asyncoption.Ok(await (0, rxjs.firstValueFrom)(signerFactory.createTransactionSigner(context).sign({ serializedTx: require_bytes_vo.HexBytes(serializedTx) })));
740
+ } catch (error) {
741
+ return require_asyncoption.Err(error instanceof Error ? error : new Error(String(error)));
742
+ }
743
+ };
744
+ //#endregion
745
+ //#region src/submit-cardano-tx.ts
746
+ const SUBMIT_TX_TIMEOUT_MS = 6e4;
747
+ /**
748
+ * Submits a signed transaction through the wallet's Cardano provider and
749
+ * waits up to 60 seconds for the provider's answer.
750
+ *
751
+ * @param wallet - A wallet with the Cardano modules loaded (see
752
+ * {@link WalletWithCardanoSubmit}).
753
+ * @param props - The signed transaction.
754
+ * @returns `Ok` with the transaction ID once the provider accepts it, or
755
+ * `Err` with the provider's refusal or a timeout. It never rejects.
756
+ */
757
+ const submitCardanoTx = async (wallet, props) => {
758
+ const { serializedTx } = props;
759
+ try {
760
+ const txId = require_cardano_tx_id_vo.CardanoTxId.fromCbor(serializedTx);
761
+ const resultPromise = (0, rxjs.firstValueFrom)((0, rxjs.merge)(wallet.actionObservables.cardanoContext.submitTxCompleted$.pipe((0, rxjs.filter)(({ payload }) => payload.txId === txId), (0, rxjs.map)(({ payload }) => require_asyncoption.Ok({ txId: payload.txId }))), wallet.actionObservables.cardanoContext.submitTxFailed$.pipe((0, rxjs.filter)(({ payload }) => payload.txId === txId), (0, rxjs.map)(({ payload }) => require_asyncoption.Err(new Error(payload.error))))).pipe((0, rxjs.timeout)(SUBMIT_TX_TIMEOUT_MS)));
762
+ wallet.dispatch("cardanoContext.submitTx", { serializedTx });
763
+ return await resultPromise;
764
+ } catch (error) {
765
+ return require_asyncoption.Err(error instanceof Error ? error : new Error(String(error)));
766
+ }
767
+ };
768
+ //#endregion
769
+ //#region ../../packages/module/swap-provider-steelswap/src/steelswap/steelswap-mappers.ts
770
+ const STEELSWAP_PROVIDER_ID = "steelswap";
771
+ const STEELSWAP_PARTNER = "lace-aggregator";
772
+ const STEELSWAP_PARTNER_ADDRESS = "$lace@steelswap";
773
+ const LOVELACE_DECIMALS = 6;
774
+ const QUOTE_EXPIRY_MS = 15e3;
775
+ const DEFAULT_PARTNER = {
776
+ name: STEELSWAP_PARTNER,
777
+ address: STEELSWAP_PARTNER_ADDRESS
778
+ };
779
+ const lovelaceToAda = (lovelace) => (lovelace / 10 ** LOVELACE_DECIMALS).toFixed(2);
780
+ const makeLovelaceFee = (label, amount) => ({
781
+ label,
782
+ amount: String(amount),
783
+ tokenId: "lovelace",
784
+ displayAmount: lovelaceToAda(amount),
785
+ displayCurrency: "ADA"
786
+ });
787
+ const toSmallestUnit = (displayAmount, decimals) => {
788
+ const number_ = Number(displayAmount);
789
+ if (Number.isNaN(number_) || number_ === 0) return 0;
790
+ return Math.round(number_ * 10 ** decimals);
791
+ };
792
+ const toEstimateRequest = (request, partner = DEFAULT_PARTNER) => ({
793
+ tokenA: request.sellTokenId,
794
+ tokenB: request.buyTokenId,
795
+ quantity: toSmallestUnit(request.sellAmount, request.sellTokenDecimals),
796
+ ignoreDexes: request.excludedDexes,
797
+ partner: partner.name,
798
+ hop: true,
799
+ da: []
800
+ });
801
+ const fromEstimateResponse = (response, request) => {
802
+ const route = (response.pools ?? (response.splitGroup ?? []).flat().flatMap((split) => split.pools ?? [])).map((pool) => ({
803
+ dexName: pool.dex,
804
+ sellTokenId: response.tokenA,
805
+ buyTokenId: response.tokenB,
806
+ percentage: response.quantityA > 0 ? pool.quantityA / response.quantityA : 0
807
+ }));
808
+ const fees = [makeLovelaceFee("v2.swap.review.network-fee", response.totalFee), makeLovelaceFee("v2.swap.review.service-fee", response.steelswapFee)];
809
+ const deposit = response.totalDeposit > 0 ? {
810
+ amount: String(response.totalDeposit),
811
+ displayAmount: lovelaceToAda(response.totalDeposit),
812
+ displayCurrency: "ADA"
813
+ } : void 0;
814
+ const totalFeeLovelace = response.totalFee + response.steelswapFee;
815
+ return {
816
+ routeId: `steelswap-${request.sellTokenId}-${request.buyTokenId}-${Date.now()}`,
817
+ providerId: STEELSWAP_PROVIDER_ID,
818
+ sellTokenId: response.tokenA,
819
+ buyTokenId: response.tokenB,
820
+ sellAmount: String(response.quantityA),
821
+ expectedBuyAmount: String(response.quantityB),
822
+ price: response.price,
823
+ priceDisplay: `${response.price.toFixed(6)}`,
824
+ fees,
825
+ totalFeeDisplay: `${lovelaceToAda(totalFeeLovelace)} ADA`,
826
+ deposit,
827
+ route,
828
+ quoteExpiresAt: Date.now() + QUOTE_EXPIRY_MS
829
+ };
830
+ };
831
+ const toBuildRequest = (request, partner = DEFAULT_PARTNER) => ({
832
+ tokenA: request.quote.sellTokenId,
833
+ tokenB: request.quote.buyTokenId,
834
+ quantity: Number(request.quote.sellAmount),
835
+ ignoreDexes: [],
836
+ partner: partner.name,
837
+ hop: true,
838
+ da: [],
839
+ address: request.userAddress,
840
+ forwardAddress: "",
841
+ utxos: request.utxos,
842
+ collateral: request.collateralUtxos,
843
+ slippage: Math.round(request.slippage * 100),
844
+ pAddress: partner.address,
845
+ feeAdust: true,
846
+ ttl: request.ttl
847
+ });
848
+ const fromBuildResponse = (response) => ({
849
+ unsignedTxCbor: response.tx,
850
+ providerId: STEELSWAP_PROVIDER_ID
851
+ });
852
+ const getCardanoTokenIconUrl = (nftCdnUrl, policyId, assetName) => {
853
+ try {
854
+ return `${nftCdnUrl}/lace/image/${require_Address.AssetFingerprint.fromParts(require_Address.PolicyId(policyId), require_Address.AssetName(assetName))}?size=64`;
855
+ } catch {
856
+ return;
857
+ }
858
+ };
859
+ const fromTokenSummary = (token, nftCdnUrl) => {
860
+ const tokenKey = token.policyId && token.policyName ? `${token.policyId}${token.policyName}` : "lovelace";
861
+ const iconUrl = token.policyId && token.policyName ? getCardanoTokenIconUrl(nftCdnUrl, token.policyId, token.policyName) : void 0;
862
+ return {
863
+ id: tokenKey,
864
+ ticker: token.ticker,
865
+ name: token.name,
866
+ decimals: token.decimals,
867
+ policyId: token.policyId || void 0,
868
+ icon: iconUrl
869
+ };
870
+ };
871
+ const fromDexList = (dexNames) => dexNames.map((name) => ({
872
+ id: name,
873
+ name
874
+ }));
875
+ const extractDetailFromErrorMessage = (message) => {
876
+ const jsonStart = message.indexOf("{");
877
+ if (jsonStart === -1) return message;
878
+ try {
879
+ return JSON.parse(message.slice(jsonStart)).detail ?? message;
880
+ } catch {
881
+ return message;
882
+ }
883
+ };
884
+ const toSwapProviderError = (error) => {
885
+ if (error instanceof Error) return {
886
+ code: "PROVIDER_UNAVAILABLE",
887
+ message: extractDetailFromErrorMessage(error.message)
888
+ };
889
+ return {
890
+ code: "UNKNOWN",
891
+ message: String(error)
892
+ };
893
+ };
894
+ //#endregion
895
+ //#region ../../packages/module/swap-provider-steelswap/src/steelswap/steelswap-provider.ts
896
+ const jsonPost = async (url, body) => {
897
+ const response = await fetch(url, {
898
+ method: "POST",
899
+ headers: { "Content-Type": "application/json" },
900
+ body: JSON.stringify(body)
901
+ });
902
+ if (!response.ok) {
903
+ const text = await response.text().catch(() => "");
904
+ throw new Error(`SteelSwap API error (${response.status}): ${text || response.statusText}`);
905
+ }
906
+ return await response.json();
907
+ };
908
+ const jsonGet = async (url) => {
909
+ const response = await fetch(url);
910
+ if (!response.ok) throw new Error(`SteelSwap API error (${response.status}): ${response.statusText}`);
911
+ return await response.json();
912
+ };
913
+ /**
914
+ * A {@link SwapProvider} over the SteelSwap aggregator's API: it quotes swap
915
+ * routes across Cardano DEXes, builds the unsigned swap transaction for a
916
+ * quote, and lists and searches the tokens and DEXes it serves. Each call
917
+ * emits one `Result`; a failed request is an `Err` with a `SwapProviderError`.
918
+ */
919
+ const createSteelSwapProvider = (config) => {
920
+ const partner = config.partner ?? {
921
+ name: "lace-aggregator",
922
+ address: "$lace@steelswap"
923
+ };
924
+ return {
925
+ getQuote: (request) => (0, rxjs.from)(jsonPost(`${config.steelswapApiBaseUrl}/swap/estimate/`, toEstimateRequest(request, partner)).then((response) => require_asyncoption.Ok(fromEstimateResponse(response, request))).catch((error) => {
926
+ return require_asyncoption.Err(toSwapProviderError(error));
927
+ })),
928
+ buildSwapTx: (request) => (0, rxjs.from)(jsonPost(`${config.steelswapApiBaseUrl}/swap/build/`, toBuildRequest(request, partner)).then((response) => require_asyncoption.Ok(fromBuildResponse(response))).catch((error) => {
929
+ return require_asyncoption.Err(toSwapProviderError(error));
930
+ })),
931
+ listTokens: () => (0, rxjs.from)(jsonGet(`${config.steelswapApiBaseUrl}/tokens/list/`).then((tokens) => require_asyncoption.Ok(tokens.map((t) => fromTokenSummary(t, config.nftCdnUrl)))).catch((error) => require_asyncoption.Err(toSwapProviderError(error)))),
932
+ listDexes: () => (0, rxjs.from)(jsonGet(`${config.steelswapApiBaseUrl}/dex/list/`).then((dexes) => require_asyncoption.Ok(fromDexList(dexes))).catch((error) => require_asyncoption.Err(toSwapProviderError(error)))),
933
+ searchTokens: (_networkId, query) => (0, rxjs.from)(jsonPost(`${config.steelswapApiBaseUrl}/tokens/find-pairs/`, { token: query }).then((tokens) => require_asyncoption.Ok(tokens.map((t) => fromTokenSummary(t, config.nftCdnUrl)))).catch((error) => require_asyncoption.Err(toSwapProviderError(error))))
934
+ };
935
+ };
936
+ //#endregion
937
+ //#region ../../packages/contract/crypto/src/contract.ts
938
+ const cryptoAddonContract = require_store.inferContractContext({
939
+ name: require_sdk.ContractName("crypto-addon"),
940
+ instance: "exactly-one",
941
+ contractType: "addon",
942
+ preloadInServiceWorker: true,
943
+ provides: { addons: ["bip32Ed25519", "blake2b"] }
944
+ });
945
+ //#endregion
946
+ //#region ../../packages/module/cardano-provider-blockfrost/src/store/index.ts
947
+ var store_default = require_store.inferStoreContext({
948
+ load: async () => Promise.resolve().then(() => require("./init-BC2CZZOu2.cjs")),
949
+ context: {
950
+ actions: {},
951
+ selectors: {}
952
+ }
953
+ });
954
+ //#endregion
955
+ //#region ../../packages/module/cardano-provider-blockfrost/src/sdk.ts
956
+ /**
957
+ * Cardano chain data through Blockfrost: UTxOs, transactions, stake
958
+ * information and protocol parameters, configured by
959
+ * `config.cardanoProvider.blockfrostConfigs`. Loads when
960
+ * `FEATURE_FLAG_CARDANO` is enabled, and needs a crypto module such as
961
+ * `m.cryptoCardanoSdk`.
962
+ */
963
+ var sdk_default$1 = require_store.inferModuleContext({
964
+ moduleName: require_sdk.ModuleName("cardano-provider-blockfrost"),
965
+ dependsOn: require_store.combineContracts([cryptoAddonContract]),
966
+ implements: require_store.combineContracts([require_sdk.cardanoProviderStoreContract, require_sdk.cardanoProviderDependencyContract]),
967
+ store: store_default,
968
+ feature: {
969
+ willLoad: (featureFlags) => featureFlags.some((flag) => flag.key === require_const.FEATURE_FLAG_CARDANO),
970
+ metadata: {
971
+ name: "Blockfrost",
972
+ description: "Blockfrost provider for Cardano"
973
+ }
974
+ },
975
+ addons: {}
976
+ });
977
+ //#endregion
978
+ //#region ../../packages/module/crypto-cardano-sdk/src/sdk.ts
979
+ /** Cardano cryptography: BIP32-Ed25519 key derivation and Blake2b hashing. */
980
+ var sdk_default = require_store.inferModuleContext({
981
+ moduleName: require_sdk.ModuleName("crypto-cardano-sdk"),
982
+ implements: require_store.combineContracts([cryptoAddonContract]),
983
+ addons: {
984
+ bip32Ed25519: async () => Promise.resolve().then(() => require("./bip32ed25519-CRiG-Kjg.cjs")),
985
+ blake2b: async () => Promise.resolve().then(() => require("./blake2b-Iy324FwH.cjs"))
986
+ }
987
+ });
988
+ //#endregion
989
+ //#region src/modules-cardano.ts
990
+ var modules_cardano_exports = /* @__PURE__ */ require_chunk.__exportAll({
991
+ blockchainCardano: () => sdk_default$2,
992
+ cardanoProviderBlockfrost: () => sdk_default$1,
993
+ cryptoCardanoSdk: () => sdk_default,
994
+ featureDev: () => require_sdk.sdk_default$2,
995
+ storageInMemory: () => require_sdk.sdk_default$1,
996
+ storageWebIndexeddb: () => require_sdk.sdk_default
997
+ });
998
+ //#endregion
999
+ Object.defineProperty(exports, "CardanoRemoteSignerFactory", {
1000
+ enumerable: true,
1001
+ get: function() {
1002
+ return CardanoRemoteSignerFactory;
1003
+ }
1004
+ });
1005
+ Object.defineProperty(exports, "PasskeyWalletMismatchError", {
1006
+ enumerable: true,
1007
+ get: function() {
1008
+ return PasskeyWalletMismatchError;
1009
+ }
1010
+ });
1011
+ Object.defineProperty(exports, "RemoteSignerResultError", {
1012
+ enumerable: true,
1013
+ get: function() {
1014
+ return RemoteSignerResultError;
1015
+ }
1016
+ });
1017
+ Object.defineProperty(exports, "createLazyInMemoryVaultModule", {
1018
+ enumerable: true,
1019
+ get: function() {
1020
+ return createLazyInMemoryVaultModule;
1021
+ }
1022
+ });
1023
+ Object.defineProperty(exports, "createPasskeyVaultModule", {
1024
+ enumerable: true,
1025
+ get: function() {
1026
+ return createPasskeyVaultModule;
1027
+ }
1028
+ });
1029
+ Object.defineProperty(exports, "createPasskeyWalletEntity", {
1030
+ enumerable: true,
1031
+ get: function() {
1032
+ return createPasskeyWalletEntity;
1033
+ }
1034
+ });
1035
+ Object.defineProperty(exports, "createRemoteCardanoVaultModule", {
1036
+ enumerable: true,
1037
+ get: function() {
1038
+ return createRemoteCardanoVaultModule;
1039
+ }
1040
+ });
1041
+ Object.defineProperty(exports, "createRemotePasskeySigner", {
1042
+ enumerable: true,
1043
+ get: function() {
1044
+ return createRemotePasskeySigner;
1045
+ }
1046
+ });
1047
+ Object.defineProperty(exports, "createRemotePasskeyWalletEntity", {
1048
+ enumerable: true,
1049
+ get: function() {
1050
+ return createRemotePasskeyWalletEntity;
1051
+ }
1052
+ });
1053
+ Object.defineProperty(exports, "createSignerClient", {
1054
+ enumerable: true,
1055
+ get: function() {
1056
+ return createSignerClient;
1057
+ }
1058
+ });
1059
+ Object.defineProperty(exports, "createSteelSwapProvider", {
1060
+ enumerable: true,
1061
+ get: function() {
1062
+ return createSteelSwapProvider;
1063
+ }
1064
+ });
1065
+ Object.defineProperty(exports, "createTxBuilder", {
1066
+ enumerable: true,
1067
+ get: function() {
1068
+ return createTxBuilder;
1069
+ }
1070
+ });
1071
+ Object.defineProperty(exports, "modules_cardano_exports", {
1072
+ enumerable: true,
1073
+ get: function() {
1074
+ return modules_cardano_exports;
1075
+ }
1076
+ });
1077
+ Object.defineProperty(exports, "sdk_default", {
1078
+ enumerable: true,
1079
+ get: function() {
1080
+ return sdk_default;
1081
+ }
1082
+ });
1083
+ Object.defineProperty(exports, "sdk_default$1", {
1084
+ enumerable: true,
1085
+ get: function() {
1086
+ return sdk_default$1;
1087
+ }
1088
+ });
1089
+ Object.defineProperty(exports, "sdk_default$2", {
1090
+ enumerable: true,
1091
+ get: function() {
1092
+ return sdk_default$2;
1093
+ }
1094
+ });
1095
+ Object.defineProperty(exports, "signCardanoTx", {
1096
+ enumerable: true,
1097
+ get: function() {
1098
+ return signCardanoTx;
1099
+ }
1100
+ });
1101
+ Object.defineProperty(exports, "submitCardanoTx", {
1102
+ enumerable: true,
1103
+ get: function() {
1104
+ return submitCardanoTx;
1105
+ }
1106
+ });
1107
+ Object.defineProperty(exports, "waitForNetworkInfo", {
1108
+ enumerable: true,
1109
+ get: function() {
1110
+ return waitForNetworkInfo;
1111
+ }
1112
+ });