@laceio/sdk 0.1.1 → 0.1.2-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.
- package/dist/{TransactionBuilder-DrB3NVTi.cjs → TransactionBuilder-X1H9Gze6.cjs} +64 -14
- package/dist/{TransactionBuilder-V6aLx4SV.js → TransactionBuilder-bp2aMDhg.js} +23 -15
- package/dist/{_polyfill-buffer-patch-BnPVerlG.cjs → _polyfill-buffer-patch-CM8X7JiY.cjs} +21 -2
- package/dist/_polyfill-buffer-patch-yNxN4d5E.js +1467 -0
- package/dist/_web-crypto-random-bytes-Bo-GTcRS.js +197 -0
- package/dist/acc-module-4iIUv6My.cjs +27654 -0
- package/dist/acc-module-Cmj8EsIb.js +27624 -0
- package/dist/account-BOQruszJ.js +6 -0
- package/dist/account-BUOj4pYJ.cjs +11 -0
- package/dist/account-call-7wnopBq0.cjs +5 -0
- package/dist/account-call-B9d_2Xwi.js +4 -0
- package/dist/account-call-Bd4Rpbvt.cjs +323 -0
- package/dist/account-call-C3CkDqEC.js +276 -0
- package/dist/account-guards-BtjTGxDZ.cjs +42 -0
- package/dist/account-guards-D9Lu5T3W.js +36 -0
- package/dist/account-tokens-DvkOFVON.js +16 -0
- package/dist/account-tokens-nwcvwLu4.cjs +21 -0
- package/dist/{activity-type.stable-BJEfeLxL.cjs → activity-type-Ch6ljxBy.cjs} +2 -1
- package/dist/{activity-type.stable-C76_hWd7.js → activity-type-GsJGWs-3.js} +2 -1
- package/dist/address-B9ntKL8K.js +13761 -0
- package/dist/address-BXp-mY8H.cjs +11270 -0
- package/dist/{address-book-address-validator-DIUolI-s.js → address-book-address-validator-0J9XAADH.js} +2 -2
- package/dist/address-book-address-validator-DK0dnsRS.cjs +41 -0
- package/dist/address-book-address-validator-Di_ywo8M.js +39 -0
- package/dist/{address-book-address-validator-DNwQGlOB.cjs → address-book-address-validator-Dte_YQ2L.cjs} +2 -2
- package/dist/artefact-loader-BWWYAD7E.cjs +183 -0
- package/dist/artefact-loader-Dik4HIfv.js +160 -0
- package/dist/auto-dismiss-failure-on-success-C-qoJuid.cjs +37 -0
- package/dist/auto-dismiss-failure-on-success-s8MGDEIu.js +31 -0
- package/dist/bip32-D6wd_QMn.cjs +3851 -0
- package/dist/bitcoin-data-provider-BYPSmuZS.js +21 -0
- package/dist/bitcoin-data-provider-w1oEDSU3.cjs +26 -0
- package/dist/bitcoin.cjs +45 -0
- package/dist/bitcoin.d.ts +29906 -1
- package/dist/bitcoin.js +20 -0
- package/dist/{blockfrost-tx-submit-provider-DPTrapz-.js → blockfrost-tx-submit-provider-CBWQ0wK9.js} +5 -157
- package/dist/{blockfrost-tx-submit-provider-BAIzV5o3.cjs → blockfrost-tx-submit-provider-CLNQ5ycR.cjs} +3 -167
- package/dist/bn-d3nSOIf7.cjs +2553 -0
- package/dist/browser-B1eMbDwh.js +7468 -0
- package/dist/bytes.vo-BB7_4JK6.js +23 -0
- package/dist/bytes.vo-BNRquqaO.cjs +34 -0
- package/dist/cardano-DfPwhwm-.js +3 -0
- package/dist/{cardano-network-id.vo-DSxrFk9S.cjs → cardano-network-id.vo-BEDPn6Li.cjs} +1 -1
- package/dist/{cardano-network-id.vo-CK1tNQDg.js → cardano-network-id.vo-Cfpvbod9.js} +1 -1
- package/dist/cardano.cjs +22 -18
- package/dist/cardano.d.ts +16962 -1716
- package/dist/cardano.js +16 -11
- package/dist/client-DXBLHk7K.cjs +808 -0
- package/dist/codecs-Cswkg7Tm.cjs +4051 -0
- package/dist/codecs-Dc1Krpbt.js +3903 -0
- package/dist/{const-C84qHkjp.js → const-BJfIK_G-.js} +4 -4
- package/dist/const-BhYOdznB.cjs +42 -0
- package/dist/const-BsnjG2_Q.cjs +32071 -0
- package/dist/const-CUnCl5U0.js +13 -0
- package/dist/{const-DXk2tFyv.js → const-CjmfjBP3.js} +1 -1
- package/dist/{const-BDEg2Trq.cjs → const-D-eZIS4n.cjs} +4 -4
- package/dist/const-D0CbQlo4.js +154 -0
- package/dist/{const-BY8B3_0_.cjs → const-iwzZEE_w.cjs} +1 -1
- package/dist/contract-1R86jhSw.js +171 -0
- package/dist/contract-MKLzYVkW.cjs +189 -0
- package/dist/create-add-accounts-Brqk84vF.js +102 -0
- package/dist/create-add-accounts-DzXIh7Ot.cjs +114 -0
- package/dist/{delegation-tx-builder-CRpLP6jH.cjs → delegation-tx-builder-Dof_0N_d.cjs} +6 -6
- package/dist/{delegation-tx-builder-CGVqlaFE.js → delegation-tx-builder-Dy3-2Auz.js} +5 -5
- package/dist/{deregistration-tx-builder-DZGwB4cz.cjs → deregistration-tx-builder-CcLwyFpj.cjs} +6 -6
- package/dist/{deregistration-tx-builder-B-CrUyX6.js → deregistration-tx-builder-QkWW_gWl.js} +5 -5
- package/dist/device-commitment-hex.vo-5wFtQvDS.js +26 -0
- package/dist/device-commitment-hex.vo-CT3RmAug.cjs +31 -0
- package/dist/device-readers-CUHYoYOH.js +145 -0
- package/dist/device-readers-CdxS2btd.cjs +168 -0
- package/dist/device-readers-D_JZeNL2.cjs +8 -0
- package/dist/device-readers-DwSNCGPP.js +4 -0
- package/dist/dist-BMi5ZjEq.cjs +43175 -0
- package/dist/dist-BtIq4XFn.cjs +535 -0
- package/dist/dist-C3SHC_Ho.cjs +1394 -0
- package/dist/dist-CykEjYEX.cjs +3814 -0
- package/dist/dist-Dcsxh3be.cjs +3452 -0
- package/dist/dist-DqJfSlTd.cjs +4413 -0
- package/dist/dist-nTZ70qj7.cjs +1306 -0
- package/dist/{earn-rewards-tx-builder-D5sUT5v8.cjs → earn-rewards-tx-builder-BP5JMIKS.cjs} +6 -6
- package/dist/{earn-rewards-tx-builder-BDbTDZmD.js → earn-rewards-tx-builder-Cku4BmNU.js} +5 -5
- package/dist/enc-key-circuits-B7BjgUL9.js +13 -0
- package/dist/enc-key-circuits-BLrZrBVI.cjs +24 -0
- package/dist/english-Byb9M0E_.cjs +2057 -0
- package/dist/envelopes-BGoO_v8m.js +1621 -0
- package/dist/envelopes-CH25R-DN.cjs +1722 -0
- package/dist/errors-BIftM8ZN.cjs +688 -0
- package/dist/errors-DSq5wUwt.js +466 -0
- package/dist/esm-HBSUQw3w.js +384 -0
- package/dist/esm-LZuaZjMf.cjs +389 -0
- package/dist/experimental.cjs +7349 -0
- package/dist/experimental.d.ts +86279 -0
- package/dist/experimental.js +7184 -0
- package/dist/gated-call-CDCVZIK-.cjs +5 -0
- package/dist/gated-call-D-tT7P_t.js +722 -0
- package/dist/gated-call-D_VT2quk.js +4 -0
- package/dist/gated-call-DgJm1Mi_.cjs +787 -0
- package/dist/grant-circuits-DswmW3nI.cjs +71 -0
- package/dist/grant-circuits-Jxb5y1HW.js +42 -0
- package/dist/grant-rules-By07_eDi.js +6824 -0
- package/dist/grant-rules-BzVTWXS7.cjs +7099 -0
- package/dist/grant-spend-B3Md9L0n.js +215 -0
- package/dist/grant-spend-oWmzRsjH.cjs +217 -0
- package/dist/grant-status-B2y49iIu.js +2688 -0
- package/dist/grant-status-DOr3t_u8.cjs +2820 -0
- package/dist/grants-2BZ-qEVQ.js +5 -0
- package/dist/grants-BPoLSiMt.cjs +18 -0
- package/dist/grants-BoI5uwSF.cjs +272 -0
- package/dist/grants-CtofFu-e.js +213 -0
- package/dist/{group-cardano-addresses-by-account-B533oVXR.cjs → group-cardano-addresses-by-account-Bp0g4wEY.cjs} +3 -39
- package/dist/{group-cardano-addresses-by-account-RHKoEskR.js → group-cardano-addresses-by-account-SR8MMrZf.js} +5 -35
- package/dist/{guarded-transaction-signer-Bxl6_XNd.cjs → guarded-transaction-signer-MFpPg98D.cjs} +17 -18
- package/dist/{guarded-transaction-signer-CpKLj8Kp.js → guarded-transaction-signer-P6Rp1faj.js} +8 -15
- package/dist/hex-D9ITYbwt.cjs +263 -0
- package/dist/hex-mkXcV3pN.js +191 -0
- package/dist/http-client-B3N-TMxu.cjs +167 -0
- package/dist/http-client-TRlhDZGh.js +155 -0
- package/dist/identity-BMLuufva.cjs +263 -0
- package/dist/identity-DII6f-h7.js +233 -0
- package/dist/in-memory-wallet-integration-B2xzxORj.cjs +20741 -0
- package/dist/in-memory-wallet-integration-CBRiPjLO.js +130 -0
- package/dist/in-memory-wallet-integration-CULUB5Tf.cjs +240 -0
- package/dist/{in-memory-wallet-integration-D-qn65Kx.js → in-memory-wallet-integration-ChIOirMW.js} +5 -2
- package/dist/{in-memory-wallet-integration-Croiuopx.js → in-memory-wallet-integration-CljprQQV.js} +7 -104
- package/dist/{in-memory-wallet-integration-DVh9sRXa.cjs → in-memory-wallet-integration-Cm6P8sk6.cjs} +3 -2
- package/dist/in-memory-wallet-integration-TM9bBphA.js +20738 -0
- package/dist/{in-memory-wallet-integration-CnLYeX4-.cjs → in-memory-wallet-integration-t9I00R_V.cjs} +17 -108
- package/dist/index.cjs +84 -47
- package/dist/index.d.ts +37505 -10036
- package/dist/index.js +52 -24
- package/dist/{init-CLHuAMB-.js → init-0zzs9aqU.js} +4 -4
- package/dist/{init-U8c9yHYx.cjs → init-5KcGcBb5.cjs} +1 -1
- package/dist/{init-CigestoM.js → init-B3-1ghyx.js} +2 -2
- package/dist/init-B8U3ABhS.cjs +107 -0
- package/dist/init-BJn-8_hf.js +141 -0
- package/dist/init-BPU3j8sT.cjs +6 -0
- package/dist/init-BRzH6xu-2.cjs +2797 -0
- package/dist/init-BmzfDaKL.js +1142 -0
- package/dist/{init-C-jErzp5.cjs → init-BopV9ed4.cjs} +2 -2
- package/dist/init-BpHTq2R5.js +105 -0
- package/dist/init-BpSITBfF.js +39 -0
- package/dist/{init-DX4WyB0R.cjs → init-BrdVzxei.cjs} +3 -3
- package/dist/{init-LfyMo-sS.cjs → init-BwkU0ruo.cjs} +2 -2
- package/dist/{init-CB__aLD7.cjs → init-C-G32J12.cjs} +2 -2
- package/dist/init-C00gw1zi.js +422 -0
- package/dist/{init-TkPq_Ny_.js → init-C2RgrfZe.js} +1 -1
- package/dist/init-C5mYyFTv.js +3584 -0
- package/dist/{init-DcYY6zMD.js → init-C8URA2OX.js} +1 -1
- package/dist/init-CDkRynJa.js +2796 -0
- package/dist/{init-Cg9XdAru.js → init-CNM5m7M2.js} +4 -4
- package/dist/init-CR7BfztQ.cjs +18 -0
- package/dist/{init-CSHwHnfg.cjs → init-CSDpdu0Q.cjs} +2 -2
- package/dist/{init-aJHl-7AO.js → init-CX0AMQUn.js} +2 -2
- package/dist/{init-FMGDET-9.js → init-CfTbSEKy.js} +259 -60
- package/dist/{init-CR6tpw1B.js → init-Cigr_tKx.js} +47 -43
- package/dist/init-Clu8pxwQ.cjs +1181 -0
- package/dist/{init-CFYsq82V.js → init-CyAY4Lzl.js} +1 -1
- package/dist/{init-BKhH6mVR.cjs → init-D6BxBs7e.cjs} +1 -1
- package/dist/init-D8OeObDF.cjs +1141 -0
- package/dist/init-D9g1HXYf.cjs +40 -0
- package/dist/{init-CNLGJJRx.js → init-DA7zmptx.js} +1 -1
- package/dist/{init-DkIc5nqF.cjs → init-DFMiP2ZH.cjs} +1 -1
- package/dist/{init-zSzCjoor.js → init-DFjT8YvT.js} +4 -4
- package/dist/init-DGjXwWs2.cjs +143 -0
- package/dist/init-DHrCbpkW.cjs +121 -0
- package/dist/init-DRzJR02G.cjs +3585 -0
- package/dist/{init-B64zCLxG.cjs → init-DUF4ar8P.cjs} +4 -4
- package/dist/init-DlqJuHhl.js +119 -0
- package/dist/{init-y2Ra0vZP.js → init-Dnsv155v.js} +3 -3
- package/dist/init-DuYENxci.js +17 -0
- package/dist/{init-D6DBUsD3.cjs → init-Dv3zKj0r.cjs} +4 -4
- package/dist/{init-BtzMZ7Pk.cjs → init-Dy-05ktr.cjs} +1 -1
- package/dist/{init-BsCBAGWf.cjs → init-EP0CUWNK.cjs} +2 -2
- package/dist/{init-BJVU54pI.cjs → init-EhzD7a8i.cjs} +1 -1
- package/dist/{init-w9GEs73W.js → init-Fw89ZmrR.js} +2 -2
- package/dist/init-GsT2AEa4.cjs +424 -0
- package/dist/{init-Rxohwpmu.js → init-NCjgwCZy.js} +2 -2
- package/dist/{init-DxUHsN53.cjs → init-NdhG_VrF.cjs} +6 -6
- package/dist/{init-DDdhguVC.js → init-SZ01tARX2.js} +2 -2
- package/dist/{init-BAJJzBza.js → init-Y3mkB4XS.js} +2 -2
- package/dist/init-c4l6r-o-.js +5 -0
- package/dist/{init-Dku4b2lG.js → init-kEfUTuG2.js} +1 -1
- package/dist/{init-C7IeJwQR.cjs → init-lzHt4Cli.cjs} +256 -59
- package/dist/init-qSEd_Spq.js +1182 -0
- package/dist/{init-anYu6XB7.cjs → init-rmt7-fQE.cjs} +2 -2
- package/dist/{init-C4Bkib9u.cjs → init-zU-_9Gsp.cjs} +67 -65
- package/dist/{is-retriable-error-BU0e3hVI.js → is-retriable-error-BUiVJDwH.js} +1 -1
- package/dist/{is-retriable-error-CeeuHqDa.cjs → is-retriable-error-Dpt860if.cjs} +1 -1
- package/dist/jubjub-authoriser-D7zDXu3V.js +86 -0
- package/dist/jubjub-authoriser-Dgu6o3Sv.cjs +87 -0
- package/dist/key-source-5oUBFiC7.cjs +583 -0
- package/dist/key-source-B08HukZg.js +2550 -0
- package/dist/keyDerivation-D3k9XyHg.js +4077 -0
- package/dist/keyDerivation-u0nBA93T.cjs +274 -0
- package/dist/{lace-context-CZcNHr4M.js → lace-context-BZciB9c7.js} +4 -4
- package/dist/{lace-context-fJTDghdp.cjs → lace-context-DgR6vLli.cjs} +4 -4
- package/dist/lib--iqvW4O_.js +2354 -0
- package/dist/lib-Yk6Upl5D.cjs +2359 -0
- package/dist/{libsodium-wrappers-UH0LaOUE.js → libsodium-wrappers-BhbOA8dQ.js} +3 -1647
- package/dist/midnight-account-id.vo-0x9X-r3l.cjs +10 -0
- package/dist/midnight-account-id.vo-DjCAGcqc.js +5 -0
- package/dist/midnight-engine-DpemplKO.js +5 -0
- package/dist/midnight-engine-xU1wotne.cjs +6 -0
- package/dist/midnight-wallet-DIsAlSn6.js +18 -0
- package/dist/midnight-wallet-XTZc2li7.cjs +24 -0
- package/dist/midnight.cjs +1408 -0
- package/dist/midnight.d.ts +28934 -0
- package/dist/midnight.js +1352 -0
- package/dist/modules-cardano-D9Gs2j60.cjs +1108 -0
- package/dist/modules-cardano-VIM8fKu-.js +995 -0
- package/dist/node-relay-DWe1U0w2.cjs +49 -0
- package/dist/node-relay-h4i5IlAQ.js +48 -0
- package/dist/outputs-Bd2yZVjx.js +720 -0
- package/dist/outputs-CJoQBIA2.cjs +990 -0
- package/dist/pbkdf2-CIW-oWrm.cjs +1337 -0
- package/dist/pending-operation-B0_P78Jo.cjs +26 -0
- package/dist/pending-operation-BIS6mpjB.js +21 -0
- package/dist/providers-FjhM47BH.cjs +388 -0
- package/dist/providers-WtiSuxFu.js +365 -0
- package/dist/redacted-BmE2aXqr.js +81 -0
- package/dist/redacted-CRZJLS3w.cjs +86 -0
- package/dist/{retry-config-DC5IMaH7.cjs → retry-config-BaCfVC1H.cjs} +1 -1
- package/dist/{retry-config-BcUmMS--.js → retry-config-Dmgt28wM.js} +1 -1
- package/dist/safe-buffer-B_vMqJWU.js +43 -0
- package/dist/safe-buffer-DYOwEfHB.cjs +48 -0
- package/dist/sdk-Cb-gZnS9.js +1241 -0
- package/dist/sdk-DffwmX8b.cjs +1439 -0
- package/dist/sdk-init-Bln9rFtn.js +4138 -0
- package/dist/sdk-init-CYViTJY_.cjs +3841 -0
- package/dist/{seam-cardano-CATqBEyK.js → seam-cardano-B_etH4F4.js} +1 -1
- package/dist/{bytes.vo-TgiwogWF.js → secret-box-DUR0ACYz.js} +3 -25
- package/dist/{bytes.vo-Ck5u40RA.cjs → secret-box-DrjLZuS1.cjs} +1 -35
- package/dist/send-proof-progress-C-ljq1x5.js +30 -0
- package/dist/send-proof-progress-vmsaSfbz.cjs +47 -0
- package/dist/side-effects-BnqYz7Nl.js +768 -0
- package/dist/side-effects-CngaeXi0.cjs +804 -0
- package/dist/sign-bitcoin-transaction-with-seed-D4z62-jV.js +147 -0
- package/dist/sign-bitcoin-transaction-with-seed-DsLYXnCY.cjs +158 -0
- package/dist/signer-3fk8lZtE.cjs +7 -0
- package/dist/signer-CsL28DrK.cjs +121 -0
- package/dist/signer-DGluibtn.js +92 -0
- package/dist/signer-RqB5pu3K.js +2 -0
- package/dist/signer-factory-BA7WFJVZ.js +282 -0
- package/dist/signer-factory-Cwd6o-lG.cjs +281 -0
- package/dist/{signer-factory-9URFliA5.js → signer-factory-DObB55D4.js} +6 -3
- package/dist/signer-factory-DhZiE03y.cjs +149 -0
- package/dist/{signer-factory-BWGUmnvm.cjs → signer-factory-Ds6G2AZk.cjs} +4 -3
- package/dist/signer-factory-hzSRaIw2.js +148 -0
- package/dist/{slice-CuHUaPZx.cjs → slice-7G2xxYKJ.cjs} +3 -3
- package/dist/{slice-DZmQJNV8.cjs → slice-B4CdYoPu.cjs} +2 -2
- package/dist/slice-BPNuHKfw.js +9091 -0
- package/dist/{slice-DGcNrbPR.cjs → slice-Bg6HEr3K.cjs} +4 -4
- package/dist/{slice-DtaO72qY.cjs → slice-Bs2aMERu.cjs} +3 -3
- package/dist/{slice-HeHCv3bl.cjs → slice-C34iOOUH.cjs} +7 -7
- package/dist/{slice-Do2R2CYW.cjs → slice-C9TT5KhY.cjs} +6 -6
- package/dist/{slice-eIwcwKHI.js → slice-CK07EBCo.js} +4 -4
- package/dist/{slice-CnyWevM9.js → slice-CU80pbiu.js} +3 -3
- package/dist/{slice-CobanYgn.js → slice-CwyYrh1H.js} +2 -2
- package/dist/slice-Czfp6t84.cjs +436 -0
- package/dist/{slice-d0p6-xj5.js → slice-D-9aPKG-.js} +6 -6
- package/dist/{slice-maaskdUn.js → slice-DBpJ2QGf.js} +6 -6
- package/dist/{slice-mxLQ_FeY.cjs → slice-DTZTiJle.cjs} +352 -39
- package/dist/{slice-zJ9XVYjZ.js → slice-Da426sf9.js} +1 -1
- package/dist/{slice-D11m2EKl.cjs → slice-DayJvMRD.cjs} +1 -1
- package/dist/slice-DnBWfA-k.cjs +9109 -0
- package/dist/{slice-oqm_r1cS.cjs → slice-DnG-yvpI.cjs} +2 -2
- package/dist/{slice-BNu73oBa.js → slice-DyNs7oWp.js} +2 -2
- package/dist/{slice-CB4SnzMm.js → slice-GwiiJRoq.js} +3 -3
- package/dist/slice-oWnc7YVD.js +412 -0
- package/dist/{slice-B2PhoWAg.js → slice-qt0uBExh.js} +325 -37
- package/dist/slice-t8Gzj55G2.cjs +106 -0
- package/dist/slice-t8Q1cHm-.js +88 -0
- package/dist/src-BDzYIksE.cjs +20637 -0
- package/dist/src-BFoefPv_.js +20755 -0
- package/dist/store-B1Lq3cEf.cjs +66 -0
- package/dist/store-DuBG8qh5.js +37 -0
- package/dist/submit-Bs77dPn_.cjs +413 -0
- package/dist/submit-DOv8Z0Vf.js +336 -0
- package/dist/submit-bitcoin-tx-D6oYgH5S.js +983 -0
- package/dist/submit-bitcoin-tx-goFuRL7K.cjs +1049 -0
- package/dist/{sync-operation-utils-BYXLO80m.js → sync-operation-utils-31iFLExW.js} +2 -38
- package/dist/{sync-operation-utils-SdPbwFoD.cjs → sync-operation-utils-COIZ66-I.cjs} +1 -67
- package/dist/token-id-mapper-Bnds3xKH.cjs +18 -0
- package/dist/{token-id-mapper-DsPAL6Nh.cjs → token-id-mapper-CVyQJUKY.cjs} +2 -2
- package/dist/token-id-mapper-CnKHQ8DV.js +16 -0
- package/dist/{token-id-mapper-B2ivlLv3.js → token-id-mapper-D29Ggv8h.js} +2 -2
- package/dist/tokens-Cevp7rdU.cjs +62 -0
- package/dist/tokens-Diw4MLRM.js +44 -0
- package/dist/types-B8uiJn-X.js +12 -0
- package/dist/types-BHC12eSa.js +33 -0
- package/dist/types-CJT6XF2c.js +10 -0
- package/dist/types-CLRUYpfe.cjs +23 -0
- package/dist/types-Cc3mC8u0.cjs +50 -0
- package/dist/types-DWbVZpnF.cjs +15 -0
- package/dist/unwrap-provider-result-BZSiwabU.js +32 -0
- package/dist/unwrap-provider-result-ZqfBsTkk.cjs +39 -0
- package/dist/{util-CGzqQ8IV.cjs → util-Bu4W5lF4.cjs} +1 -1
- package/dist/{util-BaLzwa32.js → util-Cp5cZkfK.js} +1 -1
- package/dist/{utils-o8aMjfln.js → utils-BfBEUvWA.js} +2 -2
- package/dist/utils-DFwzEvbv.js +65 -0
- package/dist/{utils-5JvjbqH3.cjs → utils-DsElZgCI.cjs} +7 -1
- package/dist/utils-IXxR-Djh.cjs +112 -0
- package/dist/v8Signatures-CO_Uloy7.cjs +71 -0
- package/dist/{vote-delegation-tx-builder-CmKv6GoG.js → vote-delegation-tx-builder-BsBSDmcX.js} +5 -5
- package/dist/{vote-delegation-tx-builder-BpEMSti4.cjs → vote-delegation-tx-builder-DSs8nybk.cjs} +6 -6
- package/dist/watch-CUEvcP-V.js +21997 -0
- package/dist/watch-DMF2s-II.cjs +52281 -0
- package/package.json +96 -4
- package/dist/account-guards.stable-B1DSSh9D.cjs +0 -10
- package/dist/account-guards.stable-JRQ5qx2V.js +0 -5
- package/dist/codecs-B7X9pAsK.cjs +0 -1945
- package/dist/codecs-CC1Xjntz.js +0 -1882
- package/dist/init-Bv53hpLM.js +0 -19
- package/dist/init-CRbjI7p1.js +0 -3494
- package/dist/init-DAna1KCg.cjs +0 -3495
- package/dist/init-DGe47B22.cjs +0 -364
- package/dist/init-DMtyvYfC.cjs +0 -21
- package/dist/init-TkPDD750.js +0 -363
- package/dist/modules-cardano-BDvuL4Xx.js +0 -5248
- package/dist/modules-cardano-D2G3De2P.cjs +0 -5432
- package/dist/slice-CGVHXHDt.cjs +0 -125
- package/dist/slice-DhvF7L6X.js +0 -107
- /package/dist/{account-id.vo-LvCBVn5r.cjs → account-id.vo-DwqFjK5u.cjs} +0 -0
- /package/dist/{account-id.vo-MYSI7YFm.js → account-id.vo-OPz2v-JZ.js} +0 -0
- /package/dist/{actions-DdGbj7c7.cjs → actions-B2BJ4RTy.cjs} +0 -0
- /package/dist/{actions-9QSQR-GB.js → actions-iLXdgL5Y.js} +0 -0
- /package/dist/{apply-vkey-witnesses-ClZbpk5w.js → apply-vkey-witnesses-BKx3lcs0.js} +0 -0
- /package/dist/{apply-vkey-witnesses-CLzVSWxl.cjs → apply-vkey-witnesses-ZnFS0jnJ.cjs} +0 -0
- /package/dist/{asyncoption-Cw07zPH7.js → asyncoption-CruEYOBI.js} +0 -0
- /package/dist/{asyncoption-DYoGuQfP.cjs → asyncoption-i0VbqVTq.cjs} +0 -0
- /package/dist/{bignum.vo-B0rK_PQ1.js → bignum.vo-CEXOIew0.js} +0 -0
- /package/dist/{bignum.vo-DsG3kNiZ.cjs → bignum.vo-hx2kuqlA.cjs} +0 -0
- /package/dist/{bip32ed25519-1ApqeAZk.cjs → bip32ed25519-B7Yat217.cjs} +0 -0
- /package/dist/{bip32ed25519-DetAdGwD.js → bip32ed25519-FQ8qvdcq.js} +0 -0
- /package/dist/{blake2b-DOEVc57D.js → blake2b-BiQTw3GC.js} +0 -0
- /package/dist/{blake2b-B9tftbvG.cjs → blake2b-DEeVUdKR.cjs} +0 -0
- /package/dist/{blockchain-network-id.vo-BXpZhvvQ.cjs → blockchain-network-id.vo-BAKEwGjG.cjs} +0 -0
- /package/dist/{blockchain-network-id.vo-DNRkuT5B.js → blockchain-network-id.vo-CiVykuqG.js} +0 -0
- /package/dist/{blockingWithLatestFrom-C5wp_uA-.js → blockingWithLatestFrom-Cd8c8EPG.js} +0 -0
- /package/dist/{blockingWithLatestFrom-DY8OPg0w.cjs → blockingWithLatestFrom-D8kBPBMX.cjs} +0 -0
- /package/dist/{cardano-network-id-to-network-type-CrZfUcyP.js → cardano-network-id-to-network-type-BWwzeEtM.js} +0 -0
- /package/dist/{cardano-network-id-to-network-type-BDTF-HmK.cjs → cardano-network-id-to-network-type-C0ufJOyE.cjs} +0 -0
- /package/dist/{cardano-tx-id.vo-BPhV-AmZ.cjs → cardano-tx-id.vo-TLjJZHCI.cjs} +0 -0
- /package/dist/{cardano-tx-id.vo-DF9NzZXk.js → cardano-tx-id.vo-eVnKuzlm.js} +0 -0
- /package/dist/{composite-signer-factory-_46QsNBz.js → composite-signer-factory-CR8YHA1y.js} +0 -0
- /package/dist/{composite-signer-factory-BpF1mIYA.cjs → composite-signer-factory-m5cVs9h_.cjs} +0 -0
- /package/dist/{error-CNIquqT5.cjs → error-Cb3EnD0u.cjs} +0 -0
- /package/dist/{error-BCp9NkPi.js → error-DIZOY2Lw.js} +0 -0
- /package/dist/{esm-browser-C93Q-EOI.js → esm-browser-MG97cre9.js} +0 -0
- /package/dist/{esm-browser-DTc9IK3D.cjs → esm-browser-bweqfBlL.cjs} +0 -0
- /package/dist/{feature-flag-key.vo-ofrB6ZVQ.js → feature-flag-key.vo-DN_-4-sG.js} +0 -0
- /package/dist/{feature-flag-key.vo-BPz-ZAp6.cjs → feature-flag-key.vo-RlfHL3hq.cjs} +0 -0
- /package/dist/{first-state-of-status-OROkXcRv.cjs → first-state-of-status-CbT7hPa4.cjs} +0 -0
- /package/dist/{first-state-of-status-DQnMT3ya.js → first-state-of-status-unPynOuM.js} +0 -0
- /package/dist/{init-Es3wHW7D.js → init-829HRYcz.js} +0 -0
- /package/dist/{init-CKipPE_c.js → init-A-VyGSNW2.js} +0 -0
- /package/dist/{init-DFQQ9dTW.cjs → init-Atisw4x2.cjs} +0 -0
- /package/dist/{init-C5CEZ1m0.cjs → init-BFcvPHL-.cjs} +0 -0
- /package/dist/{init-IAk_CkGa.cjs → init-BgNobbNq.cjs} +0 -0
- /package/dist/{init-cqN3uX2j.js → init-atCFur0v.js} +0 -0
- /package/dist/{is-redux-persist-state-CTn3WZVh.cjs → is-redux-persist-state-BCFnSm36.cjs} +0 -0
- /package/dist/{is-redux-persist-state-Cxcd0_bM.js → is-redux-persist-state-yBfq0h_E.js} +0 -0
- /package/dist/{key-value-store-8cMzeNyG.js → key-value-store--W3SrMaw.js} +0 -0
- /package/dist/{key-value-store-DUAepXQf.cjs → key-value-store-C2Xt5Emp.cjs} +0 -0
- /package/dist/{repo-slice-WxetRhMY.cjs → repo-slice-7X4AYYVm.cjs} +0 -0
- /package/dist/{repo-slice-DwyMhCR1.js → repo-slice-RxFm0zDZ.js} +0 -0
- /package/dist/{reselect-CRDqmQY9.cjs → reselect-Bd94u0K-.cjs} +0 -0
- /package/dist/{reselect-C06X06oX.js → reselect-CGoLzEPv.js} +0 -0
- /package/dist/{serializable-B8GahgE1.js → serializable-BHdKIgk3.js} +0 -0
- /package/dist/{serializable-CRdnFaLZ.cjs → serializable-BxHkoPdk.cjs} +0 -0
- /package/dist/{slice-D11FHQuQ.cjs → slice-BiRsDKOK.cjs} +0 -0
- /package/dist/{slice-Be7hj4Iy.js → slice-Bk0Sv05J.js} +0 -0
- /package/dist/{slice-FioKeHtA.cjs → slice-Dqw1ecum.cjs} +0 -0
- /package/dist/{slice-B87b52iM.js → slice-obCSLm1x.js} +0 -0
- /package/dist/{src-vq1wS9sZ.js → src-BlxEp6Mm.js} +0 -0
- /package/dist/{src-BTPIvlDI.cjs → src-Cqp0B2M_.cjs} +0 -0
- /package/dist/{time.vo-CQ8pSXz2.cjs → time.vo-D3wWRw9L.cjs} +0 -0
- /package/dist/{time.vo-DkYYGYp6.js → time.vo-tNheinXm.js} +0 -0
- /package/dist/{toEmpty-CgAl3097.js → toEmpty-8Zax1MPd.js} +0 -0
- /package/dist/{toEmpty-DAMmNB5r.cjs → toEmpty-CYAbupM4.cjs} +0 -0
- /package/dist/{token-id.vo-ClsroxHO.js → token-id.vo-Bvwhr3ZE.js} +0 -0
- /package/dist/{token-id.vo-BxG9TG0O.cjs → token-id.vo-DXv5uS9n.cjs} +0 -0
- /package/dist/{util-DxzlYNS5.js → util-C8a4fA9p.js} +0 -0
- /package/dist/{util-CmdAhheh.cjs → util-CzeB3hfa.cjs} +0 -0
- /package/dist/{util-selector-CcK-GAdE.js → util-selector-BSTsxgne.js} +0 -0
- /package/dist/{util-selector-BcAncU4L.cjs → util-selector-BWPH68_l.cjs} +0 -0
- /package/dist/{while-active-BpppWuCs.js → while-active-B0lWy_6l.js} +0 -0
- /package/dist/{while-active-Dhc2LwOm.cjs → while-active-Dsowp0Fi.cjs} +0 -0
|
@@ -0,0 +1,583 @@
|
|
|
1
|
+
const require_codecs = require("./codecs-Cswkg7Tm.cjs");
|
|
2
|
+
const require_english = require("./english-Byb9M0E_.cjs");
|
|
3
|
+
const require_esm = require("./esm-LZuaZjMf.cjs");
|
|
4
|
+
//#region ../../packages/lib/crypto/src/value-objects/entropy-hex.vo.ts
|
|
5
|
+
const ENTROPY_BYTE_LENGTH = 32;
|
|
6
|
+
const ENTROPY_HEX_LENGTH = ENTROPY_BYTE_LENGTH * 2;
|
|
7
|
+
const HEX_PATTERN = /^[0-9a-fA-F]+$/;
|
|
8
|
+
/**
|
|
9
|
+
* Types 32 bytes of entropy, as 64 hex characters, for `Mnemonic.deriveFrom`.
|
|
10
|
+
* Throws when the value has another length or is not hex.
|
|
11
|
+
*/
|
|
12
|
+
const EntropyHex = (value) => {
|
|
13
|
+
if (value.length !== ENTROPY_HEX_LENGTH) throw new Error(`EntropyHex must be ${ENTROPY_BYTE_LENGTH} bytes (${ENTROPY_HEX_LENGTH} hex characters), got ${value.length}`);
|
|
14
|
+
if (!HEX_PATTERN.test(value)) throw new Error("EntropyHex must be a hex-encoded string");
|
|
15
|
+
return value;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ../../packages/lib/crypto/node_modules/@scure/bip39/esm/index.js
|
|
19
|
+
/**
|
|
20
|
+
* Audited & minimal JS implementation of
|
|
21
|
+
* [BIP39 mnemonic phrases](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki).
|
|
22
|
+
* @module
|
|
23
|
+
* @example
|
|
24
|
+
```js
|
|
25
|
+
import * as bip39 from '@scure/bip39';
|
|
26
|
+
import { wordlist } from '@scure/bip39/wordlists/english';
|
|
27
|
+
const mn = bip39.generateMnemonic(wordlist);
|
|
28
|
+
console.log(mn);
|
|
29
|
+
const ent = bip39.mnemonicToEntropy(mn, wordlist)
|
|
30
|
+
bip39.entropyToMnemonic(ent, wordlist);
|
|
31
|
+
bip39.validateMnemonic(mn, wordlist);
|
|
32
|
+
await bip39.mnemonicToSeed(mn, 'password');
|
|
33
|
+
bip39.mnemonicToSeedSync(mn, 'password');
|
|
34
|
+
|
|
35
|
+
// Wordlists
|
|
36
|
+
import { wordlist as czech } from '@scure/bip39/wordlists/czech';
|
|
37
|
+
import { wordlist as english } from '@scure/bip39/wordlists/english';
|
|
38
|
+
import { wordlist as french } from '@scure/bip39/wordlists/french';
|
|
39
|
+
import { wordlist as italian } from '@scure/bip39/wordlists/italian';
|
|
40
|
+
import { wordlist as japanese } from '@scure/bip39/wordlists/japanese';
|
|
41
|
+
import { wordlist as korean } from '@scure/bip39/wordlists/korean';
|
|
42
|
+
import { wordlist as portuguese } from '@scure/bip39/wordlists/portuguese';
|
|
43
|
+
import { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese';
|
|
44
|
+
import { wordlist as spanish } from '@scure/bip39/wordlists/spanish';
|
|
45
|
+
import { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese';
|
|
46
|
+
```
|
|
47
|
+
*/
|
|
48
|
+
/*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
|
|
49
|
+
const isJapanese = (wordlist) => wordlist[0] === "あいこくしん";
|
|
50
|
+
function nfkd(str) {
|
|
51
|
+
if (typeof str !== "string") throw new TypeError("invalid mnemonic type: " + typeof str);
|
|
52
|
+
return str.normalize("NFKD");
|
|
53
|
+
}
|
|
54
|
+
function normalize(str) {
|
|
55
|
+
const norm = nfkd(str);
|
|
56
|
+
const words = norm.split(" ");
|
|
57
|
+
if (![
|
|
58
|
+
12,
|
|
59
|
+
15,
|
|
60
|
+
18,
|
|
61
|
+
21,
|
|
62
|
+
24
|
|
63
|
+
].includes(words.length)) throw new Error("Invalid mnemonic");
|
|
64
|
+
return {
|
|
65
|
+
nfkd: norm,
|
|
66
|
+
words
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function aentropy(ent) {
|
|
70
|
+
require_codecs.abytes(ent, 16, 20, 24, 28, 32);
|
|
71
|
+
}
|
|
72
|
+
const calcChecksum = (entropy) => {
|
|
73
|
+
const bitsLeft = 8 - entropy.length / 4;
|
|
74
|
+
return new Uint8Array([require_codecs.sha256(entropy)[0] >> bitsLeft << bitsLeft]);
|
|
75
|
+
};
|
|
76
|
+
function getCoder(wordlist) {
|
|
77
|
+
if (!Array.isArray(wordlist) || wordlist.length !== 2048 || typeof wordlist[0] !== "string") throw new Error("Wordlist: expected array of 2048 strings");
|
|
78
|
+
wordlist.forEach((i) => {
|
|
79
|
+
if (typeof i !== "string") throw new Error("wordlist: non-string element: " + i);
|
|
80
|
+
});
|
|
81
|
+
return require_esm.utils.chain(require_esm.utils.checksum(1, calcChecksum), require_esm.utils.radix2(11, true), require_esm.utils.alphabet(wordlist));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Reversible: Converts raw entropy in form of byte array to mnemonic string.
|
|
85
|
+
* @param entropy byte array
|
|
86
|
+
* @param wordlist imported wordlist for specific language
|
|
87
|
+
* @returns 12-24 words
|
|
88
|
+
* @example
|
|
89
|
+
* const ent = new Uint8Array([
|
|
90
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f,
|
|
91
|
+
* 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
|
|
92
|
+
* ]);
|
|
93
|
+
* entropyToMnemonic(ent, wordlist);
|
|
94
|
+
* // 'legal winner thank year wave sausage worth useful legal winner thank yellow'
|
|
95
|
+
*/
|
|
96
|
+
function entropyToMnemonic(entropy, wordlist) {
|
|
97
|
+
aentropy(entropy);
|
|
98
|
+
return getCoder(wordlist).encode(entropy).join(isJapanese(wordlist) ? " " : " ");
|
|
99
|
+
}
|
|
100
|
+
const psalt = (passphrase) => nfkd("mnemonic" + passphrase);
|
|
101
|
+
/**
|
|
102
|
+
* Irreversible: Uses KDF to derive 64 bytes of key data from mnemonic + optional password.
|
|
103
|
+
* @param mnemonic 12-24 words
|
|
104
|
+
* @param passphrase string that will additionally protect the key
|
|
105
|
+
* @returns 64 bytes of key data
|
|
106
|
+
* @example
|
|
107
|
+
* const mnem = 'legal winner thank year wave sausage worth useful legal winner thank yellow';
|
|
108
|
+
* mnemonicToSeedSync(mnem, 'password');
|
|
109
|
+
* // new Uint8Array([...64 bytes])
|
|
110
|
+
*/
|
|
111
|
+
function mnemonicToSeedSync(mnemonic, passphrase = "") {
|
|
112
|
+
return require_codecs.pbkdf2(require_codecs.sha512, normalize(mnemonic).nfkd, psalt(passphrase), {
|
|
113
|
+
c: 2048,
|
|
114
|
+
dkLen: 64
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region ../../packages/lib/crypto/src/value-objects/mnemonic.vo.ts
|
|
119
|
+
/**
|
|
120
|
+
* Types a list of words as a BIP-39 mnemonic; it checks nothing.
|
|
121
|
+
* `Mnemonic.deriveFrom(entropy)` derives 24 words from 32 bytes of entropy,
|
|
122
|
+
* and `Mnemonic.toSeed(words)` gives their BIP-39 seed.
|
|
123
|
+
*/
|
|
124
|
+
const Mnemonic = (words) => words;
|
|
125
|
+
/**
|
|
126
|
+
* Derives a 24-word BIP39 mnemonic from 32 bytes of hex-encoded entropy.
|
|
127
|
+
* Uses HKDF for domain separation, so the raw entropy is never used
|
|
128
|
+
* directly as seed material. The entropy bytes and the expanded key are zeroed once the
|
|
129
|
+
* words exist; the words themselves are strings and cannot be.
|
|
130
|
+
*/
|
|
131
|
+
Mnemonic.deriveFrom = (entropyHex) => {
|
|
132
|
+
const rawKey = require_codecs.hexToBytes(entropyHex);
|
|
133
|
+
const derived = require_codecs.hkdf(require_codecs.sha256, rawKey, "lace", "wallet-seed", 32);
|
|
134
|
+
try {
|
|
135
|
+
return Mnemonic(entropyToMnemonic(derived, require_english.wordlist).split(" "));
|
|
136
|
+
} finally {
|
|
137
|
+
rawKey.fill(0);
|
|
138
|
+
derived.fill(0);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* The 64-byte BIP39 seed of the mnemonic with an empty passphrase: the seed
|
|
143
|
+
* that wallets deriving their keys from the BIP39 seed consume, so secrets
|
|
144
|
+
* derived from it match what such a wallet built from the same words would
|
|
145
|
+
* derive. The caller owns the bytes and zeroes them after use.
|
|
146
|
+
*/
|
|
147
|
+
Mnemonic.toSeed = (words) => mnemonicToSeedSync(words.join(" "));
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../../packages/lib/passkey/src/constants.ts
|
|
150
|
+
/** The label of the first PRF salt, whose output is the device secret. */
|
|
151
|
+
const PRF_SALT_AUTHORISER_LABEL = "lace-passport/prf/authoriser/v1";
|
|
152
|
+
/** The label of the second PRF salt, whose output is the root every named derivation starts from. */
|
|
153
|
+
const PRF_SALT_ROOT_LABEL = "lace/prf/root/v1";
|
|
154
|
+
/** The HKDF info label under which the record sealing key derives from the root. */
|
|
155
|
+
const HKDF_RECORD_KEY_INFO = "lace-passport/hkdf/record-key/v1";
|
|
156
|
+
/** The HKDF info label under which the wallet entropy, and from it the recovery words, derives from the root. */
|
|
157
|
+
const HKDF_WALLET_ENTROPY_INFO = "lace/hkdf/wallet-entropy/v1";
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../packages/lib/passkey/src/errors.ts
|
|
160
|
+
/** The user dismissed a WebAuthn ceremony. */
|
|
161
|
+
var PasskeyCeremonyCancelledError = class extends Error {
|
|
162
|
+
code = "ceremony-cancelled";
|
|
163
|
+
constructor() {
|
|
164
|
+
super("The passkey ceremony was cancelled.");
|
|
165
|
+
this.name = "PasskeyCeremonyCancelledError";
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
/** The authenticator did not supply both PRF outputs. */
|
|
169
|
+
var PasskeyPrfUnsupportedError = class extends Error {
|
|
170
|
+
code = "prf-unsupported";
|
|
171
|
+
constructor() {
|
|
172
|
+
super("The platform authenticator does not support the PRF extension.");
|
|
173
|
+
this.name = "PasskeyPrfUnsupportedError";
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
/** The selected credential differs from the imported wallet credential. */
|
|
177
|
+
var PasskeyCredentialMismatchError = class extends Error {
|
|
178
|
+
code = "credential-mismatch";
|
|
179
|
+
constructor() {
|
|
180
|
+
super("The selected passkey does not match the wallet credential.");
|
|
181
|
+
this.name = "PasskeyCredentialMismatchError";
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* The browser refused to open the signer popup (`popup-blocked`); it must be
|
|
186
|
+
* opened inside a user gesture.
|
|
187
|
+
*/
|
|
188
|
+
var SignerPopupBlockedError = class extends Error {
|
|
189
|
+
code = "popup-blocked";
|
|
190
|
+
constructor() {
|
|
191
|
+
super("The browser blocked the signer popup.");
|
|
192
|
+
this.name = "SignerPopupBlockedError";
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* The signer answered a request with a failure; `code` is the code it
|
|
197
|
+
* reported, such as `ceremony-cancelled` when the user rejects the request
|
|
198
|
+
* or `malformed-request` when the signer cannot describe it for consent,
|
|
199
|
+
* and `details` the values it declared alongside, when any. Both come from
|
|
200
|
+
* the signer page, so a reader validates `details` before acting on it.
|
|
201
|
+
*/
|
|
202
|
+
var RemoteSignerError = class extends Error {
|
|
203
|
+
code;
|
|
204
|
+
details;
|
|
205
|
+
constructor(code, message, details) {
|
|
206
|
+
super(message);
|
|
207
|
+
this.code = code;
|
|
208
|
+
this.details = details;
|
|
209
|
+
this.name = "RemoteSignerError";
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* The signer popup closed, as when the user closes the window, while requests
|
|
214
|
+
* were still pending (`ceremony-cancelled`).
|
|
215
|
+
*/
|
|
216
|
+
var SignerClosedError = class extends Error {
|
|
217
|
+
code = "ceremony-cancelled";
|
|
218
|
+
constructor() {
|
|
219
|
+
super("The signer popup was closed.");
|
|
220
|
+
this.name = "SignerClosedError";
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../../packages/lib/passkey/src/ceremony.ts
|
|
225
|
+
const DEFAULT_RP_NAME = "Lace";
|
|
226
|
+
const CHALLENGE_LENGTH = 32;
|
|
227
|
+
const USER_ID_LENGTH = 16;
|
|
228
|
+
const WALLET_ENTROPY_LENGTH = 32;
|
|
229
|
+
const MAX_CREDENTIAL_ID_LENGTH = 1023;
|
|
230
|
+
const ES256 = -7;
|
|
231
|
+
const RS256 = -257;
|
|
232
|
+
const RECIPE_VERSION = "v1";
|
|
233
|
+
const encodeId = (id) => btoa(String.fromCharCode(...new Uint8Array(id))).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
|
|
234
|
+
const decodeId = (id) => {
|
|
235
|
+
if (!/^[A-Za-z0-9_-]+$/.test(id) || id.length > Math.ceil(MAX_CREDENTIAL_ID_LENGTH * 4 / 3)) throw new Error("Invalid passkey credential ID.");
|
|
236
|
+
let bytes;
|
|
237
|
+
try {
|
|
238
|
+
bytes = Uint8Array.from(atob(id.replaceAll("-", "+").replaceAll("_", "/")), (character) => character.charCodeAt(0));
|
|
239
|
+
} catch {
|
|
240
|
+
throw new Error("Invalid passkey credential ID.");
|
|
241
|
+
}
|
|
242
|
+
if (bytes.length > MAX_CREDENTIAL_ID_LENGTH || encodeId(bytes.buffer) !== id) throw new Error("Invalid passkey credential ID.");
|
|
243
|
+
return bytes.buffer;
|
|
244
|
+
};
|
|
245
|
+
const utf8 = (value) => new TextEncoder().encode(value);
|
|
246
|
+
/** PRF salts are public domain separators: SHA-256 of their label. */
|
|
247
|
+
const prfSalt = async (label) => new Uint8Array(await crypto.subtle.digest("SHA-256", utf8(label)));
|
|
248
|
+
const isCancellation = (error) => error instanceof Object && "name" in error && error.name === "NotAllowedError";
|
|
249
|
+
const toBytes = (source) => source instanceof ArrayBuffer ? new Uint8Array(source) : new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
250
|
+
/** Zeroes every PRF output of one assertion. */
|
|
251
|
+
const zeroOutputs = (outputs) => {
|
|
252
|
+
outputs.device?.fill(0);
|
|
253
|
+
outputs.root.fill(0);
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* The wallet entropy is HKDF-SHA256 over the root with an empty salt and a
|
|
257
|
+
* fixed info label. The expanded bytes are zeroed once encoded; the hex
|
|
258
|
+
* string is what leaves this function, and only for the caller's use.
|
|
259
|
+
*/
|
|
260
|
+
const deriveWalletEntropy = (root) => {
|
|
261
|
+
const raw = require_codecs.hkdf(require_codecs.sha256, root, void 0, HKDF_WALLET_ENTROPY_INFO, WALLET_ENTROPY_LENGTH);
|
|
262
|
+
try {
|
|
263
|
+
return EntropyHex(require_codecs.bytesToHex(raw));
|
|
264
|
+
} finally {
|
|
265
|
+
raw.fill(0);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* Runs a fresh assertion and confines the words its root derives to `consume`.
|
|
270
|
+
* The outputs are zeroed and the credential released on success and failure
|
|
271
|
+
* alike; the credential is committed only when `consume` succeeds.
|
|
272
|
+
*/
|
|
273
|
+
const withCeremonyMnemonic = async (ceremony, consume) => {
|
|
274
|
+
const { outputs, credential } = await ceremony();
|
|
275
|
+
try {
|
|
276
|
+
const result = await consume(Mnemonic.deriveFrom(deriveWalletEntropy(outputs.root)));
|
|
277
|
+
credential.commit();
|
|
278
|
+
return result;
|
|
279
|
+
} finally {
|
|
280
|
+
credential.release();
|
|
281
|
+
zeroOutputs(outputs);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* The credential handling every key source shares: enrolment, the pinned
|
|
286
|
+
* credential, and assertions evaluating the PRF at the root salt and, when
|
|
287
|
+
* `deviceSaltLabel` is given, at that salt first. The root output is the
|
|
288
|
+
* same either way, so every key source over one passkey derives the same
|
|
289
|
+
* words.
|
|
290
|
+
*
|
|
291
|
+
* Ceremonies pin `allowCredentials` to the credential id captured from
|
|
292
|
+
* passkey creation or a previous assertion; before one is known the key
|
|
293
|
+
* is omitted, which is how WebAuthn asks for a discoverable credential,
|
|
294
|
+
* so the browser offers any resident passkey for the origin. A dismissed
|
|
295
|
+
* prompt maps to PasskeyCeremonyCancelledError and an authenticator without
|
|
296
|
+
* PRF support to PasskeyPrfUnsupportedError.
|
|
297
|
+
*
|
|
298
|
+
* Enrolment asks for a platform authenticator, so the passkey is created
|
|
299
|
+
* on the device the user is on and syncs through their platform
|
|
300
|
+
* credential manager. Without that constraint a browser with no passkey
|
|
301
|
+
* for the origin yet offers to scan a QR code and enrol another device
|
|
302
|
+
* instead.
|
|
303
|
+
*/
|
|
304
|
+
const createPasskeyCeremonies = ({ credentials, rpName = DEFAULT_RP_NAME, rpId = globalThis.location?.hostname, credentialId: importedCredentialId }, deviceSaltLabel) => {
|
|
305
|
+
if (!rpId) throw new Error("A passkey RP ID is required.");
|
|
306
|
+
const container = credentials ?? navigator.credentials;
|
|
307
|
+
let credentialPin = importedCredentialId !== void 0 ? {
|
|
308
|
+
credentialId: decodeId(importedCredentialId),
|
|
309
|
+
committed: true,
|
|
310
|
+
holders: 0
|
|
311
|
+
} : void 0;
|
|
312
|
+
const prfEval = async () => {
|
|
313
|
+
const rootSalt = await prfSalt(PRF_SALT_ROOT_LABEL);
|
|
314
|
+
return deviceSaltLabel === void 0 ? { first: rootSalt } : {
|
|
315
|
+
first: await prfSalt(deviceSaltLabel),
|
|
316
|
+
second: rootSalt
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
const toOutputs = (results) => {
|
|
320
|
+
if (deviceSaltLabel === void 0) {
|
|
321
|
+
if (!results?.first) throw new PasskeyPrfUnsupportedError();
|
|
322
|
+
return { root: toBytes(results.first) };
|
|
323
|
+
}
|
|
324
|
+
if (!results?.first || !results.second) throw new PasskeyPrfUnsupportedError();
|
|
325
|
+
return {
|
|
326
|
+
device: toBytes(results.first),
|
|
327
|
+
root: toBytes(results.second)
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
const credentialRef = () => credentialPin ? {
|
|
331
|
+
credentialId: encodeId(credentialPin.credentialId),
|
|
332
|
+
rpId,
|
|
333
|
+
recipeVersion: RECIPE_VERSION
|
|
334
|
+
} : void 0;
|
|
335
|
+
const releaseCredentialPin = (pin) => {
|
|
336
|
+
pin.holders -= 1;
|
|
337
|
+
if (!pin.committed && pin.holders === 0 && credentialPin === pin) credentialPin = void 0;
|
|
338
|
+
};
|
|
339
|
+
const createCredential = async () => {
|
|
340
|
+
const evaluation = await prfEval();
|
|
341
|
+
let created;
|
|
342
|
+
try {
|
|
343
|
+
created = await container.create({ publicKey: {
|
|
344
|
+
rp: {
|
|
345
|
+
name: rpName,
|
|
346
|
+
id: rpId
|
|
347
|
+
},
|
|
348
|
+
user: {
|
|
349
|
+
id: crypto.getRandomValues(new Uint8Array(USER_ID_LENGTH)),
|
|
350
|
+
name: rpName,
|
|
351
|
+
displayName: rpName
|
|
352
|
+
},
|
|
353
|
+
challenge: crypto.getRandomValues(new Uint8Array(CHALLENGE_LENGTH)),
|
|
354
|
+
pubKeyCredParams: [{
|
|
355
|
+
type: "public-key",
|
|
356
|
+
alg: ES256
|
|
357
|
+
}, {
|
|
358
|
+
type: "public-key",
|
|
359
|
+
alg: RS256
|
|
360
|
+
}],
|
|
361
|
+
authenticatorSelection: {
|
|
362
|
+
authenticatorAttachment: "platform",
|
|
363
|
+
residentKey: "required",
|
|
364
|
+
userVerification: "required"
|
|
365
|
+
},
|
|
366
|
+
extensions: { prf: { eval: evaluation } }
|
|
367
|
+
} });
|
|
368
|
+
} catch (error) {
|
|
369
|
+
if (isCancellation(error)) throw new PasskeyCeremonyCancelledError();
|
|
370
|
+
throw error;
|
|
371
|
+
}
|
|
372
|
+
if (!created) throw new PasskeyCeremonyCancelledError();
|
|
373
|
+
const credential = created;
|
|
374
|
+
if (!credential.getClientExtensionResults().prf?.enabled) throw new PasskeyPrfUnsupportedError();
|
|
375
|
+
credentialPin = {
|
|
376
|
+
credentialId: credential.rawId,
|
|
377
|
+
committed: true,
|
|
378
|
+
holders: 0
|
|
379
|
+
};
|
|
380
|
+
return credentialRef();
|
|
381
|
+
};
|
|
382
|
+
let enrolment;
|
|
383
|
+
const ensureCredential = async () => {
|
|
384
|
+
const existing = credentialRef();
|
|
385
|
+
if (existing) return existing;
|
|
386
|
+
enrolment ??= createCredential().finally(() => {
|
|
387
|
+
enrolment = void 0;
|
|
388
|
+
});
|
|
389
|
+
return enrolment;
|
|
390
|
+
};
|
|
391
|
+
const ceremony = async () => {
|
|
392
|
+
const evaluation = await prfEval();
|
|
393
|
+
const expectedPin = credentialPin;
|
|
394
|
+
const expectedCredentialId = expectedPin?.credentialId;
|
|
395
|
+
if (expectedPin) expectedPin.holders += 1;
|
|
396
|
+
let asserted;
|
|
397
|
+
try {
|
|
398
|
+
asserted = await container.get({ publicKey: {
|
|
399
|
+
challenge: crypto.getRandomValues(new Uint8Array(CHALLENGE_LENGTH)),
|
|
400
|
+
rpId,
|
|
401
|
+
...expectedCredentialId && { allowCredentials: [{
|
|
402
|
+
type: "public-key",
|
|
403
|
+
id: expectedCredentialId
|
|
404
|
+
}] },
|
|
405
|
+
userVerification: "required",
|
|
406
|
+
extensions: { prf: { eval: evaluation } }
|
|
407
|
+
} });
|
|
408
|
+
} catch (error) {
|
|
409
|
+
if (expectedPin) releaseCredentialPin(expectedPin);
|
|
410
|
+
if (isCancellation(error)) throw new PasskeyCeremonyCancelledError();
|
|
411
|
+
throw error;
|
|
412
|
+
}
|
|
413
|
+
if (!asserted) {
|
|
414
|
+
if (expectedPin) releaseCredentialPin(expectedPin);
|
|
415
|
+
throw new PasskeyCeremonyCancelledError();
|
|
416
|
+
}
|
|
417
|
+
let heldPin = expectedPin;
|
|
418
|
+
try {
|
|
419
|
+
const credential = asserted;
|
|
420
|
+
if (expectedCredentialId && encodeId(credential.rawId) !== encodeId(expectedCredentialId)) throw new PasskeyCredentialMismatchError();
|
|
421
|
+
const outputs = toOutputs(credential.getClientExtensionResults().prf?.results);
|
|
422
|
+
if (!heldPin) {
|
|
423
|
+
const currentPin = credentialPin;
|
|
424
|
+
if (currentPin && encodeId(credential.rawId) !== encodeId(currentPin.credentialId)) throw new PasskeyCredentialMismatchError();
|
|
425
|
+
if (currentPin) {
|
|
426
|
+
currentPin.holders += 1;
|
|
427
|
+
heldPin = currentPin;
|
|
428
|
+
} else {
|
|
429
|
+
heldPin = {
|
|
430
|
+
credentialId: credential.rawId,
|
|
431
|
+
committed: false,
|
|
432
|
+
holders: 1
|
|
433
|
+
};
|
|
434
|
+
credentialPin = heldPin;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
const selectedPin = heldPin;
|
|
438
|
+
let isReleased = false;
|
|
439
|
+
return {
|
|
440
|
+
outputs,
|
|
441
|
+
credential: {
|
|
442
|
+
commit: () => {
|
|
443
|
+
selectedPin.committed = true;
|
|
444
|
+
},
|
|
445
|
+
release: () => {
|
|
446
|
+
if (isReleased) return;
|
|
447
|
+
isReleased = true;
|
|
448
|
+
releaseCredentialPin(selectedPin);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
} catch (error) {
|
|
453
|
+
if (heldPin) releaseCredentialPin(heldPin);
|
|
454
|
+
throw error;
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
return {
|
|
458
|
+
ensureCredential,
|
|
459
|
+
credentialRef,
|
|
460
|
+
ceremony
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
//#endregion
|
|
464
|
+
//#region ../../packages/lib/passkey/src/key-source.ts
|
|
465
|
+
/**
|
|
466
|
+
* Creates the key source of one passkey: it runs the WebAuthn PRF ceremony
|
|
467
|
+
* and derives the passkey's wallet words, handing them only to the callback
|
|
468
|
+
* of `withPasskeyMnemonic`.
|
|
469
|
+
*
|
|
470
|
+
* @remarks
|
|
471
|
+
* A {@link PasskeyKeySource} over the WebAuthn PRF extension. Each call to
|
|
472
|
+
* `withPasskeyMnemonic` is its own assertion: the PRF output is the root,
|
|
473
|
+
* the words derive from it through HKDF and BIP-39, and the root is zeroed
|
|
474
|
+
* once the callback settles, on success and failure alike. Nothing is kept
|
|
475
|
+
* between calls except the credential id.
|
|
476
|
+
*
|
|
477
|
+
* Ceremonies pin `allowCredentials` to the credential id captured from
|
|
478
|
+
* passkey creation or a previous assertion; before one is known the key is
|
|
479
|
+
* omitted, so the browser offers any resident passkey for the origin. A
|
|
480
|
+
* dismissed prompt rejects with a `ceremony-cancelled` error and an
|
|
481
|
+
* authenticator without PRF support with a `prf-unsupported` one.
|
|
482
|
+
*
|
|
483
|
+
* Enrolment asks for a platform authenticator, so the passkey is created on
|
|
484
|
+
* the device the user is on and syncs through their platform credential
|
|
485
|
+
* manager. Without that constraint a browser with no passkey for the origin
|
|
486
|
+
* yet offers to scan a QR code and enrol another device instead.
|
|
487
|
+
*
|
|
488
|
+
* @param props - The relying party, a saved credential ID and the WebAuthn
|
|
489
|
+
* entry point, each optional.
|
|
490
|
+
*/
|
|
491
|
+
const createPasskeyKeySource = (props = {}) => {
|
|
492
|
+
const { ensureCredential, credentialRef, ceremony } = createPasskeyCeremonies(props);
|
|
493
|
+
return {
|
|
494
|
+
ensureCredential,
|
|
495
|
+
credentialRef,
|
|
496
|
+
withPasskeyMnemonic: async (use) => withCeremonyMnemonic(ceremony, use)
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
//#endregion
|
|
500
|
+
Object.defineProperty(exports, "EntropyHex", {
|
|
501
|
+
enumerable: true,
|
|
502
|
+
get: function() {
|
|
503
|
+
return EntropyHex;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
Object.defineProperty(exports, "HKDF_RECORD_KEY_INFO", {
|
|
507
|
+
enumerable: true,
|
|
508
|
+
get: function() {
|
|
509
|
+
return HKDF_RECORD_KEY_INFO;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
Object.defineProperty(exports, "Mnemonic", {
|
|
513
|
+
enumerable: true,
|
|
514
|
+
get: function() {
|
|
515
|
+
return Mnemonic;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
Object.defineProperty(exports, "PRF_SALT_AUTHORISER_LABEL", {
|
|
519
|
+
enumerable: true,
|
|
520
|
+
get: function() {
|
|
521
|
+
return PRF_SALT_AUTHORISER_LABEL;
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
Object.defineProperty(exports, "PasskeyCeremonyCancelledError", {
|
|
525
|
+
enumerable: true,
|
|
526
|
+
get: function() {
|
|
527
|
+
return PasskeyCeremonyCancelledError;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
Object.defineProperty(exports, "PasskeyPrfUnsupportedError", {
|
|
531
|
+
enumerable: true,
|
|
532
|
+
get: function() {
|
|
533
|
+
return PasskeyPrfUnsupportedError;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
Object.defineProperty(exports, "RemoteSignerError", {
|
|
537
|
+
enumerable: true,
|
|
538
|
+
get: function() {
|
|
539
|
+
return RemoteSignerError;
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
Object.defineProperty(exports, "SignerClosedError", {
|
|
543
|
+
enumerable: true,
|
|
544
|
+
get: function() {
|
|
545
|
+
return SignerClosedError;
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
Object.defineProperty(exports, "SignerPopupBlockedError", {
|
|
549
|
+
enumerable: true,
|
|
550
|
+
get: function() {
|
|
551
|
+
return SignerPopupBlockedError;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
Object.defineProperty(exports, "createPasskeyCeremonies", {
|
|
555
|
+
enumerable: true,
|
|
556
|
+
get: function() {
|
|
557
|
+
return createPasskeyCeremonies;
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
Object.defineProperty(exports, "createPasskeyKeySource", {
|
|
561
|
+
enumerable: true,
|
|
562
|
+
get: function() {
|
|
563
|
+
return createPasskeyKeySource;
|
|
564
|
+
}
|
|
565
|
+
});
|
|
566
|
+
Object.defineProperty(exports, "deriveWalletEntropy", {
|
|
567
|
+
enumerable: true,
|
|
568
|
+
get: function() {
|
|
569
|
+
return deriveWalletEntropy;
|
|
570
|
+
}
|
|
571
|
+
});
|
|
572
|
+
Object.defineProperty(exports, "withCeremonyMnemonic", {
|
|
573
|
+
enumerable: true,
|
|
574
|
+
get: function() {
|
|
575
|
+
return withCeremonyMnemonic;
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
Object.defineProperty(exports, "zeroOutputs", {
|
|
579
|
+
enumerable: true,
|
|
580
|
+
get: function() {
|
|
581
|
+
return zeroOutputs;
|
|
582
|
+
}
|
|
583
|
+
});
|