@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
package/dist/chunk-QQNDLR6E.cjs
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunk4GFSUI2Icjs = require('./chunk-4GFSUI2I.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkRHR6P2KPcjs = require('./chunk-RHR6P2KP.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunk2M32LBCAcjs = require('./chunk-2M32LBCA.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
14
|
-
|
|
15
|
-
// src/signers/non-custodial/ncs-signer.ts
|
|
16
|
-
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
17
|
-
var NonCustodialSigner = class {
|
|
18
|
-
constructor(config) {
|
|
19
|
-
this.config = config;
|
|
20
|
-
this._needsAuth = true;
|
|
21
|
-
this._authPromise = null;
|
|
22
|
-
this._initializationPromise = null;
|
|
23
|
-
if (typeof window !== "undefined") {
|
|
24
|
-
this.initialize();
|
|
25
|
-
}
|
|
26
|
-
this.type = this.config.type;
|
|
27
|
-
}
|
|
28
|
-
locator() {
|
|
29
|
-
return this.config.locator;
|
|
30
|
-
}
|
|
31
|
-
address() {
|
|
32
|
-
return this.config.address;
|
|
33
|
-
}
|
|
34
|
-
initialize() {
|
|
35
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
36
|
-
if (this.config.clientTEEConnection == null) {
|
|
37
|
-
const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
|
|
38
|
-
if (!parsedAPIKey.isValid) {
|
|
39
|
-
throw new Error("Invalid API key");
|
|
40
|
-
}
|
|
41
|
-
const iframeManager = new (0, _chunk4GFSUI2Icjs.NcsIframeManager)({
|
|
42
|
-
environment: parsedAPIKey.environment
|
|
43
|
-
});
|
|
44
|
-
this.config.clientTEEConnection = yield iframeManager.initialize();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
getTEEConnection() {
|
|
49
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
50
|
-
if (this.config.clientTEEConnection == null) {
|
|
51
|
-
if (this._initializationPromise) {
|
|
52
|
-
yield this._initializationPromise;
|
|
53
|
-
return this.config.clientTEEConnection;
|
|
54
|
-
}
|
|
55
|
-
this._initializationPromise = this.initializeTEEConnection();
|
|
56
|
-
try {
|
|
57
|
-
yield this._initializationPromise;
|
|
58
|
-
} finally {
|
|
59
|
-
this._initializationPromise = null;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return this.config.clientTEEConnection;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
initializeTEEConnection() {
|
|
66
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
67
|
-
_chunk2M32LBCAcjs.walletsLogger.info("TEE connection not initialized, initializing now");
|
|
68
|
-
const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
|
|
69
|
-
if (!parsedAPIKey.isValid) {
|
|
70
|
-
throw new Error("Invalid API key");
|
|
71
|
-
}
|
|
72
|
-
const iframeManager = new (0, _chunk4GFSUI2Icjs.NcsIframeManager)({
|
|
73
|
-
environment: parsedAPIKey.environment
|
|
74
|
-
});
|
|
75
|
-
this.config.clientTEEConnection = yield iframeManager.initialize();
|
|
76
|
-
if (this.config.clientTEEConnection == null) {
|
|
77
|
-
throw new Error("Failed to initialize TEE connection");
|
|
78
|
-
}
|
|
79
|
-
_chunk2M32LBCAcjs.walletsLogger.info("TEE connection initialized successfully");
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
handleAuthRequired() {
|
|
83
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
84
|
-
var _a, _b;
|
|
85
|
-
const clientTEEConnection = yield this.getTEEConnection();
|
|
86
|
-
if (this.config.onAuthRequired == null) {
|
|
87
|
-
throw new Error(
|
|
88
|
-
`${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
_chunk2M32LBCAcjs.walletsLogger.info("get-status: sending request");
|
|
92
|
-
const startTime = Date.now();
|
|
93
|
-
const signerResponse = yield clientTEEConnection.sendAction({
|
|
94
|
-
event: "request:get-status",
|
|
95
|
-
responseEvent: "response:get-status",
|
|
96
|
-
data: {
|
|
97
|
-
authData: {
|
|
98
|
-
jwt: (_b = (_a = this.config.crossmint.experimental_customAuth) == null ? void 0 : _a.jwt) != null ? _b : "",
|
|
99
|
-
apiKey: this.config.crossmint.apiKey
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
103
|
-
});
|
|
104
|
-
const durationMs = Date.now() - startTime;
|
|
105
|
-
if ((signerResponse == null ? void 0 : signerResponse.status) !== "success") {
|
|
106
|
-
_chunk2M32LBCAcjs.walletsLogger.error("get-status: failed", {
|
|
107
|
-
status: signerResponse == null ? void 0 : signerResponse.status,
|
|
108
|
-
error: signerResponse == null ? void 0 : signerResponse.error,
|
|
109
|
-
durationMs
|
|
110
|
-
});
|
|
111
|
-
throw new Error(signerResponse == null ? void 0 : signerResponse.error);
|
|
112
|
-
}
|
|
113
|
-
_chunk2M32LBCAcjs.walletsLogger.info("get-status: response received", {
|
|
114
|
-
signerStatus: signerResponse.signerStatus,
|
|
115
|
-
durationMs
|
|
116
|
-
});
|
|
117
|
-
if (signerResponse.signerStatus === "ready") {
|
|
118
|
-
this._needsAuth = false;
|
|
119
|
-
return;
|
|
120
|
-
} else {
|
|
121
|
-
this._needsAuth = true;
|
|
122
|
-
}
|
|
123
|
-
_chunk2M32LBCAcjs.walletsLogger.info("Auth required, initiating OTP flow", { needsAuth: this._needsAuth });
|
|
124
|
-
const { promise, resolve, reject } = this.createAuthPromise();
|
|
125
|
-
this._authPromise = { promise, resolve, reject };
|
|
126
|
-
if (this.config.onAuthRequired) {
|
|
127
|
-
try {
|
|
128
|
-
yield this.config.onAuthRequired(
|
|
129
|
-
this._needsAuth,
|
|
130
|
-
() => this.sendMessageWithOtp(),
|
|
131
|
-
(otp) => this.verifyOtp(otp),
|
|
132
|
-
() => _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
133
|
-
_chunk2M32LBCAcjs.walletsLogger.info("Auth rejected", { authRejected: true });
|
|
134
|
-
this._needsAuth = false;
|
|
135
|
-
if (this.config.onAuthRequired != null) {
|
|
136
|
-
yield this.config.onAuthRequired(
|
|
137
|
-
this._needsAuth,
|
|
138
|
-
() => this.sendMessageWithOtp(),
|
|
139
|
-
(otp) => this.verifyOtp(otp),
|
|
140
|
-
() => {
|
|
141
|
-
var _a2;
|
|
142
|
-
return (_a2 = this._authPromise) == null ? void 0 : _a2.reject(new (0, _chunkRHR6P2KPcjs.AuthRejectedError)());
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
reject(new (0, _chunkRHR6P2KPcjs.AuthRejectedError)());
|
|
147
|
-
})
|
|
148
|
-
);
|
|
149
|
-
} catch (error) {
|
|
150
|
-
_chunk2M32LBCAcjs.walletsLogger.error("handleAuthRequired error", { error });
|
|
151
|
-
reject(error);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
try {
|
|
155
|
-
yield promise;
|
|
156
|
-
} catch (error) {
|
|
157
|
-
_chunk2M32LBCAcjs.walletsLogger.error("handleAuthRequired promise error", { error });
|
|
158
|
-
throw error;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
ensureAuthenticated() {
|
|
163
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
164
|
-
yield this.handleAuthRequired();
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
getJwtOrThrow() {
|
|
168
|
-
var _a;
|
|
169
|
-
const jwt = (_a = this.config.crossmint.experimental_customAuth) == null ? void 0 : _a.jwt;
|
|
170
|
-
if (jwt == null) {
|
|
171
|
-
throw new Error("JWT is required");
|
|
172
|
-
}
|
|
173
|
-
return jwt;
|
|
174
|
-
}
|
|
175
|
-
createAuthPromise() {
|
|
176
|
-
let resolvePromise;
|
|
177
|
-
let rejectPromise;
|
|
178
|
-
const promise = new Promise((resolve, reject) => {
|
|
179
|
-
resolvePromise = resolve;
|
|
180
|
-
rejectPromise = reject;
|
|
181
|
-
});
|
|
182
|
-
return { promise, resolve: resolvePromise, reject: rejectPromise };
|
|
183
|
-
}
|
|
184
|
-
sendMessageWithOtp() {
|
|
185
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
186
|
-
var _a, _b, _c;
|
|
187
|
-
const handshakeParent = yield this.getTEEConnection();
|
|
188
|
-
const authId = this.getAuthId();
|
|
189
|
-
_chunk2M32LBCAcjs.walletsLogger.info("start-onboarding: sending request");
|
|
190
|
-
const startTime = Date.now();
|
|
191
|
-
const response = yield handshakeParent.sendAction({
|
|
192
|
-
event: "request:start-onboarding",
|
|
193
|
-
responseEvent: "response:start-onboarding",
|
|
194
|
-
data: {
|
|
195
|
-
authData: {
|
|
196
|
-
jwt: (_b = (_a = this.config.crossmint.experimental_customAuth) == null ? void 0 : _a.jwt) != null ? _b : "",
|
|
197
|
-
apiKey: this.config.crossmint.apiKey
|
|
198
|
-
},
|
|
199
|
-
data: { authId }
|
|
200
|
-
},
|
|
201
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
202
|
-
});
|
|
203
|
-
const durationMs = Date.now() - startTime;
|
|
204
|
-
_chunk2M32LBCAcjs.walletsLogger.info("start-onboarding: response received", {
|
|
205
|
-
status: response == null ? void 0 : response.status,
|
|
206
|
-
durationMs
|
|
207
|
-
});
|
|
208
|
-
if ((response == null ? void 0 : response.status) === "success" && response.signerStatus === "ready") {
|
|
209
|
-
this._needsAuth = false;
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if ((response == null ? void 0 : response.status) === "error") {
|
|
213
|
-
_chunk2M32LBCAcjs.walletsLogger.error("start-onboarding: failed", { error: response.error });
|
|
214
|
-
(_c = this._authPromise) == null ? void 0 : _c.reject(new Error(response.error || "Failed to initiate OTP process."));
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
getAuthId() {
|
|
219
|
-
if (this.config.type === "email") {
|
|
220
|
-
return `email:${this.config.email}`;
|
|
221
|
-
}
|
|
222
|
-
return `phone:${this.config.phone}`;
|
|
223
|
-
}
|
|
224
|
-
verifyOtp(encryptedOtp) {
|
|
225
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
226
|
-
var _a, _b, _c, _d, _e;
|
|
227
|
-
let response;
|
|
228
|
-
try {
|
|
229
|
-
const handshakeParent = yield this.getTEEConnection();
|
|
230
|
-
_chunk2M32LBCAcjs.walletsLogger.info("complete-onboarding: sending request");
|
|
231
|
-
const startTime = Date.now();
|
|
232
|
-
response = yield handshakeParent.sendAction({
|
|
233
|
-
event: "request:complete-onboarding",
|
|
234
|
-
responseEvent: "response:complete-onboarding",
|
|
235
|
-
data: {
|
|
236
|
-
authData: {
|
|
237
|
-
jwt: (_b = (_a = this.config.crossmint.experimental_customAuth) == null ? void 0 : _a.jwt) != null ? _b : "",
|
|
238
|
-
apiKey: this.config.crossmint.apiKey
|
|
239
|
-
},
|
|
240
|
-
data: {
|
|
241
|
-
onboardingAuthentication: { encryptedOtp }
|
|
242
|
-
}
|
|
243
|
-
},
|
|
244
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
245
|
-
});
|
|
246
|
-
_chunk2M32LBCAcjs.walletsLogger.info("complete-onboarding: response received", {
|
|
247
|
-
status: response == null ? void 0 : response.status,
|
|
248
|
-
durationMs: Date.now() - startTime
|
|
249
|
-
});
|
|
250
|
-
} catch (err) {
|
|
251
|
-
_chunk2M32LBCAcjs.walletsLogger.error("complete-onboarding: error", { error: err });
|
|
252
|
-
this._needsAuth = true;
|
|
253
|
-
(_c = this._authPromise) == null ? void 0 : _c.reject(err);
|
|
254
|
-
throw err;
|
|
255
|
-
}
|
|
256
|
-
if ((response == null ? void 0 : response.status) === "success") {
|
|
257
|
-
this._needsAuth = false;
|
|
258
|
-
if (this.config.onAuthRequired != null) {
|
|
259
|
-
yield this.config.onAuthRequired(
|
|
260
|
-
this._needsAuth,
|
|
261
|
-
() => this.sendMessageWithOtp(),
|
|
262
|
-
(otp) => this.verifyOtp(otp),
|
|
263
|
-
() => {
|
|
264
|
-
var _a2;
|
|
265
|
-
return (_a2 = this._authPromise) == null ? void 0 : _a2.reject(new (0, _chunkRHR6P2KPcjs.AuthRejectedError)());
|
|
266
|
-
}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
(_d = this._authPromise) == null ? void 0 : _d.resolve();
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
_chunk2M32LBCAcjs.walletsLogger.error("complete-onboarding: OTP validation failed", { status: response == null ? void 0 : response.status });
|
|
273
|
-
this._needsAuth = true;
|
|
274
|
-
const errorMessage = (response == null ? void 0 : response.status) === "error" ? response.error : "Failed to validate encrypted OTP";
|
|
275
|
-
const error = new Error(errorMessage);
|
|
276
|
-
(_e = this._authPromise) == null ? void 0 : _e.reject(error);
|
|
277
|
-
throw error;
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
/**
|
|
281
|
-
* Export the private key for this signer
|
|
282
|
-
* @throws {Error} If signer is not authenticated
|
|
283
|
-
*/
|
|
284
|
-
_exportPrivateKey(exportTEEConnection) {
|
|
285
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
286
|
-
yield this.handleAuthRequired();
|
|
287
|
-
const jwt = this.getJwtOrThrow();
|
|
288
|
-
const { scheme, encoding } = this.getChainKeyParams();
|
|
289
|
-
const response = yield exportTEEConnection.sendAction({
|
|
290
|
-
event: "request:export-signer",
|
|
291
|
-
responseEvent: "response:export-signer",
|
|
292
|
-
data: {
|
|
293
|
-
authData: {
|
|
294
|
-
jwt,
|
|
295
|
-
apiKey: this.config.crossmint.apiKey
|
|
296
|
-
},
|
|
297
|
-
data: {
|
|
298
|
-
scheme,
|
|
299
|
-
encoding
|
|
300
|
-
}
|
|
301
|
-
},
|
|
302
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
303
|
-
});
|
|
304
|
-
if ((response == null ? void 0 : response.status) === "error") {
|
|
305
|
-
throw new Error(response.error || "Failed to export private key");
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
_chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
|
|
311
|
-
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
312
|
-
logger: _chunk2M32LBCAcjs.walletsLogger,
|
|
313
|
-
methodName: "handleAuthRequired"
|
|
314
|
-
})
|
|
315
|
-
], NonCustodialSigner.prototype, "handleAuthRequired", 1);
|
|
316
|
-
var DEFAULT_EVENT_OPTIONS = {
|
|
317
|
-
timeoutMs: 3e4
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
exports.NonCustodialSigner = NonCustodialSigner; exports.DEFAULT_EVENT_OPTIONS = DEFAULT_EVENT_OPTIONS;
|
package/dist/chunk-RBHGZDDX.cjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
|
|
4
|
-
|
|
5
|
-
// src/utils/signer-validation.ts
|
|
6
|
-
var _commonsdkauth = require('@crossmint/common-sdk-auth');
|
|
7
|
-
var signerConfigMismatchErrorMessage = (fieldPath, newValue, existingValue) => `Wallet signer configuration mismatch at "${fieldPath}" - expected "${existingValue}" from existing wallet but found "${newValue}"`;
|
|
8
|
-
function normalizeEmail(email) {
|
|
9
|
-
const lowerCaseEmail = email.toLowerCase();
|
|
10
|
-
const emailParts = lowerCaseEmail.split("@");
|
|
11
|
-
const domain = emailParts[1];
|
|
12
|
-
const isGoogleMailDomain = domain === "googlemail.com";
|
|
13
|
-
const isGmail = isGoogleMailDomain || domain === "gmail.com";
|
|
14
|
-
const isGmailAndHasDots = isGmail && emailParts[0].includes(".");
|
|
15
|
-
if (isGoogleMailDomain) {
|
|
16
|
-
emailParts[1] = "gmail.com";
|
|
17
|
-
}
|
|
18
|
-
if (isGmailAndHasDots) {
|
|
19
|
-
emailParts[0] = emailParts[0].replace(/\./g, "");
|
|
20
|
-
}
|
|
21
|
-
return `${emailParts[0]}@${emailParts[1]}`;
|
|
22
|
-
}
|
|
23
|
-
function normalizeValueForComparison(value) {
|
|
24
|
-
if (typeof value === "string" && _commonsdkauth.isEmailValid.call(void 0, value)) {
|
|
25
|
-
return normalizeEmail(value);
|
|
26
|
-
}
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
function compareSignerConfigs(newSignerConfig, existingSignerConfig, path = "") {
|
|
30
|
-
if (newSignerConfig === existingSignerConfig) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (newSignerConfig == null || existingSignerConfig == null) {
|
|
34
|
-
throw new Error(`Cannot compare null or undefined signer configs at path: ${path}`);
|
|
35
|
-
}
|
|
36
|
-
for (const key of Object.keys(newSignerConfig)) {
|
|
37
|
-
if (!(key in existingSignerConfig)) {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
const fieldPath = path ? `${path}.${key}` : key;
|
|
41
|
-
const newValue = newSignerConfig[key];
|
|
42
|
-
const existingValue = existingSignerConfig[key];
|
|
43
|
-
if (typeof newValue === "object" && newValue !== null && typeof existingValue === "object" && existingValue !== null) {
|
|
44
|
-
compareSignerConfigs(
|
|
45
|
-
newValue,
|
|
46
|
-
existingValue,
|
|
47
|
-
fieldPath
|
|
48
|
-
);
|
|
49
|
-
} else if (normalizeValueForComparison(newValue) !== normalizeValueForComparison(existingValue)) {
|
|
50
|
-
throw new (0, _chunkXC2V34TScjs.WalletCreationError)(signerConfigMismatchErrorMessage(fieldPath, newValue, existingValue));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
exports.normalizeValueForComparison = normalizeValueForComparison; exports.compareSignerConfigs = compareSignerConfigs;
|
package/dist/chunk-RHR6P2KP.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/signers/types.ts
|
|
2
|
-
var AuthRejectedError = class extends Error {
|
|
3
|
-
constructor() {
|
|
4
|
-
super("Authentication was rejected by the user");
|
|
5
|
-
this.name = "AuthRejectedError";
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
function isExportableSigner(signer) {
|
|
9
|
-
return signer._exportPrivateKey !== void 0;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.AuthRejectedError = AuthRejectedError; exports.isExportableSigner = isExportableSigner;
|
package/dist/chunk-RUQYXEEG.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/signers/server/helpers/get-chain-type.ts
|
|
2
|
-
function getChainType(chain) {
|
|
3
|
-
if (chain === "solana") return "solana";
|
|
4
|
-
if (chain === "stellar") return "stellar";
|
|
5
|
-
return "evm";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.getChainType = getChainType;
|
package/dist/chunk-S2L5Z2ZT.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getChainType
|
|
3
|
-
} from "./chunk-H6WV5NRT.js";
|
|
4
|
-
import {
|
|
5
|
-
deriveKeyBytes
|
|
6
|
-
} from "./chunk-Q52MMQSC.js";
|
|
7
|
-
|
|
8
|
-
// src/signers/server/helpers/derive-server-signer.ts
|
|
9
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
10
|
-
import { bytesToHex } from "@noble/hashes/utils";
|
|
11
|
-
import { Keypair as SolanaKeypair } from "@solana/web3.js";
|
|
12
|
-
import { Keypair as StellarKeypair } from "@stellar/stellar-sdk";
|
|
13
|
-
function deriveServerSignerAddress(keyBytes, chain) {
|
|
14
|
-
const chainType = getChainType(chain);
|
|
15
|
-
switch (chainType) {
|
|
16
|
-
case "evm":
|
|
17
|
-
return privateKeyToAccount(`0x${bytesToHex(keyBytes)}`).address;
|
|
18
|
-
case "solana":
|
|
19
|
-
return SolanaKeypair.fromSeed(keyBytes).publicKey.toBase58();
|
|
20
|
-
case "stellar":
|
|
21
|
-
return StellarKeypair.fromRawEd25519Seed(Buffer.from(keyBytes)).publicKey();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function deriveServerSignerDetails(signer, chain, projectId, environment) {
|
|
25
|
-
if (typeof window !== "undefined") {
|
|
26
|
-
throw new Error("Server signers can only be used from server-side code.");
|
|
27
|
-
}
|
|
28
|
-
const chainStr = typeof chain === "string" ? chain : String(chain);
|
|
29
|
-
const derivedKeyBytes = deriveKeyBytes(signer.secret, projectId, environment, chainStr);
|
|
30
|
-
const derivedAddress = deriveServerSignerAddress(derivedKeyBytes, chain);
|
|
31
|
-
return { derivedKeyBytes, derivedAddress };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
deriveServerSignerAddress,
|
|
36
|
-
deriveServerSignerDetails
|
|
37
|
-
};
|
package/dist/chunk-SGINWAB6.js
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
// src/utils/errors.ts
|
|
2
|
-
import { CrossmintSDKError, WalletErrorCode } from "@crossmint/common-sdk-base";
|
|
3
|
-
var InvalidApiKeyError = class extends CrossmintSDKError {
|
|
4
|
-
constructor(message, details) {
|
|
5
|
-
super(message, WalletErrorCode.API_KEY_INVALID, details);
|
|
6
|
-
}
|
|
7
|
-
};
|
|
8
|
-
var InvalidEnvironmentError = class extends CrossmintSDKError {
|
|
9
|
-
constructor(message, details) {
|
|
10
|
-
super(message, WalletErrorCode.ENVIRONMENT_INVALID, details);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
var WalletTypeNotSupportedError = class extends CrossmintSDKError {
|
|
14
|
-
constructor(message, details) {
|
|
15
|
-
super(message, WalletErrorCode.WALLET_TYPE_INVALID, details);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var WalletNotAvailableError = class extends CrossmintSDKError {
|
|
19
|
-
constructor(message, details) {
|
|
20
|
-
super(message, WalletErrorCode.WALLET_NOT_AVAILABLE, details);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var InvalidWalletConfigError = class extends CrossmintSDKError {
|
|
24
|
-
constructor(message, details) {
|
|
25
|
-
super(message, WalletErrorCode.WALLET_NOT_AVAILABLE, details);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var WalletCreationError = class extends CrossmintSDKError {
|
|
29
|
-
constructor(message, details) {
|
|
30
|
-
super(message, WalletErrorCode.WALLET_CREATION_FAILED, details);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var WalletTypeMismatchError = class extends CrossmintSDKError {
|
|
34
|
-
constructor(message, details) {
|
|
35
|
-
super(message, WalletErrorCode.WALLET_TYPE_INVALID, details);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var SignerTypeMismatchError = class extends CrossmintSDKError {
|
|
39
|
-
constructor(message, details) {
|
|
40
|
-
super(message, WalletErrorCode.SIGNER_INVALID, details);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var InvalidSignerError = class extends CrossmintSDKError {
|
|
44
|
-
constructor(message, details) {
|
|
45
|
-
super(message, WalletErrorCode.SIGNER_INVALID, details);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
var InvalidMessageFormatError = class extends CrossmintSDKError {
|
|
49
|
-
constructor(message, details) {
|
|
50
|
-
super(message, WalletErrorCode.MESSAGE_INVALID, details);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var InvalidTypedDataError = class extends CrossmintSDKError {
|
|
54
|
-
constructor(message, details) {
|
|
55
|
-
super(message, WalletErrorCode.MESSAGE_INVALID, details);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var SignatureNotFoundError = class extends CrossmintSDKError {
|
|
59
|
-
constructor(message, details) {
|
|
60
|
-
super(message, WalletErrorCode.SIGNING_FAILED, details);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var SigningFailedError = class extends CrossmintSDKError {
|
|
64
|
-
constructor(message, details) {
|
|
65
|
-
super(message, WalletErrorCode.SIGNING_FAILED, details);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
var MessageSigningNotSupportedError = class extends CrossmintSDKError {
|
|
69
|
-
constructor(message, details) {
|
|
70
|
-
super(message, WalletErrorCode.SIGNING_FAILED, details);
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
var SignatureNotCreatedError = class extends CrossmintSDKError {
|
|
74
|
-
constructor(message, details) {
|
|
75
|
-
super(message, WalletErrorCode.NO_SIGNATURE, details);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var SignatureNotAvailableError = class extends CrossmintSDKError {
|
|
79
|
-
constructor(message, details) {
|
|
80
|
-
super(message, WalletErrorCode.NO_SIGNATURE, details);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var SignatureFailedError = class extends CrossmintSDKError {
|
|
84
|
-
constructor(message, details) {
|
|
85
|
-
super(message, WalletErrorCode.SIGNING_FAILED, details);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
var TransactionNotCreatedError = class extends CrossmintSDKError {
|
|
89
|
-
constructor(message, details) {
|
|
90
|
-
super(message, WalletErrorCode.NO_TRANSACTION, details);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
var TransactionNotAvailableError = class extends CrossmintSDKError {
|
|
94
|
-
constructor(message, details) {
|
|
95
|
-
super(message, WalletErrorCode.NO_TRANSACTION, details);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var TransactionConfirmationTimeoutError = class extends CrossmintSDKError {
|
|
99
|
-
constructor(message, details) {
|
|
100
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var TransactionSendingFailedError = class extends CrossmintSDKError {
|
|
104
|
-
constructor(message, details) {
|
|
105
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
var TransactionAwaitingApprovalError = class extends CrossmintSDKError {
|
|
109
|
-
constructor(message, details) {
|
|
110
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
var TransactionHashNotFoundError = class extends CrossmintSDKError {
|
|
114
|
-
constructor(message, details) {
|
|
115
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
var TransactionFailedError = class extends CrossmintSDKError {
|
|
119
|
-
constructor(message, details) {
|
|
120
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
var PendingApprovalsError = class extends CrossmintSDKError {
|
|
124
|
-
constructor(message, details) {
|
|
125
|
-
super(message, WalletErrorCode.TRANSACTION_FAILED, details);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export {
|
|
130
|
-
InvalidApiKeyError,
|
|
131
|
-
InvalidEnvironmentError,
|
|
132
|
-
WalletTypeNotSupportedError,
|
|
133
|
-
WalletNotAvailableError,
|
|
134
|
-
InvalidWalletConfigError,
|
|
135
|
-
WalletCreationError,
|
|
136
|
-
WalletTypeMismatchError,
|
|
137
|
-
SignerTypeMismatchError,
|
|
138
|
-
InvalidSignerError,
|
|
139
|
-
InvalidMessageFormatError,
|
|
140
|
-
InvalidTypedDataError,
|
|
141
|
-
SignatureNotFoundError,
|
|
142
|
-
SigningFailedError,
|
|
143
|
-
MessageSigningNotSupportedError,
|
|
144
|
-
SignatureNotCreatedError,
|
|
145
|
-
SignatureNotAvailableError,
|
|
146
|
-
SignatureFailedError,
|
|
147
|
-
TransactionNotCreatedError,
|
|
148
|
-
TransactionNotAvailableError,
|
|
149
|
-
TransactionConfirmationTimeoutError,
|
|
150
|
-
TransactionSendingFailedError,
|
|
151
|
-
TransactionAwaitingApprovalError,
|
|
152
|
-
TransactionHashNotFoundError,
|
|
153
|
-
TransactionFailedError,
|
|
154
|
-
PendingApprovalsError
|
|
155
|
-
};
|
package/dist/chunk-T5NKL6F4.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_EVENT_OPTIONS,
|
|
3
|
-
NonCustodialSigner
|
|
4
|
-
} from "./chunk-FZQG6OX2.js";
|
|
5
|
-
import {
|
|
6
|
-
walletsLogger
|
|
7
|
-
} from "./chunk-XEPUH4XH.js";
|
|
8
|
-
import {
|
|
9
|
-
__async
|
|
10
|
-
} from "./chunk-ASE2FXWP.js";
|
|
11
|
-
|
|
12
|
-
// src/signers/non-custodial/ncs-evm-signer.ts
|
|
13
|
-
import { PersonalMessage } from "ox";
|
|
14
|
-
import { isHex, toHex } from "viem";
|
|
15
|
-
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends NonCustodialSigner {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
signMessage(message) {
|
|
20
|
-
return __async(this, null, function* () {
|
|
21
|
-
const messageRaw = isHex(message) ? message : toHex(message);
|
|
22
|
-
const messageToSign = PersonalMessage.getSignPayload(messageRaw);
|
|
23
|
-
return yield this.sign(messageToSign);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
signTransaction(transaction) {
|
|
27
|
-
return __async(this, null, function* () {
|
|
28
|
-
return yield this.sign(transaction);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
sign(raw) {
|
|
32
|
-
return __async(this, null, function* () {
|
|
33
|
-
var _a;
|
|
34
|
-
yield this.handleAuthRequired();
|
|
35
|
-
const jwt = this.getJwtOrThrow();
|
|
36
|
-
const hexString = raw.replace("0x", "");
|
|
37
|
-
walletsLogger.info("sign: sending request", { keyType: "secp256k1" });
|
|
38
|
-
const startTime = Date.now();
|
|
39
|
-
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
40
|
-
event: "request:sign",
|
|
41
|
-
responseEvent: "response:sign",
|
|
42
|
-
data: {
|
|
43
|
-
authData: {
|
|
44
|
-
jwt,
|
|
45
|
-
apiKey: this.config.crossmint.apiKey
|
|
46
|
-
},
|
|
47
|
-
data: {
|
|
48
|
-
keyType: "secp256k1",
|
|
49
|
-
bytes: hexString,
|
|
50
|
-
encoding: "hex"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
options: DEFAULT_EVENT_OPTIONS
|
|
54
|
-
});
|
|
55
|
-
walletsLogger.info("sign: response received", {
|
|
56
|
-
status: res == null ? void 0 : res.status,
|
|
57
|
-
durationMs: Date.now() - startTime
|
|
58
|
-
});
|
|
59
|
-
if ((res == null ? void 0 : res.status) === "error") {
|
|
60
|
-
throw new Error(res.error);
|
|
61
|
-
}
|
|
62
|
-
if ((res == null ? void 0 : res.signature) == null) {
|
|
63
|
-
throw new Error("Failed to sign transaction");
|
|
64
|
-
}
|
|
65
|
-
_EVMNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
|
|
66
|
-
return { signature: res.signature.bytes };
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
static verifyPublicKeyFormat(publicKey) {
|
|
70
|
-
if (publicKey == null) {
|
|
71
|
-
throw new Error("No public key found");
|
|
72
|
-
}
|
|
73
|
-
if (publicKey.encoding !== "hex" || publicKey.keyType !== "secp256k1" || publicKey.bytes == null) {
|
|
74
|
-
throw new Error(
|
|
75
|
-
"Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: " + JSON.stringify(publicKey)
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
getChainKeyParams() {
|
|
80
|
-
return {
|
|
81
|
-
scheme: "secp256k1",
|
|
82
|
-
encoding: "hex"
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export {
|
|
88
|
-
EVMNonCustodialSigner
|
|
89
|
-
};
|