@crossmint/wallets-sdk 0.21.0 → 1.0.0-beta.2
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/README.md +6 -6
- package/dist/api/__tests__/constants.cjs +1 -31
- package/dist/api/__tests__/constants.d.cts +9 -1
- package/dist/api/__tests__/constants.d.ts +9 -1
- package/dist/api/__tests__/constants.js +1 -31
- package/dist/api/__tests__/test-utils.cjs +1 -372
- package/dist/api/__tests__/test-utils.d.cts +10 -4
- package/dist/api/__tests__/test-utils.d.ts +10 -4
- package/dist/api/__tests__/test-utils.js +1 -372
- package/dist/api/client.cjs +1 -10
- package/dist/api/client.d.cts +14 -6
- package/dist/api/client.d.ts +14 -6
- package/dist/api/client.js +1 -10
- package/dist/api/gen/client.gen.cjs +1 -7
- package/dist/api/gen/client.gen.js +1 -7
- package/dist/api/gen/index.cjs +1 -79
- package/dist/api/gen/index.d.cts +2 -2
- package/dist/api/gen/index.d.ts +2 -2
- package/dist/api/gen/index.js +1 -79
- package/dist/api/gen/sdk.gen.cjs +1 -78
- package/dist/api/gen/sdk.gen.d.cts +2 -9
- package/dist/api/gen/sdk.gen.d.ts +2 -9
- package/dist/api/gen/sdk.gen.js +1 -78
- package/dist/api/gen/types.gen.d.cts +593 -92
- package/dist/api/gen/types.gen.d.ts +593 -92
- package/dist/api/gen/types.gen.js +1 -1
- package/dist/api/index.cjs +1 -12
- package/dist/api/index.d.cts +7 -1
- package/dist/api/index.d.ts +7 -1
- package/dist/api/index.js +1 -12
- package/dist/api/types.d.cts +11 -55
- package/dist/api/types.d.ts +11 -55
- package/dist/api/types.js +1 -1
- package/dist/chains/chains.cjs +1 -24
- package/dist/chains/chains.js +1 -24
- package/dist/chains/definitions/arcTestnet.cjs +1 -7
- package/dist/chains/definitions/arcTestnet.js +1 -7
- package/dist/chains/definitions/story.cjs +1 -7
- package/dist/chains/definitions/story.js +1 -7
- package/dist/chains/definitions/storyTestnet.cjs +1 -7
- package/dist/chains/definitions/storyTestnet.js +1 -7
- package/dist/chains/definitions/tempo.cjs +1 -7
- package/dist/chains/definitions/tempo.js +1 -7
- package/dist/chains/definitions/tempoTestnet.cjs +1 -7
- package/dist/chains/definitions/tempoTestnet.js +1 -7
- package/dist/chunk-2GKPWQBQ.cjs +1 -0
- package/dist/chunk-2YLRFJ66.js +1 -0
- package/dist/chunk-3HLCTEWX.js +1 -0
- package/dist/chunk-4ADZVYB5.cjs +1 -0
- package/dist/chunk-576HP23H.cjs +1 -0
- package/dist/chunk-5M7IRODB.js +1 -0
- package/dist/chunk-5QIW67NU.cjs +1 -0
- package/dist/chunk-5X4EOJFG.cjs +1 -0
- package/dist/chunk-5YG5A77Q.js +1 -0
- package/dist/chunk-67Z4SJMH.js +1 -0
- package/dist/chunk-6MGMZ3SI.cjs +1 -0
- package/dist/chunk-6OXELDPD.js +1 -0
- package/dist/chunk-7VUOD7EI.cjs +1 -0
- package/dist/chunk-A33BEWR7.cjs +1 -0
- package/dist/chunk-BEW7JDW6.cjs +1 -0
- package/dist/chunk-BFIHTTMM.cjs +1 -0
- package/dist/chunk-BW27ZG6O.cjs +1 -0
- package/dist/chunk-CUHDOBKN.cjs +1 -0
- package/dist/chunk-D5YDWSO5.cjs +1 -0
- package/dist/chunk-DIGDDKSF.js +1 -0
- package/dist/chunk-EE4ITUGS.js +1 -0
- package/dist/chunk-EIHK5TYE.js +1 -0
- package/dist/chunk-ENU3EKBG.cjs +1 -0
- package/dist/chunk-F6PYIH4E.cjs +1 -0
- package/dist/chunk-FT5EVMLB.js +1 -0
- package/dist/chunk-G5R6VQGJ.js +1 -0
- package/dist/chunk-GDRKG42L.cjs +1 -0
- package/dist/chunk-GEY574TH.cjs +1 -0
- package/dist/chunk-GOXB2RBF.js +1 -0
- package/dist/chunk-HOWDLODW.cjs +1 -0
- package/dist/chunk-HRUMWG2F.cjs +1 -0
- package/dist/chunk-IFD3BVMM.js +1 -0
- package/dist/chunk-IR5WN6FQ.cjs +1 -0
- package/dist/chunk-ISXH7QXG.cjs +1 -0
- package/dist/chunk-J33QM2ID.cjs +1 -0
- package/dist/chunk-J3R36SGJ.js +1 -0
- package/dist/chunk-JBP52JOH.cjs +1 -0
- package/dist/chunk-JINIR3YK.cjs +1 -0
- package/dist/chunk-JJMKQ5PK.cjs +1 -0
- package/dist/chunk-JLT4EA2Z.js +1 -0
- package/dist/chunk-JUKCHXJ6.cjs +1 -0
- package/dist/chunk-KKQBZXFE.js +1 -0
- package/dist/chunk-KUP7H7X2.js +1 -0
- package/dist/chunk-LB4V5KKI.js +1 -0
- package/dist/chunk-MCBBBEJT.js +1 -0
- package/dist/chunk-MMFZP54X.js +1 -0
- package/dist/chunk-N5WVT7QE.js +1 -0
- package/dist/chunk-NCXMTHC4.js +1 -0
- package/dist/chunk-NF7KU2ML.cjs +1 -0
- package/dist/chunk-NJWSHT2H.cjs +1 -0
- package/dist/chunk-NKR3UAMA.cjs +1 -0
- package/dist/chunk-NPCKXKQ7.js +1 -0
- package/dist/chunk-NX256LAH.cjs +1 -0
- package/dist/chunk-O4FVTK7X.cjs +1 -0
- package/dist/chunk-O6VBO7KG.js +1 -0
- package/dist/chunk-OQZTL6ZG.js +1 -0
- package/dist/chunk-P6MB5P2F.js +1 -0
- package/dist/chunk-PDHWPAGW.js +1 -0
- package/dist/chunk-PHXT77LR.js +1 -0
- package/dist/chunk-PKYRYRX4.js +1 -0
- package/dist/chunk-PSXRNSOE.js +1 -0
- package/dist/chunk-R3EQXI46.js +1 -0
- package/dist/chunk-RC6KDONJ.cjs +1 -0
- package/dist/chunk-RLAW2ERD.js +1 -0
- package/dist/chunk-RN77IYDQ.js +1 -0
- package/dist/chunk-RXRRXB74.cjs +1 -0
- package/dist/chunk-S3DMYMEQ.js +1 -0
- package/dist/chunk-S3DYQVRD.js +1 -0
- package/dist/chunk-S4O54O4C.cjs +1 -0
- package/dist/chunk-S5KDZFZ7.cjs +1 -0
- package/dist/chunk-SCEPJO4Q.cjs +1 -0
- package/dist/chunk-SH7KRBXV.js +1 -0
- package/dist/chunk-SP2YD44M.js +1 -0
- package/dist/chunk-SPTXAOFR.cjs +1 -0
- package/dist/chunk-SPVAZXRY.js +1 -0
- package/dist/chunk-STYSP6KL.cjs +1 -0
- package/dist/chunk-SVIKBM3S.js +1 -0
- package/dist/chunk-TFMNBTFK.cjs +1 -0
- package/dist/chunk-TOAFCAVT.js +0 -0
- package/dist/chunk-TTSJFEM5.cjs +1 -0
- package/dist/chunk-TYFWX53A.js +1 -0
- package/dist/chunk-U7QSF6P7.cjs +1 -0
- package/dist/chunk-UE3WVHTM.cjs +1 -0
- package/dist/chunk-W5EH3HYF.cjs +1 -0
- package/dist/chunk-WBIKVPHW.js +1 -0
- package/dist/chunk-WCGUGIGJ.js +1 -0
- package/dist/chunk-WT5MDUZY.js +1 -0
- package/dist/chunk-WTVI4AL4.js +1 -0
- package/dist/chunk-WYMBO52A.js +1 -0
- package/dist/chunk-XNZLCUTY.js +1 -0
- package/dist/chunk-XS5B3TUE.js +1 -0
- package/dist/chunk-YFAJXQAM.cjs +1 -0
- package/dist/chunk-YGL4ITFK.cjs +1 -0
- package/dist/chunk-YLRD3ANZ.cjs +1 -0
- package/dist/chunk-YQQWKSNT.cjs +1 -0
- package/dist/chunk-ZACCKNGY.cjs +1 -0
- package/dist/chunk-ZE4NT3CJ.js +1 -0
- package/dist/chunk-ZKL4RO4I.cjs +1 -0
- package/dist/index.cjs +1 -69
- package/dist/index.d.cts +9 -7
- package/dist/index.d.ts +9 -7
- package/dist/index.js +1 -69
- package/dist/logger/index.cjs +1 -11
- package/dist/logger/index.js +1 -11
- package/dist/logger/init.cjs +1 -10
- package/dist/logger/init.js +1 -10
- package/dist/sdk.cjs +1 -48
- package/dist/sdk.d.cts +25 -23
- package/dist/sdk.d.ts +25 -23
- package/dist/sdk.js +1 -48
- package/dist/signers/device.cjs +1 -0
- package/dist/signers/device.d.cts +23 -0
- package/dist/signers/device.d.ts +23 -0
- package/dist/signers/device.js +1 -0
- package/dist/signers/evm-api-key.cjs +1 -7
- package/dist/signers/evm-api-key.d.cts +8 -4
- package/dist/signers/evm-api-key.d.ts +8 -4
- package/dist/signers/evm-api-key.js +1 -7
- package/dist/signers/evm-external-wallet.cjs +1 -7
- package/dist/signers/evm-external-wallet.d.cts +13 -14
- package/dist/signers/evm-external-wallet.d.ts +13 -14
- package/dist/signers/evm-external-wallet.js +1 -7
- package/dist/signers/external-wallet-signer.cjs +1 -0
- package/dist/signers/external-wallet-signer.d.cts +28 -0
- package/dist/signers/external-wallet-signer.d.ts +28 -0
- package/dist/signers/external-wallet-signer.js +1 -0
- package/dist/signers/index.cjs +1 -33
- package/dist/signers/index.d.cts +7 -3
- package/dist/signers/index.d.ts +7 -3
- package/dist/signers/index.js +1 -33
- package/dist/signers/non-custodial/index.cjs +1 -27
- package/dist/signers/non-custodial/index.d.cts +7 -3
- package/dist/signers/non-custodial/index.d.ts +7 -3
- package/dist/signers/non-custodial/index.js +1 -27
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -13
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +7 -3
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +7 -3
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -13
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +1 -7
- package/dist/signers/non-custodial/ncs-iframe-manager.js +1 -7
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -14
- package/dist/signers/non-custodial/ncs-signer.d.cts +8 -4
- package/dist/signers/non-custodial/ncs-signer.d.ts +8 -4
- package/dist/signers/non-custodial/ncs-signer.js +1 -14
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -13
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +7 -3
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +7 -3
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -13
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -13
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +7 -3
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +7 -3
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -13
- package/dist/signers/passkey.cjs +1 -7
- package/dist/signers/passkey.d.cts +8 -4
- package/dist/signers/passkey.d.ts +8 -4
- package/dist/signers/passkey.js +1 -7
- package/dist/signers/server/assemble-server-signer.cjs +1 -14
- package/dist/signers/server/assemble-server-signer.d.cts +6 -2
- package/dist/signers/server/assemble-server-signer.d.ts +6 -2
- package/dist/signers/server/assemble-server-signer.js +1 -14
- package/dist/signers/server/evm-server-signer.cjs +1 -7
- package/dist/signers/server/evm-server-signer.d.cts +8 -4
- package/dist/signers/server/evm-server-signer.d.ts +8 -4
- package/dist/signers/server/evm-server-signer.js +1 -7
- package/dist/signers/server/helpers/derive-server-signer.cjs +1 -11
- package/dist/signers/server/helpers/derive-server-signer.d.cts +6 -2
- package/dist/signers/server/helpers/derive-server-signer.d.ts +6 -2
- package/dist/signers/server/helpers/derive-server-signer.js +1 -11
- package/dist/signers/server/helpers/get-chain-type.cjs +1 -7
- package/dist/signers/server/helpers/get-chain-type.js +1 -7
- package/dist/signers/server/helpers/index.cjs +1 -15
- package/dist/signers/server/helpers/index.d.cts +6 -2
- package/dist/signers/server/helpers/index.d.ts +6 -2
- package/dist/signers/server/helpers/index.js +1 -15
- package/dist/signers/server/index.cjs +1 -29
- package/dist/signers/server/index.d.cts +6 -2
- package/dist/signers/server/index.d.ts +6 -2
- package/dist/signers/server/index.js +1 -29
- package/dist/signers/server/solana-server-signer.cjs +1 -7
- package/dist/signers/server/solana-server-signer.d.cts +8 -4
- package/dist/signers/server/solana-server-signer.d.ts +8 -4
- package/dist/signers/server/solana-server-signer.js +1 -7
- package/dist/signers/server/stellar-server-signer.cjs +1 -7
- package/dist/signers/server/stellar-server-signer.d.cts +8 -4
- package/dist/signers/server/stellar-server-signer.d.ts +8 -4
- package/dist/signers/server/stellar-server-signer.js +1 -7
- package/dist/signers/solana-api-key.cjs +1 -7
- package/dist/signers/solana-api-key.d.cts +8 -4
- package/dist/signers/solana-api-key.d.ts +8 -4
- package/dist/signers/solana-api-key.js +1 -7
- package/dist/signers/solana-external-wallet.cjs +1 -8
- package/dist/signers/solana-external-wallet.d.cts +10 -11
- package/dist/signers/solana-external-wallet.d.ts +10 -11
- package/dist/signers/solana-external-wallet.js +1 -8
- package/dist/signers/stellar-external-wallet.cjs +1 -7
- package/dist/signers/stellar-external-wallet.d.cts +10 -10
- package/dist/signers/stellar-external-wallet.d.ts +10 -10
- package/dist/signers/stellar-external-wallet.js +1 -7
- package/dist/signers/types.cjs +1 -9
- package/dist/signers/types.d.cts +10 -102
- package/dist/signers/types.d.ts +10 -102
- package/dist/signers/types.js +1 -9
- package/dist/types/base32.js.d.cjs +1 -0
- package/dist/types/base32.js.d.d.cts +4 -0
- package/dist/types/base32.js.d.d.ts +4 -0
- package/dist/types/base32.js.d.js +0 -0
- package/dist/types-BDRS_MOb.d.ts +425 -0
- package/dist/types-D-xASbms.d.cts +425 -0
- package/dist/utils/constants.cjs +1 -13
- package/dist/utils/constants.js +1 -13
- package/dist/utils/device-signers/DeviceSignerKeyStorage.cjs +1 -0
- package/dist/utils/device-signers/DeviceSignerKeyStorage.d.cts +66 -0
- package/dist/utils/device-signers/DeviceSignerKeyStorage.d.ts +66 -0
- package/dist/utils/device-signers/DeviceSignerKeyStorage.js +1 -0
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -0
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.d.cts +48 -0
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.d.ts +48 -0
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -0
- package/dist/utils/device-signers/createDeviceSigner.cjs +1 -0
- package/dist/utils/device-signers/createDeviceSigner.d.cts +27 -0
- package/dist/utils/device-signers/createDeviceSigner.d.ts +27 -0
- package/dist/utils/device-signers/createDeviceSigner.js +1 -0
- package/dist/utils/device-signers/index.cjs +1 -0
- package/dist/utils/device-signers/index.d.cts +13 -0
- package/dist/utils/device-signers/index.d.ts +13 -0
- package/dist/utils/device-signers/index.js +1 -0
- package/dist/utils/errors.cjs +1 -55
- package/dist/utils/errors.js +1 -55
- package/dist/utils/server-key-derivation.cjs +1 -9
- package/dist/utils/server-key-derivation.js +1 -9
- package/dist/utils/signer-locator.cjs +1 -0
- package/dist/utils/signer-locator.d.cts +26 -0
- package/dist/utils/signer-locator.d.ts +26 -0
- package/dist/utils/signer-locator.js +1 -0
- package/dist/utils/signer-mapping.cjs +1 -0
- package/dist/utils/signer-mapping.d.cts +32 -0
- package/dist/utils/signer-mapping.d.ts +32 -0
- package/dist/utils/signer-mapping.js +1 -0
- package/dist/utils/signer-validation.cjs +1 -10
- package/dist/utils/signer-validation.js +1 -10
- package/dist/wallets/__tests__/setup.cjs +1 -36
- package/dist/wallets/__tests__/setup.js +1 -36
- package/dist/wallets/__tests__/test-helpers.cjs +1 -102
- package/dist/wallets/__tests__/test-helpers.d.cts +6 -6
- package/dist/wallets/__tests__/test-helpers.d.ts +6 -6
- package/dist/wallets/__tests__/test-helpers.js +1 -102
- package/dist/wallets/evm.cjs +1 -34
- package/dist/wallets/evm.d.cts +2 -3
- package/dist/wallets/evm.d.ts +2 -3
- package/dist/wallets/evm.js +1 -34
- package/dist/wallets/solana.cjs +1 -35
- package/dist/wallets/solana.d.cts +5 -4
- package/dist/wallets/solana.d.ts +5 -4
- package/dist/wallets/solana.js +1 -35
- package/dist/wallets/stellar.cjs +1 -34
- package/dist/wallets/stellar.d.cts +2 -3
- package/dist/wallets/stellar.d.ts +2 -3
- package/dist/wallets/stellar.js +1 -34
- package/dist/wallets/types.d.cts +9 -171
- package/dist/wallets/types.d.ts +9 -171
- package/dist/wallets/wallet-factory.cjs +1 -42
- package/dist/wallets/wallet-factory.d.cts +17 -13
- package/dist/wallets/wallet-factory.d.ts +17 -13
- package/dist/wallets/wallet-factory.js +1 -42
- package/dist/wallets/wallet.cjs +1 -33
- package/dist/wallets/wallet.d.cts +97 -32
- package/dist/wallets/wallet.d.ts +97 -32
- package/dist/wallets/wallet.js +1 -33
- package/package.json +9 -5
- package/dist/chunk-2I2OFGNL.js +0 -36
- package/dist/chunk-2M32LBCA.cjs +0 -52
- package/dist/chunk-2PSAUSOG.js +0 -379
- package/dist/chunk-2RG6642I.js +0 -39
- package/dist/chunk-2T5HHKUI.js +0 -19
- package/dist/chunk-3U6UAYOV.js +0 -25
- package/dist/chunk-3WZUNLYI.cjs +0 -16
- package/dist/chunk-47WKYTRN.js +0 -63
- package/dist/chunk-4GFSUI2I.cjs +0 -66
- package/dist/chunk-4Z3YDHHG.js +0 -82
- package/dist/chunk-4ZWUI6LE.cjs +0 -757
- package/dist/chunk-55V4VMTX.cjs +0 -25
- package/dist/chunk-65KPNJ77.js +0 -119
- package/dist/chunk-7EZDSDKA.cjs +0 -125
- package/dist/chunk-7GOUUPS4.js +0 -36
- package/dist/chunk-7SUWMK4J.cjs +0 -246
- package/dist/chunk-7USEVMTW.cjs +0 -21
- package/dist/chunk-7W4HGN3H.cjs +0 -63
- package/dist/chunk-ASE2FXWP.js +0 -65
- package/dist/chunk-BR4UVMIC.js +0 -332
- package/dist/chunk-BUBSPQ7U.cjs +0 -332
- package/dist/chunk-CPZQ7BK5.cjs +0 -82
- package/dist/chunk-CTOLL4BK.js +0 -29
- package/dist/chunk-DDNG224J.cjs +0 -45
- package/dist/chunk-EVR4CD53.js +0 -63
- package/dist/chunk-F7L2TZ3I.cjs +0 -21
- package/dist/chunk-FOOISYCJ.js +0 -66
- package/dist/chunk-FZQG6OX2.js +0 -323
- package/dist/chunk-G6QJHFSY.cjs +0 -74
- package/dist/chunk-GJT2JD3E.js +0 -45
- package/dist/chunk-GLUD6EBN.js +0 -16
- package/dist/chunk-H6WV5NRT.js +0 -10
- package/dist/chunk-HFEF2URB.js +0 -84
- package/dist/chunk-HTSQPZHW.cjs +0 -25
- package/dist/chunk-HWTWDQYT.cjs +0 -42
- package/dist/chunk-HYA3ESUA.js +0 -69
- package/dist/chunk-IOMKHF6R.cjs +0 -44
- package/dist/chunk-IPO25BCU.js +0 -43
- package/dist/chunk-JSWTGW46.cjs +0 -36
- package/dist/chunk-JWMQALLN.js +0 -21
- package/dist/chunk-K6LSGLG6.js +0 -42
- package/dist/chunk-KHY5FXO4.cjs +0 -37
- package/dist/chunk-KT3CVXFG.js +0 -9
- package/dist/chunk-M47ZHA7Q.js +0 -246
- package/dist/chunk-M4HCASMG.cjs +0 -119
- package/dist/chunk-M6IPPGXQ.cjs +0 -29
- package/dist/chunk-M7OPRXZH.cjs +0 -69
- package/dist/chunk-MIKWTXUA.cjs +0 -223
- package/dist/chunk-MMISP35W.js +0 -21
- package/dist/chunk-MNHK6EQK.cjs +0 -57
- package/dist/chunk-NIBKCMQ2.cjs +0 -19
- package/dist/chunk-NO2KMGS2.cjs +0 -379
- package/dist/chunk-OPKFMXPI.cjs +0 -39
- package/dist/chunk-OXB6RTW7.js +0 -125
- package/dist/chunk-P4XJHOLW.cjs +0 -253
- package/dist/chunk-PIFD6KNH.js +0 -59
- package/dist/chunk-PJOJIRTY.js +0 -74
- package/dist/chunk-PK7J3Y3L.js +0 -44
- package/dist/chunk-Q52MMQSC.js +0 -57
- package/dist/chunk-Q5KNPVYI.cjs +0 -59
- package/dist/chunk-QQNDLR6E.cjs +0 -323
- package/dist/chunk-RBHGZDDX.cjs +0 -58
- package/dist/chunk-RHR6P2KP.cjs +0 -15
- package/dist/chunk-RUQYXEEG.cjs +0 -10
- package/dist/chunk-S2L5Z2ZT.js +0 -37
- package/dist/chunk-SGINWAB6.js +0 -155
- package/dist/chunk-T5NKL6F4.js +0 -89
- package/dist/chunk-U56Z2EOR.cjs +0 -89
- package/dist/chunk-UO2J2ZB2.cjs +0 -65
- package/dist/chunk-VLZ5ZS5U.js +0 -253
- package/dist/chunk-VTF3WCXG.cjs +0 -84
- package/dist/chunk-VVPGO564.js +0 -757
- package/dist/chunk-WJUPOCKJ.js +0 -15
- package/dist/chunk-X4SPF4KJ.js +0 -223
- package/dist/chunk-XC2V34TS.cjs +0 -155
- package/dist/chunk-XEPUH4XH.js +0 -52
- package/dist/chunk-XOCC3MPK.cjs +0 -36
- package/dist/chunk-ZBLW42YE.js +0 -25
- package/dist/chunk-ZNAGDENG.cjs +0 -43
- package/dist/chunk-ZP4ZZCIE.js +0 -58
- package/dist/chunk-ZT7EGOCI.cjs +0 -9
- package/dist/chunk-ZTEMOYS2.cjs +0 -63
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { VersionedTransaction, Keypair } from '@solana/web3.js';
|
|
2
|
+
import { HandshakeParent } from '@crossmint/client-sdk-window';
|
|
3
|
+
import { exportSignerOutboundEvents, exportSignerInboundEvents, signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
|
|
4
|
+
import { Address, TypedDataDefinition, TypedData } from 'viem';
|
|
5
|
+
import { Abi } from 'abitype';
|
|
6
|
+
import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV2025ControllerSubmitApprovals2Error, WalletsV2025ControllerGetTransaction2Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV2025ControllerCreateSignatureRequest2Error, WalletsV2025ControllerSubmitSignatureApprovals2Error, WalletsV2025ControllerGetSignature2Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV2025ControllerGetTransactionsWithoutChain2Error, WalletsActivityResponseUnstableDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, FundWalletAmountDto, BalanceControllerFundWallet2Responses, BalanceControllerFundWallet2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV2025ControllerCreateDelegatedSigner2Error, WalletsV2025ControllerGetDelegatedSigner2Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './api/gen/types.gen.cjs';
|
|
7
|
+
import { WebAuthnP256 } from 'ox';
|
|
8
|
+
import { SolanaExternalWalletSignerConfig, StellarExternalWalletSignerConfig, EvmExternalWalletSignerConfig, Crossmint } from '@crossmint/common-sdk-base';
|
|
9
|
+
import { Chain, SolanaChain, StellarChain, EVMSmartWalletChain } from './chains/chains.cjs';
|
|
10
|
+
import { DeviceSignerKeyStorage } from './utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
11
|
+
|
|
12
|
+
type ExternalWalletRegistrationConfig = {
|
|
13
|
+
type: "external-wallet";
|
|
14
|
+
address: string;
|
|
15
|
+
};
|
|
16
|
+
declare class AuthRejectedError extends Error {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
type EmailSignerConfig = {
|
|
20
|
+
type: "email";
|
|
21
|
+
email?: string;
|
|
22
|
+
locator?: string;
|
|
23
|
+
};
|
|
24
|
+
type PhoneSignerConfig = {
|
|
25
|
+
type: "phone";
|
|
26
|
+
phone?: string;
|
|
27
|
+
locator?: string;
|
|
28
|
+
};
|
|
29
|
+
type NonCustodialSignerType = PhoneSignerConfig["type"] | EmailSignerConfig["type"];
|
|
30
|
+
type ExternalWalletSignerConfigForChain<C extends Chain> = C extends SolanaChain ? SolanaExternalWalletSignerConfig : C extends StellarChain ? StellarExternalWalletSignerConfig : EvmExternalWalletSignerConfig;
|
|
31
|
+
type ApiKeySignerConfig = {
|
|
32
|
+
type: "api-key";
|
|
33
|
+
};
|
|
34
|
+
type ServerSignerConfig = {
|
|
35
|
+
type: "server";
|
|
36
|
+
secret: string;
|
|
37
|
+
};
|
|
38
|
+
type BaseSignerConfig<C extends Chain> = ExternalWalletSignerConfigForChain<C> | ApiKeySignerConfig | ServerSignerConfig;
|
|
39
|
+
type PasskeySignerConfig = {
|
|
40
|
+
type: "passkey";
|
|
41
|
+
name?: string;
|
|
42
|
+
id?: string;
|
|
43
|
+
locator?: string;
|
|
44
|
+
onCreatePasskey?: (name: string) => Promise<{
|
|
45
|
+
id: string;
|
|
46
|
+
publicKey: {
|
|
47
|
+
x: string;
|
|
48
|
+
y: string;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
onSignWithPasskey?: (message: string) => Promise<PasskeySignResult>;
|
|
52
|
+
};
|
|
53
|
+
type BaseInternalSignerConfig = {
|
|
54
|
+
locator: SignerLocator;
|
|
55
|
+
address: string;
|
|
56
|
+
crossmint: Crossmint;
|
|
57
|
+
clientTEEConnection?: HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
|
|
58
|
+
};
|
|
59
|
+
type EmailInternalSignerConfig = EmailSignerConfig & Omit<BaseInternalSignerConfig, "locator"> & {
|
|
60
|
+
locator: EmailSignerLocator;
|
|
61
|
+
onAuthRequired?: Callbacks["onAuthRequired"];
|
|
62
|
+
};
|
|
63
|
+
type PhoneInternalSignerConfig = PhoneSignerConfig & Omit<BaseInternalSignerConfig, "locator"> & {
|
|
64
|
+
locator: PhoneSignerLocator;
|
|
65
|
+
onAuthRequired?: Callbacks["onAuthRequired"];
|
|
66
|
+
};
|
|
67
|
+
type DeviceInternalSignerConfig = {
|
|
68
|
+
type: "device";
|
|
69
|
+
locator?: DeviceSignerLocator;
|
|
70
|
+
address: string;
|
|
71
|
+
};
|
|
72
|
+
type PasskeyInternalSignerConfig = PasskeySignerConfig & {
|
|
73
|
+
locator: PasskeySignerLocator;
|
|
74
|
+
id: string;
|
|
75
|
+
};
|
|
76
|
+
type ApiKeyInternalSignerConfig = ApiKeySignerConfig & {
|
|
77
|
+
locator: ApiKeySignerLocator;
|
|
78
|
+
address: string;
|
|
79
|
+
};
|
|
80
|
+
type ExternalWalletInternalSignerConfig<C extends Chain> = ExternalWalletSignerConfigForChain<C> & {
|
|
81
|
+
locator: ExternalWalletSignerLocator;
|
|
82
|
+
};
|
|
83
|
+
type ServerInternalSignerConfig = {
|
|
84
|
+
type: "server";
|
|
85
|
+
/** The derived chain-specific private key bytes */
|
|
86
|
+
derivedKeyBytes: Uint8Array;
|
|
87
|
+
locator: ServerSignerLocator;
|
|
88
|
+
address: string;
|
|
89
|
+
};
|
|
90
|
+
type InternalSignerConfig<C extends Chain> = EmailInternalSignerConfig | PhoneInternalSignerConfig | PasskeyInternalSignerConfig | ApiKeyInternalSignerConfig | ExternalWalletInternalSignerConfig<C> | DeviceInternalSignerConfig | ServerInternalSignerConfig;
|
|
91
|
+
type BaseSignResult = {
|
|
92
|
+
signature: string;
|
|
93
|
+
};
|
|
94
|
+
type DeviceSignResult = {
|
|
95
|
+
signature: {
|
|
96
|
+
r: string;
|
|
97
|
+
s: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type PasskeySignResult = {
|
|
101
|
+
signature: {
|
|
102
|
+
r: string;
|
|
103
|
+
s: string;
|
|
104
|
+
};
|
|
105
|
+
metadata: WebAuthnP256.SignMetadata;
|
|
106
|
+
};
|
|
107
|
+
type DeviceSignerConfig = {
|
|
108
|
+
type: "device";
|
|
109
|
+
publicKey?: {
|
|
110
|
+
x: string;
|
|
111
|
+
y: string;
|
|
112
|
+
};
|
|
113
|
+
locator?: string;
|
|
114
|
+
};
|
|
115
|
+
type SignerConfigForChain<C extends Chain> = C extends SolanaChain ? EmailSignerConfig | PhoneSignerConfig | BaseSignerConfig<C> | DeviceSignerConfig : C extends StellarChain ? EmailSignerConfig | PhoneSignerConfig | BaseSignerConfig<C> | DeviceSignerConfig : EmailSignerConfig | PhoneSignerConfig | PasskeySignerConfig | BaseSignerConfig<C> | DeviceSignerConfig;
|
|
116
|
+
type EmailSignerLocator = `email:${string}`;
|
|
117
|
+
type PhoneSignerLocator = `phone:${string}`;
|
|
118
|
+
type PasskeySignerLocator = `passkey:${string}`;
|
|
119
|
+
type DeviceSignerLocator = `device:${string}`;
|
|
120
|
+
type ExternalWalletSignerLocator = `external-wallet:${string}`;
|
|
121
|
+
type ApiKeySignerLocator = "api-key" | `api-key:${string}`;
|
|
122
|
+
type ServerSignerLocator = `server:${string}`;
|
|
123
|
+
type SignerLocator = EmailSignerLocator | PhoneSignerLocator | PasskeySignerLocator | DeviceSignerLocator | ExternalWalletSignerLocator | ApiKeySignerLocator | ServerSignerLocator;
|
|
124
|
+
type SignResultMap = {
|
|
125
|
+
email: BaseSignResult;
|
|
126
|
+
phone: BaseSignResult;
|
|
127
|
+
"api-key": BaseSignResult;
|
|
128
|
+
"external-wallet": BaseSignResult;
|
|
129
|
+
server: BaseSignResult;
|
|
130
|
+
passkey: PasskeySignResult;
|
|
131
|
+
device: DeviceSignResult;
|
|
132
|
+
};
|
|
133
|
+
interface Signer<T extends keyof SignResultMap = keyof SignResultMap> {
|
|
134
|
+
type: T;
|
|
135
|
+
locator(): SignerLocator;
|
|
136
|
+
address?(): string;
|
|
137
|
+
signMessage(message: string): Promise<SignResultMap[T]>;
|
|
138
|
+
signTransaction(transaction: string): Promise<SignResultMap[T]>;
|
|
139
|
+
}
|
|
140
|
+
interface ExportableSigner extends Signer {
|
|
141
|
+
_exportPrivateKey: (exportTEEConnection: ExportSignerTEEConnection) => Promise<void>;
|
|
142
|
+
}
|
|
143
|
+
declare function isExportableSigner(signer: Signer): signer is ExportableSigner;
|
|
144
|
+
type ExportSignerTEEConnection = HandshakeParent<typeof exportSignerOutboundEvents, typeof exportSignerInboundEvents>;
|
|
145
|
+
|
|
146
|
+
type CreateWalletParams = CreateWalletV2025Dto;
|
|
147
|
+
type GetWalletSuccessResponse = WalletV2025ResponseDto;
|
|
148
|
+
type CreateWalletResponse = GetWalletSuccessResponse | WalletV1Alpha2ErrorDto;
|
|
149
|
+
type GetWalletResponse = GetWalletSuccessResponse | WalletV1Alpha2ErrorDto;
|
|
150
|
+
type AdminSignerConfig = NonNullable<Extract<CreateWalletV2025Dto, {
|
|
151
|
+
config: {
|
|
152
|
+
adminSigner: Record<string, unknown>;
|
|
153
|
+
};
|
|
154
|
+
}>["config"]>["adminSigner"];
|
|
155
|
+
type CreateTransactionParams = CreateTransactionV2025Dto;
|
|
156
|
+
type CreateTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
157
|
+
type CreateTransactionResponse = CreateTransactionSuccessResponse | WalletV1Alpha2TransactionErrorDto;
|
|
158
|
+
type ApproveTransactionParams = SubmitApprovalV2025Dto;
|
|
159
|
+
type ApproveTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerSubmitApprovals2Error;
|
|
160
|
+
type GetTransactionResponse = WalletsTransactionV2025ResponseDto | WalletsV2025ControllerGetTransaction2Error;
|
|
161
|
+
type GetTransactionSuccessResponse = WalletsTransactionV2025ResponseDto;
|
|
162
|
+
type CreateSignatureParams = CreateSignatureV2025Dto;
|
|
163
|
+
type CreateSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerCreateSignatureRequest2Error;
|
|
164
|
+
type ApproveSignatureParams = SubmitApprovalV2025Dto;
|
|
165
|
+
type ApproveSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerSubmitSignatureApprovals2Error;
|
|
166
|
+
type GetSignatureResponse = WalletsSignatureV2025ResponseDto | WalletsV2025ControllerGetSignature2Error;
|
|
167
|
+
type GetTransactionsResponse = WalletsMultipleTransactionV2025ResponseDto | WalletsV2025ControllerGetTransactionsWithoutChain2Error;
|
|
168
|
+
type GetBalanceResponse = WalletBalanceV20250609ResponseDto | BalanceControllerGetBalanceForLocator2Error;
|
|
169
|
+
type GetBalanceSuccessResponse = WalletBalanceV20250609ResponseDto;
|
|
170
|
+
type GetTransfersResponse = WalletsActivityResponseUnstableDto | WalletV1Alpha2ErrorDto;
|
|
171
|
+
type Transfers = WalletsActivityResponseUnstableDto;
|
|
172
|
+
type FundWalletParams = FundWalletAmountDto;
|
|
173
|
+
type FundWalletResponse = BalanceControllerFundWallet2Responses | BalanceControllerFundWallet2Error;
|
|
174
|
+
type RegisterSignerChain = Extract<CreateSignerV2025InputDto, {
|
|
175
|
+
chain: string;
|
|
176
|
+
}>["chain"];
|
|
177
|
+
type RegisterSignerPasskeyParams = Extract<CreateSignerV2025InputDto["signer"], {
|
|
178
|
+
type: "passkey";
|
|
179
|
+
}>;
|
|
180
|
+
type RegisterSignerParams = {
|
|
181
|
+
signer: SignerLocator | RegisterSignerPasskeyParams | SignerConfigForChain<Chain>;
|
|
182
|
+
chain?: RegisterSignerChain;
|
|
183
|
+
};
|
|
184
|
+
type RegisterSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerCreateDelegatedSigner2Error;
|
|
185
|
+
type GetSignerResponse = DelegatedSignerV2025Dto | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
186
|
+
type GetDelegatedSignersResponse = Array<DelegatedSignerV2025Dto> | WalletsV2025ControllerGetDelegatedSigner2Error;
|
|
187
|
+
type DelegatedSigner$1 = DelegatedSignerV2025Dto;
|
|
188
|
+
type SendParams = SendTokenDto;
|
|
189
|
+
type SendResponse = WalletsSendTokenControllerSendToken2Response;
|
|
190
|
+
type WalletType = "smart" | "mpc";
|
|
191
|
+
type SolanaAddress = string;
|
|
192
|
+
type EvmWalletLocator = `me:evm:${WalletType}` | Address;
|
|
193
|
+
type SolanaWalletLocator = `me:solana:${WalletType}` | SolanaAddress;
|
|
194
|
+
type WalletLocator = EvmWalletLocator | SolanaWalletLocator;
|
|
195
|
+
|
|
196
|
+
type PrepareOnly<T extends boolean = boolean> = {
|
|
197
|
+
prepareOnly: T;
|
|
198
|
+
};
|
|
199
|
+
type SendTokenTransactionType = "onramp" | "regulated-transfer" | "direct";
|
|
200
|
+
type TransactionInputOptions = PrepareOnly & {
|
|
201
|
+
signer?: string | ServerSignerConfig;
|
|
202
|
+
};
|
|
203
|
+
type SendTokenTransactionOptions = TransactionInputOptions & {
|
|
204
|
+
transactionType?: SendTokenTransactionType;
|
|
205
|
+
};
|
|
206
|
+
type SignatureInputOptions = PrepareOnly;
|
|
207
|
+
type AddSignerOptions = PrepareOnly;
|
|
208
|
+
type AddSignerReturnType<C extends Chain> = C extends "solana" | "stellar" ? DelegatedSigner & {
|
|
209
|
+
transactionId: string;
|
|
210
|
+
} : DelegatedSigner & {
|
|
211
|
+
signatureId?: string;
|
|
212
|
+
};
|
|
213
|
+
type SignMessageInput = {
|
|
214
|
+
message: string;
|
|
215
|
+
options?: SignatureInputOptions;
|
|
216
|
+
};
|
|
217
|
+
type SignTypedDataInput = TypedDataDefinition<TypedData, string> & {
|
|
218
|
+
chain: EVMSmartWalletChain;
|
|
219
|
+
options?: SignatureInputOptions;
|
|
220
|
+
};
|
|
221
|
+
type ApproveResult<T extends ApproveParams> = T extends {
|
|
222
|
+
transactionId: string;
|
|
223
|
+
} ? Transaction<false> : T extends {
|
|
224
|
+
signatureId: string;
|
|
225
|
+
} ? Signature<false> : Error;
|
|
226
|
+
type EVMTransactionInputBase = {
|
|
227
|
+
options?: TransactionInputOptions;
|
|
228
|
+
};
|
|
229
|
+
type EVMTransactionInput = EVMTransactionInputBase & ({
|
|
230
|
+
to: string;
|
|
231
|
+
functionName?: string;
|
|
232
|
+
args?: unknown[];
|
|
233
|
+
value?: bigint;
|
|
234
|
+
abi?: Abi;
|
|
235
|
+
data?: `0x${string}`;
|
|
236
|
+
} | {
|
|
237
|
+
transaction: string;
|
|
238
|
+
});
|
|
239
|
+
type StellarTransactionInput = ({
|
|
240
|
+
contractId: string;
|
|
241
|
+
method: string;
|
|
242
|
+
memo?: string;
|
|
243
|
+
args: Record<string, unknown>;
|
|
244
|
+
} | {
|
|
245
|
+
transaction: string;
|
|
246
|
+
contractId: string;
|
|
247
|
+
}) & {
|
|
248
|
+
options?: TransactionInputOptions;
|
|
249
|
+
};
|
|
250
|
+
type SolanaTransactionInput = ({
|
|
251
|
+
transaction: VersionedTransaction;
|
|
252
|
+
} | {
|
|
253
|
+
serializedTransaction: string;
|
|
254
|
+
}) & {
|
|
255
|
+
additionalSigners?: Keypair[];
|
|
256
|
+
options?: TransactionInputOptions;
|
|
257
|
+
};
|
|
258
|
+
type FormattedEVMTransaction = {
|
|
259
|
+
to: string;
|
|
260
|
+
value: string;
|
|
261
|
+
data: string;
|
|
262
|
+
} | {
|
|
263
|
+
transaction: string;
|
|
264
|
+
};
|
|
265
|
+
type SignerStatus = "success" | "pending" | "awaiting-approval" | "failed";
|
|
266
|
+
type DelegatedSignerInput = {
|
|
267
|
+
signer: string | ServerSignerConfig;
|
|
268
|
+
};
|
|
269
|
+
type DelegatedSigner = {
|
|
270
|
+
type: "passkey";
|
|
271
|
+
id: string;
|
|
272
|
+
name: string;
|
|
273
|
+
publicKey: {
|
|
274
|
+
x: string;
|
|
275
|
+
y: string;
|
|
276
|
+
};
|
|
277
|
+
validatorContractVersion: string;
|
|
278
|
+
locator: string;
|
|
279
|
+
status: SignerStatus;
|
|
280
|
+
} | {
|
|
281
|
+
type: "api-key";
|
|
282
|
+
address: string;
|
|
283
|
+
locator: string;
|
|
284
|
+
status: SignerStatus;
|
|
285
|
+
} | {
|
|
286
|
+
type: "external-wallet";
|
|
287
|
+
address: string;
|
|
288
|
+
locator: string;
|
|
289
|
+
status: SignerStatus;
|
|
290
|
+
} | {
|
|
291
|
+
type: "email";
|
|
292
|
+
email: string;
|
|
293
|
+
address: string;
|
|
294
|
+
locator: string;
|
|
295
|
+
status: SignerStatus;
|
|
296
|
+
} | {
|
|
297
|
+
type: "phone";
|
|
298
|
+
phone: string;
|
|
299
|
+
address: string;
|
|
300
|
+
locator: string;
|
|
301
|
+
status: SignerStatus;
|
|
302
|
+
} | {
|
|
303
|
+
type: "device";
|
|
304
|
+
publicKey: {
|
|
305
|
+
x: string;
|
|
306
|
+
y: string;
|
|
307
|
+
};
|
|
308
|
+
locator: string;
|
|
309
|
+
status: SignerStatus;
|
|
310
|
+
} | {
|
|
311
|
+
type: "server";
|
|
312
|
+
address: string;
|
|
313
|
+
locator: string;
|
|
314
|
+
status: SignerStatus;
|
|
315
|
+
};
|
|
316
|
+
type PendingApproval = NonNullable<NonNullable<CreateTransactionSuccessResponse["approvals"]>["pending"]>[number];
|
|
317
|
+
type Callbacks = {
|
|
318
|
+
onWalletCreationStart?: () => Promise<void>;
|
|
319
|
+
onTransactionStart?: () => Promise<void>;
|
|
320
|
+
onAuthRequired?: (signerType: "email" | "phone", signerLocator: string, needsAuth: boolean, sendOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
|
|
321
|
+
};
|
|
322
|
+
type StellarWalletPlugin = string;
|
|
323
|
+
type WalletPlugin<C extends Chain> = C extends StellarChain ? StellarWalletPlugin : never;
|
|
324
|
+
type WalletOptions = {
|
|
325
|
+
callbacks?: Callbacks;
|
|
326
|
+
clientTEEConnection?: HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
|
|
327
|
+
deviceSignerKeyStorage?: DeviceSignerKeyStorage;
|
|
328
|
+
};
|
|
329
|
+
type WalletArgsFor<C extends Chain> = {
|
|
330
|
+
/** The blockchain to create the wallet on (e.g. "base-sepolia"). */
|
|
331
|
+
chain: C;
|
|
332
|
+
/** Optional owner identifier. */
|
|
333
|
+
owner?: string;
|
|
334
|
+
/** Optional array of wallet plugins. */
|
|
335
|
+
plugins?: WalletPlugin<C>[];
|
|
336
|
+
options?: WalletOptions;
|
|
337
|
+
/** Optional wallet alias. */
|
|
338
|
+
alias?: string;
|
|
339
|
+
};
|
|
340
|
+
type WalletCreateArgs<C extends Chain> = WalletArgsFor<C> & {
|
|
341
|
+
/** Recovery signer for wallet creation. Device signers cannot be recovery signers. */
|
|
342
|
+
recovery: Exclude<SignerConfigForChain<C>, DeviceSignerConfig>;
|
|
343
|
+
/** Signers to register on the wallet during creation. */
|
|
344
|
+
signers?: Array<SignerConfigForChain<C> | ExternalWalletRegistrationConfig>;
|
|
345
|
+
alias?: string;
|
|
346
|
+
};
|
|
347
|
+
/**
|
|
348
|
+
* A device signer descriptor containing the public key and locator.
|
|
349
|
+
* Returned by `createDeviceSigner`.
|
|
350
|
+
*/
|
|
351
|
+
type DeviceSignerDescriptor = {
|
|
352
|
+
type: "device";
|
|
353
|
+
publicKey: {
|
|
354
|
+
x: string;
|
|
355
|
+
y: string;
|
|
356
|
+
};
|
|
357
|
+
locator: DeviceSignerLocator;
|
|
358
|
+
};
|
|
359
|
+
type ClientSideWalletArgsFor<C extends Chain> = Omit<WalletArgsFor<C>, "owner">;
|
|
360
|
+
type ClientSideWalletCreateArgs<C extends Chain> = Omit<WalletCreateArgs<C>, "owner">;
|
|
361
|
+
type ChainExtras = {
|
|
362
|
+
solana: {
|
|
363
|
+
mintHash?: string;
|
|
364
|
+
};
|
|
365
|
+
stellar: {
|
|
366
|
+
contractId?: string;
|
|
367
|
+
};
|
|
368
|
+
evm: {
|
|
369
|
+
contractAddress?: string;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
type ChainToExtrasKey<C extends Chain> = C extends "solana" ? "solana" : C extends "stellar" ? "stellar" : "evm";
|
|
373
|
+
type TokenBalance<C extends Chain = Chain> = {
|
|
374
|
+
symbol: "sol" | "eth" | "usdc" | string;
|
|
375
|
+
name: string;
|
|
376
|
+
amount: string;
|
|
377
|
+
decimals?: number;
|
|
378
|
+
rawAmount?: string;
|
|
379
|
+
} & ChainExtras[ChainToExtrasKey<C>];
|
|
380
|
+
type Balances<C extends Chain = Chain> = {
|
|
381
|
+
nativeToken: TokenBalance<C>;
|
|
382
|
+
usdc: TokenBalance<C>;
|
|
383
|
+
tokens: TokenBalance<C>[];
|
|
384
|
+
};
|
|
385
|
+
type UserLocator = {
|
|
386
|
+
email: string;
|
|
387
|
+
} | {
|
|
388
|
+
x: string;
|
|
389
|
+
} | {
|
|
390
|
+
twitter: string;
|
|
391
|
+
} | {
|
|
392
|
+
phone: string;
|
|
393
|
+
} | {
|
|
394
|
+
userId: string;
|
|
395
|
+
};
|
|
396
|
+
type Transaction<TPrepareOnly extends boolean = false> = TPrepareOnly extends true ? {
|
|
397
|
+
hash?: string;
|
|
398
|
+
explorerLink?: string;
|
|
399
|
+
transactionId: string;
|
|
400
|
+
} : {
|
|
401
|
+
hash: string;
|
|
402
|
+
explorerLink: string;
|
|
403
|
+
transactionId: string;
|
|
404
|
+
};
|
|
405
|
+
type Signature<TPrepareOnly extends boolean = false> = TPrepareOnly extends true ? {
|
|
406
|
+
signature?: string;
|
|
407
|
+
signatureId: string;
|
|
408
|
+
} : {
|
|
409
|
+
signature: string;
|
|
410
|
+
signatureId: string;
|
|
411
|
+
};
|
|
412
|
+
type ApproveOptions = {
|
|
413
|
+
approval?: Approval;
|
|
414
|
+
additionalSigners?: Signer[];
|
|
415
|
+
};
|
|
416
|
+
type ApproveParams = {
|
|
417
|
+
transactionId?: string;
|
|
418
|
+
signatureId?: string;
|
|
419
|
+
options?: ApproveOptions;
|
|
420
|
+
};
|
|
421
|
+
type Approval = (BaseSignResult | PasskeySignResult | DeviceSignResult) & {
|
|
422
|
+
signer: string;
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
export { type ApproveParams as $, type ApiKeySignerLocator as A, type Balances as B, type ClientSideWalletArgsFor as C, type DelegatedSigner as D, type EVMTransactionInput as E, type ApiKeyInternalSignerConfig as F, type ExternalWalletInternalSignerConfig as G, type PasskeyInternalSignerConfig as H, type InternalSignerConfig as I, type PasskeySignResult as J, type DelegatedSigner$1 as K, type PrepareOnly as L, type SignMessageInput as M, type SignTypedDataInput as N, type TransactionInputOptions as O, type PhoneSignerConfig as P, type StellarTransactionInput as Q, type RegisterSignerPasskeyParams as R, type SignerStatus as S, type Transfers as T, type WalletLocator as U, type FundWalletResponse as V, type WalletArgsFor as W, type GetTransactionsResponse as X, type GetTransactionSuccessResponse as Y, type SendTokenTransactionOptions as Z, type UserLocator as _, type ClientSideWalletCreateArgs as a, type ApproveResult as a0, type AddSignerOptions as a1, type AddSignerReturnType as a2, type ApproveOptions as a3, type ApproveSignatureResponse as a4, type CreateWalletResponse as a5, type SendResponse as a6, type CreateWalletParams as a7, type GetTransactionResponse as a8, type EmailInternalSignerConfig as a9, type NonCustodialSignerType as aA, type ApiKeySignerConfig as aB, type BaseSignerConfig as aC, type PasskeySignerConfig as aD, type DeviceSignerConfig as aE, type ServerSignerLocator as aF, type SendTokenTransactionType as aG, type SignatureInputOptions as aH, type FormattedEVMTransaction as aI, type DelegatedSignerInput as aJ, type PendingApproval as aK, type StellarWalletPlugin as aL, type TokenBalance as aM, type Approval as aN, type PhoneInternalSignerConfig as aa, type BaseSignResult as ab, type ServerInternalSignerConfig as ac, type GetWalletResponse as ad, type CreateTransactionParams as ae, type CreateTransactionResponse as af, type ApproveTransactionParams as ag, type ApproveTransactionResponse as ah, type CreateSignatureParams as ai, type CreateSignatureResponse as aj, type ApproveSignatureParams as ak, type GetSignatureResponse as al, type GetTransfersResponse as am, type GetBalanceResponse as an, type FundWalletParams as ao, type RegisterSignerParams as ap, type RegisterSignerResponse as aq, type GetSignerResponse as ar, type SendParams as as, type GetWalletSuccessResponse as at, type AdminSignerConfig as au, type CreateTransactionSuccessResponse as av, type GetBalanceSuccessResponse as aw, type RegisterSignerChain as ax, type GetDelegatedSignersResponse as ay, AuthRejectedError as az, type DeviceSignerDescriptor as b, type Transaction as c, type WalletCreateArgs as d, type Callbacks as e, type WalletOptions as f, type WalletPlugin as g, type Signature as h, type SolanaTransactionInput as i, isExportableSigner as j, type EmailSignerConfig as k, type ExternalWalletRegistrationConfig as l, type ExternalWalletSignerConfigForChain as m, type ServerSignerConfig as n, type SignerConfigForChain as o, type SignerLocator as p, type EmailSignerLocator as q, type PhoneSignerLocator as r, type PasskeySignerLocator as s, type DeviceSignerLocator as t, type ExternalWalletSignerLocator as u, type ExportableSigner as v, type ExportSignerTEEConnection as w, type Signer as x, type DeviceInternalSignerConfig as y, type DeviceSignResult as z };
|
package/dist/utils/constants.cjs
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk3WZUNLYIcjs = require('../chunk-3WZUNLYI.cjs');
|
|
7
|
-
require('../chunk-UO2J2ZB2.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.SDK_NAME = _chunk3WZUNLYIcjs.SDK_NAME; exports.SDK_VERSION = _chunk3WZUNLYIcjs.SDK_VERSION; exports.STATUS_POLLING_INTERVAL_MS = _chunk3WZUNLYIcjs.STATUS_POLLING_INTERVAL_MS; exports.WALLETS_SERVICE = _chunk3WZUNLYIcjs.WALLETS_SERVICE;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkU7QSF6P7cjs = require('../chunk-U7QSF6P7.cjs');require('../chunk-2GKPWQBQ.cjs');exports.SDK_NAME = _chunkU7QSF6P7cjs.c; exports.SDK_VERSION = _chunkU7QSF6P7cjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkU7QSF6P7cjs.d; exports.WALLETS_SERVICE = _chunkU7QSF6P7cjs.a;
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
SDK_NAME,
|
|
3
|
-
SDK_VERSION,
|
|
4
|
-
STATUS_POLLING_INTERVAL_MS,
|
|
5
|
-
WALLETS_SERVICE
|
|
6
|
-
} from "../chunk-GLUD6EBN.js";
|
|
7
|
-
import "../chunk-ASE2FXWP.js";
|
|
8
|
-
export {
|
|
9
|
-
SDK_NAME,
|
|
10
|
-
SDK_VERSION,
|
|
11
|
-
STATUS_POLLING_INTERVAL_MS,
|
|
12
|
-
WALLETS_SERVICE
|
|
13
|
-
};
|
|
1
|
+
import{a,b,c,d}from"../chunk-TYFWX53A.js";import"../chunk-J3R36SGJ.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD5YDWSO5cjs = require('../../chunk-D5YDWSO5.cjs');require('../../chunk-2GKPWQBQ.cjs');exports.DeviceSignerKeyStorage = _chunkD5YDWSO5cjs.a;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract storage interface for managing P-256 (secp256r1) device signer key pairs.
|
|
3
|
+
* Implementations handle key generation, persistence, retrieval, signing, and deletion.
|
|
4
|
+
*/
|
|
5
|
+
type BiometricPolicy = "always" | "session" | "none";
|
|
6
|
+
declare abstract class DeviceSignerKeyStorage {
|
|
7
|
+
protected readonly apiKey: string;
|
|
8
|
+
constructor(apiKey: string);
|
|
9
|
+
/**
|
|
10
|
+
* Generate a new P-256 key pair and persist it.
|
|
11
|
+
* @param params - Key generation parameters.
|
|
12
|
+
* @param params.address - Optional wallet address to associate the key with. If omitted, the key
|
|
13
|
+
* should be stored under a temporary identifier until {@link mapAddressToKey} is called.
|
|
14
|
+
* @returns The uncompressed public key encoded as a base64 string.
|
|
15
|
+
*/
|
|
16
|
+
abstract generateKey(params: {
|
|
17
|
+
address?: string;
|
|
18
|
+
biometricPolicy?: Exclude<BiometricPolicy, "session">;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
abstract generateKey(params: {
|
|
21
|
+
address?: string;
|
|
22
|
+
biometricPolicy: "session";
|
|
23
|
+
biometricExpirationTime: number;
|
|
24
|
+
}): Promise<string>;
|
|
25
|
+
abstract generateKey(params: {
|
|
26
|
+
address?: string;
|
|
27
|
+
biometricPolicy?: BiometricPolicy;
|
|
28
|
+
biometricExpirationTime?: number;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Associate an already-generated key pair with a wallet address.
|
|
32
|
+
* Used when the wallet address is not yet known at the time of key generation.
|
|
33
|
+
* @param address - The wallet address to map the key to.
|
|
34
|
+
* @param publicKeyBase64 - The base64-encoded public key returned by {@link generateKey}.
|
|
35
|
+
*/
|
|
36
|
+
abstract mapAddressToKey(address: string, publicKeyBase64: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve the public key for a given wallet address.
|
|
39
|
+
* @param address - The wallet address whose public key to look up.
|
|
40
|
+
* @returns The base64-encoded public key, or `null` if no key is found for the address.
|
|
41
|
+
*/
|
|
42
|
+
abstract getKey(address: string): Promise<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a key with the given public key exists on this device.
|
|
45
|
+
* @param publicKeyBase64 - The base64-encoded public key to look for.
|
|
46
|
+
* @returns `true` if the key exists on the device, `false` otherwise.
|
|
47
|
+
*/
|
|
48
|
+
abstract hasKey(publicKeyBase64: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Sign a message using the private key associated with the given wallet address.
|
|
51
|
+
* @param address - The wallet address whose private key to sign with.
|
|
52
|
+
* @param message - The message string to sign.
|
|
53
|
+
* @returns The ECDSA signature split into its `r` and `s` components, each as a hex string.
|
|
54
|
+
*/
|
|
55
|
+
abstract signMessage(address: string, message: string): Promise<{
|
|
56
|
+
r: string;
|
|
57
|
+
s: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete the key pair associated with the given wallet address.
|
|
61
|
+
* @param address - The wallet address whose key pair to remove.
|
|
62
|
+
*/
|
|
63
|
+
abstract deleteKey(address: string): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { type BiometricPolicy, DeviceSignerKeyStorage };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract storage interface for managing P-256 (secp256r1) device signer key pairs.
|
|
3
|
+
* Implementations handle key generation, persistence, retrieval, signing, and deletion.
|
|
4
|
+
*/
|
|
5
|
+
type BiometricPolicy = "always" | "session" | "none";
|
|
6
|
+
declare abstract class DeviceSignerKeyStorage {
|
|
7
|
+
protected readonly apiKey: string;
|
|
8
|
+
constructor(apiKey: string);
|
|
9
|
+
/**
|
|
10
|
+
* Generate a new P-256 key pair and persist it.
|
|
11
|
+
* @param params - Key generation parameters.
|
|
12
|
+
* @param params.address - Optional wallet address to associate the key with. If omitted, the key
|
|
13
|
+
* should be stored under a temporary identifier until {@link mapAddressToKey} is called.
|
|
14
|
+
* @returns The uncompressed public key encoded as a base64 string.
|
|
15
|
+
*/
|
|
16
|
+
abstract generateKey(params: {
|
|
17
|
+
address?: string;
|
|
18
|
+
biometricPolicy?: Exclude<BiometricPolicy, "session">;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
abstract generateKey(params: {
|
|
21
|
+
address?: string;
|
|
22
|
+
biometricPolicy: "session";
|
|
23
|
+
biometricExpirationTime: number;
|
|
24
|
+
}): Promise<string>;
|
|
25
|
+
abstract generateKey(params: {
|
|
26
|
+
address?: string;
|
|
27
|
+
biometricPolicy?: BiometricPolicy;
|
|
28
|
+
biometricExpirationTime?: number;
|
|
29
|
+
}): Promise<string>;
|
|
30
|
+
/**
|
|
31
|
+
* Associate an already-generated key pair with a wallet address.
|
|
32
|
+
* Used when the wallet address is not yet known at the time of key generation.
|
|
33
|
+
* @param address - The wallet address to map the key to.
|
|
34
|
+
* @param publicKeyBase64 - The base64-encoded public key returned by {@link generateKey}.
|
|
35
|
+
*/
|
|
36
|
+
abstract mapAddressToKey(address: string, publicKeyBase64: string): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve the public key for a given wallet address.
|
|
39
|
+
* @param address - The wallet address whose public key to look up.
|
|
40
|
+
* @returns The base64-encoded public key, or `null` if no key is found for the address.
|
|
41
|
+
*/
|
|
42
|
+
abstract getKey(address: string): Promise<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a key with the given public key exists on this device.
|
|
45
|
+
* @param publicKeyBase64 - The base64-encoded public key to look for.
|
|
46
|
+
* @returns `true` if the key exists on the device, `false` otherwise.
|
|
47
|
+
*/
|
|
48
|
+
abstract hasKey(publicKeyBase64: string): Promise<boolean>;
|
|
49
|
+
/**
|
|
50
|
+
* Sign a message using the private key associated with the given wallet address.
|
|
51
|
+
* @param address - The wallet address whose private key to sign with.
|
|
52
|
+
* @param message - The message string to sign.
|
|
53
|
+
* @returns The ECDSA signature split into its `r` and `s` components, each as a hex string.
|
|
54
|
+
*/
|
|
55
|
+
abstract signMessage(address: string, message: string): Promise<{
|
|
56
|
+
r: string;
|
|
57
|
+
s: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Delete the key pair associated with the given wallet address.
|
|
61
|
+
* @param address - The wallet address whose key pair to remove.
|
|
62
|
+
*/
|
|
63
|
+
abstract deleteKey(address: string): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { type BiometricPolicy, DeviceSignerKeyStorage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../../chunk-RLAW2ERD.js";import"../../chunk-J3R36SGJ.js";export{a as DeviceSignerKeyStorage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkYLRD3ANZcjs = require('../../chunk-YLRD3ANZ.cjs');require('../../chunk-D5YDWSO5.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-S4O54O4C.cjs');require('../../chunk-U7QSF6P7.cjs');require('../../chunk-2GKPWQBQ.cjs');exports.IframeDeviceSignerKeyStorage = _chunkYLRD3ANZcjs.a;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { DeviceSignerKeyStorage } from './DeviceSignerKeyStorage.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Callback invoked before a WebAuthn ceremony to obtain user activation.
|
|
5
|
+
* Implementations should show a UI prompt and resolve when the user interacts (e.g. clicks a button).
|
|
6
|
+
* @param action - The biometric action being requested: `"createCredential"` for wallet creation, `"sign"` for transaction signing.
|
|
7
|
+
*/
|
|
8
|
+
type BiometricRequestHandler = (action: "createCredential" | "sign") => Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* DeviceSignerKeyStorage backed by a hidden iframe.
|
|
11
|
+
* All crypto operations are delegated to the iframe via postMessage RPC,
|
|
12
|
+
* keeping key material isolated in the iframe's origin.
|
|
13
|
+
*/
|
|
14
|
+
declare class IframeDeviceSignerKeyStorage extends DeviceSignerKeyStorage {
|
|
15
|
+
private iframePromise;
|
|
16
|
+
private reloading;
|
|
17
|
+
private readonly iframeUrl;
|
|
18
|
+
private biometricRequestHandler;
|
|
19
|
+
private biometricListener;
|
|
20
|
+
constructor(apiKey: string);
|
|
21
|
+
/**
|
|
22
|
+
* Set a handler that is called before each WebAuthn ceremony to obtain user activation.
|
|
23
|
+
* The handler should show a UI prompt (e.g. PasskeyPrompt) and resolve when the user clicks.
|
|
24
|
+
*/
|
|
25
|
+
setBiometricRequestHandler(handler: BiometricRequestHandler): void;
|
|
26
|
+
generateKey(params?: Parameters<DeviceSignerKeyStorage["generateKey"]>[0]): Promise<string>;
|
|
27
|
+
mapAddressToKey(address: string, publicKeyBase64: string): Promise<void>;
|
|
28
|
+
getKey(address: string): Promise<string | null>;
|
|
29
|
+
hasKey(publicKeyBase64: string): Promise<boolean>;
|
|
30
|
+
signMessage(address: string, message: string): Promise<{
|
|
31
|
+
r: string;
|
|
32
|
+
s: string;
|
|
33
|
+
}>;
|
|
34
|
+
deleteKey(address: string): Promise<void>;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
private rpc;
|
|
37
|
+
private sendRpc;
|
|
38
|
+
/**
|
|
39
|
+
* Destroy the current iframe and create a fresh one.
|
|
40
|
+
* Uses a single-flight pattern to prevent concurrent reloads.
|
|
41
|
+
*/
|
|
42
|
+
private reloadIframe;
|
|
43
|
+
private setupBiometricListener;
|
|
44
|
+
private getIframe;
|
|
45
|
+
private createIframe;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { type BiometricRequestHandler, IframeDeviceSignerKeyStorage };
|