@crossmint/wallets-sdk 1.5.2 → 1.6.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/api/__tests__/constants.cjs +1 -1
- package/dist/api/__tests__/constants.d.cts +1 -1
- package/dist/api/__tests__/constants.d.ts +1 -1
- package/dist/api/__tests__/constants.js +1 -1
- package/dist/api/__tests__/test-utils.cjs +1 -1
- package/dist/api/__tests__/test-utils.d.cts +1 -1
- package/dist/api/__tests__/test-utils.d.ts +1 -1
- package/dist/api/__tests__/test-utils.js +1 -1
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.d.cts +1 -1
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.js +1 -1
- package/dist/api/gen/client.gen.cjs +1 -1
- package/dist/api/gen/client.gen.js +1 -1
- package/dist/api/gen/index.cjs +1 -1
- package/dist/api/gen/index.js +1 -1
- package/dist/api/gen/sdk.gen.cjs +1 -1
- package/dist/api/gen/sdk.gen.js +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/types.d.cts +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/chains/adapters/evm.cjs +1 -0
- package/dist/chains/adapters/evm.d.cts +16 -0
- package/dist/chains/adapters/evm.d.ts +16 -0
- package/dist/chains/adapters/evm.js +1 -0
- package/dist/chains/adapters/solana.cjs +1 -0
- package/dist/chains/adapters/solana.d.cts +16 -0
- package/dist/chains/adapters/solana.d.ts +16 -0
- package/dist/chains/adapters/solana.js +1 -0
- package/dist/chains/adapters/stellar.cjs +1 -0
- package/dist/chains/adapters/stellar.d.cts +16 -0
- package/dist/chains/adapters/stellar.d.ts +16 -0
- package/dist/chains/adapters/stellar.js +1 -0
- package/dist/chains/chain-adapter.cjs +1 -0
- package/dist/chains/chain-adapter.d.cts +36 -0
- package/dist/chains/chain-adapter.d.ts +36 -0
- package/dist/chains/chain-adapter.js +1 -0
- package/dist/chains/chains.cjs +1 -1
- package/dist/chains/chains.js +1 -1
- package/dist/chains/definitions/arcTestnet.cjs +1 -1
- package/dist/chains/definitions/arcTestnet.js +1 -1
- package/dist/chains/definitions/story.cjs +1 -1
- package/dist/chains/definitions/story.js +1 -1
- package/dist/chains/definitions/storyTestnet.cjs +1 -1
- package/dist/chains/definitions/storyTestnet.js +1 -1
- package/dist/chains/definitions/tempo.cjs +1 -1
- package/dist/chains/definitions/tempo.js +1 -1
- package/dist/chains/definitions/tempoTestnet.cjs +1 -1
- package/dist/chains/definitions/tempoTestnet.js +1 -1
- package/dist/chunk-277G6KNG.js +1 -0
- package/dist/{chunk-VVX6XW5L.cjs → chunk-2WS6SXS6.cjs} +1 -1
- package/dist/chunk-2YZQ4YYU.cjs +1 -0
- package/dist/chunk-3F4FMM3R.cjs +1 -0
- package/dist/{chunk-PG6S5LNU.js → chunk-46Z5EE2F.js} +1 -1
- package/dist/chunk-4DLKWRLY.cjs +1 -0
- package/dist/{chunk-SPTXAOFR.cjs → chunk-5FVDLMWW.cjs} +1 -1
- package/dist/{chunk-N4IWDL6M.js → chunk-5LNDUSMZ.js} +1 -1
- package/dist/chunk-64JQSHXM.js +1 -0
- package/dist/{chunk-4TGSG3UZ.cjs → chunk-66XVKHJQ.cjs} +1 -1
- package/dist/{chunk-M5BPFF6N.js → chunk-6A7SZ3QD.js} +1 -1
- package/dist/{chunk-VUC4UU5M.cjs → chunk-6GEBK257.cjs} +1 -1
- package/dist/chunk-6VH3KWLM.js +1 -0
- package/dist/{chunk-ENZ7MQIX.js → chunk-6ZD7NFX6.js} +1 -1
- package/dist/chunk-73FKNIUX.cjs +1 -0
- package/dist/{chunk-R52TCQ54.js → chunk-76TBLKLF.js} +1 -1
- package/dist/chunk-7KF4AULF.cjs +2 -0
- package/dist/{chunk-JGWGYONV.js → chunk-7SKKGHMB.js} +1 -1
- package/dist/chunk-7VMBZI5M.cjs +1 -0
- package/dist/chunk-A3N6JH3M.cjs +1 -0
- package/dist/chunk-AK3REMFI.cjs +1 -0
- package/dist/{chunk-JBP52JOH.cjs → chunk-ATIC4ENG.cjs} +1 -1
- package/dist/chunk-BNC4HX7P.js +1 -0
- package/dist/{chunk-PHPBBEXU.cjs → chunk-CDHMNLZ6.cjs} +1 -1
- package/dist/{chunk-W5SV3EQJ.cjs → chunk-CHDHMS5R.cjs} +1 -1
- package/dist/chunk-CTQFY3MR.js +1 -0
- package/dist/chunk-DSIFRRBS.cjs +1 -0
- package/dist/chunk-E3H6RZHM.js +1 -0
- package/dist/chunk-EE6XMYUL.js +1 -0
- package/dist/{chunk-KHFRALRB.cjs → chunk-EFAZ2WYW.cjs} +1 -1
- package/dist/chunk-FJPAMX7L.js +1 -0
- package/dist/{chunk-KXKBZNET.cjs → chunk-FN64UU7M.cjs} +1 -1
- package/dist/{chunk-2O6HQK34.js → chunk-FOHYTIML.js} +1 -1
- package/dist/{chunk-QVTKTDED.js → chunk-FQ5F3VYJ.js} +1 -1
- package/dist/chunk-GA7EPR4Z.js +1 -0
- package/dist/{chunk-YHV3672R.cjs → chunk-GMU3ZYLS.cjs} +1 -1
- package/dist/chunk-GSNFNRH2.cjs +1 -0
- package/dist/{chunk-XS5B3TUE.js → chunk-HAQMNZO5.js} +1 -1
- package/dist/chunk-HBHDN4G7.js +1 -0
- package/dist/chunk-HHVYXPUL.cjs +1 -0
- package/dist/chunk-HI72AV4W.cjs +1 -0
- package/dist/chunk-HJH2S644.cjs +1 -0
- package/dist/{chunk-UHNDS4AW.cjs → chunk-HOK6IZYG.cjs} +1 -1
- package/dist/{chunk-A33BEWR7.cjs → chunk-HYWIWJ6H.cjs} +1 -1
- package/dist/{chunk-O6VBO7KG.js → chunk-IHMMTMFG.js} +1 -1
- package/dist/{chunk-4HWSBR3N.cjs → chunk-IKHH67TL.cjs} +1 -1
- package/dist/chunk-IQ3QQ4M6.js +1 -0
- package/dist/{chunk-KZMDZJGM.js → chunk-IUMKG7QD.js} +1 -1
- package/dist/chunk-IZMSUJUW.cjs +1 -0
- package/dist/chunk-JFJXQGW5.cjs +1 -0
- package/dist/chunk-JTWVCUVZ.js +1 -0
- package/dist/chunk-JZYDIP5D.cjs +1 -0
- package/dist/chunk-K55DPXZQ.cjs +1 -0
- package/dist/chunk-K7BNQDN2.cjs +1 -0
- package/dist/{chunk-EE4ITUGS.js → chunk-K7BPGUFU.js} +1 -1
- package/dist/chunk-KGQWE3HH.js +1 -0
- package/dist/chunk-KQNMPKVE.js +1 -0
- package/dist/{chunk-X5JWMXUK.js → chunk-KSW27XVT.js} +1 -1
- package/dist/chunk-KULR5B4O.cjs +1 -0
- package/dist/chunk-LJKNUBZA.js +1 -0
- package/dist/{chunk-FF2GQYF4.js → chunk-LKFW3NS5.js} +1 -1
- package/dist/{chunk-OGP7B5O3.cjs → chunk-LMHH6ODX.cjs} +1 -1
- package/dist/chunk-LV5QR6LK.js +1 -0
- package/dist/chunk-LWA3SX6Z.cjs +1 -0
- package/dist/chunk-M7BGVCMZ.cjs +1 -0
- package/dist/{chunk-YH7G2U6V.js → chunk-MLROTECD.js} +1 -1
- package/dist/{chunk-CKZYSQOK.js → chunk-MN2BGRRJ.js} +1 -1
- package/dist/chunk-NE2Y6VFQ.js +1 -0
- package/dist/{chunk-CAQZTHJB.cjs → chunk-NFDWJLL6.cjs} +1 -1
- package/dist/chunk-NU7VF7MC.js +1 -0
- package/dist/chunk-NUO3MBBE.cjs +1 -0
- package/dist/chunk-NZXYWQE5.js +1 -0
- package/dist/chunk-OWJS5ITO.cjs +1 -0
- package/dist/chunk-PNYAMSZ7.cjs +1 -0
- package/dist/chunk-PVXNJEBO.js +2 -0
- package/dist/chunk-Q4VN3MG7.cjs +1 -0
- package/dist/{chunk-Q4EIDR3A.cjs → chunk-Q66YRLSW.cjs} +1 -1
- package/dist/{chunk-SYQ5Q3WU.js → chunk-QOSA6B55.js} +1 -1
- package/dist/{chunk-IJ632UXD.cjs → chunk-R4SBFRTM.cjs} +1 -1
- package/dist/chunk-RKUCX4Z4.cjs +2 -0
- package/dist/{chunk-YM3T5Z2Z.js → chunk-RKVJZO7O.js} +1 -1
- package/dist/chunk-RPBBYBNA.js +2 -0
- package/dist/chunk-RWRESDZR.cjs +1 -0
- package/dist/chunk-S7XUH7XP.js +1 -0
- package/dist/chunk-SEOBV6KR.js +1 -0
- package/dist/chunk-SJ5MLAQI.cjs +1 -0
- package/dist/chunk-SNAWZWNR.cjs +1 -0
- package/dist/{chunk-6BERCSZQ.cjs → chunk-SO32FMP7.cjs} +1 -1
- package/dist/{chunk-2MSS6HZD.cjs → chunk-SWBJ2RMN.cjs} +1 -1
- package/dist/chunk-TGFHY5PL.js +1 -0
- package/dist/chunk-TIRSLCAM.js +1 -0
- package/dist/chunk-TL2BD4MX.cjs +1 -0
- package/dist/chunk-TM45QNB3.js +1 -0
- package/dist/{chunk-M335XCYO.js → chunk-TMOWGJ5Z.js} +1 -1
- package/dist/{chunk-MDINF2FR.js → chunk-TSJUK3ED.js} +1 -1
- package/dist/chunk-TUSSLVSF.cjs +1 -0
- package/dist/{chunk-6EUBBDIV.cjs → chunk-U7MO5CYP.cjs} +1 -1
- package/dist/chunk-UAB6KH63.js +1 -0
- package/dist/chunk-UEM7C5FY.js +1 -0
- package/dist/chunk-ULAIS6HM.js +1 -0
- package/dist/{chunk-E4EOD7MP.cjs → chunk-UULZ22RQ.cjs} +1 -1
- package/dist/{chunk-5DDBWQT7.js → chunk-UUMP3VCM.js} +1 -1
- package/dist/chunk-UWX7ID4X.cjs +1 -0
- package/dist/chunk-VMDJJX7P.cjs +1 -0
- package/dist/{chunk-EOBMHTZD.js → chunk-VPBJ7L4I.js} +1 -1
- package/dist/chunk-WK2RGS25.cjs +1 -0
- package/dist/chunk-WK67OXB3.js +1 -0
- package/dist/{chunk-LDOMAUCN.js → chunk-WPNLE54U.js} +1 -1
- package/dist/chunk-WTIV4TTS.js +1 -0
- package/dist/chunk-XKMIK6EW.js +1 -0
- package/dist/{chunk-GEY3BU62.cjs → chunk-XWQC6G7N.cjs} +1 -1
- package/dist/chunk-YEHBDKR3.cjs +1 -0
- package/dist/chunk-YWZMLT47.js +1 -0
- package/dist/{chunk-42JFJWEX.js → chunk-Z5DV2DB7.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/init.cjs +1 -1
- package/dist/logger/init.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.d.cts +4 -1
- package/dist/sdk.d.ts +4 -1
- package/dist/sdk.js +1 -1
- package/dist/signers/descriptors/api-key.cjs +1 -0
- package/dist/signers/descriptors/api-key.d.cts +17 -0
- package/dist/signers/descriptors/api-key.d.ts +17 -0
- package/dist/signers/descriptors/api-key.js +1 -0
- package/dist/signers/descriptors/device.cjs +1 -0
- package/dist/signers/descriptors/device.d.cts +17 -0
- package/dist/signers/descriptors/device.d.ts +17 -0
- package/dist/signers/descriptors/device.js +1 -0
- package/dist/signers/descriptors/email.cjs +1 -0
- package/dist/signers/descriptors/email.d.cts +17 -0
- package/dist/signers/descriptors/email.d.ts +17 -0
- package/dist/signers/descriptors/email.js +1 -0
- package/dist/signers/descriptors/external-wallet.cjs +1 -0
- package/dist/signers/descriptors/external-wallet.d.cts +18 -0
- package/dist/signers/descriptors/external-wallet.d.ts +18 -0
- package/dist/signers/descriptors/external-wallet.js +1 -0
- package/dist/signers/descriptors/index.cjs +1 -0
- package/dist/signers/descriptors/index.d.cts +18 -0
- package/dist/signers/descriptors/index.d.ts +18 -0
- package/dist/signers/descriptors/index.js +1 -0
- package/dist/signers/descriptors/passkey.cjs +1 -0
- package/dist/signers/descriptors/passkey.d.cts +17 -0
- package/dist/signers/descriptors/passkey.d.ts +17 -0
- package/dist/signers/descriptors/passkey.js +1 -0
- package/dist/signers/descriptors/phone.cjs +1 -0
- package/dist/signers/descriptors/phone.d.cts +17 -0
- package/dist/signers/descriptors/phone.d.ts +17 -0
- package/dist/signers/descriptors/phone.js +1 -0
- package/dist/signers/descriptors/server.cjs +1 -0
- package/dist/signers/descriptors/server.d.cts +17 -0
- package/dist/signers/descriptors/server.d.ts +17 -0
- package/dist/signers/descriptors/server.js +1 -0
- package/dist/signers/descriptors/types.cjs +1 -0
- package/dist/signers/descriptors/types.d.cts +46 -0
- package/dist/signers/descriptors/types.d.ts +46 -0
- package/dist/signers/descriptors/types.js +0 -0
- package/dist/signers/device.cjs +1 -1
- package/dist/signers/device.d.cts +1 -1
- package/dist/signers/device.d.ts +1 -1
- package/dist/signers/device.js +1 -1
- package/dist/signers/evm-api-key.cjs +1 -1
- package/dist/signers/evm-api-key.d.cts +1 -1
- package/dist/signers/evm-api-key.d.ts +1 -1
- package/dist/signers/evm-api-key.js +1 -1
- package/dist/signers/evm-external-wallet.cjs +1 -1
- package/dist/signers/evm-external-wallet.d.cts +1 -1
- package/dist/signers/evm-external-wallet.d.ts +1 -1
- package/dist/signers/evm-external-wallet.js +1 -1
- package/dist/signers/external-wallet-signer.cjs +1 -1
- package/dist/signers/external-wallet-signer.d.cts +1 -1
- package/dist/signers/external-wallet-signer.d.ts +1 -1
- package/dist/signers/external-wallet-signer.js +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.d.cts +1 -1
- package/dist/signers/index.d.ts +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/signers/non-custodial/index.cjs +1 -1
- package/dist/signers/non-custodial/index.d.cts +1 -1
- package/dist/signers/non-custodial/index.d.ts +1 -1
- package/dist/signers/non-custodial/index.js +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +1 -1
- package/dist/signers/non-custodial/ncs-iframe-manager.js +1 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
- package/dist/signers/passkey.cjs +1 -1
- package/dist/signers/passkey.d.cts +1 -1
- package/dist/signers/passkey.d.ts +1 -1
- package/dist/signers/passkey.js +1 -1
- package/dist/signers/server/assemble-server-signer.cjs +1 -1
- package/dist/signers/server/assemble-server-signer.d.cts +1 -1
- package/dist/signers/server/assemble-server-signer.d.ts +1 -1
- package/dist/signers/server/assemble-server-signer.js +1 -1
- package/dist/signers/server/evm-server-signer.cjs +1 -1
- package/dist/signers/server/evm-server-signer.d.cts +1 -1
- package/dist/signers/server/evm-server-signer.d.ts +1 -1
- package/dist/signers/server/evm-server-signer.js +1 -1
- package/dist/signers/server/helpers/derive-server-signer.cjs +1 -1
- package/dist/signers/server/helpers/derive-server-signer.d.cts +1 -1
- package/dist/signers/server/helpers/derive-server-signer.d.ts +1 -1
- package/dist/signers/server/helpers/derive-server-signer.js +1 -1
- package/dist/signers/server/helpers/get-chain-type.cjs +1 -1
- package/dist/signers/server/helpers/get-chain-type.js +1 -1
- package/dist/signers/server/helpers/index.cjs +1 -1
- package/dist/signers/server/helpers/index.d.cts +1 -1
- package/dist/signers/server/helpers/index.d.ts +1 -1
- package/dist/signers/server/helpers/index.js +1 -1
- package/dist/signers/server/index.cjs +1 -1
- package/dist/signers/server/index.d.cts +1 -1
- package/dist/signers/server/index.d.ts +1 -1
- package/dist/signers/server/index.js +1 -1
- package/dist/signers/server/resolver.cjs +1 -0
- package/dist/signers/server/resolver.d.cts +54 -0
- package/dist/signers/server/resolver.d.ts +54 -0
- package/dist/signers/server/resolver.js +1 -0
- package/dist/signers/server/solana-server-signer.cjs +1 -1
- package/dist/signers/server/solana-server-signer.d.cts +1 -1
- package/dist/signers/server/solana-server-signer.d.ts +1 -1
- package/dist/signers/server/solana-server-signer.js +1 -1
- package/dist/signers/server/stellar-server-signer.cjs +1 -1
- package/dist/signers/server/stellar-server-signer.d.cts +1 -1
- package/dist/signers/server/stellar-server-signer.d.ts +1 -1
- package/dist/signers/server/stellar-server-signer.js +1 -1
- package/dist/signers/solana-api-key.cjs +1 -1
- package/dist/signers/solana-api-key.d.cts +1 -1
- package/dist/signers/solana-api-key.d.ts +1 -1
- package/dist/signers/solana-api-key.js +1 -1
- package/dist/signers/solana-external-wallet.cjs +1 -1
- package/dist/signers/solana-external-wallet.d.cts +1 -1
- package/dist/signers/solana-external-wallet.d.ts +1 -1
- package/dist/signers/solana-external-wallet.js +1 -1
- package/dist/signers/stellar-external-wallet.cjs +1 -1
- package/dist/signers/stellar-external-wallet.d.cts +1 -1
- package/dist/signers/stellar-external-wallet.d.ts +1 -1
- package/dist/signers/stellar-external-wallet.js +1 -1
- package/dist/signers/types.cjs +1 -1
- package/dist/signers/types.d.cts +1 -1
- package/dist/signers/types.d.ts +1 -1
- package/dist/signers/types.js +1 -1
- package/dist/{types-CbJcRrxL.d.cts → types-D6r1qRCA.d.cts} +5 -1
- package/dist/{types-CpyIKxWr.d.ts → types-VTpasnqi.d.ts} +5 -1
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/device-signers/DeviceSignerKeyStorage.cjs +1 -1
- package/dist/utils/device-signers/DeviceSignerKeyStorage.js +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
- package/dist/utils/device-signers/createDeviceSigner.cjs +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.cts +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.ts +1 -1
- package/dist/utils/device-signers/createDeviceSigner.js +1 -1
- package/dist/utils/device-signers/index.cjs +1 -1
- package/dist/utils/device-signers/index.d.cts +1 -1
- package/dist/utils/device-signers/index.d.ts +1 -1
- package/dist/utils/device-signers/index.js +1 -1
- package/dist/utils/device-signers/storage-partitioning.cjs +1 -0
- package/dist/utils/device-signers/storage-partitioning.d.cts +13 -0
- package/dist/utils/device-signers/storage-partitioning.d.ts +13 -0
- package/dist/utils/device-signers/storage-partitioning.js +1 -0
- package/dist/utils/errors.cjs +1 -1
- package/dist/utils/errors.d.cts +17 -2
- package/dist/utils/errors.d.ts +17 -2
- package/dist/utils/errors.js +1 -1
- package/dist/utils/locators.cjs +1 -0
- package/dist/utils/locators.d.cts +16 -0
- package/dist/utils/locators.d.ts +16 -0
- package/dist/utils/locators.js +1 -0
- package/dist/utils/secure-wipe.cjs +1 -0
- package/dist/utils/secure-wipe.d.cts +7 -0
- package/dist/utils/secure-wipe.d.ts +7 -0
- package/dist/utils/secure-wipe.js +1 -0
- package/dist/utils/server-key-derivation.cjs +1 -1
- package/dist/utils/server-key-derivation.js +1 -1
- package/dist/utils/server-signers/createServerSigner.cjs +1 -1
- package/dist/utils/server-signers/createServerSigner.js +1 -1
- package/dist/utils/server-signers/index.cjs +1 -1
- package/dist/utils/server-signers/index.js +1 -1
- package/dist/utils/signer-locator.cjs +1 -1
- package/dist/utils/signer-locator.d.cts +1 -1
- package/dist/utils/signer-locator.d.ts +1 -1
- package/dist/utils/signer-locator.js +1 -1
- package/dist/utils/signer-mapping.cjs +1 -1
- package/dist/utils/signer-mapping.d.cts +2 -5
- package/dist/utils/signer-mapping.d.ts +2 -5
- package/dist/utils/signer-mapping.js +1 -1
- package/dist/utils/signer-validation.cjs +1 -1
- package/dist/utils/signer-validation.js +1 -1
- package/dist/utils/stellar.cjs +1 -1
- package/dist/utils/stellar.js +1 -1
- package/dist/wallets/__tests__/setup.cjs +1 -1
- package/dist/wallets/__tests__/setup.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +1 -1
- package/dist/wallets/__tests__/test-helpers.d.cts +7 -4
- package/dist/wallets/__tests__/test-helpers.d.ts +7 -4
- package/dist/wallets/__tests__/test-helpers.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.d.cts +4 -1
- package/dist/wallets/evm.d.ts +4 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/services/balance-formatter.cjs +1 -0
- package/dist/wallets/services/balance-formatter.d.cts +15 -0
- package/dist/wallets/services/balance-formatter.d.ts +15 -0
- package/dist/wallets/services/balance-formatter.js +1 -0
- package/dist/wallets/services/device-recovery-service.cjs +1 -0
- package/dist/wallets/services/device-recovery-service.d.cts +39 -0
- package/dist/wallets/services/device-recovery-service.d.ts +39 -0
- package/dist/wallets/services/device-recovery-service.js +1 -0
- package/dist/wallets/services/operation-poller.cjs +1 -0
- package/dist/wallets/services/operation-poller.d.cts +23 -0
- package/dist/wallets/services/operation-poller.d.ts +23 -0
- package/dist/wallets/services/operation-poller.js +1 -0
- package/dist/wallets/services/signer-manager.cjs +1 -0
- package/dist/wallets/services/signer-manager.d.cts +52 -0
- package/dist/wallets/services/signer-manager.d.ts +52 -0
- package/dist/wallets/services/signer-manager.js +1 -0
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.d.cts +4 -1
- package/dist/wallets/solana.d.ts +4 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.d.cts +4 -1
- package/dist/wallets/stellar.d.ts +4 -1
- package/dist/wallets/stellar.js +1 -1
- package/dist/wallets/types.d.cts +1 -1
- package/dist/wallets/types.d.ts +1 -1
- package/dist/wallets/wallet-factory.cjs +1 -1
- package/dist/wallets/wallet-factory.d.cts +4 -1
- package/dist/wallets/wallet-factory.d.ts +4 -1
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.d.cts +8 -85
- package/dist/wallets/wallet.d.ts +8 -85
- package/dist/wallets/wallet.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-2GKPWQBQ.cjs +0 -1
- package/dist/chunk-3SVXPFSP.cjs +0 -1
- package/dist/chunk-3VRN3GKQ.js +0 -1
- package/dist/chunk-4DJWSV7I.cjs +0 -1
- package/dist/chunk-5OYPWGMX.js +0 -1
- package/dist/chunk-6X5JEJD7.js +0 -1
- package/dist/chunk-A5GN63FT.cjs +0 -1
- package/dist/chunk-BITOMWYZ.js +0 -1
- package/dist/chunk-GDEOTJEZ.cjs +0 -1
- package/dist/chunk-GZP2JQ6P.cjs +0 -1
- package/dist/chunk-HSLZH2ZC.cjs +0 -1
- package/dist/chunk-J3R36SGJ.js +0 -1
- package/dist/chunk-MYJFCP65.js +0 -1
- package/dist/chunk-N355UETO.js +0 -1
- package/dist/chunk-OWQZPI3U.cjs +0 -1
- package/dist/chunk-PMUGCRPI.js +0 -3
- package/dist/chunk-QLEJSDVV.js +0 -1
- package/dist/chunk-QVNXEPOZ.cjs +0 -3
- package/dist/chunk-RJ24JXFS.js +0 -1
- package/dist/chunk-TLLXWU3N.js +0 -1
- package/dist/chunk-VDNAVMQQ.cjs +0 -1
- package/dist/chunk-W4RKYWY3.cjs +0 -1
- package/dist/chunk-XNZLCUTY.js +0 -1
- package/dist/chunk-YF5G4U6L.cjs +0 -1
- package/dist/chunk-YGL4ITFK.cjs +0 -1
- package/dist/chunk-YN4JN7PO.js +0 -1
- package/dist/chunk-YVDA37CD.cjs +0 -1
- package/dist/chunk-ZF4VCMLC.cjs +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiClient } from '../api/client.cjs';
|
|
2
2
|
import { Chain } from '../chains/chains.cjs';
|
|
3
|
-
import { W as WalletArgsFor, H as WalletCreateArgs } from '../types-
|
|
3
|
+
import { W as WalletArgsFor, H as WalletCreateArgs } from '../types-D6r1qRCA.cjs';
|
|
4
4
|
import { Wallet } from './wallet.cjs';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -11,6 +11,9 @@ import '@crossmint/client-signers';
|
|
|
11
11
|
import '@solana/web3.js';
|
|
12
12
|
import 'abitype';
|
|
13
13
|
import '../utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
14
|
+
import './services/signer-manager.cjs';
|
|
15
|
+
import '../signers/descriptors/types.cjs';
|
|
16
|
+
import '../signers/server/resolver.cjs';
|
|
14
17
|
|
|
15
18
|
declare class WalletFactory {
|
|
16
19
|
private readonly apiClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiClient } from '../api/client.js';
|
|
2
2
|
import { Chain } from '../chains/chains.js';
|
|
3
|
-
import { W as WalletArgsFor, H as WalletCreateArgs } from '../types-
|
|
3
|
+
import { W as WalletArgsFor, H as WalletCreateArgs } from '../types-VTpasnqi.js';
|
|
4
4
|
import { Wallet } from './wallet.js';
|
|
5
5
|
import '@crossmint/common-sdk-base';
|
|
6
6
|
import 'viem';
|
|
@@ -11,6 +11,9 @@ import '@crossmint/client-signers';
|
|
|
11
11
|
import '@solana/web3.js';
|
|
12
12
|
import 'abitype';
|
|
13
13
|
import '../utils/device-signers/DeviceSignerKeyStorage.js';
|
|
14
|
+
import './services/signer-manager.js';
|
|
15
|
+
import '../signers/descriptors/types.js';
|
|
16
|
+
import '../signers/server/resolver.js';
|
|
14
17
|
|
|
15
18
|
declare class WalletFactory {
|
|
16
19
|
private readonly apiClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-6ZD7NFX6.js";import"../chunk-7SKKGHMB.js";import"../chunk-UAB6KH63.js";import"../chunk-ULAIS6HM.js";import"../chunk-S7XUH7XP.js";import"../chunk-TIRSLCAM.js";import"../chunk-TOAFCAVT.js";import"../chunk-5LNDUSMZ.js";import"../chunk-LJKNUBZA.js";import"../chunk-WK67OXB3.js";import"../chunk-UEM7C5FY.js";import"../chunk-NZXYWQE5.js";import"../chunk-IOSADDL5.js";import"../chunk-64JQSHXM.js";import"../chunk-RPBBYBNA.js";import"../chunk-NE2Y6VFQ.js";import"../chunk-JTWVCUVZ.js";import"../chunk-HBHDN4G7.js";import"../chunk-PVXNJEBO.js";import"../chunk-TM45QNB3.js";import"../chunk-EE6XMYUL.js";import"../chunk-GOXB2RBF.js";import"../chunk-XKMIK6EW.js";import"../chunk-CTQFY3MR.js";import"../chunk-L52GDMSH.js";import"../chunk-SEOBV6KR.js";import"../chunk-QM3BB4E2.js";import"../chunk-TSJUK3ED.js";import"../chunk-277G6KNG.js";import"../chunk-IQ3QQ4M6.js";import"../chunk-GA7EPR4Z.js";import"../chunk-YDZRBHS3.js";import"../chunk-46Z5EE2F.js";import"../chunk-RKVJZO7O.js";import"../chunk-VPBJ7L4I.js";import"../chunk-WPNLE54U.js";import"../chunk-IHMMTMFG.js";import"../chunk-E3H6RZHM.js";import"../chunk-EM3D5Q3A.js";import"../chunk-FOHYTIML.js";import"../chunk-K7BPGUFU.js";import"../chunk-OWDSSX2P.js";import"../chunk-FJPAMX7L.js";import"../chunk-MN2BGRRJ.js";import"../chunk-FQ5F3VYJ.js";import"../chunk-HAQMNZO5.js";import"../chunk-2YLRFJ66.js";import"../chunk-TMOWGJ5Z.js";import"../chunk-MLROTECD.js";import"../chunk-YWZMLT47.js";import"../chunk-BNC4HX7P.js";import"../chunk-6VH3KWLM.js";import"../chunk-KGQWE3HH.js";import"../chunk-IUMKG7QD.js";import"../chunk-OQZTL6ZG.js";import"../chunk-KSW27XVT.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-QOSA6B55.js";import"../chunk-LV5QR6LK.js";import"../chunk-NU7VF7MC.js";export{a as WalletFactory};
|
package/dist/wallets/wallet.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkSNAWZWNRcjs = require('../chunk-SNAWZWNR.cjs');require('../chunk-K7BNQDN2.cjs');require('../chunk-4DLKWRLY.cjs');require('../chunk-HHVYXPUL.cjs');require('../chunk-CUHDOBKN.cjs');require('../chunk-GMU3ZYLS.cjs');require('../chunk-Q4VN3MG7.cjs');require('../chunk-K55DPXZQ.cjs');require('../chunk-A3N6JH3M.cjs');require('../chunk-GSNFNRH2.cjs');require('../chunk-3VYGTPRF.cjs');require('../chunk-OWJS5ITO.cjs');require('../chunk-RKUCX4Z4.cjs');require('../chunk-SJ5MLAQI.cjs');require('../chunk-M7BGVCMZ.cjs');require('../chunk-WK2RGS25.cjs');require('../chunk-7KF4AULF.cjs');require('../chunk-UWX7ID4X.cjs');require('../chunk-TL2BD4MX.cjs');require('../chunk-NX256LAH.cjs');require('../chunk-IZMSUJUW.cjs');require('../chunk-7VMBZI5M.cjs');require('../chunk-5IC7UWND.cjs');require('../chunk-KULR5B4O.cjs');require('../chunk-IGRPHTXZ.cjs');require('../chunk-Q66YRLSW.cjs');require('../chunk-VMDJJX7P.cjs');require('../chunk-HJH2S644.cjs');require('../chunk-AK3REMFI.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-SO32FMP7.cjs');require('../chunk-EFAZ2WYW.cjs');require('../chunk-SWBJ2RMN.cjs');require('../chunk-IKHH67TL.cjs');require('../chunk-ATIC4ENG.cjs');require('../chunk-2YZQ4YYU.cjs');require('../chunk-5FH7WFWL.cjs');require('../chunk-UULZ22RQ.cjs');require('../chunk-5FVDLMWW.cjs');require('../chunk-5HBCBS5W.cjs');require('../chunk-LWA3SX6Z.cjs');require('../chunk-XWQC6G7N.cjs');require('../chunk-R4SBFRTM.cjs');require('../chunk-HYWIWJ6H.cjs');require('../chunk-SCEPJO4Q.cjs');require('../chunk-LMHH6ODX.cjs');require('../chunk-CDHMNLZ6.cjs');require('../chunk-RWRESDZR.cjs');require('../chunk-JZYDIP5D.cjs');require('../chunk-HI72AV4W.cjs');require('../chunk-JFJXQGW5.cjs');require('../chunk-FN64UU7M.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-NFDWJLL6.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-6GEBK257.cjs');require('../chunk-2WS6SXS6.cjs');require('../chunk-DSIFRRBS.cjs');exports.Wallet = _chunkSNAWZWNRcjs.a;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WalletsTransactionV2025ResponseDtoClass } from '../api/gen/types.gen.cjs';
|
|
2
2
|
import { ApiClient } from '../api/client.cjs';
|
|
3
|
-
import { I as WalletOptions,
|
|
3
|
+
import { I as WalletOptions, a8 as RecoverySignerConfigForChain, v as SignerConfigForChain, u as SignerAdapter, r as ServerSignerConfig, B as Balances, a9 as FundWalletResponse, aa as GetTransactionsResponse, ab as GetTransactionSuccessResponse, G as Transfers, ac as SendTokenTransactionOptions, _ as UserLocator, T as Transaction, a1 as PrepareOnly, c as ApproveParams, ad as ApproveResult, A as AddSignerOptions, l as ExternalWalletRegistrationConfig, ae as AddSignerReturnType, t as Signer, q as RemoveSignerOptions, af as RemoveSignerReturnType, w as SignerLocator, ag as WalletLocator, b as ApproveOptions, ah as ApproveSignatureResponse, s as Signature } from '../types-D6r1qRCA.cjs';
|
|
4
4
|
import { Chain } from '../chains/chains.cjs';
|
|
5
|
+
import { SignerManager } from './services/signer-manager.cjs';
|
|
5
6
|
import '@crossmint/common-sdk-base';
|
|
6
7
|
import 'viem';
|
|
7
8
|
import 'ox';
|
|
@@ -10,6 +11,8 @@ import '@crossmint/client-signers';
|
|
|
10
11
|
import '@solana/web3.js';
|
|
11
12
|
import 'abitype';
|
|
12
13
|
import '../utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
14
|
+
import '../signers/descriptors/types.cjs';
|
|
15
|
+
import '../signers/server/resolver.cjs';
|
|
13
16
|
|
|
14
17
|
type WalletContructorType<C extends Chain> = {
|
|
15
18
|
chain: C;
|
|
@@ -36,13 +39,6 @@ declare class Wallet<C extends Chain> {
|
|
|
36
39
|
* After this resolves, `needsRecovery()` reflects the true state.
|
|
37
40
|
*/
|
|
38
41
|
waitForInit(): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Initialize the device signer by resolving key availability.
|
|
41
|
-
* If a device key is found locally, assembles the signer immediately.
|
|
42
|
-
* If not, flags the wallet for recovery so a key is generated during the next transaction.
|
|
43
|
-
* Device signer support depends on the wallet provider; validation is handled server-side.
|
|
44
|
-
*/
|
|
45
|
-
private initDeviceSigner;
|
|
46
42
|
/**
|
|
47
43
|
* Initialize the default signer for this wallet.
|
|
48
44
|
* Priority:
|
|
@@ -56,13 +52,6 @@ declare class Wallet<C extends Chain> {
|
|
|
56
52
|
* is not available in the API response. In those cases, the signer is left undefined.
|
|
57
53
|
*/
|
|
58
54
|
private initDefaultSigner;
|
|
59
|
-
/**
|
|
60
|
-
* Attempt to auto-assemble the recovery signer onto the wallet. Used as the fallback
|
|
61
|
-
* when device-signer registration is rejected by the backend with `DEVICE_SIGNER_NOT_SUPPORTED`
|
|
62
|
-
* so the consumer's next transaction has a usable signer without re-routing through
|
|
63
|
-
* initDefaultSigner.
|
|
64
|
-
*/
|
|
65
|
-
private assembleRecoverySignerFallback;
|
|
66
55
|
protected static getApiClient<C extends Chain>(wallet: Wallet<C>): ApiClient;
|
|
67
56
|
protected static getOptions<C extends Chain>(wallet: Wallet<C>): WalletOptions | undefined;
|
|
68
57
|
protected static getRecovery<C extends Chain>(wallet: Wallet<C>): RecoverySignerConfigForChain<C>;
|
|
@@ -71,20 +60,7 @@ declare class Wallet<C extends Chain> {
|
|
|
71
60
|
protected static getApiDelegatedServerSignerAddresses<C extends Chain>(wallet: Wallet<C>): string[];
|
|
72
61
|
get apiClient(): ApiClient;
|
|
73
62
|
protected get options(): WalletOptions | undefined;
|
|
74
|
-
|
|
75
|
-
* Derive both primary ("evm") and legacy (chain-specific) server signer candidates.
|
|
76
|
-
*/
|
|
77
|
-
private deriveServerSignerCandidates;
|
|
78
|
-
/**
|
|
79
|
-
* Return the resolved server signer if it matches the given config (i.e. its address
|
|
80
|
-
* matches either the primary or legacy candidate). Returns null otherwise.
|
|
81
|
-
*/
|
|
82
|
-
private matchResolvedServerSigner;
|
|
83
|
-
/**
|
|
84
|
-
* Resolve which derivation (primary "evm" or legacy chain-specific) to use for a server signer.
|
|
85
|
-
* Priority: cached resolution → legacy if it matches a known on-chain address → primary.
|
|
86
|
-
*/
|
|
87
|
-
private resolveServerSignerDerivation;
|
|
63
|
+
private get chainAdapter();
|
|
88
64
|
/**
|
|
89
65
|
* Resolve a ServerSignerConfig to an API locator string.
|
|
90
66
|
*/
|
|
@@ -113,11 +89,6 @@ declare class Wallet<C extends Chain> {
|
|
|
113
89
|
* @throws {Error} If the funding operation fails or if called in a production environment
|
|
114
90
|
*/
|
|
115
91
|
stagingFund(amount: number, chain?: Chain): Promise<FundWalletResponse>;
|
|
116
|
-
/**
|
|
117
|
-
* Transform the API balance response to the new structure
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
private transformBalanceResponse;
|
|
121
92
|
/**
|
|
122
93
|
* Get the wallet NFTs
|
|
123
94
|
* @param params - The parameters
|
|
@@ -228,9 +199,8 @@ declare class Wallet<C extends Chain> {
|
|
|
228
199
|
*/
|
|
229
200
|
private resolveNonDeviceSigner;
|
|
230
201
|
/**
|
|
231
|
-
* Resolve a server signer:
|
|
232
|
-
* (
|
|
233
|
-
* to whichever derivation is on-chain. Returns true if the signer is the admin (recovery) signer.
|
|
202
|
+
* Resolve a server signer: prefer a derivation already registered on-chain, else fall back
|
|
203
|
+
* to the recovery (admin) signer. Returns true if the signer is the admin (recovery) signer.
|
|
234
204
|
*/
|
|
235
205
|
private resolveServerSigner;
|
|
236
206
|
/**
|
|
@@ -244,8 +214,6 @@ declare class Wallet<C extends Chain> {
|
|
|
244
214
|
* Server signers use the derived address; other types use the standard locator.
|
|
245
215
|
*/
|
|
246
216
|
private resolveSignerLocator;
|
|
247
|
-
private getSignerRegistrationChain;
|
|
248
|
-
private withRecoverySigner;
|
|
249
217
|
private isPasskeyMissingId;
|
|
250
218
|
/**
|
|
251
219
|
* Check if a signer is registered in this wallet.
|
|
@@ -259,7 +227,6 @@ declare class Wallet<C extends Chain> {
|
|
|
259
227
|
* @returns true if the signer is approved for this chain
|
|
260
228
|
*/
|
|
261
229
|
isSignerApproved(signerLocator: SignerLocator | string): Promise<boolean>;
|
|
262
|
-
private isApprovedSignerStatus;
|
|
263
230
|
/**
|
|
264
231
|
* Whether the wallet needs recovery (signer registration) before the next transaction.
|
|
265
232
|
* @returns true if recovery is needed
|
|
@@ -271,23 +238,6 @@ declare class Wallet<C extends Chain> {
|
|
|
271
238
|
* Returns early if the device signer's locator is already approved on-chain.
|
|
272
239
|
*/
|
|
273
240
|
recover(): Promise<void>;
|
|
274
|
-
/**
|
|
275
|
-
* Check if a device signer is already approved or has a pending operation that can be resumed.
|
|
276
|
-
* Returns true if the signer is now approved (either already was, or pending op was completed).
|
|
277
|
-
*/
|
|
278
|
-
private checkAndResumeDeviceSigner;
|
|
279
|
-
/**
|
|
280
|
-
* Resume a pending approval operation for a device signer.
|
|
281
|
-
* Temporarily swaps to the recovery signer, approves the pending operation,
|
|
282
|
-
* then restores the device signer.
|
|
283
|
-
*/
|
|
284
|
-
private resumePendingDeviceSignerApproval;
|
|
285
|
-
/**
|
|
286
|
-
* Search registered device signers to find one whose private key exists locally.
|
|
287
|
-
* Returns an assembled SignerAdapter (without pre-fetched status) if found, or null.
|
|
288
|
-
* The caller is responsible for checking status via checkAndResumeDeviceSigner.
|
|
289
|
-
*/
|
|
290
|
-
private findLocalDeviceSigner;
|
|
291
241
|
/**
|
|
292
242
|
* List the signers for this wallet.
|
|
293
243
|
* Returns full signer objects with status.
|
|
@@ -296,39 +246,12 @@ declare class Wallet<C extends Chain> {
|
|
|
296
246
|
*/
|
|
297
247
|
signers(): Promise<Signer[]>;
|
|
298
248
|
protected get walletLocator(): WalletLocator;
|
|
299
|
-
|
|
300
|
-
* Ensures that a signer is available. Throws if the wallet is read-only.
|
|
301
|
-
*/
|
|
302
|
-
protected requireSigner(): SignerAdapter;
|
|
249
|
+
protected get signerManager(): SignerManager<C>;
|
|
303
250
|
protected preAuthIfNeeded(): Promise<void>;
|
|
304
251
|
/**
|
|
305
252
|
* Check if a signer config matches the wallet's recovery signer.
|
|
306
253
|
*/
|
|
307
254
|
private isRecoverySigner;
|
|
308
|
-
/**
|
|
309
|
-
* Validate that the signer input has the required values for its type.
|
|
310
|
-
*/
|
|
311
|
-
private validateSignerInput;
|
|
312
|
-
/**
|
|
313
|
-
* Check if a device signer key is available locally, or flag for recovery.
|
|
314
|
-
* Looks up device key storage by wallet address, then by matching registered device signers.
|
|
315
|
-
* If no key is found, sets needsRecovery so a new device key is generated during the next transaction.
|
|
316
|
-
*/
|
|
317
|
-
private resolveDeviceSignerAvailability;
|
|
318
|
-
private assembleFullSigner;
|
|
319
|
-
private getSignerState;
|
|
320
|
-
/**
|
|
321
|
-
* Build an InternalSignerConfig from a SignerConfigForChain.
|
|
322
|
-
*/
|
|
323
|
-
private buildInternalSignerConfig;
|
|
324
|
-
/**
|
|
325
|
-
* Returns true if the signer config can be auto-assembled without user interaction.
|
|
326
|
-
* Types like external-wallet (stored as evm-keypair/solana-keypair in the API) require
|
|
327
|
-
* the user to provide a signing callback via useSigner(), so they cannot be auto-assembled.
|
|
328
|
-
* Server signers also require the secret to be present in the config.
|
|
329
|
-
*/
|
|
330
|
-
private isAutoAssemblableSignerConfig;
|
|
331
|
-
protected get isSolanaWallet(): boolean;
|
|
332
255
|
protected resolveChainForEnvironment(): C;
|
|
333
256
|
protected approveTransactionAndWait(transactionId: string, options?: ApproveOptions): Promise<{
|
|
334
257
|
hash: string;
|
package/dist/wallets/wallet.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { WalletsTransactionV2025ResponseDtoClass } from '../api/gen/types.gen.js';
|
|
2
2
|
import { ApiClient } from '../api/client.js';
|
|
3
|
-
import { I as WalletOptions,
|
|
3
|
+
import { I as WalletOptions, a8 as RecoverySignerConfigForChain, v as SignerConfigForChain, u as SignerAdapter, r as ServerSignerConfig, B as Balances, a9 as FundWalletResponse, aa as GetTransactionsResponse, ab as GetTransactionSuccessResponse, G as Transfers, ac as SendTokenTransactionOptions, _ as UserLocator, T as Transaction, a1 as PrepareOnly, c as ApproveParams, ad as ApproveResult, A as AddSignerOptions, l as ExternalWalletRegistrationConfig, ae as AddSignerReturnType, t as Signer, q as RemoveSignerOptions, af as RemoveSignerReturnType, w as SignerLocator, ag as WalletLocator, b as ApproveOptions, ah as ApproveSignatureResponse, s as Signature } from '../types-VTpasnqi.js';
|
|
4
4
|
import { Chain } from '../chains/chains.js';
|
|
5
|
+
import { SignerManager } from './services/signer-manager.js';
|
|
5
6
|
import '@crossmint/common-sdk-base';
|
|
6
7
|
import 'viem';
|
|
7
8
|
import 'ox';
|
|
@@ -10,6 +11,8 @@ import '@crossmint/client-signers';
|
|
|
10
11
|
import '@solana/web3.js';
|
|
11
12
|
import 'abitype';
|
|
12
13
|
import '../utils/device-signers/DeviceSignerKeyStorage.js';
|
|
14
|
+
import '../signers/descriptors/types.js';
|
|
15
|
+
import '../signers/server/resolver.js';
|
|
13
16
|
|
|
14
17
|
type WalletContructorType<C extends Chain> = {
|
|
15
18
|
chain: C;
|
|
@@ -36,13 +39,6 @@ declare class Wallet<C extends Chain> {
|
|
|
36
39
|
* After this resolves, `needsRecovery()` reflects the true state.
|
|
37
40
|
*/
|
|
38
41
|
waitForInit(): Promise<void>;
|
|
39
|
-
/**
|
|
40
|
-
* Initialize the device signer by resolving key availability.
|
|
41
|
-
* If a device key is found locally, assembles the signer immediately.
|
|
42
|
-
* If not, flags the wallet for recovery so a key is generated during the next transaction.
|
|
43
|
-
* Device signer support depends on the wallet provider; validation is handled server-side.
|
|
44
|
-
*/
|
|
45
|
-
private initDeviceSigner;
|
|
46
42
|
/**
|
|
47
43
|
* Initialize the default signer for this wallet.
|
|
48
44
|
* Priority:
|
|
@@ -56,13 +52,6 @@ declare class Wallet<C extends Chain> {
|
|
|
56
52
|
* is not available in the API response. In those cases, the signer is left undefined.
|
|
57
53
|
*/
|
|
58
54
|
private initDefaultSigner;
|
|
59
|
-
/**
|
|
60
|
-
* Attempt to auto-assemble the recovery signer onto the wallet. Used as the fallback
|
|
61
|
-
* when device-signer registration is rejected by the backend with `DEVICE_SIGNER_NOT_SUPPORTED`
|
|
62
|
-
* so the consumer's next transaction has a usable signer without re-routing through
|
|
63
|
-
* initDefaultSigner.
|
|
64
|
-
*/
|
|
65
|
-
private assembleRecoverySignerFallback;
|
|
66
55
|
protected static getApiClient<C extends Chain>(wallet: Wallet<C>): ApiClient;
|
|
67
56
|
protected static getOptions<C extends Chain>(wallet: Wallet<C>): WalletOptions | undefined;
|
|
68
57
|
protected static getRecovery<C extends Chain>(wallet: Wallet<C>): RecoverySignerConfigForChain<C>;
|
|
@@ -71,20 +60,7 @@ declare class Wallet<C extends Chain> {
|
|
|
71
60
|
protected static getApiDelegatedServerSignerAddresses<C extends Chain>(wallet: Wallet<C>): string[];
|
|
72
61
|
get apiClient(): ApiClient;
|
|
73
62
|
protected get options(): WalletOptions | undefined;
|
|
74
|
-
|
|
75
|
-
* Derive both primary ("evm") and legacy (chain-specific) server signer candidates.
|
|
76
|
-
*/
|
|
77
|
-
private deriveServerSignerCandidates;
|
|
78
|
-
/**
|
|
79
|
-
* Return the resolved server signer if it matches the given config (i.e. its address
|
|
80
|
-
* matches either the primary or legacy candidate). Returns null otherwise.
|
|
81
|
-
*/
|
|
82
|
-
private matchResolvedServerSigner;
|
|
83
|
-
/**
|
|
84
|
-
* Resolve which derivation (primary "evm" or legacy chain-specific) to use for a server signer.
|
|
85
|
-
* Priority: cached resolution → legacy if it matches a known on-chain address → primary.
|
|
86
|
-
*/
|
|
87
|
-
private resolveServerSignerDerivation;
|
|
63
|
+
private get chainAdapter();
|
|
88
64
|
/**
|
|
89
65
|
* Resolve a ServerSignerConfig to an API locator string.
|
|
90
66
|
*/
|
|
@@ -113,11 +89,6 @@ declare class Wallet<C extends Chain> {
|
|
|
113
89
|
* @throws {Error} If the funding operation fails or if called in a production environment
|
|
114
90
|
*/
|
|
115
91
|
stagingFund(amount: number, chain?: Chain): Promise<FundWalletResponse>;
|
|
116
|
-
/**
|
|
117
|
-
* Transform the API balance response to the new structure
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
private transformBalanceResponse;
|
|
121
92
|
/**
|
|
122
93
|
* Get the wallet NFTs
|
|
123
94
|
* @param params - The parameters
|
|
@@ -228,9 +199,8 @@ declare class Wallet<C extends Chain> {
|
|
|
228
199
|
*/
|
|
229
200
|
private resolveNonDeviceSigner;
|
|
230
201
|
/**
|
|
231
|
-
* Resolve a server signer:
|
|
232
|
-
* (
|
|
233
|
-
* to whichever derivation is on-chain. Returns true if the signer is the admin (recovery) signer.
|
|
202
|
+
* Resolve a server signer: prefer a derivation already registered on-chain, else fall back
|
|
203
|
+
* to the recovery (admin) signer. Returns true if the signer is the admin (recovery) signer.
|
|
234
204
|
*/
|
|
235
205
|
private resolveServerSigner;
|
|
236
206
|
/**
|
|
@@ -244,8 +214,6 @@ declare class Wallet<C extends Chain> {
|
|
|
244
214
|
* Server signers use the derived address; other types use the standard locator.
|
|
245
215
|
*/
|
|
246
216
|
private resolveSignerLocator;
|
|
247
|
-
private getSignerRegistrationChain;
|
|
248
|
-
private withRecoverySigner;
|
|
249
217
|
private isPasskeyMissingId;
|
|
250
218
|
/**
|
|
251
219
|
* Check if a signer is registered in this wallet.
|
|
@@ -259,7 +227,6 @@ declare class Wallet<C extends Chain> {
|
|
|
259
227
|
* @returns true if the signer is approved for this chain
|
|
260
228
|
*/
|
|
261
229
|
isSignerApproved(signerLocator: SignerLocator | string): Promise<boolean>;
|
|
262
|
-
private isApprovedSignerStatus;
|
|
263
230
|
/**
|
|
264
231
|
* Whether the wallet needs recovery (signer registration) before the next transaction.
|
|
265
232
|
* @returns true if recovery is needed
|
|
@@ -271,23 +238,6 @@ declare class Wallet<C extends Chain> {
|
|
|
271
238
|
* Returns early if the device signer's locator is already approved on-chain.
|
|
272
239
|
*/
|
|
273
240
|
recover(): Promise<void>;
|
|
274
|
-
/**
|
|
275
|
-
* Check if a device signer is already approved or has a pending operation that can be resumed.
|
|
276
|
-
* Returns true if the signer is now approved (either already was, or pending op was completed).
|
|
277
|
-
*/
|
|
278
|
-
private checkAndResumeDeviceSigner;
|
|
279
|
-
/**
|
|
280
|
-
* Resume a pending approval operation for a device signer.
|
|
281
|
-
* Temporarily swaps to the recovery signer, approves the pending operation,
|
|
282
|
-
* then restores the device signer.
|
|
283
|
-
*/
|
|
284
|
-
private resumePendingDeviceSignerApproval;
|
|
285
|
-
/**
|
|
286
|
-
* Search registered device signers to find one whose private key exists locally.
|
|
287
|
-
* Returns an assembled SignerAdapter (without pre-fetched status) if found, or null.
|
|
288
|
-
* The caller is responsible for checking status via checkAndResumeDeviceSigner.
|
|
289
|
-
*/
|
|
290
|
-
private findLocalDeviceSigner;
|
|
291
241
|
/**
|
|
292
242
|
* List the signers for this wallet.
|
|
293
243
|
* Returns full signer objects with status.
|
|
@@ -296,39 +246,12 @@ declare class Wallet<C extends Chain> {
|
|
|
296
246
|
*/
|
|
297
247
|
signers(): Promise<Signer[]>;
|
|
298
248
|
protected get walletLocator(): WalletLocator;
|
|
299
|
-
|
|
300
|
-
* Ensures that a signer is available. Throws if the wallet is read-only.
|
|
301
|
-
*/
|
|
302
|
-
protected requireSigner(): SignerAdapter;
|
|
249
|
+
protected get signerManager(): SignerManager<C>;
|
|
303
250
|
protected preAuthIfNeeded(): Promise<void>;
|
|
304
251
|
/**
|
|
305
252
|
* Check if a signer config matches the wallet's recovery signer.
|
|
306
253
|
*/
|
|
307
254
|
private isRecoverySigner;
|
|
308
|
-
/**
|
|
309
|
-
* Validate that the signer input has the required values for its type.
|
|
310
|
-
*/
|
|
311
|
-
private validateSignerInput;
|
|
312
|
-
/**
|
|
313
|
-
* Check if a device signer key is available locally, or flag for recovery.
|
|
314
|
-
* Looks up device key storage by wallet address, then by matching registered device signers.
|
|
315
|
-
* If no key is found, sets needsRecovery so a new device key is generated during the next transaction.
|
|
316
|
-
*/
|
|
317
|
-
private resolveDeviceSignerAvailability;
|
|
318
|
-
private assembleFullSigner;
|
|
319
|
-
private getSignerState;
|
|
320
|
-
/**
|
|
321
|
-
* Build an InternalSignerConfig from a SignerConfigForChain.
|
|
322
|
-
*/
|
|
323
|
-
private buildInternalSignerConfig;
|
|
324
|
-
/**
|
|
325
|
-
* Returns true if the signer config can be auto-assembled without user interaction.
|
|
326
|
-
* Types like external-wallet (stored as evm-keypair/solana-keypair in the API) require
|
|
327
|
-
* the user to provide a signing callback via useSigner(), so they cannot be auto-assembled.
|
|
328
|
-
* Server signers also require the secret to be present in the config.
|
|
329
|
-
*/
|
|
330
|
-
private isAutoAssemblableSignerConfig;
|
|
331
|
-
protected get isSolanaWallet(): boolean;
|
|
332
255
|
protected resolveChainForEnvironment(): C;
|
|
333
256
|
protected approveTransactionAndWait(transactionId: string, options?: ApproveOptions): Promise<{
|
|
334
257
|
hash: string;
|
package/dist/wallets/wallet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-UAB6KH63.js";import"../chunk-ULAIS6HM.js";import"../chunk-S7XUH7XP.js";import"../chunk-TIRSLCAM.js";import"../chunk-TOAFCAVT.js";import"../chunk-5LNDUSMZ.js";import"../chunk-LJKNUBZA.js";import"../chunk-WK67OXB3.js";import"../chunk-UEM7C5FY.js";import"../chunk-NZXYWQE5.js";import"../chunk-IOSADDL5.js";import"../chunk-64JQSHXM.js";import"../chunk-RPBBYBNA.js";import"../chunk-NE2Y6VFQ.js";import"../chunk-JTWVCUVZ.js";import"../chunk-HBHDN4G7.js";import"../chunk-PVXNJEBO.js";import"../chunk-TM45QNB3.js";import"../chunk-EE6XMYUL.js";import"../chunk-GOXB2RBF.js";import"../chunk-XKMIK6EW.js";import"../chunk-CTQFY3MR.js";import"../chunk-L52GDMSH.js";import"../chunk-SEOBV6KR.js";import"../chunk-QM3BB4E2.js";import"../chunk-TSJUK3ED.js";import"../chunk-277G6KNG.js";import"../chunk-IQ3QQ4M6.js";import"../chunk-GA7EPR4Z.js";import"../chunk-YDZRBHS3.js";import"../chunk-46Z5EE2F.js";import"../chunk-RKVJZO7O.js";import"../chunk-VPBJ7L4I.js";import"../chunk-WPNLE54U.js";import"../chunk-IHMMTMFG.js";import"../chunk-E3H6RZHM.js";import"../chunk-EM3D5Q3A.js";import"../chunk-FOHYTIML.js";import"../chunk-K7BPGUFU.js";import"../chunk-OWDSSX2P.js";import"../chunk-FJPAMX7L.js";import"../chunk-MN2BGRRJ.js";import"../chunk-FQ5F3VYJ.js";import"../chunk-HAQMNZO5.js";import"../chunk-2YLRFJ66.js";import"../chunk-TMOWGJ5Z.js";import"../chunk-MLROTECD.js";import"../chunk-YWZMLT47.js";import"../chunk-BNC4HX7P.js";import"../chunk-6VH3KWLM.js";import"../chunk-KGQWE3HH.js";import"../chunk-IUMKG7QD.js";import"../chunk-OQZTL6ZG.js";import"../chunk-KSW27XVT.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-QOSA6B55.js";import"../chunk-LV5QR6LK.js";import"../chunk-NU7VF7MC.js";export{a as Wallet};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crossmint/wallets-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"repository": "https://github.com/Crossmint/crossmint-sdk",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Paella Labs Inc",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"tweetnacl": "1.0.3",
|
|
32
32
|
"viem": "2.33.1",
|
|
33
33
|
"@crossmint/client-sdk-window": "1.0.10",
|
|
34
|
-
"@crossmint/client-signers": "0.2.
|
|
34
|
+
"@crossmint/client-signers": "0.2.1",
|
|
35
35
|
"@crossmint/client-signers-cryptography": "0.0.5",
|
|
36
|
-
"@crossmint/common-sdk-auth": "1.1.
|
|
37
|
-
"@crossmint/common-sdk-base": "0.10.
|
|
36
|
+
"@crossmint/common-sdk-auth": "1.1.12",
|
|
37
|
+
"@crossmint/common-sdk-base": "0.10.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@hey-api/openapi-ts": "0.69.2",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@solana/web3.js": "^1.98.1"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "pnpm generate && tsup",
|
|
49
|
+
"build": "pnpm generate && cross-env NODE_OPTIONS=--max-old-space-size=8192 tsup",
|
|
50
50
|
"dev": "tsup --watch",
|
|
51
51
|
"test:vitest": "vitest run --passWithNoTests",
|
|
52
52
|
"openapi-ts": "openapi-ts",
|
package/dist/chunk-2GKPWQBQ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var m=Object.defineProperty,p=Object.defineProperties,q=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var s=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;var n=b=>{throw TypeError(b)};var l=(b,a,c)=>a in b?m(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c,u= exports.a =(b,a)=>{for(var c in a||(a={}))s.call(a,c)&&l(b,c,a[c]);if(k)for(var c of k(a))t.call(a,c)&&l(b,c,a[c]);return b},v= exports.b =(b,a)=>p(b,r(a));var w=(b,a,c,e)=>{for(var d=e>1?void 0:e?q(a,c):a,g=b.length-1,h;g>=0;g--)(h=b[g])&&(d=(e?h(a,c,d):h(d))||d);return e&&d&&m(a,c,d),d};var o=(b,a,c)=>a.has(b)||n("Cannot "+c);var x=(b,a,c)=>(o(b,a,"read from private field"),c?c.call(b):a.get(b)),y= exports.e =(b,a,c)=>a.has(b)?n("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c),z= exports.f =(b,a,c,e)=>(o(b,a,"write to private field"),e?e.call(b,c):a.set(b,c),c);var A=(b,a,c)=>new Promise((e,d)=>{var g=f=>{try{i(c.next(f))}catch(j){d(j)}},h=f=>{try{i(c.throw(f))}catch(j){d(j)}},i=f=>f.done?e(f.value):Promise.resolve(f.value).then(g,h);i((c=c.apply(b,a)).next())});exports.a = u; exports.b = v; exports.c = w; exports.d = x; exports.e = y; exports.f = z; exports.g = A;
|
package/dist/chunk-3SVXPFSP.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _accounts = require('viem/accounts');var _utils = require('@noble/hashes/utils');var t=class{constructor(r){this.type="server";this.account=_accounts.privateKeyToAccount.call(void 0, `0x${_utils.bytesToHex.call(void 0, r.derivedKeyBytes)}`),this._address=this.account.address,this._locator=r.locator}address(){return this._address}locator(){return this._locator}signMessage(r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(!r.startsWith("0x"))throw new Error(`EVMServerSigner.signMessage expects a 0x-prefixed hex string, got: ${r.slice(0,10)}...`);return{signature:yield this.account.signMessage({message:{raw:r}})}})}signTransaction(r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.signMessage(r)})}};exports.a = t;
|
package/dist/chunk-3VRN3GKQ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./chunk-J3R36SGJ.js";import{Keypair as d,VersionedTransaction as p}from"@solana/web3.js";import r from"bs58";import a from"tweetnacl";var n=class{constructor(e){this.type="server";this.keypair=d.fromSeed(e.derivedKeyBytes),this._address=this.keypair.publicKey.toBase58(),this._locator=e.locator}address(){return this._address}locator(){return this._locator}signMessage(e){return t(this,null,function*(){let s=r.decode(e),i=a.sign.detached(s,this.keypair.secretKey);return{signature:r.encode(i)}})}signTransaction(e){return t(this,null,function*(){let s=r.decode(e),o=p.deserialize(s).message.serialize(),c=a.sign.detached(o,this.keypair.secretKey);return{signature:r.encode(c)}})}};export{n as a};
|
package/dist/chunk-4DJWSV7I.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _tweetnacl = require('tweetnacl'); var _tweetnacl2 = _interopRequireDefault(_tweetnacl);var n=class{constructor(e){this.type="server";this.keypair=_web3js.Keypair.fromSeed(e.derivedKeyBytes),this._address=this.keypair.publicKey.toBase58(),this._locator=e.locator}address(){return this._address}locator(){return this._locator}signMessage(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let s=_bs582.default.decode(e),i=_tweetnacl2.default.sign.detached(s,this.keypair.secretKey);return{signature:_bs582.default.encode(i)}})}signTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let s=_bs582.default.decode(e),o=_web3js.VersionedTransaction.deserialize(s).message.serialize(),c=_tweetnacl2.default.sign.detached(o,this.keypair.secretKey);return{signature:_bs582.default.encode(c)}})}};exports.a = n;
|
package/dist/chunk-5OYPWGMX.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{CrossmintSDKError as t,WalletErrorCode as e}from"@crossmint/common-sdk-base";var o=class extends t{constructor(s,r){super(s,e.API_KEY_INVALID,r)}},c=class extends t{constructor(s,r){super(s,e.ENVIRONMENT_INVALID,r)}},I=class extends t{constructor(s,r){super(s,e.WALLET_CREATION_FAILED,r)}},p=class extends t{constructor(s,r){super(s,e.WALLET_TYPE_INVALID,r)}},i=class extends t{constructor(s,r){super(s,e.WALLET_NOT_AVAILABLE,r)}},x=class extends t{constructor(s,r){super(s,e.WALLET_NOT_AVAILABLE,r)}},A=class extends t{constructor(s,r){super(s,e.WALLET_CREATION_FAILED,r)}},g=class extends t{constructor(s,r){super(s,e.WALLET_TYPE_INVALID,r)}},u=class extends t{constructor(s,r){super(s,e.SIGNER_INVALID,r)}},N=class extends t{constructor(s,r){super(s,e.SIGNER_INVALID,r)}},K="DEVICE_SIGNER_NOT_SUPPORTED",E=class extends t{constructor(s,r){super(s,e.SIGNER_INVALID,r)}},_=class extends t{constructor(s,r){super(s,e.MESSAGE_INVALID,r)}},L=class extends t{constructor(s,r){super(s,e.MESSAGE_INVALID,r)}},T=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},l=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},a=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},d=class extends t{constructor(s,r){super(s,e.NO_SIGNATURE,r)}},D=class extends t{constructor(s,r){super(s,e.NO_SIGNATURE,r)}},S=class extends t{constructor(s,r){super(s,e.SIGNING_FAILED,r)}},R=class extends t{constructor(s,r){super(s,e.NO_TRANSACTION,r)}},O=class extends t{constructor(s,r){super(s,e.NO_TRANSACTION,r)}},C=class extends t{constructor(s,r){super(s,e.NO_TRANSACTION,r)}},G=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},V=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},F=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},P=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},W=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},U=class extends t{constructor(s,r){super(s,e.TRANSACTION_FAILED,r)}},m=class extends t{constructor(s,r){super(s,e.RECIPIENT_ADDRESS_INVALID,r)}};export{o as a,c as b,I as c,p as d,i as e,x as f,A as g,g as h,u as i,N as j,K as k,E as l,_ as m,L as n,T as o,l as p,a as q,d as r,D as s,S as t,R as u,O as v,C as w,G as x,V as y,F as z,P as A,W as B,U as C,m as D};
|
package/dist/chunk-6X5JEJD7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-OQZTL6ZG.js";import{a as n}from"./chunk-N355UETO.js";import{a as i}from"./chunk-3VRN3GKQ.js";import{a as t}from"./chunk-BITOMWYZ.js";function c(a,e){switch(r(a)){case"evm":return new n(e);case"solana":return new i(e);case"stellar":return new t(e)}}export{c as a};
|
package/dist/chunk-A5GN63FT.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQVNXEPOZcjs = require('./chunk-QVNXEPOZ.cjs');var _chunkOWQZPI3Ucjs = require('./chunk-OWQZPI3U.cjs');var _chunkVUC4UU5Mcjs = require('./chunk-VUC4UU5M.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=409,l=class l extends _chunkQVNXEPOZcjs.a{constructor(e){super({chain:e.chain,address:e.address,owner:e.owner,options:_chunkQVNXEPOZcjs.a.getOptions(e),alias:e.alias,recovery:_chunkQVNXEPOZcjs.a.getRecovery(e),apiRecoveryServerSignerAddress:_chunkQVNXEPOZcjs.a.getApiRecoveryServerSignerAddress(e),apiDelegatedServerSignerAddresses:_chunkQVNXEPOZcjs.a.getApiDelegatedServerSignerAddresses(e),signer:e.signer,signers:_chunkQVNXEPOZcjs.a.getInitialSigners(e)},_chunkQVNXEPOZcjs.a.getApiClient(e))}static from(e){if(!_commonsdkbase.isValidStellarAddress.call(void 0, e.address))throw new Error("Wallet is not a Stellar wallet");return new l(e)}sendTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){var d;_chunkVUC4UU5Mcjs.a.info("stellarWallet.sendTransaction.start"),yield this.preAuthIfNeeded();let r=yield this.createTransaction(e);if((d=e.options)!=null&&d.prepareOnly)return _chunkVUC4UU5Mcjs.a.info("stellarWallet.sendTransaction.prepared",{transactionId:r.id}),{hash:void 0,explorerLink:void 0,transactionId:r.id};let a={},n=yield this.approveTransactionAndWait(r.id,a);return _chunkVUC4UU5Mcjs.a.info("stellarWallet.sendTransaction.success",{transactionId:r.id,hash:n.hash}),n})}upgrade(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunkVUC4UU5Mcjs.a.info("stellarWallet.upgrade.start"),yield this.preAuthIfNeeded();let r=yield this.createWalletLifecycleTransaction("upgrade-wallet",e);if(r!=null){if(e!=null&&e.prepareOnly)return _chunkVUC4UU5Mcjs.a.info("stellarWallet.upgrade.prepared",{transactionId:r}),{hash:void 0,explorerLink:void 0,transactionId:r};yield this.approveTransactionAndWait(r),_chunkVUC4UU5Mcjs.a.info("stellarWallet.upgrade.phase1.success",{transactionId:r})}else _chunkVUC4UU5Mcjs.a.info("stellarWallet.upgrade.phase1.skipped",{reason:"wallet already locked from a prior upgrade"});let a=yield this.migrateInternal({signer:e==null?void 0:e.signer,prepareOnly:e==null?void 0:e.prepareOnly});return _chunkVUC4UU5Mcjs.a.info("stellarWallet.upgrade.success",{transactionId:a.transactionId,hash:a.hash}),a})}migrate(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.preAuthIfNeeded(),yield this.migrateInternal(e)})}migrateInternal(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){_chunkVUC4UU5Mcjs.a.info("stellarWallet.migrate.start");let r=yield this.createWalletLifecycleTransaction("migrate-wallet",e);if(r==null)throw new (0, _chunkOWQZPI3Ucjs.v)("Failed to create migrate-wallet transaction");if(e!=null&&e.prepareOnly)return _chunkVUC4UU5Mcjs.a.info("stellarWallet.migrate.prepared",{transactionId:r}),{hash:void 0,explorerLink:void 0,transactionId:r};let a=yield this.approveTransactionAndWait(r);return _chunkVUC4UU5Mcjs.a.info("stellarWallet.migrate.success",{transactionId:r,hash:a.hash}),a})}createTransaction(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let{contractId:r,options:a}=e,n=this.resolveStellarSigner(a==null?void 0:a.signer),d="transaction"in e?{type:"serialized-transaction",serializedTransaction:e.transaction,contractId:r}:{type:"contract-call",contractId:r,method:e.method,memo:e.memo!=null?{type:"text",value:e.memo}:void 0,args:e.args},p=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:d,signer:n}});if("error"in p)throw new (0, _chunkOWQZPI3Ucjs.v)(JSON.stringify(p));return p})}createWalletLifecycleTransaction(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let a=(r==null?void 0:r.signer)!=null?this.resolveStellarSigner(r.signer):void 0,n=yield this.apiClient.createTransaction(this.walletLocator,{params:_chunk2GKPWQBQcjs.a.call(void 0, {transaction:{type:e}},a!=null?{signer:a}:{})});if("error"in n){if(e==="upgrade-wallet"&&y(n))return null;throw new (0, _chunkOWQZPI3Ucjs.v)(JSON.stringify(n))}return n.id})}resolveStellarSigner(e){return e==null?this.requireSigner().locator():typeof e=="string"?e:this.resolveServerSignerApiLocator(e)}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"stellarWallet.sendTransaction",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"sendTransaction",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"stellarWallet.upgrade",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"upgrade",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"stellarWallet.migrate",buildContext(e){return{chain:e.chain,address:e.address}}})],l.prototype,"migrate",1);var h=l;function y(o){return typeof o=="object"&&o!==null&&"statusCode"in o&&o.statusCode===m}exports.a = h;
|
package/dist/chunk-BITOMWYZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as s,b as i,c as n}from"./chunk-EM3D5Q3A.js";import{g as t}from"./chunk-J3R36SGJ.js";var a=class{constructor(e){this.type="server";let r=i(e.derivedKeyBytes);this._address=s(r.publicKey),this._locator=e.locator,this.secretKey=r.secretKey}address(){return this._address}locator(){return this._locator}signMessage(e){return t(this,null,function*(){if(!/^[A-Za-z0-9+/]*={0,2}$/.test(e))throw new Error("StellarServerSigner.signMessage: expected a base64-encoded string");let r=Buffer.from(e,"base64"),o=n(r,this.secretKey);return{signature:Buffer.from(o).toString("base64")}})}signTransaction(e){return t(this,null,function*(){return yield this.signMessage(e)})}};export{a};
|
package/dist/chunk-GDEOTJEZ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkW5SV3EQJcjs = require('./chunk-W5SV3EQJ.cjs');var _chunkYHV3672Rcjs = require('./chunk-YHV3672R.cjs');var _chunk4TGSG3UZcjs = require('./chunk-4TGSG3UZ.cjs');var _chunkVUC4UU5Mcjs = require('./chunk-VUC4UU5M.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var o=class c{constructor(e){_chunkVUC4UU5Mcjs.b.call(void 0, e.apiKey);let t=new (0, _chunk4TGSG3UZcjs.a)(e);this.walletFactory=new (0, _chunkW5SV3EQJcjs.a)(t),_chunkVUC4UU5Mcjs.a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(typeof e=="string"){if(t==null)throw new Error("Args parameter is required when walletLocator is provided");return yield this.walletFactory.getWallet(e,t)}return yield this.walletFactory.getWallet(e)})}createWallet(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield _chunkYHV3672Rcjs.a.call(void 0, e,t)})}createPasskeySigner(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let t=yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};exports.a = _commonsdkbase.createCrossmint; exports.b = o;
|
package/dist/chunk-GZP2JQ6P.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkENU3EKBGcjs = require('./chunk-ENU3EKBG.cjs');var _chunk3SVXPFSPcjs = require('./chunk-3SVXPFSP.cjs');var _chunk4DJWSV7Icjs = require('./chunk-4DJWSV7I.cjs');var _chunkYF5G4U6Lcjs = require('./chunk-YF5G4U6L.cjs');function l(a,e){switch(_chunkENU3EKBGcjs.a.call(void 0, a)){case"evm":return new (0, _chunk3SVXPFSPcjs.a)(e);case"solana":return new (0, _chunk4DJWSV7Icjs.a)(e);case"stellar":return new (0, _chunkYF5G4U6Lcjs.a)(e)}}exports.a = l;
|
package/dist/chunk-HSLZH2ZC.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3VYGTPRFcjs = require('./chunk-3VYGTPRF.cjs');var _chunkVUC4UU5Mcjs = require('./chunk-VUC4UU5M.cjs');var _chunk2GKPWQBQcjs = require('./chunk-2GKPWQBQ.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var b={[_commonsdkbase.APIKeyEnvironmentPrefix.DEVELOPMENT]:"https://development.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.STAGING]:"https://staging.devicekey.store",[_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION]:"https://devicekey.store"},P=6e4,K="indexeddb-fatal",c= exports.a =class extends _chunk3VYGTPRFcjs.a{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;let r=_commonsdkbase.getEnvironmentForKey.call(void 0, e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=b[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return _chunk2GKPWQBQcjs.g.call(void 0, this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){_chunkVUC4UU5Mcjs.a.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${P}ms`))},P);function p(y){let m=y.data;m==null||m.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),m.type==="error"&&m.code===K?s({fatal:!0}):m.type==="error"?o(new Error(m.error)):s({value:m.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(this.reloading!=null)return this.reloading;let e=_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>_chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield _ox.WebAuthnP256.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield _ox.WebAuthnP256.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),_chunk2GKPWQBQcjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkVUC4UU5Mcjs.a,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);exports.a = c;
|
package/dist/chunk-J3R36SGJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var m=Object.defineProperty,p=Object.defineProperties,q=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var s=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;var n=b=>{throw TypeError(b)};var l=(b,a,c)=>a in b?m(b,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):b[a]=c,u=(b,a)=>{for(var c in a||(a={}))s.call(a,c)&&l(b,c,a[c]);if(k)for(var c of k(a))t.call(a,c)&&l(b,c,a[c]);return b},v=(b,a)=>p(b,r(a));var w=(b,a,c,e)=>{for(var d=e>1?void 0:e?q(a,c):a,g=b.length-1,h;g>=0;g--)(h=b[g])&&(d=(e?h(a,c,d):h(d))||d);return e&&d&&m(a,c,d),d};var o=(b,a,c)=>a.has(b)||n("Cannot "+c);var x=(b,a,c)=>(o(b,a,"read from private field"),c?c.call(b):a.get(b)),y=(b,a,c)=>a.has(b)?n("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c),z=(b,a,c,e)=>(o(b,a,"write to private field"),e?e.call(b,c):a.set(b,c),c);var A=(b,a,c)=>new Promise((e,d)=>{var g=f=>{try{i(c.next(f))}catch(j){d(j)}},h=f=>{try{i(c.throw(f))}catch(j){d(j)}},i=f=>f.done?e(f.value):Promise.resolve(f.value).then(g,h);i((c=c.apply(b,a)).next())});export{u as a,v as b,w as c,x as d,y as e,z as f,A as g};
|
package/dist/chunk-MYJFCP65.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-IOSADDL5.js";import{a as l}from"./chunk-SYQ5Q3WU.js";import{c as d,g as n}from"./chunk-J3R36SGJ.js";import{getEnvironmentForKey as E,APIKeyEnvironmentPrefix as h,WithLoggerContext as u}from"@crossmint/common-sdk-base";import{WebAuthnP256 as w}from"ox";var b={[h.DEVELOPMENT]:"https://development.devicekey.store",[h.STAGING]:"https://staging.devicekey.store",[h.PRODUCTION]:"https://devicekey.store"},P=6e4,K="indexeddb-fatal",c=class extends v{constructor(e){super(e);this.iframePromise=null;this.reloading=null;this.biometricRequestHandler=null;this.biometricListener=null;let r=E(e);if(r==null)throw new Error("Unable to determine environment from API key");this.iframeUrl=b[r]}setBiometricRequestHandler(e){this.biometricRequestHandler=e}generateKey(){return n(this,arguments,function*(e={biometricPolicy:"none"}){return(yield this.rpc("generateKey",e)).publicKeyBase64})}mapAddressToKey(e,r){return n(this,null,function*(){yield this.rpc("mapAddressToKey",{address:e,publicKeyBase64:r})})}getKey(e){return n(this,null,function*(){return(yield this.rpc("getKey",{address:e})).publicKeyBase64})}hasKey(e){return n(this,null,function*(){return(yield this.rpc("hasKey",{publicKeyBase64:e})).hasKey})}signMessage(e,r){return n(this,null,function*(){return yield this.rpc("signMessage",{address:e,message:r})})}deleteKey(e){return n(this,null,function*(){yield this.rpc("deleteKey",{address:e})})}destroy(){this.biometricListener!=null&&(window.removeEventListener("message",this.biometricListener),this.biometricListener=null),this.iframePromise!=null&&(this.iframePromise.then(e=>e.remove()).catch(()=>{}),this.iframePromise=null)}rpc(e,r){return n(this,null,function*(){let i=yield this.sendRpc(e,r);if(i.fatal){l.warn(`[IframeDeviceSignerKeyStorage] Recoverable IDB error on "${e}", reloading iframe and retrying`),yield this.reloadIframe();let t=yield this.sendRpc(e,r);if(t.fatal)throw new Error(`Device signer IDB fatal error on "${e}" persisted after iframe reload`);return t.value}return i.value})}sendRpc(e,r){return n(this,null,function*(){let t=(yield this.getIframe()).contentWindow;if(t==null)throw new Error("Device signer iframe has no contentWindow");let g=crypto.randomUUID(),a=new URL(this.iframeUrl).origin;return new Promise((s,o)=>{let f=setTimeout(()=>{window.removeEventListener("message",p),o(new Error(`Device signer RPC "${e}" timed out after ${P}ms`))},P);function p(y){let m=y.data;m==null||m.id!==g||y.origin===a&&(clearTimeout(f),window.removeEventListener("message",p),m.type==="error"&&m.code===K?s({fatal:!0}):m.type==="error"?o(new Error(m.error)):s({value:m.result,fatal:!1}))}window.addEventListener("message",p),t.postMessage({type:e,id:g,payload:r},this.iframeUrl)})})}reloadIframe(){return n(this,null,function*(){if(this.reloading!=null)return this.reloading;let e=n(this,null,function*(){try{this.destroy(),yield this.getIframe()}finally{this.reloading=null}});return this.reloading=e,e})}setupBiometricListener(e){let r=new URL(this.iframeUrl).origin;this.biometricListener=i=>n(this,null,function*(){if(i.origin!==r)return;let t=i.data;if((t==null?void 0:t.type)!=="biometric-request")return;let g=e.contentWindow;if(g!=null)try{this.biometricRequestHandler!=null&&(yield this.biometricRequestHandler(t.action));let a=null;if(t.action==="createCredential"){let s=t.payload,o=yield w.createCredential({name:s.name});a={id:o.id,publicKey:{x:`0x${o.publicKey.x.toString(16)}`,y:`0x${o.publicKey.y.toString(16)}`}}}else if(t.action==="sign"){let s=t.payload,{signature:o,metadata:f}=yield w.sign({credentialId:s.credentialId,challenge:s.challenge});a={signature:{r:`0x${o.r.toString(16)}`,s:`0x${o.s.toString(16)}`},metadata:f}}g.postMessage({type:"biometric-response",id:t.id,result:a},this.iframeUrl)}catch(a){let s=a instanceof Error?a.message:"Unknown biometric error";g.postMessage({type:"biometric-response",id:t.id,error:s},this.iframeUrl)}}),window.addEventListener("message",this.biometricListener)}getIframe(){return this.iframePromise==null&&(this.iframePromise=this.createIframe().catch(e=>{throw this.iframePromise=null,e})),this.iframePromise}createIframe(){let e=document.createElement("iframe");return e.src=this.iframeUrl,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,i)=>{e.onload=()=>{this.setupBiometricListener(e),r(e)},e.onerror=()=>i(new Error("Failed to load device signer iframe")),document.body.appendChild(e)})}getDeviceName(){var t;if(typeof navigator=="undefined")return"Unknown Device";let e=navigator.userAgent,r=this.parseDevice(e),i=this.parseBrowser(e);return r!=null&&i!=null?`${i} on ${r}`:(t=r!=null?r:i)!=null?t:"Unknown Device"}parseDevice(e){return/iPad/.test(e)?"iPad":/iPhone/.test(e)?"iPhone":/Macintosh|Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Android/.test(e)?"Android":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"ChromeOS":null}parseBrowser(e){return/Edg\//.test(e)?"Edge":/OPR\/|Opera/.test(e)?"Opera":typeof navigator!="undefined"&&"brave"in navigator?"Brave":/Chrome\//.test(e)?"Chrome":/Safari\//.test(e)&&!/Chrome\//.test(e)?"Safari":/Firefox\//.test(e)?"Firefox":null}};d([u({logger:l,methodName:"deviceSignerKeyStorage.generateKey"})],c.prototype,"generateKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.mapAddressToKey"})],c.prototype,"mapAddressToKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.getKey"})],c.prototype,"getKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.hasKey"})],c.prototype,"hasKey",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.signMessage"})],c.prototype,"signMessage",1),d([u({logger:l,methodName:"deviceSignerKeyStorage.deleteKey"})],c.prototype,"deleteKey",1);export{c as a};
|
package/dist/chunk-N355UETO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./chunk-J3R36SGJ.js";import{privateKeyToAccount as s}from"viem/accounts";import{bytesToHex as a}from"@noble/hashes/utils";var t=class{constructor(r){this.type="server";this.account=s(`0x${a(r.derivedKeyBytes)}`),this._address=this.account.address,this._locator=r.locator}address(){return this._address}locator(){return this._locator}signMessage(r){return e(this,null,function*(){if(!r.startsWith("0x"))throw new Error(`EVMServerSigner.signMessage expects a 0x-prefixed hex string, got: ${r.slice(0,10)}...`);return{signature:yield this.account.signMessage({message:{raw:r}})}})}signTransaction(r){return e(this,null,function*(){return yield this.signMessage(r)})}};export{t as a};
|
package/dist/chunk-OWQZPI3U.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _commonsdkbase = require('@crossmint/common-sdk-base');var o=class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.API_KEY_INVALID,r)}},c= exports.b =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.ENVIRONMENT_INVALID,r)}},I= exports.c =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_CREATION_FAILED,r)}},p= exports.d =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID,r)}},i= exports.e =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE,r)}},x= exports.f =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_NOT_AVAILABLE,r)}},A= exports.g =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_CREATION_FAILED,r)}},g= exports.h =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.WALLET_TYPE_INVALID,r)}},u= exports.i =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNER_INVALID,r)}},N= exports.j =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNER_INVALID,r)}},B= exports.k ="DEVICE_SIGNER_NOT_SUPPORTED",E= exports.l =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNER_INVALID,r)}},_= exports.m =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.MESSAGE_INVALID,r)}},L= exports.n =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.MESSAGE_INVALID,r)}},T= exports.o =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},l= exports.p =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},a= exports.q =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},d= exports.r =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_SIGNATURE,r)}},D= exports.s =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_SIGNATURE,r)}},S= exports.t =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.SIGNING_FAILED,r)}},R= exports.u =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_TRANSACTION,r)}},O= exports.v =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_TRANSACTION,r)}},C= exports.w =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.NO_TRANSACTION,r)}},G= exports.x =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},V= exports.y =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},F= exports.z =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},P= exports.A =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},W= exports.B =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},U= exports.C =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.TRANSACTION_FAILED,r)}},m= exports.D =class extends _commonsdkbase.CrossmintSDKError{constructor(s,r){super(s,_commonsdkbase.WalletErrorCode.RECIPIENT_ADDRESS_INVALID,r)}};exports.a = o; exports.b = c; exports.c = I; exports.d = p; exports.e = i; exports.f = x; exports.g = A; exports.h = g; exports.i = u; exports.j = N; exports.k = B; exports.l = E; exports.m = _; exports.n = L; exports.o = T; exports.p = l; exports.q = a; exports.r = d; exports.s = D; exports.t = S; exports.u = R; exports.v = O; exports.w = C; exports.x = G; exports.y = V; exports.z = F; exports.A = P; exports.B = W; exports.C = U; exports.D = m;
|