@crossmint/wallets-sdk 0.21.0 → 1.0.0-beta.3
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.d.cts +2 -1
- package/dist/chains/chains.d.ts +2 -1
- 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-24JKRXBH.js +1 -0
- package/dist/chunk-2C3AOHCT.cjs +1 -0
- package/dist/chunk-2GKPWQBQ.cjs +1 -0
- package/dist/chunk-2JW6HKFK.js +1 -0
- package/dist/chunk-2RNAWXXS.js +1 -0
- package/dist/chunk-2YLRFJ66.js +1 -0
- package/dist/chunk-36OMUNL3.js +1 -0
- package/dist/chunk-3OGAQBMG.cjs +1 -0
- package/dist/chunk-3VYGTPRF.cjs +1 -0
- package/dist/chunk-4ADZVYB5.cjs +1 -0
- package/dist/chunk-4GTMI5ZT.js +1 -0
- package/dist/chunk-4JWRQRKA.cjs +1 -0
- package/dist/chunk-575WRSRN.js +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-6EZCCLTK.cjs +1 -0
- package/dist/chunk-6FGJ3ICD.js +1 -0
- package/dist/chunk-6MGMZ3SI.cjs +1 -0
- package/dist/chunk-6TYV7ADO.js +1 -0
- package/dist/chunk-7VUOD7EI.cjs +1 -0
- package/dist/chunk-A33BEWR7.cjs +1 -0
- package/dist/chunk-CUHDOBKN.cjs +1 -0
- package/dist/chunk-DIGDDKSF.js +1 -0
- package/dist/chunk-E7B6R3GF.cjs +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-EXC7TCGL.js +1 -0
- package/dist/chunk-F2KLBYRR.cjs +1 -0
- package/dist/chunk-FOINTZC5.cjs +1 -0
- package/dist/chunk-FT5EVMLB.js +1 -0
- package/dist/chunk-G5R6VQGJ.js +1 -0
- package/dist/chunk-GEY574TH.cjs +1 -0
- package/dist/chunk-GOXB2RBF.js +1 -0
- package/dist/chunk-HMELCNK6.js +1 -0
- package/dist/chunk-HRUMWG2F.cjs +1 -0
- package/dist/chunk-IOSADDL5.js +1 -0
- package/dist/chunk-IR5WN6FQ.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-JDDMCB6P.js +1 -0
- package/dist/chunk-JDTKL2XR.js +1 -0
- package/dist/chunk-JINIR3YK.cjs +1 -0
- package/dist/chunk-JJ72GFYU.cjs +1 -0
- package/dist/chunk-JJMKQ5PK.cjs +1 -0
- package/dist/chunk-K5TQ4QU3.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-LEALJLNK.js +1 -0
- package/dist/chunk-LZNQBJEK.cjs +1 -0
- package/dist/chunk-MMFZP54X.js +1 -0
- package/dist/chunk-MTK3HWXV.js +1 -0
- package/dist/chunk-N5WVT7QE.js +1 -0
- package/dist/chunk-NJWSHT2H.cjs +1 -0
- package/dist/chunk-NX256LAH.cjs +1 -0
- package/dist/chunk-O5D3H7CZ.cjs +1 -0
- package/dist/chunk-O6VBO7KG.js +1 -0
- package/dist/chunk-OQZTL6ZG.js +1 -0
- package/dist/chunk-PDHWPAGW.js +1 -0
- package/dist/chunk-PKYRYRX4.js +1 -0
- package/dist/chunk-QBS76CBT.cjs +1 -0
- package/dist/chunk-QY5OHQW4.cjs +1 -0
- package/dist/chunk-RBKG6QLZ.js +1 -0
- package/dist/chunk-RC6KDONJ.cjs +1 -0
- package/dist/chunk-RR6DWIRN.js +1 -0
- package/dist/chunk-RXRRXB74.cjs +1 -0
- package/dist/chunk-S3DYQVRD.js +1 -0
- package/dist/chunk-SCEPJO4Q.cjs +1 -0
- package/dist/chunk-SH7KRBXV.js +1 -0
- package/dist/chunk-SMADCELI.js +1 -0
- package/dist/chunk-SPTXAOFR.cjs +1 -0
- package/dist/chunk-STYSP6KL.cjs +1 -0
- package/dist/chunk-SVIKBM3S.js +1 -0
- package/dist/chunk-T3U46LK3.cjs +1 -0
- package/dist/chunk-TOAFCAVT.js +0 -0
- package/dist/chunk-TTSJFEM5.cjs +1 -0
- package/dist/chunk-UE3WVHTM.cjs +1 -0
- package/dist/chunk-USL4YOIR.cjs +1 -0
- package/dist/chunk-VA26VSUQ.cjs +1 -0
- package/dist/chunk-VV6374MW.cjs +1 -0
- package/dist/chunk-W5EH3HYF.cjs +1 -0
- package/dist/chunk-W6V7WGBL.js +1 -0
- package/dist/chunk-W7LJS32A.js +1 -0
- package/dist/chunk-WBIKVPHW.js +1 -0
- package/dist/chunk-WCGUGIGJ.js +1 -0
- package/dist/chunk-WP4V3OCS.cjs +1 -0
- package/dist/chunk-WT5MDUZY.js +1 -0
- package/dist/chunk-XNZLCUTY.js +1 -0
- package/dist/chunk-XS5B3TUE.js +1 -0
- package/dist/chunk-YGL4ITFK.cjs +1 -0
- package/dist/chunk-YIO5XXQ4.js +1 -0
- package/dist/chunk-YPHM2V2G.cjs +1 -0
- package/dist/chunk-ZE4NT3CJ.js +1 -0
- package/dist/chunk-ZIFTCPCX.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 +21 -19
- package/dist/sdk.d.ts +21 -19
- 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 +7 -3
- package/dist/signers/evm-api-key.d.ts +7 -3
- 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 +12 -13
- package/dist/signers/evm-external-wallet.d.ts +12 -13
- 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 +6 -2
- package/dist/signers/index.d.ts +6 -2
- package/dist/signers/index.js +1 -33
- package/dist/signers/non-custodial/index.cjs +1 -27
- package/dist/signers/non-custodial/index.d.cts +6 -2
- package/dist/signers/non-custodial/index.d.ts +6 -2
- 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 +6 -2
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +6 -2
- 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 +7 -3
- package/dist/signers/non-custodial/ncs-signer.d.ts +7 -3
- 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 +6 -2
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +6 -2
- 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 +6 -2
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +6 -2
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -13
- package/dist/signers/passkey.cjs +1 -7
- package/dist/signers/passkey.d.cts +7 -3
- package/dist/signers/passkey.d.ts +7 -3
- 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 +5 -1
- package/dist/signers/server/assemble-server-signer.d.ts +5 -1
- 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 +7 -3
- package/dist/signers/server/evm-server-signer.d.ts +7 -3
- 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 +5 -1
- package/dist/signers/server/helpers/derive-server-signer.d.ts +5 -1
- 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 +5 -1
- package/dist/signers/server/helpers/index.d.ts +5 -1
- package/dist/signers/server/helpers/index.js +1 -15
- package/dist/signers/server/index.cjs +1 -29
- package/dist/signers/server/index.d.cts +5 -1
- package/dist/signers/server/index.d.ts +5 -1
- 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 +7 -3
- package/dist/signers/server/solana-server-signer.d.ts +7 -3
- 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 +7 -3
- package/dist/signers/server/stellar-server-signer.d.ts +7 -3
- 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 +7 -3
- package/dist/signers/solana-api-key.d.ts +7 -3
- 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 +9 -10
- package/dist/signers/solana-external-wallet.d.ts +9 -10
- 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 +9 -9
- package/dist/signers/stellar-external-wallet.d.ts +9 -9
- 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-BaHy48kd.d.ts +427 -0
- package/dist/types-Dz8JNP4U.d.cts +427 -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 +72 -0
- package/dist/utils/device-signers/DeviceSignerKeyStorage.d.ts +72 -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 +51 -0
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.d.ts +51 -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 +28 -0
- package/dist/utils/device-signers/createDeviceSigner.d.ts +28 -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.d.cts +11 -2
- package/dist/utils/errors.d.ts +11 -2
- 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.d.cts +6 -4
- package/dist/utils/signer-validation.d.ts +6 -4
- 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 +8 -8
- package/dist/wallets/__tests__/test-helpers.d.ts +8 -8
- package/dist/wallets/__tests__/test-helpers.js +1 -102
- package/dist/wallets/evm.cjs +1 -34
- package/dist/wallets/evm.d.cts +6 -7
- package/dist/wallets/evm.d.ts +6 -7
- package/dist/wallets/evm.js +1 -34
- package/dist/wallets/solana.cjs +1 -35
- package/dist/wallets/solana.d.cts +8 -7
- package/dist/wallets/solana.d.ts +8 -7
- package/dist/wallets/solana.js +1 -35
- package/dist/wallets/stellar.cjs +1 -34
- package/dist/wallets/stellar.d.cts +5 -6
- package/dist/wallets/stellar.d.ts +5 -6
- 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 +14 -10
- package/dist/wallets/wallet-factory.d.ts +14 -10
- package/dist/wallets/wallet-factory.js +1 -42
- package/dist/wallets/wallet.cjs +1 -33
- package/dist/wallets/wallet.d.cts +132 -34
- package/dist/wallets/wallet.d.ts +132 -34
- 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-2I2OFGNL.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "./chunk-ASE2FXWP.js";
|
|
4
|
-
|
|
5
|
-
// src/signers/solana-api-key.ts
|
|
6
|
-
var SolanaApiKeySigner = class {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.type = "api-key";
|
|
10
|
-
}
|
|
11
|
-
locator() {
|
|
12
|
-
return this.config.locator;
|
|
13
|
-
}
|
|
14
|
-
signMessage() {
|
|
15
|
-
return __async(this, null, function* () {
|
|
16
|
-
return yield Promise.reject(
|
|
17
|
-
new Error(
|
|
18
|
-
"API key signers do not support direct message signing - signatures are handled automatically by the backend"
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
signTransaction() {
|
|
24
|
-
return __async(this, null, function* () {
|
|
25
|
-
return yield Promise.reject(
|
|
26
|
-
new Error(
|
|
27
|
-
"API key signers do not support direct transaction signing - transaction are handled automatically by the backend"
|
|
28
|
-
)
|
|
29
|
-
);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
SolanaApiKeySigner
|
|
36
|
-
};
|
package/dist/chunk-2M32LBCA.cjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunk3WZUNLYIcjs = require('./chunk-3WZUNLYI.cjs');
|
|
5
|
-
|
|
6
|
-
// src/logger/init.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
14
|
-
var walletsLogger = new (0, _commonsdkbase.SdkLogger)();
|
|
15
|
-
function initWalletsLogger(apiKey) {
|
|
16
|
-
const platform = _commonsdkbase.detectPlatform.call(void 0, );
|
|
17
|
-
const validationResult = _commonsdkbase.validateAPIKey.call(void 0, apiKey);
|
|
18
|
-
if (!validationResult.isValid) {
|
|
19
|
-
throw new Error(`Invalid API key: ${validationResult.message}`);
|
|
20
|
-
}
|
|
21
|
-
const { environment, projectId } = validationResult;
|
|
22
|
-
walletsLogger.init({
|
|
23
|
-
packageName: _chunk3WZUNLYIcjs.SDK_NAME,
|
|
24
|
-
packageVersion: _chunk3WZUNLYIcjs.SDK_VERSION,
|
|
25
|
-
environment,
|
|
26
|
-
projectId,
|
|
27
|
-
platform
|
|
28
|
-
});
|
|
29
|
-
switch (platform) {
|
|
30
|
-
case "browser": {
|
|
31
|
-
const sink = new (0, _commonsdkbase.BrowserDatadogSink)(environment);
|
|
32
|
-
walletsLogger.addSink(sink);
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
case "react-native": {
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case "server": {
|
|
39
|
-
const sink = new (0, _commonsdkbase.ServerDatadogSink)(environment);
|
|
40
|
-
walletsLogger.addSink(sink);
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
default: {
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
exports.walletsLogger = walletsLogger; exports.initWalletsLogger = initWalletsLogger;
|
package/dist/chunk-2PSAUSOG.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
compareSignerConfigs,
|
|
3
|
-
normalizeValueForComparison
|
|
4
|
-
} from "./chunk-ZP4ZZCIE.js";
|
|
5
|
-
import {
|
|
6
|
-
Wallet
|
|
7
|
-
} from "./chunk-VVPGO564.js";
|
|
8
|
-
import {
|
|
9
|
-
assembleSigner
|
|
10
|
-
} from "./chunk-EVR4CD53.js";
|
|
11
|
-
import {
|
|
12
|
-
deriveServerSignerDetails
|
|
13
|
-
} from "./chunk-S2L5Z2ZT.js";
|
|
14
|
-
import {
|
|
15
|
-
validateChainForEnvironment
|
|
16
|
-
} from "./chunk-X4SPF4KJ.js";
|
|
17
|
-
import {
|
|
18
|
-
WalletCreationError,
|
|
19
|
-
WalletNotAvailableError
|
|
20
|
-
} from "./chunk-SGINWAB6.js";
|
|
21
|
-
import {
|
|
22
|
-
walletsLogger
|
|
23
|
-
} from "./chunk-XEPUH4XH.js";
|
|
24
|
-
import {
|
|
25
|
-
__async,
|
|
26
|
-
__decorateClass,
|
|
27
|
-
__spreadProps,
|
|
28
|
-
__spreadValues
|
|
29
|
-
} from "./chunk-ASE2FXWP.js";
|
|
30
|
-
|
|
31
|
-
// src/wallets/wallet-factory.ts
|
|
32
|
-
import { WithLoggerContext } from "@crossmint/common-sdk-base";
|
|
33
|
-
import { WebAuthnP256 } from "ox";
|
|
34
|
-
var DELEGATED_SIGNER_MISMATCH_ERROR = "When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.";
|
|
35
|
-
var WalletFactory = class {
|
|
36
|
-
constructor(apiClient) {
|
|
37
|
-
this.apiClient = apiClient;
|
|
38
|
-
}
|
|
39
|
-
getOrCreateWallet(args) {
|
|
40
|
-
return __async(this, null, function* () {
|
|
41
|
-
if (this.apiClient.isServerSide) {
|
|
42
|
-
walletsLogger.error("walletFactory.getOrCreateWallet.error", {
|
|
43
|
-
error: "getOrCreateWallet can only be called from client-side code"
|
|
44
|
-
});
|
|
45
|
-
throw new WalletCreationError(
|
|
46
|
-
"getOrCreateWallet can only be called from client-side code.\n- Make sure you're running this in the browser (or another client environment), not on your server.\n- Use your Crossmint Client API Key (not a server key)."
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
|
|
50
|
-
const locator = this.getWalletLocator(args);
|
|
51
|
-
walletsLogger.info("walletFactory.getOrCreateWallet.start");
|
|
52
|
-
const existingWallet = yield this.apiClient.getWallet(locator);
|
|
53
|
-
if (existingWallet != null && !("error" in existingWallet)) {
|
|
54
|
-
walletsLogger.info("walletFactory.getOrCreateWallet.existing", {
|
|
55
|
-
address: existingWallet.address
|
|
56
|
-
});
|
|
57
|
-
return this.createWalletInstance(existingWallet, args);
|
|
58
|
-
}
|
|
59
|
-
walletsLogger.info("walletFactory.getOrCreateWallet.creating");
|
|
60
|
-
return this.createWalletInternal(args);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
getWallet(walletLocator, args) {
|
|
64
|
-
return __async(this, null, function* () {
|
|
65
|
-
if (!this.apiClient.isServerSide) {
|
|
66
|
-
walletsLogger.error("walletFactory.getWallet.error", {
|
|
67
|
-
error: "getWallet is not supported on client side"
|
|
68
|
-
});
|
|
69
|
-
throw new WalletCreationError("getWallet is not supported on client side, use getOrCreateWallet instead");
|
|
70
|
-
}
|
|
71
|
-
args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
|
|
72
|
-
walletsLogger.info("walletFactory.getWallet.start");
|
|
73
|
-
const existingWallet = yield this.apiClient.getWallet(walletLocator);
|
|
74
|
-
if ("error" in existingWallet) {
|
|
75
|
-
walletsLogger.warn("walletFactory.getWallet.notFound", {
|
|
76
|
-
error: existingWallet.error
|
|
77
|
-
});
|
|
78
|
-
throw new WalletNotAvailableError(JSON.stringify(existingWallet));
|
|
79
|
-
}
|
|
80
|
-
walletsLogger.info("walletFactory.getWallet.success", {
|
|
81
|
-
address: existingWallet.address
|
|
82
|
-
});
|
|
83
|
-
return this.createWalletInstance(existingWallet, args);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
createWallet(args) {
|
|
87
|
-
return __async(this, null, function* () {
|
|
88
|
-
args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
|
|
89
|
-
return this.createWalletInternal(args);
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
createWalletInternal(args) {
|
|
93
|
-
return __async(this, null, function* () {
|
|
94
|
-
var _a, _b, _c, _d, _e, _f;
|
|
95
|
-
yield (_c = (_b = (_a = args.options) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onWalletCreationStart) == null ? void 0 : _c.call(_b);
|
|
96
|
-
walletsLogger.info("walletFactory.createWallet.start");
|
|
97
|
-
this.mutateSignerFromCustomAuth(args, true);
|
|
98
|
-
let adminSigner;
|
|
99
|
-
const delegatedSigners = (_d = args.delegatedSigners) == null ? void 0 : _d.map((ds) => ({
|
|
100
|
-
signer: typeof ds.signer === "object" && ds.signer.type === "server" ? `server:${deriveServerSignerDetails(ds.signer, args.chain, this.apiClient.projectId, this.apiClient.environment).derivedAddress}` : ds.signer
|
|
101
|
-
}));
|
|
102
|
-
if (args.signer.type === "passkey") {
|
|
103
|
-
adminSigner = yield this.createPasskeyAdminSigner(args.signer);
|
|
104
|
-
} else if (args.signer.type === "server") {
|
|
105
|
-
const { derivedAddress } = deriveServerSignerDetails(
|
|
106
|
-
args.signer,
|
|
107
|
-
args.chain,
|
|
108
|
-
this.apiClient.projectId,
|
|
109
|
-
this.apiClient.environment
|
|
110
|
-
);
|
|
111
|
-
adminSigner = { type: "server", address: derivedAddress };
|
|
112
|
-
} else {
|
|
113
|
-
adminSigner = args.signer;
|
|
114
|
-
}
|
|
115
|
-
const walletResponse = yield this.apiClient.createWallet({
|
|
116
|
-
type: "smart",
|
|
117
|
-
chainType: this.getChainType(args.chain),
|
|
118
|
-
config: __spreadValues(__spreadValues({
|
|
119
|
-
adminSigner
|
|
120
|
-
}, (args == null ? void 0 : args.plugins) ? { plugins: args.plugins } : {}), delegatedSigners != null ? { delegatedSigners } : {}),
|
|
121
|
-
owner: (_e = args.owner) != null ? _e : void 0,
|
|
122
|
-
alias: (_f = args.alias) != null ? _f : void 0
|
|
123
|
-
});
|
|
124
|
-
if ("error" in walletResponse) {
|
|
125
|
-
walletsLogger.error("walletFactory.createWallet.error", {
|
|
126
|
-
error: walletResponse.error
|
|
127
|
-
});
|
|
128
|
-
throw new WalletCreationError(JSON.stringify(walletResponse));
|
|
129
|
-
}
|
|
130
|
-
walletsLogger.info("walletFactory.createWallet.success", {
|
|
131
|
-
address: walletResponse.address
|
|
132
|
-
});
|
|
133
|
-
return this.createWalletInstance(walletResponse, args);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
createWalletInstance(walletResponse, args) {
|
|
137
|
-
this.validateExistingWalletConfig(walletResponse, args);
|
|
138
|
-
const signerConfig = this.toInternalSignerConfig(walletResponse, args.signer, args.chain, args.options);
|
|
139
|
-
return new Wallet(
|
|
140
|
-
{
|
|
141
|
-
chain: args.chain,
|
|
142
|
-
address: walletResponse.address,
|
|
143
|
-
owner: walletResponse.owner,
|
|
144
|
-
signer: assembleSigner(args.chain, signerConfig),
|
|
145
|
-
options: args.options,
|
|
146
|
-
alias: args.alias
|
|
147
|
-
},
|
|
148
|
-
this.apiClient
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
toInternalSignerConfig(walletResponse, signerArgs, chain, options) {
|
|
152
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
153
|
-
if (!(walletResponse.chainType === "evm" || walletResponse.chainType === "solana" || walletResponse.chainType === "stellar")) {
|
|
154
|
-
throw new WalletCreationError(`Wallet type ${walletResponse.chainType} is not supported`);
|
|
155
|
-
}
|
|
156
|
-
if (signerArgs == null && ((_a = walletResponse.config) == null ? void 0 : _a.adminSigner) == null) {
|
|
157
|
-
throw new WalletCreationError("Signer is required to create a wallet");
|
|
158
|
-
}
|
|
159
|
-
switch (signerArgs.type) {
|
|
160
|
-
case "api-key": {
|
|
161
|
-
if (((_b = walletResponse.config) == null ? void 0 : _b.adminSigner.type) !== "api-key") {
|
|
162
|
-
throw new WalletCreationError("API key signer does not match the wallet's signer type");
|
|
163
|
-
}
|
|
164
|
-
return {
|
|
165
|
-
type: "api-key",
|
|
166
|
-
address: walletResponse.config.adminSigner.address,
|
|
167
|
-
locator: walletResponse.config.adminSigner.locator
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
case "external-wallet":
|
|
171
|
-
if (((_c = walletResponse.config) == null ? void 0 : _c.adminSigner.type) !== "external-wallet") {
|
|
172
|
-
throw new WalletCreationError("External wallet signer does not match the wallet's signer type");
|
|
173
|
-
}
|
|
174
|
-
return __spreadValues(__spreadValues({}, walletResponse.config.adminSigner), signerArgs);
|
|
175
|
-
case "passkey":
|
|
176
|
-
if (((_d = walletResponse.config) == null ? void 0 : _d.adminSigner.type) !== "passkey") {
|
|
177
|
-
throw new WalletCreationError("Passkey signer does not match the wallet's signer type");
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
type: "passkey",
|
|
181
|
-
id: walletResponse.config.adminSigner.id,
|
|
182
|
-
name: walletResponse.config.adminSigner.name,
|
|
183
|
-
locator: walletResponse.config.adminSigner.locator,
|
|
184
|
-
onCreatePasskey: signerArgs.onCreatePasskey,
|
|
185
|
-
onSignWithPasskey: signerArgs.onSignWithPasskey
|
|
186
|
-
};
|
|
187
|
-
case "server": {
|
|
188
|
-
const serverAdminSigner = (_e = walletResponse.config) == null ? void 0 : _e.adminSigner;
|
|
189
|
-
if ((serverAdminSigner == null ? void 0 : serverAdminSigner.type) !== "server") {
|
|
190
|
-
throw new WalletCreationError("Server signer expects a server admin signer on the wallet");
|
|
191
|
-
}
|
|
192
|
-
const { derivedKeyBytes, derivedAddress } = deriveServerSignerDetails(
|
|
193
|
-
signerArgs,
|
|
194
|
-
chain,
|
|
195
|
-
this.apiClient.projectId,
|
|
196
|
-
this.apiClient.environment
|
|
197
|
-
);
|
|
198
|
-
if (serverAdminSigner.address !== derivedAddress) {
|
|
199
|
-
throw new WalletCreationError(
|
|
200
|
-
`Server signer address ${derivedAddress} does not match the wallet's admin signer address`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
return {
|
|
204
|
-
type: "server",
|
|
205
|
-
derivedKeyBytes,
|
|
206
|
-
locator: serverAdminSigner.locator,
|
|
207
|
-
address: derivedAddress
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
case "email": {
|
|
211
|
-
if (((_f = walletResponse.config) == null ? void 0 : _f.adminSigner.type) !== "email") {
|
|
212
|
-
throw new WalletCreationError("Email signer does not match the wallet's signer type");
|
|
213
|
-
}
|
|
214
|
-
const { locator, email, address } = walletResponse.config.adminSigner;
|
|
215
|
-
return {
|
|
216
|
-
type: "email",
|
|
217
|
-
email,
|
|
218
|
-
locator,
|
|
219
|
-
address,
|
|
220
|
-
crossmint: this.apiClient.crossmint,
|
|
221
|
-
onAuthRequired: signerArgs.onAuthRequired,
|
|
222
|
-
clientTEEConnection: options == null ? void 0 : options.clientTEEConnection
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
case "phone": {
|
|
226
|
-
if (((_g = walletResponse.config) == null ? void 0 : _g.adminSigner.type) !== "phone") {
|
|
227
|
-
throw new WalletCreationError("Phone signer does not match the wallet's signer type");
|
|
228
|
-
}
|
|
229
|
-
const { locator, phone, address } = walletResponse.config.adminSigner;
|
|
230
|
-
return {
|
|
231
|
-
type: "phone",
|
|
232
|
-
phone,
|
|
233
|
-
locator,
|
|
234
|
-
address,
|
|
235
|
-
crossmint: this.apiClient.crossmint,
|
|
236
|
-
onAuthRequired: signerArgs.onAuthRequired,
|
|
237
|
-
clientTEEConnection: options == null ? void 0 : options.clientTEEConnection
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
default:
|
|
241
|
-
throw new Error("Invalid signer type");
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
getWalletLocator(args) {
|
|
245
|
-
return `me:${this.getChainType(args.chain)}:smart` + (args.alias != null ? `:alias:${args.alias}` : "");
|
|
246
|
-
}
|
|
247
|
-
createPasskeyAdminSigner(signer) {
|
|
248
|
-
return __async(this, null, function* () {
|
|
249
|
-
var _a;
|
|
250
|
-
if (signer.type !== "passkey") {
|
|
251
|
-
throw new Error("Signer is not a passkey");
|
|
252
|
-
}
|
|
253
|
-
const passkeyName = (_a = signer.name) != null ? _a : `Crossmint Wallet ${Date.now()}`;
|
|
254
|
-
const passkeyCredential = signer.onCreatePasskey ? yield signer.onCreatePasskey(passkeyName) : yield WebAuthnP256.createCredential({ name: passkeyName });
|
|
255
|
-
return {
|
|
256
|
-
type: "passkey",
|
|
257
|
-
id: passkeyCredential.id,
|
|
258
|
-
name: passkeyName,
|
|
259
|
-
publicKey: {
|
|
260
|
-
x: passkeyCredential.publicKey.x.toString(),
|
|
261
|
-
y: passkeyCredential.publicKey.y.toString()
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
mutateSignerFromCustomAuth(args, isNewWalletSigner = false) {
|
|
267
|
-
var _a, _b;
|
|
268
|
-
const { experimental_customAuth } = this.apiClient.crossmint;
|
|
269
|
-
if (args.signer.type === "email" && (experimental_customAuth == null ? void 0 : experimental_customAuth.email) != null) {
|
|
270
|
-
args.signer.email = (_a = args.signer.email) != null ? _a : experimental_customAuth.email;
|
|
271
|
-
}
|
|
272
|
-
if (args.signer.type === "phone" && (experimental_customAuth == null ? void 0 : experimental_customAuth.phone) != null) {
|
|
273
|
-
args.signer.phone = (_b = args.signer.phone) != null ? _b : experimental_customAuth.phone;
|
|
274
|
-
}
|
|
275
|
-
if (args.signer.type === "external-wallet" && (experimental_customAuth == null ? void 0 : experimental_customAuth.externalWalletSigner) != null) {
|
|
276
|
-
args.signer = isNewWalletSigner ? {
|
|
277
|
-
type: "external-wallet",
|
|
278
|
-
address: experimental_customAuth.externalWalletSigner.address
|
|
279
|
-
} : experimental_customAuth.externalWalletSigner;
|
|
280
|
-
}
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
validateExistingWalletConfig(existingWallet, args) {
|
|
284
|
-
var _a;
|
|
285
|
-
this.mutateSignerFromCustomAuth(args);
|
|
286
|
-
if (args.owner != null && existingWallet.owner != null && normalizeValueForComparison(args.owner) !== normalizeValueForComparison(existingWallet.owner)) {
|
|
287
|
-
throw new WalletCreationError("Wallet owner does not match existing wallet's linked user");
|
|
288
|
-
}
|
|
289
|
-
if (args.chain === "solana" && existingWallet.chainType !== "solana" || args.chain !== "solana" && existingWallet.chainType === "solana" || args.chain === "stellar" && existingWallet.chainType !== "stellar" || args.chain !== "stellar" && existingWallet.chainType === "stellar") {
|
|
290
|
-
throw new WalletCreationError(
|
|
291
|
-
`Wallet chain does not match existing wallet's chain. You must use chain: ${existingWallet.chainType}.`
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
if (existingWallet.type !== "smart") {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
const adminSignerArgs = args.signer;
|
|
298
|
-
const existingWalletSigner = (_a = existingWallet == null ? void 0 : existingWallet.config) == null ? void 0 : _a.adminSigner;
|
|
299
|
-
if (adminSignerArgs != null && existingWalletSigner != null) {
|
|
300
|
-
if (adminSignerArgs.type !== existingWalletSigner.type) {
|
|
301
|
-
throw new WalletCreationError(
|
|
302
|
-
"The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type"
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
|
-
compareSignerConfigs(adminSignerArgs, existingWalletSigner);
|
|
306
|
-
}
|
|
307
|
-
if (args.delegatedSigners != null) {
|
|
308
|
-
this.validateDelegatedSigners(existingWallet, args.delegatedSigners, args.chain);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
validateDelegatedSigners(existingWallet, inputDelegatedSigners, chain) {
|
|
312
|
-
var _a;
|
|
313
|
-
const existingDelegatedSigners = (_a = existingWallet == null ? void 0 : existingWallet.config) == null ? void 0 : _a.delegatedSigners;
|
|
314
|
-
if (inputDelegatedSigners.length === 0) {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
if (existingDelegatedSigners == null || existingDelegatedSigners.length === 0) {
|
|
318
|
-
throw new WalletCreationError(
|
|
319
|
-
`${inputDelegatedSigners.length} delegated signer(s) specified, but wallet "${existingWallet.address}" has no delegated signers. ${DELEGATED_SIGNER_MISMATCH_ERROR}`
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
for (const argSigner of inputDelegatedSigners) {
|
|
323
|
-
const resolvedSigner = typeof argSigner.signer === "object" && argSigner.signer.type === "server" ? `server:${deriveServerSignerDetails(argSigner.signer, chain, this.apiClient.projectId, this.apiClient.environment).derivedAddress}` : argSigner.signer;
|
|
324
|
-
const matchingExistingSigner = existingDelegatedSigners.find(
|
|
325
|
-
(existingSigner) => existingSigner.locator === resolvedSigner
|
|
326
|
-
);
|
|
327
|
-
if (matchingExistingSigner == null) {
|
|
328
|
-
const walletSigners = existingDelegatedSigners.map((s) => s.locator).join(", ");
|
|
329
|
-
throw new WalletCreationError(
|
|
330
|
-
`Delegated signer '${resolvedSigner}' does not exist in wallet "${existingWallet.address}". Available delegated signers: ${walletSigners}. ${DELEGATED_SIGNER_MISMATCH_ERROR}`
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
getChainType(chain) {
|
|
336
|
-
if (chain === "solana") {
|
|
337
|
-
return "solana";
|
|
338
|
-
}
|
|
339
|
-
if (chain === "stellar") {
|
|
340
|
-
return "stellar";
|
|
341
|
-
}
|
|
342
|
-
return "evm";
|
|
343
|
-
}
|
|
344
|
-
};
|
|
345
|
-
__decorateClass([
|
|
346
|
-
WithLoggerContext({
|
|
347
|
-
logger: walletsLogger,
|
|
348
|
-
methodName: "walletFactory.getOrCreateWallet",
|
|
349
|
-
buildContext(_thisArg, args) {
|
|
350
|
-
const walletArgs = args[0];
|
|
351
|
-
return { chain: walletArgs.chain, signerType: walletArgs.signer.type };
|
|
352
|
-
}
|
|
353
|
-
})
|
|
354
|
-
], WalletFactory.prototype, "getOrCreateWallet", 1);
|
|
355
|
-
__decorateClass([
|
|
356
|
-
WithLoggerContext({
|
|
357
|
-
logger: walletsLogger,
|
|
358
|
-
methodName: "walletFactory.getWallet",
|
|
359
|
-
buildContext(_thisArg, args) {
|
|
360
|
-
const walletLocator = args[0];
|
|
361
|
-
const walletArgs = args[1];
|
|
362
|
-
return { walletLocator, chain: walletArgs.chain };
|
|
363
|
-
}
|
|
364
|
-
})
|
|
365
|
-
], WalletFactory.prototype, "getWallet", 1);
|
|
366
|
-
__decorateClass([
|
|
367
|
-
WithLoggerContext({
|
|
368
|
-
logger: walletsLogger,
|
|
369
|
-
methodName: "walletFactory.createWallet",
|
|
370
|
-
buildContext(_thisArg, args) {
|
|
371
|
-
const walletArgs = args[0];
|
|
372
|
-
return { chain: walletArgs.chain, signerType: walletArgs.signer.type };
|
|
373
|
-
}
|
|
374
|
-
})
|
|
375
|
-
], WalletFactory.prototype, "createWallet", 1);
|
|
376
|
-
|
|
377
|
-
export {
|
|
378
|
-
WalletFactory
|
|
379
|
-
};
|
package/dist/chunk-2RG6642I.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "./chunk-ASE2FXWP.js";
|
|
4
|
-
|
|
5
|
-
// src/signers/server/stellar-server-signer.ts
|
|
6
|
-
import { Keypair } from "@stellar/stellar-sdk";
|
|
7
|
-
var StellarServerSigner = class {
|
|
8
|
-
constructor(config) {
|
|
9
|
-
this.type = "server";
|
|
10
|
-
this.keypair = Keypair.fromRawEd25519Seed(Buffer.from(config.derivedKeyBytes));
|
|
11
|
-
this._address = this.keypair.publicKey();
|
|
12
|
-
this._locator = config.locator;
|
|
13
|
-
}
|
|
14
|
-
address() {
|
|
15
|
-
return this._address;
|
|
16
|
-
}
|
|
17
|
-
locator() {
|
|
18
|
-
return this._locator;
|
|
19
|
-
}
|
|
20
|
-
signMessage(message) {
|
|
21
|
-
return __async(this, null, function* () {
|
|
22
|
-
if (!/^[A-Za-z0-9+/]*={0,2}$/.test(message)) {
|
|
23
|
-
throw new Error("StellarServerSigner.signMessage: expected a base64-encoded string");
|
|
24
|
-
}
|
|
25
|
-
const messageBytes = Buffer.from(message, "base64");
|
|
26
|
-
const signatureBytes = this.keypair.sign(messageBytes);
|
|
27
|
-
return { signature: signatureBytes.toString("base64") };
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
signTransaction(transaction) {
|
|
31
|
-
return __async(this, null, function* () {
|
|
32
|
-
return yield this.signMessage(transaction);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
StellarServerSigner
|
|
39
|
-
};
|
package/dist/chunk-2T5HHKUI.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// src/chains/definitions/story.ts
|
|
2
|
-
import { defineChain } from "viem";
|
|
3
|
-
var story = defineChain({
|
|
4
|
-
id: 1514,
|
|
5
|
-
name: "Story",
|
|
6
|
-
nativeCurrency: {
|
|
7
|
-
decimals: 18,
|
|
8
|
-
name: "IP Token",
|
|
9
|
-
symbol: "IP"
|
|
10
|
-
},
|
|
11
|
-
rpcUrls: {
|
|
12
|
-
default: { http: ["https://mainnet.storyrpc.io"] }
|
|
13
|
-
},
|
|
14
|
-
testnet: false
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
story
|
|
19
|
-
};
|
package/dist/chunk-3U6UAYOV.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// src/chains/definitions/storyTestnet.ts
|
|
2
|
-
import { defineChain } from "viem";
|
|
3
|
-
var storyTestnet = defineChain({
|
|
4
|
-
id: 1513,
|
|
5
|
-
name: "Story Testnet",
|
|
6
|
-
nativeCurrency: {
|
|
7
|
-
decimals: 18,
|
|
8
|
-
name: "IP",
|
|
9
|
-
symbol: "IP"
|
|
10
|
-
},
|
|
11
|
-
rpcUrls: {
|
|
12
|
-
default: { http: ["https://testnet.storyrpc.io"] }
|
|
13
|
-
},
|
|
14
|
-
blockExplorers: {
|
|
15
|
-
default: {
|
|
16
|
-
name: "Story Testnet Explorer",
|
|
17
|
-
url: "https://testnet.storyscan.xyz"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
testnet: true
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
storyTestnet
|
|
25
|
-
};
|
package/dist/chunk-3WZUNLYI.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
|
|
2
|
-
var name = "@crossmint/wallets-sdk";
|
|
3
|
-
var version = "0.21.0";
|
|
4
|
-
|
|
5
|
-
// src/utils/constants.ts
|
|
6
|
-
var WALLETS_SERVICE = "WALLETS_SDK";
|
|
7
|
-
var SDK_VERSION = version;
|
|
8
|
-
var SDK_NAME = name;
|
|
9
|
-
var STATUS_POLLING_INTERVAL_MS = 500;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.WALLETS_SERVICE = WALLETS_SERVICE; exports.SDK_VERSION = SDK_VERSION; exports.SDK_NAME = SDK_NAME; exports.STATUS_POLLING_INTERVAL_MS = STATUS_POLLING_INTERVAL_MS;
|
package/dist/chunk-47WKYTRN.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__async
|
|
3
|
-
} from "./chunk-ASE2FXWP.js";
|
|
4
|
-
|
|
5
|
-
// src/signers/evm-external-wallet.ts
|
|
6
|
-
var EVMExternalWalletSigner = class {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.type = "external-wallet";
|
|
10
|
-
if (config.address == null) {
|
|
11
|
-
throw new Error("Please provide an address for the External Wallet Signer");
|
|
12
|
-
}
|
|
13
|
-
this._address = config.address;
|
|
14
|
-
this.provider = config.provider;
|
|
15
|
-
this.viemAccount = config.viemAccount;
|
|
16
|
-
}
|
|
17
|
-
address() {
|
|
18
|
-
return this._address;
|
|
19
|
-
}
|
|
20
|
-
locator() {
|
|
21
|
-
return this.config.locator;
|
|
22
|
-
}
|
|
23
|
-
signMessage(message) {
|
|
24
|
-
return __async(this, null, function* () {
|
|
25
|
-
var _a;
|
|
26
|
-
if (this.provider != null) {
|
|
27
|
-
const signature = yield this.provider.request({
|
|
28
|
-
method: "personal_sign",
|
|
29
|
-
params: [message, this._address]
|
|
30
|
-
});
|
|
31
|
-
if (signature == null) {
|
|
32
|
-
throw new Error(
|
|
33
|
-
"[EVMExternalWalletSigner] Failed to sign message: EIP1193 provider signMessage returned null"
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
return { signature };
|
|
37
|
-
}
|
|
38
|
-
if (((_a = this.viemAccount) == null ? void 0 : _a.signMessage) != null) {
|
|
39
|
-
const signature = yield this.viemAccount.signMessage({
|
|
40
|
-
message: {
|
|
41
|
-
raw: message
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
if (signature == null) {
|
|
45
|
-
throw new Error(
|
|
46
|
-
"[EVMExternalWalletSigner] Failed to sign message: Viem account signMessage returned null"
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
return { signature };
|
|
50
|
-
}
|
|
51
|
-
throw new Error("No signer provider or viem account provided");
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
signTransaction(transaction) {
|
|
55
|
-
return __async(this, null, function* () {
|
|
56
|
-
return yield this.signMessage(transaction);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export {
|
|
62
|
-
EVMExternalWalletSigner
|
|
63
|
-
};
|