@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-U56Z2EOR.cjs
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkQQNDLR6Ecjs = require('./chunk-QQNDLR6E.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunk2M32LBCAcjs = require('./chunk-2M32LBCA.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
11
|
-
|
|
12
|
-
// src/signers/non-custodial/ncs-evm-signer.ts
|
|
13
|
-
var _ox = require('ox');
|
|
14
|
-
var _viem = require('viem');
|
|
15
|
-
var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends _chunkQQNDLR6Ecjs.NonCustodialSigner {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
signMessage(message) {
|
|
20
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
21
|
-
const messageRaw = _viem.isHex.call(void 0, message) ? message : _viem.toHex.call(void 0, message);
|
|
22
|
-
const messageToSign = _ox.PersonalMessage.getSignPayload(messageRaw);
|
|
23
|
-
return yield this.sign(messageToSign);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
signTransaction(transaction) {
|
|
27
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
28
|
-
return yield this.sign(transaction);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
sign(raw) {
|
|
32
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
33
|
-
var _a;
|
|
34
|
-
yield this.handleAuthRequired();
|
|
35
|
-
const jwt = this.getJwtOrThrow();
|
|
36
|
-
const hexString = raw.replace("0x", "");
|
|
37
|
-
_chunk2M32LBCAcjs.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: _chunkQQNDLR6Ecjs.DEFAULT_EVENT_OPTIONS
|
|
54
|
-
});
|
|
55
|
-
_chunk2M32LBCAcjs.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
|
-
|
|
88
|
-
|
|
89
|
-
exports.EVMNonCustodialSigner = EVMNonCustodialSigner;
|
package/dist/chunk-UO2J2ZB2.cjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __typeError = (msg) => {
|
|
9
|
-
throw TypeError(msg);
|
|
10
|
-
};
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
25
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
26
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
27
|
-
if (decorator = decorators[i])
|
|
28
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
29
|
-
if (kind && result) __defProp(target, key, result);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
33
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
34
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
35
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
36
|
-
var __async = (__this, __arguments, generator) => {
|
|
37
|
-
return new Promise((resolve, reject) => {
|
|
38
|
-
var fulfilled = (value) => {
|
|
39
|
-
try {
|
|
40
|
-
step(generator.next(value));
|
|
41
|
-
} catch (e) {
|
|
42
|
-
reject(e);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
var rejected = (value) => {
|
|
46
|
-
try {
|
|
47
|
-
step(generator.throw(value));
|
|
48
|
-
} catch (e) {
|
|
49
|
-
reject(e);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__decorateClass = __decorateClass; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__async = __async;
|
package/dist/chunk-VLZ5ZS5U.js
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
InvalidApiKeyError
|
|
3
|
-
} from "./chunk-SGINWAB6.js";
|
|
4
|
-
import {
|
|
5
|
-
walletsLogger
|
|
6
|
-
} from "./chunk-XEPUH4XH.js";
|
|
7
|
-
import {
|
|
8
|
-
SDK_NAME,
|
|
9
|
-
SDK_VERSION
|
|
10
|
-
} from "./chunk-GLUD6EBN.js";
|
|
11
|
-
import {
|
|
12
|
-
__async
|
|
13
|
-
} from "./chunk-ASE2FXWP.js";
|
|
14
|
-
|
|
15
|
-
// src/api/client.ts
|
|
16
|
-
import {
|
|
17
|
-
APIKeyEnvironmentPrefix,
|
|
18
|
-
APIKeyUsageOrigin,
|
|
19
|
-
CrossmintApiClient
|
|
20
|
-
} from "@crossmint/common-sdk-base";
|
|
21
|
-
var ApiClient = class extends CrossmintApiClient {
|
|
22
|
-
constructor(crossmint) {
|
|
23
|
-
super(crossmint, {
|
|
24
|
-
internalConfig: {
|
|
25
|
-
sdkMetadata: { name: SDK_NAME, version: SDK_VERSION }
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
this.apiPrefix = "api/2025-06-09/wallets";
|
|
29
|
-
this.legacyApiPrefix = "api/2022-06-09/wallets";
|
|
30
|
-
}
|
|
31
|
-
createWallet(params) {
|
|
32
|
-
return __async(this, null, function* () {
|
|
33
|
-
const path = this.isServerSide ? `${this.apiPrefix}` : `${this.apiPrefix}/me`;
|
|
34
|
-
walletsLogger.info("wallets.api.createWallet", {
|
|
35
|
-
chainType: params.chainType,
|
|
36
|
-
walletType: params.type
|
|
37
|
-
});
|
|
38
|
-
const response = yield this.post(path, {
|
|
39
|
-
body: JSON.stringify(params),
|
|
40
|
-
headers: this.headers
|
|
41
|
-
});
|
|
42
|
-
const result = yield response.json();
|
|
43
|
-
if ("error" in result) {
|
|
44
|
-
walletsLogger.error("wallets.api.createWallet.error", {
|
|
45
|
-
error: result.error,
|
|
46
|
-
chainType: params.chainType
|
|
47
|
-
});
|
|
48
|
-
} else if ("address" in result) {
|
|
49
|
-
walletsLogger.info("wallets.api.createWallet.success", {
|
|
50
|
-
address: result.address,
|
|
51
|
-
chainType: params.chainType
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
getWallet(locator) {
|
|
58
|
-
return __async(this, null, function* () {
|
|
59
|
-
walletsLogger.info("wallets.api.getWallet", { locator });
|
|
60
|
-
const response = yield this.get(`${this.apiPrefix}/${locator}`, {
|
|
61
|
-
headers: this.headers
|
|
62
|
-
});
|
|
63
|
-
const result = yield response.json();
|
|
64
|
-
if ("error" in result) {
|
|
65
|
-
walletsLogger.warn("wallets.api.getWallet.error", {
|
|
66
|
-
locator,
|
|
67
|
-
error: result.error
|
|
68
|
-
});
|
|
69
|
-
} else if ("address" in result) {
|
|
70
|
-
walletsLogger.info("wallets.api.getWallet.success", result);
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
createTransaction(walletLocator, params) {
|
|
76
|
-
return __async(this, null, function* () {
|
|
77
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/transactions`, {
|
|
78
|
-
body: JSON.stringify(params),
|
|
79
|
-
headers: this.headers
|
|
80
|
-
});
|
|
81
|
-
return response.json();
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
approveTransaction(walletLocator, transactionId, params) {
|
|
85
|
-
return __async(this, null, function* () {
|
|
86
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/transactions/${transactionId}/approvals`, {
|
|
87
|
-
body: JSON.stringify(params),
|
|
88
|
-
headers: this.headers
|
|
89
|
-
});
|
|
90
|
-
return response.json();
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
getTransaction(walletLocator, transactionId) {
|
|
94
|
-
return __async(this, null, function* () {
|
|
95
|
-
const response = yield this.get(`${this.apiPrefix}/${walletLocator}/transactions/${transactionId}`, {
|
|
96
|
-
headers: this.headers
|
|
97
|
-
});
|
|
98
|
-
return response.json();
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
createSignature(walletLocator, params) {
|
|
102
|
-
return __async(this, null, function* () {
|
|
103
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/signatures`, {
|
|
104
|
-
body: JSON.stringify(params),
|
|
105
|
-
headers: this.headers
|
|
106
|
-
});
|
|
107
|
-
return response.json();
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
approveSignature(walletLocator, signatureId, params) {
|
|
111
|
-
return __async(this, null, function* () {
|
|
112
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/signatures/${signatureId}/approvals`, {
|
|
113
|
-
body: JSON.stringify(params),
|
|
114
|
-
headers: this.headers
|
|
115
|
-
});
|
|
116
|
-
return response.json();
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
getSignature(walletLocator, signatureId) {
|
|
120
|
-
return __async(this, null, function* () {
|
|
121
|
-
const response = yield this.get(`${this.apiPrefix}/${walletLocator}/signatures/${signatureId}`, {
|
|
122
|
-
headers: this.headers
|
|
123
|
-
});
|
|
124
|
-
return response.json();
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
getTransactions(walletLocator) {
|
|
128
|
-
return __async(this, null, function* () {
|
|
129
|
-
const response = yield this.get(`${this.apiPrefix}/${walletLocator}/transactions`, {
|
|
130
|
-
headers: this.headers
|
|
131
|
-
});
|
|
132
|
-
return response.json();
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
experimental_getNfts(params) {
|
|
136
|
-
return __async(this, null, function* () {
|
|
137
|
-
const queryParams = new URLSearchParams();
|
|
138
|
-
queryParams.append("page", params.page.toString());
|
|
139
|
-
queryParams.append("perPage", params.perPage.toString());
|
|
140
|
-
const identifier = `${params.chain}:${params.address}`;
|
|
141
|
-
const response = yield this.get(`${this.apiPrefix}/${identifier}/nfts?${queryParams.toString()}`, {
|
|
142
|
-
headers: this.headers
|
|
143
|
-
});
|
|
144
|
-
return response.json();
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
experimental_activity(walletLocator, params) {
|
|
148
|
-
return __async(this, null, function* () {
|
|
149
|
-
let legacyLocator = walletLocator;
|
|
150
|
-
if (!this.isServerSide) {
|
|
151
|
-
legacyLocator = `me:${params.chain === "solana" ? "solana-smart-wallet" : "evm-smart-wallet"}`;
|
|
152
|
-
}
|
|
153
|
-
const queryParams = new URLSearchParams();
|
|
154
|
-
queryParams.append("chain", params.chain.toString());
|
|
155
|
-
const response = yield this.get(`${this.legacyApiPrefix}/${legacyLocator}/activity?${queryParams.toString()}`, {
|
|
156
|
-
headers: this.headers
|
|
157
|
-
});
|
|
158
|
-
return response.json();
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
getBalance(walletLocator, params) {
|
|
162
|
-
return __async(this, null, function* () {
|
|
163
|
-
const queryParams = new URLSearchParams();
|
|
164
|
-
queryParams.append("tokens", params.tokens.join(","));
|
|
165
|
-
queryParams.append("chains", params.chains.join(","));
|
|
166
|
-
const response = yield this.get(`${this.apiPrefix}/${walletLocator}/balances?${queryParams.toString()}`, {
|
|
167
|
-
headers: this.headers
|
|
168
|
-
});
|
|
169
|
-
return response.json();
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
fundWallet(walletLocator, params) {
|
|
173
|
-
return __async(this, null, function* () {
|
|
174
|
-
if (this.environment === APIKeyEnvironmentPrefix.PRODUCTION) {
|
|
175
|
-
throw new Error("Funding wallets is only supported in staging environment");
|
|
176
|
-
}
|
|
177
|
-
const response = yield this.post(`api/v1-alpha2/wallets/${walletLocator}/balances`, {
|
|
178
|
-
body: JSON.stringify(params),
|
|
179
|
-
headers: this.headers
|
|
180
|
-
});
|
|
181
|
-
return response.json();
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
registerSigner(walletLocator, params) {
|
|
185
|
-
return __async(this, null, function* () {
|
|
186
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/signers`, {
|
|
187
|
-
body: JSON.stringify(params),
|
|
188
|
-
headers: this.headers
|
|
189
|
-
});
|
|
190
|
-
return response.json();
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
getSigner(walletLocator, signer) {
|
|
194
|
-
return __async(this, null, function* () {
|
|
195
|
-
const response = yield this.get(`${this.apiPrefix}/${walletLocator}/signers/${signer}`, {
|
|
196
|
-
headers: this.headers
|
|
197
|
-
});
|
|
198
|
-
return response.json();
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
send(walletLocator, tokenLocator, params) {
|
|
202
|
-
return __async(this, null, function* () {
|
|
203
|
-
walletsLogger.info("wallets.api.send", {
|
|
204
|
-
walletLocator,
|
|
205
|
-
tokenLocator,
|
|
206
|
-
recipient: params.recipient
|
|
207
|
-
});
|
|
208
|
-
const response = yield this.post(`${this.apiPrefix}/${walletLocator}/tokens/${tokenLocator}/transfers`, {
|
|
209
|
-
body: JSON.stringify(params),
|
|
210
|
-
headers: this.headers
|
|
211
|
-
});
|
|
212
|
-
const result = yield response.json();
|
|
213
|
-
if ("error" in result) {
|
|
214
|
-
walletsLogger.error("wallets.api.send.error", {
|
|
215
|
-
walletLocator,
|
|
216
|
-
tokenLocator,
|
|
217
|
-
error: result.error
|
|
218
|
-
});
|
|
219
|
-
} else if ("id" in result) {
|
|
220
|
-
walletsLogger.info("wallets.api.send.success", {
|
|
221
|
-
walletLocator,
|
|
222
|
-
transactionId: result.id
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
return result;
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
get isServerSide() {
|
|
229
|
-
return this.parsedAPIKey.usageOrigin === APIKeyUsageOrigin.SERVER;
|
|
230
|
-
}
|
|
231
|
-
get environment() {
|
|
232
|
-
if (!this.parsedAPIKey.isValid) {
|
|
233
|
-
throw new InvalidApiKeyError("Invalid API key");
|
|
234
|
-
}
|
|
235
|
-
return this.parsedAPIKey.environment;
|
|
236
|
-
}
|
|
237
|
-
get projectId() {
|
|
238
|
-
if (!this.parsedAPIKey.isValid) {
|
|
239
|
-
throw new InvalidApiKeyError("Invalid API key");
|
|
240
|
-
}
|
|
241
|
-
return this.parsedAPIKey.projectId;
|
|
242
|
-
}
|
|
243
|
-
get headers() {
|
|
244
|
-
const headers = {
|
|
245
|
-
"Content-Type": "application/json"
|
|
246
|
-
};
|
|
247
|
-
return headers;
|
|
248
|
-
}
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
export {
|
|
252
|
-
ApiClient
|
|
253
|
-
};
|
package/dist/chunk-VTF3WCXG.cjs
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkQQNDLR6Ecjs = require('./chunk-QQNDLR6E.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunk2M32LBCAcjs = require('./chunk-2M32LBCA.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
|
|
11
|
-
|
|
12
|
-
// src/signers/non-custodial/ncs-solana-signer.ts
|
|
13
|
-
var _web3js = require('@solana/web3.js');
|
|
14
|
-
var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
|
|
15
|
-
var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkQQNDLR6Ecjs.NonCustodialSigner {
|
|
16
|
-
constructor(config) {
|
|
17
|
-
super(config);
|
|
18
|
-
}
|
|
19
|
-
signMessage() {
|
|
20
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
21
|
-
return yield Promise.reject(new Error("signMessage method not implemented for email signer"));
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
signTransaction(transaction) {
|
|
25
|
-
return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
|
|
26
|
-
var _a;
|
|
27
|
-
yield this.handleAuthRequired();
|
|
28
|
-
const jwt = this.getJwtOrThrow();
|
|
29
|
-
const transactionBytes = _bs582.default.decode(transaction);
|
|
30
|
-
const deserializedTransaction = _web3js.VersionedTransaction.deserialize(transactionBytes);
|
|
31
|
-
const messageData = deserializedTransaction.message.serialize();
|
|
32
|
-
_chunk2M32LBCAcjs.walletsLogger.info("sign: sending request", { keyType: "ed25519" });
|
|
33
|
-
const startTime = Date.now();
|
|
34
|
-
const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
|
|
35
|
-
event: "request:sign",
|
|
36
|
-
responseEvent: "response:sign",
|
|
37
|
-
data: {
|
|
38
|
-
authData: {
|
|
39
|
-
jwt,
|
|
40
|
-
apiKey: this.config.crossmint.apiKey
|
|
41
|
-
},
|
|
42
|
-
data: {
|
|
43
|
-
keyType: "ed25519",
|
|
44
|
-
bytes: _bs582.default.encode(messageData),
|
|
45
|
-
encoding: "base58"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
options: _chunkQQNDLR6Ecjs.DEFAULT_EVENT_OPTIONS
|
|
49
|
-
});
|
|
50
|
-
_chunk2M32LBCAcjs.walletsLogger.info("sign: response received", {
|
|
51
|
-
status: res == null ? void 0 : res.status,
|
|
52
|
-
durationMs: Date.now() - startTime
|
|
53
|
-
});
|
|
54
|
-
if ((res == null ? void 0 : res.status) === "error") {
|
|
55
|
-
throw new Error(res.error);
|
|
56
|
-
}
|
|
57
|
-
if ((res == null ? void 0 : res.signature) == null) {
|
|
58
|
-
throw new Error("Failed to sign transaction");
|
|
59
|
-
}
|
|
60
|
-
_SolanaNonCustodialSigner.verifyPublicKeyFormat(res.publicKey);
|
|
61
|
-
return { signature: res.signature.bytes };
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
static verifyPublicKeyFormat(publicKey) {
|
|
65
|
-
if (publicKey == null) {
|
|
66
|
-
throw new Error("No public key found");
|
|
67
|
-
}
|
|
68
|
-
if (publicKey.encoding !== "base58" || publicKey.keyType !== "ed25519" || publicKey.bytes == null) {
|
|
69
|
-
throw new Error(
|
|
70
|
-
"Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: " + JSON.stringify(publicKey)
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
getChainKeyParams() {
|
|
75
|
-
return {
|
|
76
|
-
scheme: "ed25519",
|
|
77
|
-
encoding: "base58"
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
exports.SolanaNonCustodialSigner = SolanaNonCustodialSigner;
|