@crossmint/wallets-sdk 1.0.0 → 1.0.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 +221 -0
- package/dist/api/__tests__/constants.cjs +1 -0
- package/dist/api/__tests__/constants.d.cts +104 -0
- package/dist/api/__tests__/constants.d.ts +104 -0
- package/dist/api/__tests__/constants.js +1 -0
- package/dist/api/__tests__/test-utils.cjs +1 -0
- package/dist/api/__tests__/test-utils.d.cts +105 -0
- package/dist/api/__tests__/test-utils.d.ts +105 -0
- package/dist/api/__tests__/test-utils.js +1 -0
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.d.cts +42 -40
- package/dist/api/client.d.ts +42 -40
- package/dist/api/client.js +1 -1
- package/dist/api/gen/client.gen.cjs +1 -1
- package/dist/api/gen/client.gen.js +1 -1
- package/dist/api/gen/index.cjs +1 -1
- package/dist/api/gen/index.d.cts +2 -2
- package/dist/api/gen/index.d.ts +2 -2
- package/dist/api/gen/index.js +1 -1
- package/dist/api/gen/sdk.gen.cjs +1 -1
- package/dist/api/gen/sdk.gen.d.cts +123 -48
- package/dist/api/gen/sdk.gen.d.ts +123 -48
- package/dist/api/gen/sdk.gen.js +1 -1
- package/dist/api/gen/types.gen.d.cts +9810 -2353
- package/dist/api/gen/types.gen.d.ts +9810 -2353
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.d.cts +10 -1
- package/dist/api/index.d.ts +10 -1
- package/dist/api/index.js +1 -1
- package/dist/api/types.cjs +1 -0
- package/dist/api/types.d.cts +11 -0
- package/dist/api/types.d.ts +11 -0
- package/dist/api/types.js +1 -0
- package/dist/chains/chains.cjs +1 -0
- package/dist/chains/chains.d.cts +29 -0
- package/dist/chains/chains.d.ts +29 -0
- package/dist/chains/chains.js +1 -0
- package/dist/chains/definitions/arcTestnet.cjs +1 -0
- package/dist/chains/definitions/arcTestnet.d.cts +43 -0
- package/dist/chains/definitions/arcTestnet.d.ts +43 -0
- package/dist/chains/definitions/arcTestnet.js +1 -0
- package/dist/chains/definitions/story.cjs +1 -0
- package/dist/chains/definitions/story.d.cts +49 -0
- package/dist/chains/definitions/story.d.ts +49 -0
- package/dist/chains/definitions/story.js +1 -0
- package/dist/chains/definitions/storyTestnet.cjs +1 -0
- package/dist/chains/definitions/storyTestnet.d.cts +43 -0
- package/dist/chains/definitions/storyTestnet.d.ts +43 -0
- package/dist/chains/definitions/storyTestnet.js +1 -0
- package/dist/chains/definitions/tempo.cjs +1 -0
- package/dist/chains/definitions/tempo.d.cts +39 -0
- package/dist/chains/definitions/tempo.d.ts +39 -0
- package/dist/chains/definitions/tempo.js +1 -0
- package/dist/chains/definitions/tempoTestnet.cjs +1 -0
- package/dist/chains/definitions/tempoTestnet.d.cts +39 -0
- package/dist/chains/definitions/tempoTestnet.d.ts +39 -0
- package/dist/chains/definitions/tempoTestnet.js +1 -0
- package/dist/chunk-2DANZH3R.js +1 -0
- package/dist/chunk-2GKPWQBQ.cjs +1 -0
- package/dist/chunk-2YLRFJ66.js +1 -0
- package/dist/chunk-3FY5QWEA.cjs +1 -0
- package/dist/chunk-3SVXPFSP.cjs +1 -0
- package/dist/chunk-3TRQCN5N.cjs +1 -0
- package/dist/chunk-3VRN3GKQ.js +1 -0
- package/dist/chunk-3VSFHDFH.cjs +1 -0
- package/dist/chunk-3VYGTPRF.cjs +1 -0
- package/dist/chunk-4DJWSV7I.cjs +1 -0
- package/dist/chunk-4GEI6CKB.js +1 -0
- package/dist/chunk-4KN3NJMT.cjs +1 -0
- package/dist/chunk-4YR5EP32.cjs +1 -0
- package/dist/chunk-5FH7WFWL.cjs +1 -0
- package/dist/chunk-5IFDVB4Y.js +0 -0
- package/dist/chunk-5LWJMR24.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-6HXIZLEQ.cjs +1 -0
- package/dist/chunk-6X5JEJD7.js +1 -0
- package/dist/chunk-A33BEWR7.cjs +1 -0
- package/dist/chunk-B5TANOHX.cjs +1 -0
- package/dist/chunk-B6GZ3H2H.js +1 -0
- package/dist/chunk-BITOMWYZ.js +1 -0
- package/dist/chunk-CAZWAHBL.cjs +1 -0
- package/dist/chunk-CBKN4SEV.js +1 -0
- package/dist/chunk-CCIGWTAO.cjs +1 -0
- package/dist/chunk-CEV4NP5X.cjs +1 -0
- package/dist/chunk-CKZYSQOK.js +1 -0
- package/dist/chunk-CUHDOBKN.cjs +1 -0
- package/dist/chunk-D6SLJ5C2.cjs +1 -0
- package/dist/chunk-DIGDDKSF.js +1 -0
- package/dist/chunk-ECAM5KTH.cjs +1 -0
- package/dist/chunk-EE4ITUGS.js +1 -0
- package/dist/chunk-EM3D5Q3A.js +1 -0
- package/dist/chunk-ENU3EKBG.cjs +1 -0
- package/dist/chunk-EXC7TCGL.js +1 -0
- package/dist/chunk-FT5EVMLB.js +1 -0
- package/dist/chunk-GEY3BU62.cjs +1 -0
- package/dist/chunk-GEY574TH.cjs +1 -0
- package/dist/chunk-GOXB2RBF.js +1 -0
- package/dist/chunk-GZP2JQ6P.cjs +1 -0
- package/dist/chunk-HRUMWG2F.cjs +1 -0
- package/dist/chunk-IA6LDKX6.cjs +1 -0
- package/dist/chunk-ICFT4GH4.cjs +3 -0
- package/dist/chunk-IFTHOW6I.js +1 -0
- package/dist/chunk-IGRPHTXZ.cjs +1 -0
- package/dist/chunk-IJ632UXD.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-JINIR3YK.cjs +1 -0
- package/dist/chunk-K5TQ4QU3.cjs +1 -0
- package/dist/chunk-KBJA7JDT.js +0 -0
- package/dist/chunk-KKQBZXFE.js +1 -0
- package/dist/chunk-KUP7H7X2.js +1 -0
- package/dist/chunk-KY7JXYJT.js +1 -0
- package/dist/chunk-KYHZI332.js +1 -0
- package/dist/chunk-L2HE5GZQ.cjs +1 -0
- package/dist/chunk-L52GDMSH.js +0 -0
- package/dist/chunk-L756WM7L.cjs +1 -0
- package/dist/chunk-LKQYA27B.cjs +1 -0
- package/dist/chunk-LSMX26JP.js +1 -0
- package/dist/chunk-M335XCYO.js +1 -0
- package/dist/chunk-MXHHXA2U.cjs +1 -0
- package/dist/chunk-N355UETO.js +1 -0
- package/dist/chunk-N4IWDL6M.js +1 -0
- package/dist/chunk-N5622OKA.js +1 -0
- package/dist/chunk-NX256LAH.cjs +1 -0
- package/dist/chunk-O6VBO7KG.js +1 -0
- package/dist/chunk-OBCMEKEL.js +1 -0
- package/dist/chunk-ODOCGZQN.cjs +1 -0
- package/dist/chunk-OGP7B5O3.cjs +1 -0
- package/dist/chunk-OQZTL6ZG.js +1 -0
- package/dist/chunk-PDHWPAGW.js +1 -0
- package/dist/chunk-PHPBBEXU.cjs +1 -0
- package/dist/chunk-PO6S7UR3.cjs +1 -0
- package/dist/chunk-Q7CG36OB.js +3 -0
- package/dist/chunk-QM3BB4E2.js +0 -0
- package/dist/chunk-QVTKTDED.js +1 -0
- package/dist/chunk-RBSMBO4T.js +1 -0
- package/dist/chunk-RWV3P3EG.js +1 -0
- package/dist/chunk-S3DYQVRD.js +1 -0
- package/dist/chunk-SCEPJO4Q.cjs +1 -0
- package/dist/chunk-SLXO6E5S.js +1 -0
- package/dist/chunk-SPTXAOFR.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-U64C57PB.cjs +1 -0
- package/dist/chunk-UE3WVHTM.cjs +1 -0
- package/dist/chunk-VADIEIDS.js +1 -0
- package/dist/chunk-W7LJS32A.js +1 -0
- package/dist/chunk-WCGUGIGJ.js +1 -0
- package/dist/chunk-XLOZ34NX.js +1 -0
- package/dist/chunk-XNZLCUTY.js +1 -0
- package/dist/chunk-XS5B3TUE.js +1 -0
- package/dist/chunk-XVNQOEEA.js +1 -0
- package/dist/chunk-YDZRBHS3.js +0 -0
- package/dist/chunk-YF5G4U6L.cjs +1 -0
- package/dist/chunk-YGL4ITFK.cjs +1 -0
- package/dist/chunk-YH7G2U6V.js +1 -0
- package/dist/chunk-YHV3672R.cjs +1 -0
- package/dist/chunk-YIO5XXQ4.js +1 -0
- package/dist/chunk-ZKOHOVGT.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +1 -1
- package/dist/logger/index.cjs +1 -0
- package/dist/logger/index.d.cts +2 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger/index.js +1 -0
- package/dist/logger/init.cjs +1 -0
- package/dist/logger/init.d.cts +15 -0
- package/dist/logger/init.d.ts +15 -0
- package/dist/logger/init.js +1 -0
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.d.cts +42 -28
- package/dist/sdk.d.ts +42 -28
- package/dist/sdk.js +1 -1
- 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 -0
- package/dist/signers/evm-api-key.d.cts +22 -0
- package/dist/signers/evm-api-key.d.ts +22 -0
- package/dist/signers/evm-api-key.js +1 -0
- package/dist/signers/evm-external-wallet.cjs +1 -0
- package/dist/signers/evm-external-wallet.d.cts +25 -0
- package/dist/signers/evm-external-wallet.d.ts +25 -0
- package/dist/signers/evm-external-wallet.js +1 -0
- 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 -0
- package/dist/signers/index.d.cts +15 -0
- package/dist/signers/index.d.ts +15 -0
- package/dist/signers/index.js +1 -0
- package/dist/signers/non-custodial/index.cjs +1 -0
- package/dist/signers/non-custodial/index.d.cts +15 -0
- package/dist/signers/non-custodial/index.d.ts +15 -0
- package/dist/signers/non-custodial/index.js +1 -0
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -0
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +34 -0
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +34 -0
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +1 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.d.cts +16 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.d.ts +16 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.js +1 -0
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -0
- package/dist/signers/non-custodial/ncs-signer.d.cts +54 -0
- package/dist/signers/non-custodial/ncs-signer.d.ts +54 -0
- package/dist/signers/non-custodial/ncs-signer.js +1 -0
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -0
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +31 -0
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +31 -0
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +31 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +31 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -0
- package/dist/signers/passkey.cjs +1 -0
- package/dist/signers/passkey.d.cts +23 -0
- package/dist/signers/passkey.d.ts +23 -0
- package/dist/signers/passkey.js +1 -0
- package/dist/signers/server/assemble-server-signer.cjs +1 -0
- package/dist/signers/server/assemble-server-signer.d.cts +15 -0
- package/dist/signers/server/assemble-server-signer.d.ts +15 -0
- package/dist/signers/server/assemble-server-signer.js +1 -0
- package/dist/signers/server/evm-server-signer.cjs +1 -0
- package/dist/signers/server/evm-server-signer.d.cts +29 -0
- package/dist/signers/server/evm-server-signer.d.ts +29 -0
- package/dist/signers/server/evm-server-signer.js +1 -0
- package/dist/signers/server/helpers/derive-server-signer.cjs +1 -0
- package/dist/signers/server/helpers/derive-server-signer.d.cts +19 -0
- package/dist/signers/server/helpers/derive-server-signer.d.ts +19 -0
- package/dist/signers/server/helpers/derive-server-signer.js +1 -0
- package/dist/signers/server/helpers/get-chain-type.cjs +1 -0
- package/dist/signers/server/helpers/get-chain-type.d.cts +7 -0
- package/dist/signers/server/helpers/get-chain-type.d.ts +7 -0
- package/dist/signers/server/helpers/get-chain-type.js +1 -0
- package/dist/signers/server/helpers/index.cjs +1 -0
- package/dist/signers/server/helpers/index.d.cts +13 -0
- package/dist/signers/server/helpers/index.d.ts +13 -0
- package/dist/signers/server/helpers/index.js +1 -0
- package/dist/signers/server/index.cjs +1 -0
- package/dist/signers/server/index.d.cts +16 -0
- package/dist/signers/server/index.d.ts +16 -0
- package/dist/signers/server/index.js +1 -0
- package/dist/signers/server/solana-server-signer.cjs +1 -0
- package/dist/signers/server/solana-server-signer.d.cts +29 -0
- package/dist/signers/server/solana-server-signer.d.ts +29 -0
- package/dist/signers/server/solana-server-signer.js +1 -0
- package/dist/signers/server/stellar-server-signer.cjs +1 -0
- package/dist/signers/server/stellar-server-signer.d.cts +29 -0
- package/dist/signers/server/stellar-server-signer.d.ts +29 -0
- package/dist/signers/server/stellar-server-signer.js +1 -0
- package/dist/signers/solana-api-key.cjs +1 -0
- package/dist/signers/solana-api-key.d.cts +22 -0
- package/dist/signers/solana-api-key.d.ts +22 -0
- package/dist/signers/solana-api-key.js +1 -0
- package/dist/signers/solana-external-wallet.cjs +1 -0
- package/dist/signers/solana-external-wallet.d.cts +23 -0
- package/dist/signers/solana-external-wallet.d.ts +23 -0
- package/dist/signers/solana-external-wallet.js +1 -0
- package/dist/signers/stellar-external-wallet.cjs +1 -0
- package/dist/signers/stellar-external-wallet.d.cts +23 -0
- package/dist/signers/stellar-external-wallet.d.ts +23 -0
- package/dist/signers/stellar-external-wallet.js +1 -0
- package/dist/signers/types.cjs +1 -0
- package/dist/signers/types.d.cts +11 -0
- package/dist/signers/types.d.ts +11 -0
- package/dist/signers/types.js +1 -0
- 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-DfT-EHk3.d.cts +428 -0
- package/dist/types-vcGYTcL0.d.ts +428 -0
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.d.cts +2 -1
- package/dist/utils/constants.d.ts +2 -1
- package/dist/utils/constants.js +1 -1
- 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 -0
- package/dist/utils/errors.d.cts +89 -0
- package/dist/utils/errors.d.ts +89 -0
- package/dist/utils/errors.js +1 -0
- package/dist/utils/server-key-derivation.cjs +1 -0
- package/dist/utils/server-key-derivation.d.cts +20 -0
- package/dist/utils/server-key-derivation.d.ts +20 -0
- package/dist/utils/server-key-derivation.js +1 -0
- 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 +36 -0
- package/dist/utils/signer-mapping.d.ts +36 -0
- package/dist/utils/signer-mapping.js +1 -0
- package/dist/utils/signer-validation.cjs +1 -0
- package/dist/utils/signer-validation.d.cts +11 -0
- package/dist/utils/signer-validation.d.ts +11 -0
- package/dist/utils/signer-validation.js +1 -0
- package/dist/utils/stellar.cjs +1 -0
- package/dist/utils/stellar.d.cts +18 -0
- package/dist/utils/stellar.d.ts +18 -0
- package/dist/utils/stellar.js +1 -0
- package/dist/wallets/__tests__/setup.cjs +1 -0
- package/dist/wallets/__tests__/setup.d.cts +2 -0
- package/dist/wallets/__tests__/setup.d.ts +2 -0
- package/dist/wallets/__tests__/setup.js +1 -0
- package/dist/wallets/__tests__/test-helpers.cjs +1 -0
- package/dist/wallets/__tests__/test-helpers.d.cts +36 -0
- package/dist/wallets/__tests__/test-helpers.d.ts +36 -0
- package/dist/wallets/__tests__/test-helpers.js +1 -0
- package/dist/wallets/evm.cjs +1 -0
- package/dist/wallets/evm.d.cts +154 -0
- package/dist/wallets/evm.d.ts +154 -0
- package/dist/wallets/evm.js +1 -0
- package/dist/wallets/solana.cjs +1 -0
- package/dist/wallets/solana.d.cts +29 -0
- package/dist/wallets/solana.d.ts +29 -0
- package/dist/wallets/solana.js +1 -0
- package/dist/wallets/stellar.cjs +1 -0
- package/dist/wallets/stellar.d.cts +29 -0
- package/dist/wallets/stellar.d.ts +29 -0
- package/dist/wallets/stellar.js +1 -0
- package/dist/wallets/types.cjs +1 -0
- package/dist/wallets/types.d.cts +11 -0
- package/dist/wallets/types.d.ts +11 -0
- package/dist/wallets/types.js +0 -0
- package/dist/wallets/wallet-factory.cjs +1 -0
- package/dist/wallets/wallet-factory.d.cts +37 -0
- package/dist/wallets/wallet-factory.d.ts +37 -0
- package/dist/wallets/wallet-factory.js +1 -0
- package/dist/wallets/wallet.cjs +1 -0
- package/dist/wallets/wallet.d.cts +274 -0
- package/dist/wallets/wallet.d.ts +274 -0
- package/dist/wallets/wallet.js +1 -0
- package/package.json +30 -12
- package/dist/chunk-22GIA4MK.js +0 -1
- package/dist/chunk-3ENSZP74.cjs +0 -1
- package/dist/chunk-6TDMYZSP.js +0 -1
- package/dist/chunk-APYZEG33.js +0 -1
- package/dist/chunk-CK4JCQY6.cjs +0 -1
- package/dist/chunk-DBOB7H6W.cjs +0 -1
- package/dist/chunk-EY4BQMWT.js +0 -1
- package/dist/chunk-ICE64YWF.js +0 -1
- package/dist/chunk-MSK53SDP.js +0 -1
- package/dist/chunk-O5UBTDCJ.cjs +0 -1
- package/dist/chunk-OOKBOMFJ.cjs +0 -1
- package/dist/chunk-U2WTEWN7.cjs +0 -1
- package/dist/chunk-WVCL7F3L.js +0 -1
- package/dist/chunk-Z4FSGH26.js +0 -1
- package/dist/chunk-Z4XNQ4N5.cjs +0 -1
- package/dist/chunk-Z6JFF3HR.cjs +0 -1
- package/dist/evm/chains.cjs +0 -1
- package/dist/evm/chains.d.cts +0 -9
- package/dist/evm/chains.d.ts +0 -9
- package/dist/evm/chains.js +0 -1
- package/dist/evm/index.cjs +0 -1
- package/dist/evm/index.d.cts +0 -6
- package/dist/evm/index.d.ts +0 -6
- package/dist/evm/index.js +0 -1
- package/dist/evm/wallet.cjs +0 -1
- package/dist/evm/wallet.d.cts +0 -48
- package/dist/evm/wallet.d.ts +0 -48
- package/dist/evm/wallet.js +0 -1
- package/dist/solana/index.cjs +0 -1
- package/dist/solana/index.d.cts +0 -5
- package/dist/solana/index.d.ts +0 -5
- package/dist/solana/index.js +0 -1
- package/dist/solana/wallet.cjs +0 -1
- package/dist/solana/wallet.d.cts +0 -33
- package/dist/solana/wallet.d.ts +0 -33
- package/dist/solana/wallet.js +0 -1
- /package/dist/{chunk-A7F5DWC7.js → chunk-455NK5LB.js} +0 -0
- /package/dist/{chunk-RUIBT3JV.cjs → chunk-5IC7UWND.cjs} +0 -0
package/README.md
CHANGED
|
@@ -1 +1,222 @@
|
|
|
1
1
|
# @crossmint/wallets-sdk
|
|
2
|
+
|
|
3
|
+
Typescript SDK for creating and managing [Crossmint Wallets](https://docs.crossmint.com) on EVM, Solana, and Stellar chains.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Get a Crossmint API key from the [developer console](https://docs.crossmint.com/introduction/platform/api-keys). Ensure your key has the **Wallet API** scopes enabled.
|
|
8
|
+
|
|
9
|
+
- **Client-side** (browser): Use a client API key
|
|
10
|
+
- **Server-side** (Node.js): Use a server API key
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @crossmint/wallets-sdk
|
|
16
|
+
# or
|
|
17
|
+
pnpm add @crossmint/wallets-sdk
|
|
18
|
+
# or
|
|
19
|
+
yarn add @crossmint/wallets-sdk
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
### Server-side (Node.js)
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createCrossmint, CrossmintWallets } from "@crossmint/wallets-sdk";
|
|
28
|
+
|
|
29
|
+
const crossmint = createCrossmint({ apiKey: "<YOUR_SERVER_API_KEY>" });
|
|
30
|
+
const wallets = CrossmintWallets.from(crossmint);
|
|
31
|
+
|
|
32
|
+
// Create a wallet with a server signer
|
|
33
|
+
const wallet = await wallets.createWallet({
|
|
34
|
+
chain: "base-sepolia",
|
|
35
|
+
recovery: { type: "server", secret: "<RECOVERY_SECRET>" },
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
console.log(wallet.address);
|
|
39
|
+
|
|
40
|
+
// Send tokens
|
|
41
|
+
const tx = await wallet.send("0xRecipientAddress", "usdc", "10");
|
|
42
|
+
console.log(tx.explorerLink);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Client-side (Headless)
|
|
46
|
+
|
|
47
|
+
For client-side usage without React, you can use the SDK directly with JWT authentication:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { createCrossmint, CrossmintWallets } from "@crossmint/wallets-sdk";
|
|
51
|
+
|
|
52
|
+
const crossmint = createCrossmint({ apiKey: "<YOUR_CLIENT_API_KEY>" });
|
|
53
|
+
crossmint.setJwt("<USER_JWT>");
|
|
54
|
+
|
|
55
|
+
const wallets = CrossmintWallets.from(crossmint);
|
|
56
|
+
|
|
57
|
+
const wallet = await wallets.getWallet({ chain: "base-sepolia" });
|
|
58
|
+
console.log(wallet.address);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> For React apps, use [`@crossmint/client-sdk-react-ui`](https://www.npmjs.com/package/@crossmint/client-sdk-react-ui) which provides `CrossmintWalletProvider`, hooks, and built-in UI for OTP and passkey flows.
|
|
62
|
+
|
|
63
|
+
## Core Concepts
|
|
64
|
+
|
|
65
|
+
### Signers
|
|
66
|
+
|
|
67
|
+
Wallets SDK uses a two-tier signer model:
|
|
68
|
+
|
|
69
|
+
- **Recovery signer** — High-security, used for wallet recovery and adding new signers. Supports email OTP, phone OTP, external wallet, or server key.
|
|
70
|
+
- **Operational signer** — Low-friction, used for day-to-day signing. The default is the **device signer**, which uses hardware-backed keys (no OTP needed). Also supports passkey, server key, and external wallet.
|
|
71
|
+
|
|
72
|
+
When no operational signer is available, the recovery signer automatically serves as a fallback for signing.
|
|
73
|
+
|
|
74
|
+
### Wallet Lifecycle
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
// Create a new wallet
|
|
78
|
+
const wallet = await wallets.createWallet({
|
|
79
|
+
chain: "base-sepolia",
|
|
80
|
+
recovery: { type: "email", email: "user@example.com" },
|
|
81
|
+
signers: [{ type: "device" }], // optional — device is the default
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Retrieve an existing wallet (client-side)
|
|
85
|
+
const wallet = await wallets.getWallet({ chain: "base-sepolia" });
|
|
86
|
+
|
|
87
|
+
// Retrieve an existing wallet (server-side)
|
|
88
|
+
const wallet = await wallets.getWallet("0xWalletAddress", {
|
|
89
|
+
chain: "base-sepolia",
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Usage
|
|
94
|
+
|
|
95
|
+
### Balances
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
const balances = await wallet.balances();
|
|
99
|
+
|
|
100
|
+
console.log(balances.nativeToken.amount);
|
|
101
|
+
console.log(balances.usdc.amount);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Send Tokens
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
const tx = await wallet.send("0xRecipient", "usdc", "100");
|
|
108
|
+
console.log(tx.explorerLink);
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Transfers
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
const transfers = await wallet.transfers({
|
|
115
|
+
tokens: "usdc",
|
|
116
|
+
status: "successful",
|
|
117
|
+
});
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### NFTs
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
const nfts = await wallet.nfts({ perPage: 10, page: 1 });
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Chain-Specific Transactions
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import { EVMWallet, SolanaWallet, StellarWallet } from "@crossmint/wallets-sdk";
|
|
130
|
+
|
|
131
|
+
// EVM — smart contract interaction
|
|
132
|
+
const evmWallet = EVMWallet.from(wallet);
|
|
133
|
+
const tx = await evmWallet.sendTransaction({
|
|
134
|
+
to: "0xContractAddress",
|
|
135
|
+
abi: contractAbi,
|
|
136
|
+
functionName: "mint",
|
|
137
|
+
args: [1],
|
|
138
|
+
value: 0n,
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
// EVM — sign a message
|
|
142
|
+
const sig = await evmWallet.signMessage({ message: "Hello" });
|
|
143
|
+
|
|
144
|
+
// EVM — viem public client
|
|
145
|
+
const client = evmWallet.getViemClient();
|
|
146
|
+
|
|
147
|
+
// Solana
|
|
148
|
+
const solWallet = SolanaWallet.from(wallet);
|
|
149
|
+
const solTx = await solWallet.sendTransaction({
|
|
150
|
+
serializedTransaction: "<base64-encoded-transaction>",
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
// Stellar
|
|
154
|
+
const stellarWallet = StellarWallet.from(wallet);
|
|
155
|
+
const stellarTx = await stellarWallet.sendTransaction({
|
|
156
|
+
contractId: "C...",
|
|
157
|
+
method: "transfer",
|
|
158
|
+
args: { to: "G...", amount: "1000000" },
|
|
159
|
+
});
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Signer Management
|
|
163
|
+
|
|
164
|
+
```ts
|
|
165
|
+
// Add a new signer
|
|
166
|
+
await wallet.addSigner({ type: "server", secret: "<SECRET>" });
|
|
167
|
+
|
|
168
|
+
// List signers
|
|
169
|
+
const signers = await wallet.signers();
|
|
170
|
+
console.log(signers); // [{ type: "device", locator: "device:...", status: "success" }, ...]
|
|
171
|
+
|
|
172
|
+
// Set the active signer
|
|
173
|
+
await wallet.useSigner({ type: "server", secret: "<SECRET>" });
|
|
174
|
+
|
|
175
|
+
// Recovery flow (new device)
|
|
176
|
+
if (wallet.needsRecovery()) {
|
|
177
|
+
await wallet.recover(); // uses recovery signer to register a new device signer
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Transaction Approval (Prepare-Only Mode)
|
|
182
|
+
|
|
183
|
+
For flows that require multi-step approval:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
// Create a transaction without auto-approving
|
|
187
|
+
const pendingTx = await wallet.send("0xRecipient", "usdc", "10", {
|
|
188
|
+
prepareOnly: true,
|
|
189
|
+
});
|
|
190
|
+
console.log(pendingTx.transactionId);
|
|
191
|
+
|
|
192
|
+
// Approve later
|
|
193
|
+
const result = await wallet.approve({
|
|
194
|
+
transactionId: pendingTx.transactionId,
|
|
195
|
+
});
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Signer Types
|
|
199
|
+
|
|
200
|
+
| Type | Use Case | Platforms |
|
|
201
|
+
|---|---|---|
|
|
202
|
+
| `device` | Default day-to-day signer. Hardware-backed, no OTP. | Browser, React Native |
|
|
203
|
+
| `server` | Server-side automated operations (AI agents, backends). | Node.js |
|
|
204
|
+
| `email` | OTP-based recovery signer. | All |
|
|
205
|
+
| `phone` | OTP-based recovery signer. | All |
|
|
206
|
+
| `passkey` | WebAuthn/FIDO2 biometric signer. | Browser (EVM only) |
|
|
207
|
+
| `external-wallet` | Bring-your-own key (MetaMask, KMS, etc). | All |
|
|
208
|
+
|
|
209
|
+
## React / React Native
|
|
210
|
+
|
|
211
|
+
For React applications, use [`@crossmint/client-sdk-react-ui`](https://www.npmjs.com/package/@crossmint/client-sdk-react-ui) which provides wallet providers, hooks (`useWallet`, `useWalletOtpSigner`), and built-in UI for OTP and passkey flows.
|
|
212
|
+
|
|
213
|
+
For React Native, see [`@crossmint/client-sdk-react-native-ui`](https://www.npmjs.com/package/@crossmint/client-sdk-react-native-ui).
|
|
214
|
+
|
|
215
|
+
## Documentation
|
|
216
|
+
|
|
217
|
+
- [Crossmint Wallets Docs](https://docs.crossmint.com)
|
|
218
|
+
- [SDK Reference](https://docs.crossmint.com/sdk-reference/wallets)
|
|
219
|
+
|
|
220
|
+
## License
|
|
221
|
+
|
|
222
|
+
Apache-2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');require('../../chunk-2GKPWQBQ.cjs');exports.DELAY_LONG = _chunkJ33QM2IDcjs.i; exports.DELAY_MEDIUM = _chunkJ33QM2IDcjs.h; exports.DELAY_RATE_LIMIT_WINDOW = _chunkJ33QM2IDcjs.j; exports.DELAY_SHORT = _chunkJ33QM2IDcjs.g; exports.HTTP_ERROR_STATUSES = _chunkJ33QM2IDcjs.a; exports.MOCK_API_KEY = _chunkJ33QM2IDcjs.m; exports.TEST_ADDRESSES = _chunkJ33QM2IDcjs.k; exports.TEST_VALUES = _chunkJ33QM2IDcjs.l; exports.TIMEOUT_LONG = _chunkJ33QM2IDcjs.f; exports.TIMEOUT_MEDIUM = _chunkJ33QM2IDcjs.e; exports.TIMEOUT_SHORT = _chunkJ33QM2IDcjs.d; exports.TOKEN_LOCATORS = _chunkJ33QM2IDcjs.c; exports.WALLET_LOCATORS = _chunkJ33QM2IDcjs.b;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { a3 as WalletLocator } from '../../types-DfT-EHk3.cjs';
|
|
2
|
+
import 'viem';
|
|
3
|
+
import '../gen/types.gen.cjs';
|
|
4
|
+
import 'ox';
|
|
5
|
+
import '@crossmint/client-sdk-window';
|
|
6
|
+
import '@crossmint/client-signers';
|
|
7
|
+
import '@crossmint/common-sdk-base';
|
|
8
|
+
import '../../chains/chains.cjs';
|
|
9
|
+
import '@solana/web3.js';
|
|
10
|
+
import 'abitype';
|
|
11
|
+
import '../../utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
12
|
+
|
|
13
|
+
declare const HTTP_ERROR_STATUSES: readonly [{
|
|
14
|
+
readonly status: 400;
|
|
15
|
+
readonly message: "Bad Request";
|
|
16
|
+
}, {
|
|
17
|
+
readonly status: 401;
|
|
18
|
+
readonly message: "Unauthorized";
|
|
19
|
+
}, {
|
|
20
|
+
readonly status: 403;
|
|
21
|
+
readonly message: "Forbidden";
|
|
22
|
+
}, {
|
|
23
|
+
readonly status: 404;
|
|
24
|
+
readonly message: "Not Found";
|
|
25
|
+
}, {
|
|
26
|
+
readonly status: 429;
|
|
27
|
+
readonly message: "Rate limit exceeded";
|
|
28
|
+
}, {
|
|
29
|
+
readonly status: 500;
|
|
30
|
+
readonly message: "Internal server error";
|
|
31
|
+
}, {
|
|
32
|
+
readonly status: 502;
|
|
33
|
+
readonly message: "Bad Gateway";
|
|
34
|
+
}, {
|
|
35
|
+
readonly status: 503;
|
|
36
|
+
readonly message: "Service Unavailable";
|
|
37
|
+
}];
|
|
38
|
+
/**
|
|
39
|
+
* General-purpose wallet locators for unit and integration tests.
|
|
40
|
+
* Includes both locator format strings (me:chain:type) and actual addresses.
|
|
41
|
+
* Used for testing wallet operations that accept WalletLocator type.
|
|
42
|
+
*/
|
|
43
|
+
declare const WALLET_LOCATORS: {
|
|
44
|
+
readonly evmSmart: WalletLocator;
|
|
45
|
+
readonly evmMpc: WalletLocator;
|
|
46
|
+
readonly solanaSmart: WalletLocator;
|
|
47
|
+
readonly solanaAddress: WalletLocator;
|
|
48
|
+
readonly evmAddress: WalletLocator;
|
|
49
|
+
readonly evmAddressWithSpecialChars: WalletLocator;
|
|
50
|
+
};
|
|
51
|
+
declare const TOKEN_LOCATORS: {
|
|
52
|
+
readonly eth: "base-sepolia:eth";
|
|
53
|
+
readonly usdc: "base-sepolia:usdc";
|
|
54
|
+
readonly sol: "solana:sol";
|
|
55
|
+
readonly customContract: "base-sepolia:0x1234567890123456789012345678901234567890";
|
|
56
|
+
readonly tokenWithSpecialChars: "base-sepolia:0xABCDEFabcdef0123456789ABCDEFabcdef012345";
|
|
57
|
+
};
|
|
58
|
+
declare const TIMEOUT_SHORT = 30000;
|
|
59
|
+
declare const TIMEOUT_MEDIUM = 60000;
|
|
60
|
+
declare const TIMEOUT_LONG = 120000;
|
|
61
|
+
declare const DELAY_SHORT = 200;
|
|
62
|
+
declare const DELAY_MEDIUM = 500;
|
|
63
|
+
declare const DELAY_LONG = 1000;
|
|
64
|
+
declare const DELAY_RATE_LIMIT_WINDOW = 2000;
|
|
65
|
+
/**
|
|
66
|
+
* Real blockchain addresses for integration tests with specific purposes.
|
|
67
|
+
* These are actual addresses used in integration tests for:
|
|
68
|
+
* - Admin signers (external wallet addresses for wallet creation)
|
|
69
|
+
* - Recipients (addresses to send tokens to)
|
|
70
|
+
* - Error testing (non-existent addresses)
|
|
71
|
+
* - General test operations
|
|
72
|
+
* Note: These are actual addresses, not locator format strings.
|
|
73
|
+
*/
|
|
74
|
+
declare const TEST_ADDRESSES: {
|
|
75
|
+
readonly EVM_ADMIN_SIGNER: "0xe5E91D9b21C3563011cc332B050150fb9211bBEB";
|
|
76
|
+
readonly SOLANA_ADMIN_SIGNER: "CsHuaddA9J8j9vSTdL9wpvBsyjYe4F7iQQLuPg3EUqsU";
|
|
77
|
+
readonly EVM_RECIPIENT: "0xDF8b5F9c19E187f1Ea00730a1e46180152244315";
|
|
78
|
+
readonly EVM_NON_EXISTENT: "0x0000000000000000000000000000000000000000";
|
|
79
|
+
readonly EVM_TEST: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd";
|
|
80
|
+
};
|
|
81
|
+
declare const TEST_VALUES: {
|
|
82
|
+
readonly FUNDING_AMOUNT_SMALL: 1;
|
|
83
|
+
readonly FUNDING_AMOUNT_LARGE: 10;
|
|
84
|
+
readonly SEND_AMOUNT_SMALL: "0.0001";
|
|
85
|
+
readonly SEND_AMOUNT_VERY_SMALL: "0.000000000000000001";
|
|
86
|
+
readonly SEND_AMOUNT_ZERO: "0";
|
|
87
|
+
readonly SEND_AMOUNT_INVALID: "999999999999999999.0";
|
|
88
|
+
readonly SEND_AMOUNT_EXTREME: "999999999999999999999999999999.999999999999999999";
|
|
89
|
+
readonly LONG_STRING_LENGTH: 10000;
|
|
90
|
+
readonly CONCURRENT_REQUESTS: 3;
|
|
91
|
+
readonly RAPID_SEQUENTIAL_COUNT: 3;
|
|
92
|
+
readonly RATE_LIMIT_BATCH_SIZE: 5;
|
|
93
|
+
readonly RATE_LIMIT_BATCHES: 3;
|
|
94
|
+
readonly RATE_LIMIT_RAPID_COUNT: 20;
|
|
95
|
+
readonly RATE_LIMIT_STRESS_COUNT: 50;
|
|
96
|
+
readonly APPROVE_TRANSACTION_MAX_RETRIES: 10;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Mock API key for unit tests.
|
|
100
|
+
* This is a valid development API key format used for testing purposes only.
|
|
101
|
+
*/
|
|
102
|
+
declare const MOCK_API_KEY = "ck_development_A61UZQnvjSQcM5qVBaBactgqebxafWAVsNdD2xLkgBxoYuH5q2guM8r9DUmZQzE1WYyoByGVYpEG2o9gVSzAZFsrLbfKGERUJ6D5CW6S9AsJGAc3ctgrsD4n2ioekzGj7KPbLwT3SysDjMamYXLxEroUbQSdwf6aLF4zeEpECq2crkTUQeLFzxzmjWNxFDHFYefDrfrFPCURvBXJLf5pCxCQ";
|
|
103
|
+
|
|
104
|
+
export { DELAY_LONG, DELAY_MEDIUM, DELAY_RATE_LIMIT_WINDOW, DELAY_SHORT, HTTP_ERROR_STATUSES, MOCK_API_KEY, TEST_ADDRESSES, TEST_VALUES, TIMEOUT_LONG, TIMEOUT_MEDIUM, TIMEOUT_SHORT, TOKEN_LOCATORS, WALLET_LOCATORS };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { a3 as WalletLocator } from '../../types-vcGYTcL0.js';
|
|
2
|
+
import 'viem';
|
|
3
|
+
import '../gen/types.gen.js';
|
|
4
|
+
import 'ox';
|
|
5
|
+
import '@crossmint/client-sdk-window';
|
|
6
|
+
import '@crossmint/client-signers';
|
|
7
|
+
import '@crossmint/common-sdk-base';
|
|
8
|
+
import '../../chains/chains.js';
|
|
9
|
+
import '@solana/web3.js';
|
|
10
|
+
import 'abitype';
|
|
11
|
+
import '../../utils/device-signers/DeviceSignerKeyStorage.js';
|
|
12
|
+
|
|
13
|
+
declare const HTTP_ERROR_STATUSES: readonly [{
|
|
14
|
+
readonly status: 400;
|
|
15
|
+
readonly message: "Bad Request";
|
|
16
|
+
}, {
|
|
17
|
+
readonly status: 401;
|
|
18
|
+
readonly message: "Unauthorized";
|
|
19
|
+
}, {
|
|
20
|
+
readonly status: 403;
|
|
21
|
+
readonly message: "Forbidden";
|
|
22
|
+
}, {
|
|
23
|
+
readonly status: 404;
|
|
24
|
+
readonly message: "Not Found";
|
|
25
|
+
}, {
|
|
26
|
+
readonly status: 429;
|
|
27
|
+
readonly message: "Rate limit exceeded";
|
|
28
|
+
}, {
|
|
29
|
+
readonly status: 500;
|
|
30
|
+
readonly message: "Internal server error";
|
|
31
|
+
}, {
|
|
32
|
+
readonly status: 502;
|
|
33
|
+
readonly message: "Bad Gateway";
|
|
34
|
+
}, {
|
|
35
|
+
readonly status: 503;
|
|
36
|
+
readonly message: "Service Unavailable";
|
|
37
|
+
}];
|
|
38
|
+
/**
|
|
39
|
+
* General-purpose wallet locators for unit and integration tests.
|
|
40
|
+
* Includes both locator format strings (me:chain:type) and actual addresses.
|
|
41
|
+
* Used for testing wallet operations that accept WalletLocator type.
|
|
42
|
+
*/
|
|
43
|
+
declare const WALLET_LOCATORS: {
|
|
44
|
+
readonly evmSmart: WalletLocator;
|
|
45
|
+
readonly evmMpc: WalletLocator;
|
|
46
|
+
readonly solanaSmart: WalletLocator;
|
|
47
|
+
readonly solanaAddress: WalletLocator;
|
|
48
|
+
readonly evmAddress: WalletLocator;
|
|
49
|
+
readonly evmAddressWithSpecialChars: WalletLocator;
|
|
50
|
+
};
|
|
51
|
+
declare const TOKEN_LOCATORS: {
|
|
52
|
+
readonly eth: "base-sepolia:eth";
|
|
53
|
+
readonly usdc: "base-sepolia:usdc";
|
|
54
|
+
readonly sol: "solana:sol";
|
|
55
|
+
readonly customContract: "base-sepolia:0x1234567890123456789012345678901234567890";
|
|
56
|
+
readonly tokenWithSpecialChars: "base-sepolia:0xABCDEFabcdef0123456789ABCDEFabcdef012345";
|
|
57
|
+
};
|
|
58
|
+
declare const TIMEOUT_SHORT = 30000;
|
|
59
|
+
declare const TIMEOUT_MEDIUM = 60000;
|
|
60
|
+
declare const TIMEOUT_LONG = 120000;
|
|
61
|
+
declare const DELAY_SHORT = 200;
|
|
62
|
+
declare const DELAY_MEDIUM = 500;
|
|
63
|
+
declare const DELAY_LONG = 1000;
|
|
64
|
+
declare const DELAY_RATE_LIMIT_WINDOW = 2000;
|
|
65
|
+
/**
|
|
66
|
+
* Real blockchain addresses for integration tests with specific purposes.
|
|
67
|
+
* These are actual addresses used in integration tests for:
|
|
68
|
+
* - Admin signers (external wallet addresses for wallet creation)
|
|
69
|
+
* - Recipients (addresses to send tokens to)
|
|
70
|
+
* - Error testing (non-existent addresses)
|
|
71
|
+
* - General test operations
|
|
72
|
+
* Note: These are actual addresses, not locator format strings.
|
|
73
|
+
*/
|
|
74
|
+
declare const TEST_ADDRESSES: {
|
|
75
|
+
readonly EVM_ADMIN_SIGNER: "0xe5E91D9b21C3563011cc332B050150fb9211bBEB";
|
|
76
|
+
readonly SOLANA_ADMIN_SIGNER: "CsHuaddA9J8j9vSTdL9wpvBsyjYe4F7iQQLuPg3EUqsU";
|
|
77
|
+
readonly EVM_RECIPIENT: "0xDF8b5F9c19E187f1Ea00730a1e46180152244315";
|
|
78
|
+
readonly EVM_NON_EXISTENT: "0x0000000000000000000000000000000000000000";
|
|
79
|
+
readonly EVM_TEST: "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd";
|
|
80
|
+
};
|
|
81
|
+
declare const TEST_VALUES: {
|
|
82
|
+
readonly FUNDING_AMOUNT_SMALL: 1;
|
|
83
|
+
readonly FUNDING_AMOUNT_LARGE: 10;
|
|
84
|
+
readonly SEND_AMOUNT_SMALL: "0.0001";
|
|
85
|
+
readonly SEND_AMOUNT_VERY_SMALL: "0.000000000000000001";
|
|
86
|
+
readonly SEND_AMOUNT_ZERO: "0";
|
|
87
|
+
readonly SEND_AMOUNT_INVALID: "999999999999999999.0";
|
|
88
|
+
readonly SEND_AMOUNT_EXTREME: "999999999999999999999999999999.999999999999999999";
|
|
89
|
+
readonly LONG_STRING_LENGTH: 10000;
|
|
90
|
+
readonly CONCURRENT_REQUESTS: 3;
|
|
91
|
+
readonly RAPID_SEQUENTIAL_COUNT: 3;
|
|
92
|
+
readonly RATE_LIMIT_BATCH_SIZE: 5;
|
|
93
|
+
readonly RATE_LIMIT_BATCHES: 3;
|
|
94
|
+
readonly RATE_LIMIT_RAPID_COUNT: 20;
|
|
95
|
+
readonly RATE_LIMIT_STRESS_COUNT: 50;
|
|
96
|
+
readonly APPROVE_TRANSACTION_MAX_RETRIES: 10;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Mock API key for unit tests.
|
|
100
|
+
* This is a valid development API key format used for testing purposes only.
|
|
101
|
+
*/
|
|
102
|
+
declare const MOCK_API_KEY = "ck_development_A61UZQnvjSQcM5qVBaBactgqebxafWAVsNdD2xLkgBxoYuH5q2guM8r9DUmZQzE1WYyoByGVYpEG2o9gVSzAZFsrLbfKGERUJ6D5CW6S9AsJGAc3ctgrsD4n2ioekzGj7KPbLwT3SysDjMamYXLxEroUbQSdwf6aLF4zeEpECq2crkTUQeLFzxzmjWNxFDHFYefDrfrFPCURvBXJLf5pCxCQ";
|
|
103
|
+
|
|
104
|
+
export { DELAY_LONG, DELAY_MEDIUM, DELAY_RATE_LIMIT_WINDOW, DELAY_SHORT, HTTP_ERROR_STATUSES, MOCK_API_KEY, TEST_ADDRESSES, TEST_VALUES, TIMEOUT_LONG, TIMEOUT_MEDIUM, TIMEOUT_SHORT, TOKEN_LOCATORS, WALLET_LOCATORS };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"../../chunk-DIGDDKSF.js";import"../../chunk-J3R36SGJ.js";export{i as DELAY_LONG,h as DELAY_MEDIUM,j as DELAY_RATE_LIMIT_WINDOW,g as DELAY_SHORT,a as HTTP_ERROR_STATUSES,m as MOCK_API_KEY,k as TEST_ADDRESSES,l as TEST_VALUES,f as TIMEOUT_LONG,e as TIMEOUT_MEDIUM,d as TIMEOUT_SHORT,c as TOKEN_LOCATORS,b as WALLET_LOCATORS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');var _chunkIA6LDKX6cjs = require('../../chunk-IA6LDKX6.cjs');require('../../chunk-T3U46LK3.cjs');require('../../chunk-3TRQCN5N.cjs');require('../../chunk-LKQYA27B.cjs');var _chunk2GKPWQBQcjs = require('../../chunk-2GKPWQBQ.cjs');var _vitest = require('vitest');var b=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:_vitest.vi.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j= exports.createMockSuccessResponse =e=>b({data:e}),P= exports.createMockErrorResponse =(e,t=400,n="Bad Request")=>b({data:e,status:t,ok:!1,statusText:n}),B= exports.createMockCrossmint =(e={})=>{let t=_chunk2GKPWQBQcjs.a.call(void 0, {apiKey:_chunkJ33QM2IDcjs.m},e);return _chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},t),{setJwt:_vitest.vi.fn().mockReturnThis()})},L= exports.createTestApiClient =e=>new (0, _chunkIA6LDKX6cjs.a)(e||B()),K= exports.createServerSideApiClient =()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},Y= exports.extractFetchCall =e=>{let t=e.mock.calls;if(t.length===0)return;let n=t[t.length-1];return{path:n[0],options:n[1]}},N= exports.expectRequestPath =(e,t)=>{_vitest.expect.call(void 0, e==null?void 0:e.path).toBe(t)},V= exports.expectCommonHeaders =e=>{_vitest.expect.call(void 0, e["Content-Type"]).toBe("application/json")},q= exports.expectRequestBody =(e,t)=>{_vitest.expect.call(void 0, e.body).toBe(JSON.stringify(t))},z= exports.validateRequest =(e,t,n)=>{_vitest.expect.call(void 0, e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},X= exports.testHttpErrorResponse =(e,t,n,s)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){t.mockResolvedValue(P(n,s));let a=yield e();_vitest.expect.call(void 0, u(a)).toBe(!0),u(a)&&(_vitest.expect.call(void 0, a.error).toBe(!0),n.message&&_vitest.expect.call(void 0, a.message).toBe(n.message))}),Z= exports.testCommonHttpErrors =(s,a,...o)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of _chunkJ33QM2IDcjs.a){if(n.includes(c))continue;let l={error:!0,message:g};t.mockResolvedValueOnce(P(l,c));let m=yield e();_vitest.expect.call(void 0, u(m)).toBe(!0)}}),Q= exports.testNetworkError =(e,t)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Network error")}),ee= exports.testInvalidJsonResponse =(e,t)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){let n={json:_vitest.vi.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield _vitest.expect.call(void 0, e()).rejects.toThrow()}),te= exports.testTimeoutError =(e,t)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield _vitest.expect.call(void 0, e()).rejects.toThrow("Request timeout")}),ne= exports.testMalformedResponse =(e,t,n)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();_vitest.expect.call(void 0, s).toEqual(n)}),se= exports.createMockWalletResponse =(e={})=>_chunk2GKPWQBQcjs.a.call(void 0, {address:_chunkJ33QM2IDcjs.b.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:_chunkJ33QM2IDcjs.k.EVM_TEST}}},e),oe= exports.createMockSendResponse =(e={})=>_chunk2GKPWQBQcjs.a.call(void 0, {id:"txn-123",status:"pending",chainType:"evm",walletType:"evm-smart-wallet",params:{transaction:"0x1234567890abcdef",signer:"api-key:test"},onChain:{txId:"0xabcdef1234567890abcdef1234567890abcdef12",explorerLink:"https://explorer.example.com/tx/0xabcdef1234567890abcdef1234567890abcdef12"},createdAt:Date.now()},e);function u(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function h(e){return typeof e=="object"&&e!==null&&"address"in e&&"chainType"in e&&"type"in e}function $(e){return typeof e=="object"&&e!==null&&"id"in e&&"status"in e&&"chainType"in e}var x=e=>new Promise(t=>setTimeout(t,e)),re= exports.isValidEthereumAddress =e=>/^0x[a-fA-F0-9]{40}$/.test(e),ae= exports.isValidSolanaAddress =e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ie= exports.createIntegrationApiClient =(e,t,n={})=>{let s=_chunk2GKPWQBQcjs.a.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {apiKey:e},t&&{overrideBaseUrl:t}),n),a=_chunk2GKPWQBQcjs.b.call(void 0, _chunk2GKPWQBQcjs.a.call(void 0, {},s),{setJwt:()=>a});return new (0, _chunkIA6LDKX6cjs.a)(a)},v= exports.TestDataFactory =class{constructor(){this.wallets=[];this.transactions=[]}addWallet(t){t&&!this.wallets.includes(t)&&this.wallets.push(t)}addTransaction(t){t&&!this.transactions.includes(t)&&this.transactions.push(t)}getWallet(t=0){return this.wallets[t]}getTransaction(t=0){return this.transactions[t]}hasWallets(){return this.wallets.length>0}clear(){this.wallets=[],this.transactions=[]}};function ce(s,a){return _chunk2GKPWQBQcjs.g.call(void 0, this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:l="default"}=n,m=g||`userId:integration-${l}-${Date.now()}`,f=yield e.createWallet(_chunk2GKPWQBQcjs.a.call(void 0, {chainType:o,type:c},g&&{owner:m}));if(h(f))return t.addWallet(f.address),f.address})}function pe(e,t,n){return _chunk2GKPWQBQcjs.g.call(void 0, this,null,function*(){let s=yield e.createWallet(n);return h(s)&&t.addWallet(s.address),s})}function ue(e,t){_vitest.expect.call(void 0, u(e)).toBe(!0),t&&_vitest.expect.call(void 0, e.message).toBeDefined()}function le(e){_vitest.expect.call(void 0, h(e)).toBe(!0)}function de(e){_vitest.expect.call(void 0, $(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(u(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(_chunkJ33QM2IDcjs.i),c}),U= exports.approveTransaction =(a,o,c,...g)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,[a,o,c,...g],function*(e,t,n,s=_chunkJ33QM2IDcjs.l.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(u(d))throw new Error(`Transaction not found: ${d.message||"Unknown error"}`);if("status"in d&&(d.status==="success"||d.status==="failed"))return d;let T="approvals"in d?(m=d.approvals)==null?void 0:m.pending:void 0;if(T&&T.length>0){let O={approvals:T.map(_=>({signer:_.signer.locator,signature:""}))},C=yield e.approveTransaction(t,n,O);if(u(C))throw new Error(`Failed to approve transaction: ${C.message||"Unknown error"}`);yield x(_chunkJ33QM2IDcjs.j);continue}yield x(_chunkJ33QM2IDcjs.i)}let l=yield e.getTransaction(t,n);if(u(l))throw new Error(`Transaction not found after retries: ${l.message||"Unknown error"}`);if(!("status"in l))throw new Error("Transaction response missing status property");return l}),me= exports.fundWalletAndWait =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){return I(e,t,n,s,a)}),fe= exports.sendTokenAndApprove =(e,t,n,s,a)=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(u(o))throw new Error(`Failed to send token: ${o.message||"Unknown error"}`);if(typeof o=="object"&&o!==null&&"id"in o&&typeof o.id=="string")return U(e,t,o.id);throw new Error("Transaction ID not found in send response")}),ge= exports.ensureWalletFunded =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunk2GKPWQBQcjs.g.call(void 0, void 0,null,function*(){try{yield I(e,t,n,s,a)}catch(o){let c=o instanceof Error?o.message:String(o);if(!c.includes("already funded")&&!c.includes("insufficient"))throw o}});exports.TestDataFactory = v; exports.approveTransaction = U; exports.createIntegrationApiClient = ie; exports.createMockCrossmint = B; exports.createMockErrorResponse = P; exports.createMockResponse = b; exports.createMockSendResponse = oe; exports.createMockSuccessResponse = j; exports.createMockWalletResponse = se; exports.createServerSideApiClient = K; exports.createTestApiClient = L; exports.createTestWallet = pe; exports.delay = x; exports.ensureWalletExists = ce; exports.ensureWalletFunded = ge; exports.expectCommonHeaders = V; exports.expectErrorResponse = ue; exports.expectRequestBody = q; exports.expectRequestPath = N; exports.expectSuccessTransactionResponse = de; exports.expectSuccessWalletResponse = le; exports.extractFetchCall = Y; exports.fundWallet = I; exports.fundWalletAndWait = me; exports.isErrorResponse = u; exports.isSuccessTransactionResponse = $; exports.isSuccessWalletResponse = h; exports.isValidEthereumAddress = re; exports.isValidSolanaAddress = ae; exports.sendTokenAndApprove = fe; exports.testCommonHttpErrors = Z; exports.testHttpErrorResponse = X; exports.testInvalidJsonResponse = ee; exports.testMalformedResponse = ne; exports.testNetworkError = Q; exports.testTimeoutError = te; exports.validateRequest = z;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { MockedFunction } from 'vitest';
|
|
2
|
+
import { Crossmint } from '@crossmint/common-sdk-base';
|
|
3
|
+
import { ApiClient } from '../client.cjs';
|
|
4
|
+
import { a5 as CreateWalletResponse, a6 as SendResponse, a7 as CreateWalletParams, a3 as WalletLocator, Y as FundWalletResponse, a8 as GetTransactionResponse } from '../../types-DfT-EHk3.cjs';
|
|
5
|
+
import '../../chains/chains.cjs';
|
|
6
|
+
import 'viem';
|
|
7
|
+
import '../gen/types.gen.cjs';
|
|
8
|
+
import 'ox';
|
|
9
|
+
import '@crossmint/client-sdk-window';
|
|
10
|
+
import '@crossmint/client-signers';
|
|
11
|
+
import '@solana/web3.js';
|
|
12
|
+
import 'abitype';
|
|
13
|
+
import '../../utils/device-signers/DeviceSignerKeyStorage.cjs';
|
|
14
|
+
|
|
15
|
+
type MockResponseOptions<T> = {
|
|
16
|
+
data: T;
|
|
17
|
+
status?: number;
|
|
18
|
+
ok?: boolean;
|
|
19
|
+
statusText?: string;
|
|
20
|
+
};
|
|
21
|
+
type FetchCallInfo = {
|
|
22
|
+
path: string;
|
|
23
|
+
options: RequestInit;
|
|
24
|
+
};
|
|
25
|
+
declare const createMockResponse: <T>({ data, status, ok, statusText, }: MockResponseOptions<T>) => Response;
|
|
26
|
+
declare const createMockSuccessResponse: <T>(data: T) => Response;
|
|
27
|
+
declare const createMockErrorResponse: <T>(data: T, status?: number, statusText?: string) => Response;
|
|
28
|
+
declare const createMockCrossmint: (overrides?: Partial<Crossmint>) => Crossmint;
|
|
29
|
+
declare const createTestApiClient: (crossmint?: Crossmint) => ApiClient;
|
|
30
|
+
declare const createServerSideApiClient: () => ApiClient;
|
|
31
|
+
declare const extractFetchCall: (mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>) => FetchCallInfo | undefined;
|
|
32
|
+
declare const expectRequestPath: (call: FetchCallInfo | undefined, expectedPath: string) => void;
|
|
33
|
+
declare const expectCommonHeaders: (headers: HeadersInit) => void;
|
|
34
|
+
declare const expectRequestBody: (options: RequestInit, expectedBody: unknown) => void;
|
|
35
|
+
declare const validateRequest: (call: FetchCallInfo | undefined, expectedPath: string, expectedBody?: unknown) => void;
|
|
36
|
+
declare const testHttpErrorResponse: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>, errorData: {
|
|
37
|
+
error: boolean;
|
|
38
|
+
message?: string;
|
|
39
|
+
}, statusCode: number) => Promise<void>;
|
|
40
|
+
declare const testCommonHttpErrors: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>, skipStatuses?: number[]) => Promise<void>;
|
|
41
|
+
declare const testNetworkError: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>) => Promise<void>;
|
|
42
|
+
declare const testInvalidJsonResponse: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>) => Promise<void>;
|
|
43
|
+
declare const testTimeoutError: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>) => Promise<void>;
|
|
44
|
+
declare const testMalformedResponse: <T>(apiCall: () => Promise<T>, mockFn: MockedFunction<any> | MockedFunction<ApiClient["post"]> | MockedFunction<ApiClient["get"]>, malformedData: unknown) => Promise<void>;
|
|
45
|
+
declare const createMockWalletResponse: (overrides?: Partial<CreateWalletResponse>) => CreateWalletResponse;
|
|
46
|
+
declare const createMockSendResponse: (overrides?: Partial<SendResponse>) => SendResponse;
|
|
47
|
+
interface ErrorResponse {
|
|
48
|
+
error: true;
|
|
49
|
+
message?: string;
|
|
50
|
+
details?: unknown;
|
|
51
|
+
}
|
|
52
|
+
interface SuccessWalletResponse {
|
|
53
|
+
address: string;
|
|
54
|
+
chainType: string;
|
|
55
|
+
type: string;
|
|
56
|
+
config?: {
|
|
57
|
+
adminSigner?: {
|
|
58
|
+
type: string;
|
|
59
|
+
address: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
interface SuccessTransactionResponse {
|
|
64
|
+
id: string;
|
|
65
|
+
status: string;
|
|
66
|
+
chainType: string;
|
|
67
|
+
}
|
|
68
|
+
declare function isErrorResponse(response: unknown): response is ErrorResponse;
|
|
69
|
+
declare function isSuccessWalletResponse(response: unknown): response is SuccessWalletResponse;
|
|
70
|
+
declare function isSuccessTransactionResponse(response: unknown): response is SuccessTransactionResponse;
|
|
71
|
+
declare const delay: (ms: number) => Promise<unknown>;
|
|
72
|
+
declare const isValidEthereumAddress: (address: string) => boolean;
|
|
73
|
+
declare const isValidSolanaAddress: (address: string) => boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Creates an API client for integration tests using environment variables.
|
|
76
|
+
* This is different from createTestApiClient which uses mocked data.
|
|
77
|
+
*/
|
|
78
|
+
declare const createIntegrationApiClient: (apiKey: string, baseUrl?: string, overrides?: Partial<Crossmint>) => ApiClient;
|
|
79
|
+
declare class TestDataFactory {
|
|
80
|
+
private wallets;
|
|
81
|
+
private transactions;
|
|
82
|
+
addWallet(address: string): void;
|
|
83
|
+
addTransaction(id: string): void;
|
|
84
|
+
getWallet(index?: number): string | undefined;
|
|
85
|
+
getTransaction(index?: number): string | undefined;
|
|
86
|
+
hasWallets(): boolean;
|
|
87
|
+
clear(): void;
|
|
88
|
+
}
|
|
89
|
+
declare function ensureWalletExists(apiClient: ApiClient, testData: TestDataFactory, options?: {
|
|
90
|
+
chainType?: "evm" | "solana";
|
|
91
|
+
type?: "mpc" | "smart";
|
|
92
|
+
owner?: string;
|
|
93
|
+
testName?: string;
|
|
94
|
+
}): Promise<string | undefined>;
|
|
95
|
+
declare function createTestWallet(apiClient: ApiClient, testData: TestDataFactory, params: CreateWalletParams): Promise<CreateWalletResponse>;
|
|
96
|
+
declare function expectErrorResponse(response: unknown, message?: string): asserts response is ErrorResponse;
|
|
97
|
+
declare function expectSuccessWalletResponse(response: unknown): asserts response is SuccessWalletResponse;
|
|
98
|
+
declare function expectSuccessTransactionResponse(response: unknown): asserts response is SuccessTransactionResponse;
|
|
99
|
+
declare const fundWallet: (apiClient: ApiClient, walletLocator: WalletLocator, amount: number, token?: "usdxm", chain?: string) => Promise<FundWalletResponse>;
|
|
100
|
+
declare const approveTransaction: (apiClient: ApiClient, walletLocator: WalletLocator, transactionId: string, maxRetries?: number) => Promise<GetTransactionResponse>;
|
|
101
|
+
declare const fundWalletAndWait: (apiClient: ApiClient, walletLocator: WalletLocator, amount?: number, token?: "usdxm", chain?: string) => Promise<FundWalletResponse>;
|
|
102
|
+
declare const sendTokenAndApprove: (apiClient: ApiClient, walletLocator: WalletLocator, tokenLocator: string, recipient: string, amount: string) => Promise<GetTransactionResponse>;
|
|
103
|
+
declare const ensureWalletFunded: (apiClient: ApiClient, walletLocator: WalletLocator, amount?: number, token?: "usdxm", chain?: string) => Promise<void>;
|
|
104
|
+
|
|
105
|
+
export { type ErrorResponse, type FetchCallInfo, type MockResponseOptions, type SuccessTransactionResponse, type SuccessWalletResponse, TestDataFactory, approveTransaction, createIntegrationApiClient, createMockCrossmint, createMockErrorResponse, createMockResponse, createMockSendResponse, createMockSuccessResponse, createMockWalletResponse, createServerSideApiClient, createTestApiClient, createTestWallet, delay, ensureWalletExists, ensureWalletFunded, expectCommonHeaders, expectErrorResponse, expectRequestBody, expectRequestPath, expectSuccessTransactionResponse, expectSuccessWalletResponse, extractFetchCall, fundWallet, fundWalletAndWait, isErrorResponse, isSuccessTransactionResponse, isSuccessWalletResponse, isValidEthereumAddress, isValidSolanaAddress, sendTokenAndApprove, testCommonHttpErrors, testHttpErrorResponse, testInvalidJsonResponse, testMalformedResponse, testNetworkError, testTimeoutError, validateRequest };
|