@crossmint/wallets-sdk 0.20.1 → 0.20.4
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/dist/api/__tests__/constants.cjs +4 -3
- package/dist/api/__tests__/constants.cjs.map +1 -0
- package/dist/api/__tests__/constants.js +3 -2
- package/dist/api/__tests__/constants.js.map +1 -0
- package/dist/api/__tests__/test-utils.cjs +36 -35
- package/dist/api/__tests__/test-utils.cjs.map +1 -0
- package/dist/api/__tests__/test-utils.js +7 -6
- package/dist/api/__tests__/test-utils.js.map +1 -0
- package/dist/api/client.cjs +7 -6
- package/dist/api/client.cjs.map +1 -0
- package/dist/api/client.js +6 -5
- package/dist/api/client.js.map +1 -0
- package/dist/api/gen/client.gen.cjs +4 -3
- package/dist/api/gen/client.gen.cjs.map +1 -0
- package/dist/api/gen/client.gen.js +3 -2
- package/dist/api/gen/client.gen.js.map +1 -0
- package/dist/api/gen/index.cjs +6 -5
- package/dist/api/gen/index.cjs.map +1 -0
- package/dist/api/gen/index.js +5 -4
- package/dist/api/gen/index.js.map +1 -0
- package/dist/api/gen/sdk.gen.cjs +5 -4
- package/dist/api/gen/sdk.gen.cjs.map +1 -0
- package/dist/api/gen/sdk.gen.js +4 -3
- package/dist/api/gen/sdk.gen.js.map +1 -0
- package/dist/api/gen/types.gen.cjs +2 -1
- package/dist/api/gen/types.gen.cjs.map +1 -0
- package/dist/api/gen/types.gen.js +2 -1
- package/dist/api/gen/types.gen.js.map +1 -0
- package/dist/api/index.cjs +9 -8
- package/dist/api/index.cjs.map +1 -0
- package/dist/api/index.js +8 -7
- package/dist/api/index.js.map +1 -0
- package/dist/api/types.cjs +2 -1
- package/dist/api/types.cjs.map +1 -0
- package/dist/api/types.js +2 -1
- package/dist/api/types.js.map +1 -0
- package/dist/chains/chains.cjs +13 -12
- package/dist/chains/chains.cjs.map +1 -0
- package/dist/chains/chains.js +12 -11
- package/dist/chains/chains.js.map +1 -0
- package/dist/chains/definitions/arcTestnet.cjs +4 -3
- package/dist/chains/definitions/arcTestnet.cjs.map +1 -0
- package/dist/chains/definitions/arcTestnet.js +3 -2
- package/dist/chains/definitions/arcTestnet.js.map +1 -0
- package/dist/chains/definitions/story.cjs +4 -3
- package/dist/chains/definitions/story.cjs.map +1 -0
- package/dist/chains/definitions/story.js +3 -2
- package/dist/chains/definitions/story.js.map +1 -0
- package/dist/chains/definitions/storyTestnet.cjs +4 -3
- package/dist/chains/definitions/storyTestnet.cjs.map +1 -0
- package/dist/chains/definitions/storyTestnet.js +3 -2
- package/dist/chains/definitions/storyTestnet.js.map +1 -0
- package/dist/chains/definitions/tempo.cjs +4 -3
- package/dist/chains/definitions/tempo.cjs.map +1 -0
- package/dist/chains/definitions/tempo.js +3 -2
- package/dist/chains/definitions/tempo.js.map +1 -0
- package/dist/chains/definitions/tempoTestnet.cjs +4 -3
- package/dist/chains/definitions/tempoTestnet.cjs.map +1 -0
- package/dist/chains/definitions/tempoTestnet.js +3 -2
- package/dist/chains/definitions/tempoTestnet.js.map +1 -0
- package/dist/{chunk-TPW2OJIB.js → chunk-2QI75IOB.js} +4 -3
- package/dist/chunk-2QI75IOB.js.map +1 -0
- package/dist/{chunk-2T5HHKUI.js → chunk-2RQYQVVY.js} +1 -0
- package/dist/chunk-2RQYQVVY.js.map +1 -0
- package/dist/{chunk-JWMQALLN.js → chunk-33TLFTHT.js} +1 -0
- package/dist/chunk-33TLFTHT.js.map +1 -0
- package/dist/{chunk-SGINWAB6.js → chunk-36C7SCPK.js} +1 -0
- package/dist/chunk-36C7SCPK.js.map +1 -0
- package/dist/{chunk-WJUPOCKJ.js → chunk-3J2BNUTO.js} +1 -0
- package/dist/chunk-3J2BNUTO.js.map +1 -0
- package/dist/{chunk-FOOISYCJ.js → chunk-3PG4HRAS.js} +2 -1
- package/dist/chunk-3PG4HRAS.js.map +1 -0
- package/dist/{chunk-ZP4ZZCIE.js → chunk-4AV3GY27.js} +2 -1
- package/dist/chunk-4AV3GY27.js.map +1 -0
- package/dist/{chunk-47WKYTRN.js → chunk-4BB7YYTT.js} +2 -1
- package/dist/chunk-4BB7YYTT.js.map +1 -0
- package/dist/{chunk-XC2V34TS.cjs → chunk-4GADBBZN.cjs} +1 -0
- package/dist/chunk-4GADBBZN.cjs.map +1 -0
- package/dist/{chunk-XTKNO44C.js → chunk-4GSHSMCA.js} +4 -3
- package/dist/chunk-4GSHSMCA.js.map +1 -0
- package/dist/{chunk-3G4P2NHM.js → chunk-5NIFUAZH.js} +4 -3
- package/dist/chunk-5NIFUAZH.js.map +1 -0
- package/dist/{chunk-TYRXXYHP.js → chunk-5OFC4HSW.js} +5 -4
- package/dist/chunk-5OFC4HSW.js.map +1 -0
- package/dist/{chunk-ZZLEVK2P.cjs → chunk-5QPU62QL.cjs} +16 -15
- package/dist/chunk-5QPU62QL.cjs.map +1 -0
- package/dist/{chunk-4GFSUI2I.cjs → chunk-6CR6FGAO.cjs} +4 -3
- package/dist/chunk-6CR6FGAO.cjs.map +1 -0
- package/dist/{chunk-JSWTGW46.cjs → chunk-6DPHKKVR.cjs} +4 -3
- package/dist/chunk-6DPHKKVR.cjs.map +1 -0
- package/dist/{chunk-MMISP35W.js → chunk-6G4QLBSO.js} +1 -0
- package/dist/chunk-6G4QLBSO.js.map +1 -0
- package/dist/{chunk-ZNAGDENG.cjs → chunk-6PIQDY3F.cjs} +4 -3
- package/dist/chunk-6PIQDY3F.cjs.map +1 -0
- package/dist/{chunk-J45OIOTF.js → chunk-6QZLBFZZ.js} +6 -5
- package/dist/chunk-6QZLBFZZ.js.map +1 -0
- package/dist/{chunk-NPTNXK47.js → chunk-7PHIXK4Q.js} +2 -1
- package/dist/chunk-7PHIXK4Q.js.map +1 -0
- package/dist/{chunk-RBHGZDDX.cjs → chunk-A3QJT5UU.cjs} +3 -2
- package/dist/chunk-A3QJT5UU.cjs.map +1 -0
- package/dist/{chunk-IBV7DELQ.js → chunk-AMS7MCD6.js} +6 -5
- package/dist/chunk-AMS7MCD6.js.map +1 -0
- package/dist/{chunk-TC6ITDWV.cjs → chunk-BBUEX3DG.cjs} +4 -3
- package/dist/chunk-BBUEX3DG.cjs.map +1 -0
- package/dist/chunk-BD3ZXT5D.js +1 -0
- package/dist/chunk-BD3ZXT5D.js.map +1 -0
- package/dist/{chunk-ZBLW42YE.js → chunk-C6WWOWGR.js} +1 -0
- package/dist/chunk-C6WWOWGR.js.map +1 -0
- package/dist/{chunk-Q5KNPVYI.cjs → chunk-CLVXR2JV.cjs} +7 -6
- package/dist/chunk-CLVXR2JV.cjs.map +1 -0
- package/dist/{chunk-55V4VMTX.cjs → chunk-CYUJJIHO.cjs} +1 -0
- package/dist/chunk-CYUJJIHO.cjs.map +1 -0
- package/dist/{chunk-7GOUUPS4.js → chunk-D2OS4757.js} +2 -1
- package/dist/chunk-D2OS4757.js.map +1 -0
- package/dist/chunk-DA47DMPI.js +1 -0
- package/dist/chunk-DA47DMPI.js.map +1 -0
- package/dist/{chunk-IPO25BCU.js → chunk-DGBAFJTM.js} +2 -1
- package/dist/chunk-DGBAFJTM.js.map +1 -0
- package/dist/{chunk-O42BRSEX.cjs → chunk-DIJNSNWN.cjs} +18 -17
- package/dist/chunk-DIJNSNWN.cjs.map +1 -0
- package/dist/{chunk-7USEVMTW.cjs → chunk-DN2SNZIX.cjs} +1 -0
- package/dist/chunk-DN2SNZIX.cjs.map +1 -0
- package/dist/{chunk-PIFD6KNH.js → chunk-EKMTR3GD.js} +3 -2
- package/dist/chunk-EKMTR3GD.js.map +1 -0
- package/dist/{chunk-COR3CNRW.cjs → chunk-FLI7NWQN.cjs} +130 -129
- package/dist/chunk-FLI7NWQN.cjs.map +1 -0
- package/dist/{chunk-NIBKCMQ2.cjs → chunk-G43MR76L.cjs} +1 -0
- package/dist/chunk-G43MR76L.cjs.map +1 -0
- package/dist/{chunk-XOCC3MPK.cjs → chunk-GGMUF77N.cjs} +4 -3
- package/dist/chunk-GGMUF77N.cjs.map +1 -0
- package/dist/{chunk-FGGGBNUF.js → chunk-GNU6RIKU.js} +8 -7
- package/dist/chunk-GNU6RIKU.js.map +1 -0
- package/dist/{chunk-H3XAAMD3.cjs → chunk-H6BH7OK4.cjs} +16 -15
- package/dist/chunk-H6BH7OK4.cjs.map +1 -0
- package/dist/{chunk-DENEF27X.js → chunk-HP6T3FTF.js} +5 -4
- package/dist/chunk-HP6T3FTF.js.map +1 -0
- package/dist/{chunk-RHR6P2KP.cjs → chunk-I2O3XXRZ.cjs} +1 -0
- package/dist/chunk-I2O3XXRZ.cjs.map +1 -0
- package/dist/chunk-IE4R2VDM.cjs +1 -0
- package/dist/chunk-IE4R2VDM.cjs.map +1 -0
- package/dist/{chunk-KD6N62YZ.js → chunk-IP6APT2S.js} +5 -4
- package/dist/chunk-IP6APT2S.js.map +1 -0
- package/dist/{chunk-BMMZIPXT.js → chunk-IUSTF2DR.js} +3 -2
- package/dist/chunk-IUSTF2DR.js.map +1 -0
- package/dist/{chunk-XMVAZ7EW.cjs → chunk-IYQMWYQI.cjs} +12 -11
- package/dist/chunk-IYQMWYQI.cjs.map +1 -0
- package/dist/{chunk-3ASKCQJN.cjs → chunk-IZYJJUOE.cjs} +37 -36
- package/dist/chunk-IZYJJUOE.cjs.map +1 -0
- package/dist/{chunk-HTSQPZHW.cjs → chunk-J2OH6EMB.cjs} +1 -0
- package/dist/chunk-J2OH6EMB.cjs.map +1 -0
- package/dist/{chunk-DPZIHSN7.js → chunk-J6AO2ZDU.js} +8 -6
- package/dist/chunk-J6AO2ZDU.js.map +1 -0
- package/dist/{chunk-ASE2FXWP.js → chunk-JF4JR5QQ.js} +1 -0
- package/dist/chunk-JF4JR5QQ.js.map +1 -0
- package/dist/{chunk-2I2OFGNL.js → chunk-JMRG565N.js} +2 -1
- package/dist/chunk-JMRG565N.js.map +1 -0
- package/dist/{chunk-DZ6MCPD3.js → chunk-JXXXM7AV.js} +2 -1
- package/dist/chunk-JXXXM7AV.js.map +1 -0
- package/dist/{chunk-ZT7EGOCI.cjs → chunk-KV7KHODO.cjs} +1 -0
- package/dist/chunk-KV7KHODO.cjs.map +1 -0
- package/dist/{chunk-LPR7BODP.cjs → chunk-KXXRVRR6.cjs} +10 -9
- package/dist/chunk-KXXRVRR6.cjs.map +1 -0
- package/dist/chunk-L33DZOLM.cjs +1 -0
- package/dist/chunk-L33DZOLM.cjs.map +1 -0
- package/dist/chunk-M2OFHRMU.cjs +1 -0
- package/dist/chunk-M2OFHRMU.cjs.map +1 -0
- package/dist/{chunk-ZTEMOYS2.cjs → chunk-NAGMAP3Y.cjs} +4 -3
- package/dist/chunk-NAGMAP3Y.cjs.map +1 -0
- package/dist/{chunk-PK7J3Y3L.js → chunk-NG77OKLY.js} +2 -1
- package/dist/chunk-NG77OKLY.js.map +1 -0
- package/dist/{chunk-HH3MM7IJ.cjs → chunk-NQR4AQOW.cjs} +2 -1
- package/dist/chunk-NQR4AQOW.cjs.map +1 -0
- package/dist/chunk-PHGHKSBT.js +1 -0
- package/dist/chunk-PHGHKSBT.js.map +1 -0
- package/dist/{chunk-G6QJHFSY.cjs → chunk-QFE6TYBN.cjs} +1 -0
- package/dist/chunk-QFE6TYBN.cjs.map +1 -0
- package/dist/{chunk-PJOJIRTY.js → chunk-QUIRXKKE.js} +1 -0
- package/dist/chunk-QUIRXKKE.js.map +1 -0
- package/dist/chunk-RB7HTHG4.js +1 -0
- package/dist/chunk-RB7HTHG4.js.map +1 -0
- package/dist/{chunk-IOMKHF6R.cjs → chunk-RJ3VNO74.cjs} +4 -3
- package/dist/chunk-RJ3VNO74.cjs.map +1 -0
- package/dist/chunk-RLWGW5R2.js +1 -0
- package/dist/chunk-RLWGW5R2.js.map +1 -0
- package/dist/{chunk-AEGU53OM.cjs → chunk-RPLIXWF3.cjs} +11 -10
- package/dist/chunk-RPLIXWF3.cjs.map +1 -0
- package/dist/{chunk-3SYMIYEW.js → chunk-RUUBB4EB.js} +10 -9
- package/dist/chunk-RUUBB4EB.js.map +1 -0
- package/dist/{chunk-SJSXTTSY.cjs → chunk-TONAC74L.cjs} +121 -119
- package/dist/chunk-TONAC74L.cjs.map +1 -0
- package/dist/{chunk-F7L2TZ3I.cjs → chunk-TXLF6BM6.cjs} +1 -0
- package/dist/chunk-TXLF6BM6.cjs.map +1 -0
- package/dist/{chunk-3KEY2NLC.js → chunk-UAFXNE4C.js} +5 -4
- package/dist/chunk-UAFXNE4C.js.map +1 -0
- package/dist/chunk-UBZ7RWBZ.cjs +1 -0
- package/dist/chunk-UBZ7RWBZ.cjs.map +1 -0
- package/dist/chunk-UDLDOYUB.cjs +1 -0
- package/dist/chunk-UDLDOYUB.cjs.map +1 -0
- package/dist/chunk-V5HHKVTT.cjs +59 -0
- package/dist/chunk-V5HHKVTT.cjs.map +1 -0
- package/dist/{chunk-AYE7XUR2.js → chunk-VIL33DEX.js} +8 -7
- package/dist/chunk-VIL33DEX.js.map +1 -0
- package/dist/{chunk-UO2J2ZB2.cjs → chunk-W4VYO3P6.cjs} +1 -0
- package/dist/chunk-W4VYO3P6.cjs.map +1 -0
- package/dist/{chunk-KN3AKBVY.cjs → chunk-W5LNQWQD.cjs} +10 -9
- package/dist/chunk-W5LNQWQD.cjs.map +1 -0
- package/dist/{chunk-3WF7K4KF.cjs → chunk-XOVH2G3J.cjs} +38 -37
- package/dist/chunk-XOVH2G3J.cjs.map +1 -0
- package/dist/{chunk-NFV5K2D2.cjs → chunk-XWXIO5PH.cjs} +32 -31
- package/dist/chunk-XWXIO5PH.cjs.map +1 -0
- package/dist/{chunk-Y35UJFTB.cjs → chunk-Y3CJJ3GO.cjs} +55 -54
- package/dist/chunk-Y3CJJ3GO.cjs.map +1 -0
- package/dist/{chunk-3U6UAYOV.js → chunk-Y5AADOPZ.js} +1 -0
- package/dist/chunk-Y5AADOPZ.js.map +1 -0
- package/dist/{chunk-KT3CVXFG.js → chunk-ZEH4W3O4.js} +1 -0
- package/dist/chunk-ZEH4W3O4.js.map +1 -0
- package/dist/index.cjs +37 -36
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +36 -35
- package/dist/index.js.map +1 -0
- package/dist/logger/index.cjs +6 -5
- package/dist/logger/index.cjs.map +1 -0
- package/dist/logger/index.js +5 -4
- package/dist/logger/index.js.map +1 -0
- package/dist/logger/init.cjs +5 -4
- package/dist/logger/init.cjs.map +1 -0
- package/dist/logger/init.js +4 -3
- package/dist/logger/init.js.map +1 -0
- package/dist/sdk.cjs +34 -33
- package/dist/sdk.cjs.map +1 -0
- package/dist/sdk.js +33 -32
- package/dist/sdk.js.map +1 -0
- package/dist/signers/evm-api-key.cjs +4 -3
- package/dist/signers/evm-api-key.cjs.map +1 -0
- package/dist/signers/evm-api-key.js +3 -2
- package/dist/signers/evm-api-key.js.map +1 -0
- package/dist/signers/evm-external-wallet.cjs +4 -3
- package/dist/signers/evm-external-wallet.cjs.map +1 -0
- package/dist/signers/evm-external-wallet.js +3 -2
- package/dist/signers/evm-external-wallet.js.map +1 -0
- package/dist/signers/index.cjs +21 -20
- package/dist/signers/index.cjs.map +1 -0
- package/dist/signers/index.js +20 -19
- package/dist/signers/index.js.map +1 -0
- package/dist/signers/non-custodial/index.cjs +13 -12
- package/dist/signers/non-custodial/index.cjs.map +1 -0
- package/dist/signers/non-custodial/index.js +12 -11
- package/dist/signers/non-custodial/index.js.map +1 -0
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +10 -9
- package/dist/signers/non-custodial/ncs-evm-signer.cjs.map +1 -0
- package/dist/signers/non-custodial/ncs-evm-signer.js +9 -8
- package/dist/signers/non-custodial/ncs-evm-signer.js.map +1 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs +4 -3
- package/dist/signers/non-custodial/ncs-iframe-manager.cjs.map +1 -0
- package/dist/signers/non-custodial/ncs-iframe-manager.js +3 -2
- package/dist/signers/non-custodial/ncs-iframe-manager.js.map +1 -0
- package/dist/signers/non-custodial/ncs-signer.cjs +9 -8
- package/dist/signers/non-custodial/ncs-signer.cjs.map +1 -0
- package/dist/signers/non-custodial/ncs-signer.js +8 -7
- package/dist/signers/non-custodial/ncs-signer.js.map +1 -0
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +10 -9
- package/dist/signers/non-custodial/ncs-solana-signer.cjs.map +1 -0
- package/dist/signers/non-custodial/ncs-solana-signer.js +9 -8
- package/dist/signers/non-custodial/ncs-solana-signer.js.map +1 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +10 -9
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs.map +1 -0
- package/dist/signers/non-custodial/ncs-stellar-signer.js +9 -8
- package/dist/signers/non-custodial/ncs-stellar-signer.js.map +1 -0
- package/dist/signers/passkey.cjs +4 -3
- package/dist/signers/passkey.cjs.map +1 -0
- package/dist/signers/passkey.js +3 -2
- package/dist/signers/passkey.js.map +1 -0
- package/dist/signers/solana-api-key.cjs +4 -3
- package/dist/signers/solana-api-key.cjs.map +1 -0
- package/dist/signers/solana-api-key.js +3 -2
- package/dist/signers/solana-api-key.js.map +1 -0
- package/dist/signers/solana-external-wallet.cjs +5 -4
- package/dist/signers/solana-external-wallet.cjs.map +1 -0
- package/dist/signers/solana-external-wallet.js +4 -3
- package/dist/signers/solana-external-wallet.js.map +1 -0
- package/dist/signers/stellar-external-wallet.cjs +4 -3
- package/dist/signers/stellar-external-wallet.cjs.map +1 -0
- package/dist/signers/stellar-external-wallet.js +3 -2
- package/dist/signers/stellar-external-wallet.js.map +1 -0
- package/dist/signers/types.cjs +4 -3
- package/dist/signers/types.cjs.map +1 -0
- package/dist/signers/types.js +3 -2
- package/dist/signers/types.js.map +1 -0
- package/dist/utils/constants.cjs +4 -3
- package/dist/utils/constants.cjs.map +1 -0
- package/dist/utils/constants.js +3 -2
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/errors.cjs +4 -3
- package/dist/utils/errors.cjs.map +1 -0
- package/dist/utils/errors.js +3 -2
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/signer-validation.cjs +5 -4
- package/dist/utils/signer-validation.cjs.map +1 -0
- package/dist/utils/signer-validation.js +4 -3
- package/dist/utils/signer-validation.js.map +1 -0
- package/dist/wallets/__tests__/setup.cjs +4 -3
- package/dist/wallets/__tests__/setup.cjs.map +1 -0
- package/dist/wallets/__tests__/setup.js +2 -1
- package/dist/wallets/__tests__/setup.js.map +1 -0
- package/dist/wallets/__tests__/test-helpers.cjs +22 -21
- package/dist/wallets/__tests__/test-helpers.cjs.map +1 -0
- package/dist/wallets/__tests__/test-helpers.js +20 -19
- package/dist/wallets/__tests__/test-helpers.js.map +1 -0
- package/dist/wallets/evm.cjs +22 -21
- package/dist/wallets/evm.cjs.map +1 -0
- package/dist/wallets/evm.js +21 -20
- package/dist/wallets/evm.js.map +1 -0
- package/dist/wallets/solana.cjs +23 -22
- package/dist/wallets/solana.cjs.map +1 -0
- package/dist/wallets/solana.js +22 -21
- package/dist/wallets/solana.js.map +1 -0
- package/dist/wallets/stellar.cjs +22 -21
- package/dist/wallets/stellar.cjs.map +1 -0
- package/dist/wallets/stellar.js +21 -20
- package/dist/wallets/stellar.js.map +1 -0
- package/dist/wallets/types.cjs +1 -1
- package/dist/wallets/types.cjs.map +1 -0
- package/dist/wallets/types.js +1 -0
- package/dist/wallets/types.js.map +1 -0
- package/dist/wallets/wallet-factory.cjs +30 -29
- package/dist/wallets/wallet-factory.cjs.map +1 -0
- package/dist/wallets/wallet-factory.js +29 -28
- package/dist/wallets/wallet-factory.js.map +1 -0
- package/dist/wallets/wallet.cjs +21 -20
- package/dist/wallets/wallet.cjs.map +1 -0
- package/dist/wallets/wallet.js +20 -19
- package/dist/wallets/wallet.js.map +1 -0
- package/package.json +47 -50
- package/dist/chunk-455NK5LB.js +0 -0
- package/dist/chunk-5IFDVB4Y.js +0 -0
- package/dist/chunk-6HXIZLEQ.cjs +0 -1
- package/dist/chunk-CCIGWTAO.cjs +0 -1
- package/dist/chunk-ECAM5KTH.cjs +0 -1
- package/dist/chunk-KBJA7JDT.js +0 -0
- package/dist/chunk-LONKAMXJ.cjs +0 -58
- package/dist/chunk-PO6S7UR3.cjs +0 -1
- package/dist/chunk-XPMCPXI3.cjs +0 -1
- package/dist/chunk-YDZRBHS3.js +0 -0
- package/dist/chunk-YMRXMNME.js +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIZYJJUOEcjs = require('./chunk-IZYJJUOE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkH6BH7OK4cjs = require('./chunk-H6BH7OK4.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -18,13 +18,13 @@ var _chunkH3XAAMD3cjs = require('./chunk-H3XAAMD3.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunk4GADBBZNcjs = require('./chunk-4GADBBZN.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkBBUEX3DGcjs = require('./chunk-BBUEX3DG.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkNQR4AQOWcjs = require('./chunk-NQR4AQOW.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -33,22 +33,22 @@ var _chunkHH3MM7IJcjs = require('./chunk-HH3MM7IJ.cjs');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
var
|
|
36
|
+
var _chunkW4VYO3P6cjs = require('./chunk-W4VYO3P6.cjs');
|
|
37
37
|
|
|
38
38
|
// src/wallets/wallet.ts
|
|
39
39
|
var _commonsdkbase = require('@crossmint/common-sdk-base');
|
|
40
40
|
var _options, _apiClient;
|
|
41
41
|
var Wallet = class {
|
|
42
42
|
constructor(args, apiClient) {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
_chunkW4VYO3P6cjs.__privateAdd.call(void 0, this, _options);
|
|
44
|
+
_chunkW4VYO3P6cjs.__privateAdd.call(void 0, this, _apiClient);
|
|
45
45
|
const { chain, address, owner, signer, options, alias } = args;
|
|
46
|
-
|
|
46
|
+
_chunkW4VYO3P6cjs.__privateSet.call(void 0, this, _apiClient, apiClient);
|
|
47
47
|
this.chain = chain;
|
|
48
48
|
this.address = address;
|
|
49
49
|
this.owner = owner;
|
|
50
50
|
this.signer = signer;
|
|
51
|
-
|
|
51
|
+
_chunkW4VYO3P6cjs.__privateSet.call(void 0, this, _options, options);
|
|
52
52
|
this.alias = alias;
|
|
53
53
|
}
|
|
54
54
|
static getApiClient(wallet) {
|
|
@@ -58,10 +58,10 @@ var Wallet = class {
|
|
|
58
58
|
return wallet.options;
|
|
59
59
|
}
|
|
60
60
|
get apiClient() {
|
|
61
|
-
return
|
|
61
|
+
return _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient);
|
|
62
62
|
}
|
|
63
63
|
get options() {
|
|
64
|
-
return
|
|
64
|
+
return _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _options);
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Get the API client
|
|
@@ -69,11 +69,11 @@ var Wallet = class {
|
|
|
69
69
|
* @experimental This API is experimental and may change in the future
|
|
70
70
|
*/
|
|
71
71
|
experimental_apiClient() {
|
|
72
|
-
return
|
|
72
|
+
return _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient);
|
|
73
73
|
}
|
|
74
74
|
balances(tokens) {
|
|
75
|
-
return
|
|
76
|
-
|
|
75
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
76
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.balances.start");
|
|
77
77
|
const resolvedChain = this.resolveChainForEnvironment();
|
|
78
78
|
let nativeToken;
|
|
79
79
|
switch (this.chain) {
|
|
@@ -88,21 +88,21 @@ var Wallet = class {
|
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
const allTokens = [nativeToken, "usdc", ...tokens != null ? tokens : []];
|
|
91
|
-
const response = yield
|
|
91
|
+
const response = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getBalance(this.address, {
|
|
92
92
|
chains: [resolvedChain],
|
|
93
93
|
tokens: allTokens
|
|
94
94
|
});
|
|
95
95
|
if ("error" in response) {
|
|
96
|
-
|
|
96
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.balances.error", { error: response });
|
|
97
97
|
throw new Error(`Failed to get balances for wallet: ${JSON.stringify(response.message)}`);
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.balances.success");
|
|
100
100
|
return this.transformBalanceResponse(response, nativeToken, tokens);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
stagingFund(amount, chain) {
|
|
104
|
-
return
|
|
105
|
-
|
|
104
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
105
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.stagingFund.start", {
|
|
106
106
|
amount,
|
|
107
107
|
chain: chain != null ? chain : this.chain
|
|
108
108
|
});
|
|
@@ -114,12 +114,12 @@ var Wallet = class {
|
|
|
114
114
|
chain: chain != null ? chain : this.chain
|
|
115
115
|
});
|
|
116
116
|
if ("error" in response) {
|
|
117
|
-
|
|
117
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.stagingFund.error", {
|
|
118
118
|
error: response
|
|
119
119
|
});
|
|
120
120
|
throw new Error(`Failed to fund wallet: ${JSON.stringify(response.message)}`);
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.stagingFund.success");
|
|
123
123
|
return response;
|
|
124
124
|
});
|
|
125
125
|
}
|
|
@@ -141,7 +141,7 @@ var Wallet = class {
|
|
|
141
141
|
contractAddress: chainData.contractAddress
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
return
|
|
144
|
+
return _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {
|
|
145
145
|
symbol: (_b = tokenData.symbol) != null ? _b : "",
|
|
146
146
|
name: (_c = tokenData.name) != null ? _c : "",
|
|
147
147
|
amount: (_d = tokenData.amount) != null ? _d : "0",
|
|
@@ -170,7 +170,7 @@ var Wallet = class {
|
|
|
170
170
|
} else {
|
|
171
171
|
chainSpecificField = { contractAddress: void 0 };
|
|
172
172
|
}
|
|
173
|
-
return
|
|
173
|
+
return _chunkW4VYO3P6cjs.__spreadValues.call(void 0, _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {}, baseToken), chainSpecificField);
|
|
174
174
|
};
|
|
175
175
|
return {
|
|
176
176
|
nativeToken: nativeTokenData != null ? transformTokenBalance(nativeTokenData) : createDefaultToken(nativeTokenSymbol),
|
|
@@ -188,8 +188,8 @@ var Wallet = class {
|
|
|
188
188
|
* @experimental This API is experimental and may change in the future
|
|
189
189
|
*/
|
|
190
190
|
experimental_nfts(params) {
|
|
191
|
-
return
|
|
192
|
-
return yield
|
|
191
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
192
|
+
return yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).experimental_getNfts(_chunkW4VYO3P6cjs.__spreadProps.call(void 0, _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {}, params), {
|
|
193
193
|
chain: this.chain,
|
|
194
194
|
address: this.address
|
|
195
195
|
}));
|
|
@@ -201,8 +201,8 @@ var Wallet = class {
|
|
|
201
201
|
* @throws {Error} If the transactions cannot be retrieved
|
|
202
202
|
*/
|
|
203
203
|
experimental_transactions() {
|
|
204
|
-
return
|
|
205
|
-
const response = yield
|
|
204
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
205
|
+
const response = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getTransactions(this.walletLocator);
|
|
206
206
|
if ("error" in response) {
|
|
207
207
|
throw new Error(`Failed to get transactions: ${JSON.stringify(response.message)}`);
|
|
208
208
|
}
|
|
@@ -215,8 +215,8 @@ var Wallet = class {
|
|
|
215
215
|
* @throws {Error} If the transaction cannot be retrieved
|
|
216
216
|
*/
|
|
217
217
|
experimental_transaction(transactionId) {
|
|
218
|
-
return
|
|
219
|
-
const response = yield
|
|
218
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
219
|
+
const response = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getTransaction(this.walletLocator, transactionId);
|
|
220
220
|
if ("error" in response) {
|
|
221
221
|
throw new Error(`Failed to get transaction: ${JSON.stringify(response.error)}`);
|
|
222
222
|
}
|
|
@@ -230,7 +230,7 @@ var Wallet = class {
|
|
|
230
230
|
* @throws {Error} If the activity cannot be retrieved
|
|
231
231
|
*/
|
|
232
232
|
experimental_activity() {
|
|
233
|
-
return
|
|
233
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
234
234
|
const resolvedChain = this.resolveChainForEnvironment();
|
|
235
235
|
const response = yield this.apiClient.experimental_activity(this.walletLocator, { chain: resolvedChain });
|
|
236
236
|
if ("error" in response) {
|
|
@@ -240,31 +240,31 @@ var Wallet = class {
|
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
242
|
send(to, token, amount, options) {
|
|
243
|
-
return
|
|
243
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
244
244
|
const resolvedChain = this.resolveChainForEnvironment();
|
|
245
245
|
const recipient = toRecipientLocator(to);
|
|
246
246
|
const tokenLocator = toTokenLocator(token, resolvedChain);
|
|
247
|
-
|
|
247
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.send.start", _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {
|
|
248
248
|
recipient,
|
|
249
249
|
token: tokenLocator,
|
|
250
250
|
amount
|
|
251
251
|
}, (options == null ? void 0 : options.transactionType) != null ? { transactionType: options.transactionType } : {}));
|
|
252
252
|
yield this.preAuthIfNeeded();
|
|
253
|
-
const sendParams =
|
|
253
|
+
const sendParams = _chunkW4VYO3P6cjs.__spreadValues.call(void 0, _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {
|
|
254
254
|
recipient,
|
|
255
255
|
amount
|
|
256
256
|
}, (options == null ? void 0 : options.experimental_signer) != null ? { signer: options.experimental_signer } : {}), (options == null ? void 0 : options.transactionType) != null ? { transactionType: options.transactionType } : {});
|
|
257
|
-
const transactionCreationResponse = yield
|
|
257
|
+
const transactionCreationResponse = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).send(this.walletLocator, tokenLocator, sendParams);
|
|
258
258
|
if ("message" in transactionCreationResponse) {
|
|
259
|
-
|
|
259
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.send.error", {
|
|
260
260
|
error: transactionCreationResponse
|
|
261
261
|
});
|
|
262
|
-
throw new (0,
|
|
262
|
+
throw new (0, _chunk4GADBBZNcjs.TransactionNotCreatedError)(
|
|
263
263
|
`Failed to send token: ${JSON.stringify(transactionCreationResponse.message)}`
|
|
264
264
|
);
|
|
265
265
|
}
|
|
266
266
|
if (options == null ? void 0 : options.experimental_prepareOnly) {
|
|
267
|
-
|
|
267
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.send.prepared", {
|
|
268
268
|
transactionId: transactionCreationResponse.id
|
|
269
269
|
});
|
|
270
270
|
return {
|
|
@@ -274,7 +274,7 @@ var Wallet = class {
|
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
276
|
const result = yield this.approveTransactionAndWait(transactionCreationResponse.id);
|
|
277
|
-
|
|
277
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.send.success", {
|
|
278
278
|
transactionId: transactionCreationResponse.id,
|
|
279
279
|
hash: result.hash
|
|
280
280
|
});
|
|
@@ -293,7 +293,7 @@ var Wallet = class {
|
|
|
293
293
|
*/
|
|
294
294
|
// TODO: Remove this method in the next major version
|
|
295
295
|
approveTransaction(params) {
|
|
296
|
-
return
|
|
296
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
297
297
|
console.warn(
|
|
298
298
|
"approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."
|
|
299
299
|
);
|
|
@@ -301,70 +301,71 @@ var Wallet = class {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
approve(params) {
|
|
304
|
-
return
|
|
305
|
-
|
|
304
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
305
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.approve.start", {
|
|
306
306
|
transactionId: params.transactionId,
|
|
307
307
|
signatureId: params.signatureId
|
|
308
308
|
});
|
|
309
|
+
yield this.preAuthIfNeeded();
|
|
309
310
|
if (params.transactionId != null) {
|
|
310
311
|
const result = yield this.approveTransactionAndWait(
|
|
311
312
|
params.transactionId,
|
|
312
313
|
params.options
|
|
313
314
|
);
|
|
314
|
-
|
|
315
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.approve.success", {
|
|
315
316
|
transactionId: params.transactionId
|
|
316
317
|
});
|
|
317
318
|
return result;
|
|
318
319
|
}
|
|
319
320
|
if (params.signatureId != null) {
|
|
320
321
|
const result = yield this.approveSignatureAndWait(params.signatureId, params.options);
|
|
321
|
-
|
|
322
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.approve.success", {
|
|
322
323
|
signatureId: params.signatureId
|
|
323
324
|
});
|
|
324
325
|
return result;
|
|
325
326
|
}
|
|
326
|
-
|
|
327
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.approve.error", {
|
|
327
328
|
error: "Either transactionId or signatureId must be provided"
|
|
328
329
|
});
|
|
329
330
|
throw new Error("Either transactionId or signatureId must be provided");
|
|
330
331
|
});
|
|
331
332
|
}
|
|
332
333
|
addDelegatedSigner(params) {
|
|
333
|
-
return
|
|
334
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
334
335
|
var _a, _b, _c;
|
|
335
|
-
|
|
336
|
-
const response = yield
|
|
336
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.start");
|
|
337
|
+
const response = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).registerSigner(this.walletLocator, {
|
|
337
338
|
signer: params.signer,
|
|
338
339
|
chain: this.chain === "solana" || this.chain === "stellar" ? void 0 : this.chain
|
|
339
340
|
});
|
|
340
341
|
if ("error" in response) {
|
|
341
|
-
|
|
342
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
|
|
342
343
|
error: response
|
|
343
344
|
});
|
|
344
345
|
throw new Error(`Failed to register signer: ${JSON.stringify(response.message)}`);
|
|
345
346
|
}
|
|
346
347
|
if (this.chain === "solana" || this.chain === "stellar") {
|
|
347
348
|
if (!("transaction" in response) || response.transaction == null) {
|
|
348
|
-
|
|
349
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
|
|
349
350
|
error: "Expected transaction in response for Solana/Stellar chain"
|
|
350
351
|
});
|
|
351
352
|
throw new Error("Expected transaction in response for Solana/Stellar chain");
|
|
352
353
|
}
|
|
353
354
|
const transactionId = response.transaction.id;
|
|
354
355
|
if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
|
|
355
|
-
|
|
356
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
|
|
356
357
|
transactionId
|
|
357
358
|
});
|
|
358
359
|
return { transactionId };
|
|
359
360
|
}
|
|
360
361
|
yield this.approveTransactionAndWait(transactionId);
|
|
361
|
-
|
|
362
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
|
|
362
363
|
transactionId
|
|
363
364
|
});
|
|
364
365
|
return void 0;
|
|
365
366
|
}
|
|
366
367
|
if (!("chains" in response)) {
|
|
367
|
-
|
|
368
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
|
|
368
369
|
error: "Expected chains in response for EVM chain"
|
|
369
370
|
});
|
|
370
371
|
throw new Error("Expected chains in response for EVM chain");
|
|
@@ -372,45 +373,45 @@ var Wallet = class {
|
|
|
372
373
|
const chainResponse = (_b = response.chains) == null ? void 0 : _b[this.chain];
|
|
373
374
|
if ((_c = params.options) == null ? void 0 : _c.experimental_prepareOnly) {
|
|
374
375
|
const signatureId = (chainResponse == null ? void 0 : chainResponse.status) !== "success" ? chainResponse == null ? void 0 : chainResponse.id : void 0;
|
|
375
|
-
|
|
376
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
|
|
376
377
|
signatureId
|
|
377
378
|
});
|
|
378
379
|
return { signatureId };
|
|
379
380
|
}
|
|
380
381
|
if ((chainResponse == null ? void 0 : chainResponse.status) === "awaiting-approval") {
|
|
381
382
|
yield this.approveSignatureAndWait(chainResponse.id);
|
|
382
|
-
|
|
383
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
|
|
383
384
|
signatureId: chainResponse.id
|
|
384
385
|
});
|
|
385
386
|
return void 0;
|
|
386
387
|
}
|
|
387
388
|
if ((chainResponse == null ? void 0 : chainResponse.status) === "pending") {
|
|
388
389
|
yield this.waitForSignature(chainResponse.id);
|
|
389
|
-
|
|
390
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
|
|
390
391
|
signatureId: chainResponse.id
|
|
391
392
|
});
|
|
392
393
|
return void 0;
|
|
393
394
|
}
|
|
394
|
-
|
|
395
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.addDelegatedSigner.success");
|
|
395
396
|
return void 0;
|
|
396
397
|
});
|
|
397
398
|
}
|
|
398
399
|
delegatedSigners() {
|
|
399
|
-
return
|
|
400
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
400
401
|
var _a, _b, _c;
|
|
401
|
-
|
|
402
|
-
const walletResponse = yield
|
|
402
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.delegatedSigners.start");
|
|
403
|
+
const walletResponse = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getWallet(this.walletLocator);
|
|
403
404
|
if ("error" in walletResponse) {
|
|
404
|
-
|
|
405
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.delegatedSigners.error", {
|
|
405
406
|
error: walletResponse
|
|
406
407
|
});
|
|
407
|
-
throw new (0,
|
|
408
|
+
throw new (0, _chunk4GADBBZNcjs.WalletNotAvailableError)(JSON.stringify(walletResponse));
|
|
408
409
|
}
|
|
409
410
|
if (walletResponse.type !== "smart" || walletResponse.chainType !== "evm" && walletResponse.chainType !== "solana" && walletResponse.chainType !== "stellar") {
|
|
410
|
-
|
|
411
|
+
_chunkBBUEX3DGcjs.walletsLogger.error("wallet.delegatedSigners.error", {
|
|
411
412
|
error: `Wallet type ${walletResponse.type} not supported`
|
|
412
413
|
});
|
|
413
|
-
throw new (0,
|
|
414
|
+
throw new (0, _chunk4GADBBZNcjs.WalletTypeNotSupportedError)(`Wallet type ${walletResponse.type} not supported`);
|
|
414
415
|
}
|
|
415
416
|
const signers = (_c = (_b = (_a = walletResponse == null ? void 0 : walletResponse.config) == null ? void 0 : _a.delegatedSigners) == null ? void 0 : _b.map((signer) => {
|
|
416
417
|
const colonIndex = signer.locator.indexOf(":");
|
|
@@ -419,14 +420,14 @@ var Wallet = class {
|
|
|
419
420
|
signer: `external-wallet:${address}`
|
|
420
421
|
};
|
|
421
422
|
})) != null ? _c : [];
|
|
422
|
-
|
|
423
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.delegatedSigners.success", {
|
|
423
424
|
count: signers.length
|
|
424
425
|
});
|
|
425
426
|
return signers;
|
|
426
427
|
});
|
|
427
428
|
}
|
|
428
429
|
get walletLocator() {
|
|
429
|
-
if (
|
|
430
|
+
if (_chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).isServerSide) {
|
|
430
431
|
return this.address;
|
|
431
432
|
} else {
|
|
432
433
|
let baseLocator;
|
|
@@ -446,8 +447,8 @@ var Wallet = class {
|
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
449
|
preAuthIfNeeded() {
|
|
449
|
-
return
|
|
450
|
-
if (this.signer instanceof
|
|
450
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
451
|
+
if (this.signer instanceof _chunkIZYJJUOEcjs.NonCustodialSigner) {
|
|
451
452
|
yield this.signer.ensureAuthenticated();
|
|
452
453
|
}
|
|
453
454
|
});
|
|
@@ -456,21 +457,21 @@ var Wallet = class {
|
|
|
456
457
|
return this.chain === "solana";
|
|
457
458
|
}
|
|
458
459
|
resolveChainForEnvironment() {
|
|
459
|
-
const resolvedChain =
|
|
460
|
+
const resolvedChain = _chunkH6BH7OK4cjs.validateChainForEnvironment.call(void 0, this.chain, _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).environment);
|
|
460
461
|
if (resolvedChain !== this.chain) {
|
|
461
462
|
this.chain = resolvedChain;
|
|
462
463
|
}
|
|
463
464
|
return this.chain;
|
|
464
465
|
}
|
|
465
466
|
approveTransactionAndWait(transactionId, options) {
|
|
466
|
-
return
|
|
467
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
467
468
|
yield this.approveTransactionInternal(transactionId, options);
|
|
468
469
|
yield this.sleep(1e3);
|
|
469
470
|
return yield this.waitForTransaction(transactionId);
|
|
470
471
|
});
|
|
471
472
|
}
|
|
472
473
|
approveSignatureAndWait(signatureId, options) {
|
|
473
|
-
return
|
|
474
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
474
475
|
const signatureResponse = yield this.approveSignatureInternal(signatureId, options);
|
|
475
476
|
if (!("error" in signatureResponse) && signatureResponse.status === "success" && signatureResponse.outputSignature != null) {
|
|
476
477
|
return {
|
|
@@ -483,14 +484,14 @@ var Wallet = class {
|
|
|
483
484
|
});
|
|
484
485
|
}
|
|
485
486
|
approveSignatureInternal(signatureId, options) {
|
|
486
|
-
return
|
|
487
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
487
488
|
var _a, _b;
|
|
488
489
|
if (this.isSolanaWallet) {
|
|
489
490
|
throw new Error("Approving signatures is only supported for EVM smart wallets");
|
|
490
491
|
}
|
|
491
|
-
const signature = yield
|
|
492
|
+
const signature = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getSignature(this.walletLocator, signatureId);
|
|
492
493
|
if ("error" in signature) {
|
|
493
|
-
throw new (0,
|
|
494
|
+
throw new (0, _chunk4GADBBZNcjs.SignatureNotAvailableError)(JSON.stringify(signature));
|
|
494
495
|
}
|
|
495
496
|
if (this.signer.type === "api-key") {
|
|
496
497
|
return signature;
|
|
@@ -505,13 +506,13 @@ var Wallet = class {
|
|
|
505
506
|
}
|
|
506
507
|
const signers = [...(_b = options == null ? void 0 : options.additionalSigners) != null ? _b : [], this.signer];
|
|
507
508
|
const approvals = yield Promise.all(
|
|
508
|
-
pendingApprovals.map((pendingApproval) =>
|
|
509
|
+
pendingApprovals.map((pendingApproval) => _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
509
510
|
const signer = signers.find((s) => s.locator() === pendingApproval.signer.locator);
|
|
510
511
|
if (signer == null) {
|
|
511
|
-
throw new (0,
|
|
512
|
+
throw new (0, _chunk4GADBBZNcjs.InvalidSignerError)(`Signer ${pendingApproval.signer} not found in pending approvals`);
|
|
512
513
|
}
|
|
513
514
|
const signature2 = yield signer.signMessage(pendingApproval.message);
|
|
514
|
-
return
|
|
515
|
+
return _chunkW4VYO3P6cjs.__spreadProps.call(void 0, _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {}, signature2), {
|
|
515
516
|
signer: signer.locator()
|
|
516
517
|
});
|
|
517
518
|
}))
|
|
@@ -520,13 +521,13 @@ var Wallet = class {
|
|
|
520
521
|
});
|
|
521
522
|
}
|
|
522
523
|
approveTransactionInternal(transactionId, options) {
|
|
523
|
-
return
|
|
524
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
524
525
|
var _a, _b, _c, _d, _e;
|
|
525
|
-
const transaction = yield
|
|
526
|
+
const transaction = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getTransaction(this.walletLocator, transactionId);
|
|
526
527
|
if ("error" in transaction) {
|
|
527
|
-
throw new (0,
|
|
528
|
+
throw new (0, _chunk4GADBBZNcjs.TransactionNotAvailableError)(JSON.stringify(transaction));
|
|
528
529
|
}
|
|
529
|
-
yield (_c = (_b = (_a =
|
|
530
|
+
yield (_c = (_b = (_a = _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _options)) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onTransactionStart) == null ? void 0 : _c.call(_b);
|
|
530
531
|
if (this.signer.type === "api-key") {
|
|
531
532
|
return transaction;
|
|
532
533
|
}
|
|
@@ -540,14 +541,14 @@ var Wallet = class {
|
|
|
540
541
|
}
|
|
541
542
|
const signers = [...(_e = options == null ? void 0 : options.additionalSigners) != null ? _e : [], this.signer];
|
|
542
543
|
const approvals = yield Promise.all(
|
|
543
|
-
pendingApprovals.map((pendingApproval) =>
|
|
544
|
+
pendingApprovals.map((pendingApproval) => _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
544
545
|
const signer = signers.find((s) => s.locator() === pendingApproval.signer.locator);
|
|
545
546
|
if (signer == null) {
|
|
546
|
-
throw new (0,
|
|
547
|
+
throw new (0, _chunk4GADBBZNcjs.InvalidSignerError)(`Signer ${pendingApproval.signer} not found in pending approvals`);
|
|
547
548
|
}
|
|
548
549
|
const transactionToSign = transaction.chainType === "solana" && "transaction" in transaction.onChain ? transaction.onChain.transaction : pendingApproval.message;
|
|
549
550
|
const signature = yield signer.signTransaction(transactionToSign);
|
|
550
|
-
return
|
|
551
|
+
return _chunkW4VYO3P6cjs.__spreadProps.call(void 0, _chunkW4VYO3P6cjs.__spreadValues.call(void 0, {}, signature), {
|
|
551
552
|
signer: signer.locator()
|
|
552
553
|
});
|
|
553
554
|
}))
|
|
@@ -556,43 +557,43 @@ var Wallet = class {
|
|
|
556
557
|
});
|
|
557
558
|
}
|
|
558
559
|
executeApproveTransactionWithErrorHandling(transactionId, approvals) {
|
|
559
|
-
return
|
|
560
|
-
|
|
561
|
-
const approvedTransaction = yield
|
|
560
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
561
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.approve: submitting approval to API", { transactionId });
|
|
562
|
+
const approvedTransaction = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).approveTransaction(this.walletLocator, transactionId, {
|
|
562
563
|
approvals
|
|
563
564
|
});
|
|
564
565
|
if (approvedTransaction.error) {
|
|
565
|
-
throw new (0,
|
|
566
|
+
throw new (0, _chunk4GADBBZNcjs.TransactionFailedError)(JSON.stringify(approvedTransaction));
|
|
566
567
|
}
|
|
567
568
|
return approvedTransaction;
|
|
568
569
|
});
|
|
569
570
|
}
|
|
570
571
|
executeApproveSignatureWithErrorHandling(signatureId, approvals) {
|
|
571
|
-
return
|
|
572
|
-
const approvedSignature = yield
|
|
572
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
573
|
+
const approvedSignature = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).approveSignature(this.walletLocator, signatureId, {
|
|
573
574
|
approvals
|
|
574
575
|
});
|
|
575
576
|
if (approvedSignature.error) {
|
|
576
|
-
throw new (0,
|
|
577
|
+
throw new (0, _chunk4GADBBZNcjs.SignatureFailedError)(JSON.stringify(approvedSignature));
|
|
577
578
|
}
|
|
578
579
|
return approvedSignature;
|
|
579
580
|
});
|
|
580
581
|
}
|
|
581
582
|
waitForSignature(signatureId) {
|
|
582
|
-
return
|
|
583
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
583
584
|
let signatureResponse = null;
|
|
584
585
|
do {
|
|
585
|
-
yield new Promise((resolve) => setTimeout(resolve,
|
|
586
|
-
signatureResponse = yield
|
|
586
|
+
yield new Promise((resolve) => setTimeout(resolve, _chunkNQR4AQOWcjs.STATUS_POLLING_INTERVAL_MS));
|
|
587
|
+
signatureResponse = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getSignature(this.walletLocator, signatureId);
|
|
587
588
|
if ("error" in signatureResponse) {
|
|
588
|
-
throw new (0,
|
|
589
|
+
throw new (0, _chunk4GADBBZNcjs.SignatureNotAvailableError)(JSON.stringify(signatureResponse));
|
|
589
590
|
}
|
|
590
591
|
} while (signatureResponse === null || signatureResponse.status === "pending");
|
|
591
592
|
if (signatureResponse.status === "failed") {
|
|
592
|
-
throw new (0,
|
|
593
|
+
throw new (0, _chunk4GADBBZNcjs.SigningFailedError)("Signature signing failed");
|
|
593
594
|
}
|
|
594
595
|
if (!signatureResponse.outputSignature) {
|
|
595
|
-
throw new (0,
|
|
596
|
+
throw new (0, _chunk4GADBBZNcjs.SignatureNotAvailableError)("Signature not available");
|
|
596
597
|
}
|
|
597
598
|
return {
|
|
598
599
|
signature: signatureResponse.outputSignature,
|
|
@@ -601,42 +602,42 @@ var Wallet = class {
|
|
|
601
602
|
});
|
|
602
603
|
}
|
|
603
604
|
waitForTransaction(_0) {
|
|
604
|
-
return
|
|
605
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, arguments, function* (transactionId, timeoutMs = 6e4, {
|
|
605
606
|
backoffMultiplier = 1.1,
|
|
606
607
|
maxBackoffMs = 2e3,
|
|
607
|
-
initialBackoffMs =
|
|
608
|
+
initialBackoffMs = _chunkNQR4AQOWcjs.STATUS_POLLING_INTERVAL_MS
|
|
608
609
|
} = {}) {
|
|
609
610
|
var _a;
|
|
610
|
-
|
|
611
|
+
_chunkBBUEX3DGcjs.walletsLogger.info("wallet.approve: waiting for transaction confirmation", { transactionId, timeoutMs });
|
|
611
612
|
const startTime = Date.now();
|
|
612
613
|
let transactionResponse;
|
|
613
614
|
do {
|
|
614
615
|
if (Date.now() - startTime > timeoutMs) {
|
|
615
|
-
const error = new (0,
|
|
616
|
+
const error = new (0, _chunk4GADBBZNcjs.TransactionConfirmationTimeoutError)("Transaction confirmation timeout");
|
|
616
617
|
throw error;
|
|
617
618
|
}
|
|
618
|
-
transactionResponse = yield
|
|
619
|
+
transactionResponse = yield _chunkW4VYO3P6cjs.__privateGet.call(void 0, this, _apiClient).getTransaction(this.walletLocator, transactionId);
|
|
619
620
|
if (transactionResponse.error) {
|
|
620
|
-
throw new (0,
|
|
621
|
+
throw new (0, _chunk4GADBBZNcjs.TransactionNotAvailableError)(JSON.stringify(transactionResponse));
|
|
621
622
|
}
|
|
622
623
|
yield this.sleep(initialBackoffMs);
|
|
623
624
|
initialBackoffMs = Math.min(initialBackoffMs * backoffMultiplier, maxBackoffMs);
|
|
624
625
|
} while (transactionResponse.status === "pending");
|
|
625
626
|
if (transactionResponse.status === "failed") {
|
|
626
|
-
const error = new (0,
|
|
627
|
+
const error = new (0, _chunk4GADBBZNcjs.TransactionSendingFailedError)(
|
|
627
628
|
`Transaction sending failed: ${JSON.stringify(transactionResponse.error)}`
|
|
628
629
|
);
|
|
629
630
|
throw error;
|
|
630
631
|
}
|
|
631
632
|
if (transactionResponse.status === "awaiting-approval") {
|
|
632
|
-
const error = new (0,
|
|
633
|
+
const error = new (0, _chunk4GADBBZNcjs.TransactionAwaitingApprovalError)(
|
|
633
634
|
`Transaction is awaiting approval. Please submit required approvals before waiting for completion.`
|
|
634
635
|
);
|
|
635
636
|
throw error;
|
|
636
637
|
}
|
|
637
638
|
const transactionHash = transactionResponse.onChain.txId;
|
|
638
639
|
if (transactionHash == null) {
|
|
639
|
-
const error = new (0,
|
|
640
|
+
const error = new (0, _chunk4GADBBZNcjs.TransactionHashNotFoundError)("Transaction hash not found on transaction response");
|
|
640
641
|
throw error;
|
|
641
642
|
}
|
|
642
643
|
return {
|
|
@@ -647,61 +648,61 @@ var Wallet = class {
|
|
|
647
648
|
});
|
|
648
649
|
}
|
|
649
650
|
sleep(ms) {
|
|
650
|
-
return
|
|
651
|
+
return _chunkW4VYO3P6cjs.__async.call(void 0, this, null, function* () {
|
|
651
652
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
652
653
|
});
|
|
653
654
|
}
|
|
654
655
|
};
|
|
655
656
|
_options = new WeakMap();
|
|
656
657
|
_apiClient = new WeakMap();
|
|
657
|
-
|
|
658
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
658
659
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
659
|
-
logger:
|
|
660
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
660
661
|
methodName: "wallet.balances",
|
|
661
662
|
buildContext(thisArg) {
|
|
662
663
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
663
664
|
}
|
|
664
665
|
})
|
|
665
666
|
], Wallet.prototype, "balances", 1);
|
|
666
|
-
|
|
667
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
667
668
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
668
|
-
logger:
|
|
669
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
669
670
|
methodName: "wallet.stagingFund",
|
|
670
671
|
buildContext(thisArg) {
|
|
671
672
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
672
673
|
}
|
|
673
674
|
})
|
|
674
675
|
], Wallet.prototype, "stagingFund", 1);
|
|
675
|
-
|
|
676
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
676
677
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
677
|
-
logger:
|
|
678
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
678
679
|
methodName: "wallet.send",
|
|
679
680
|
buildContext(thisArg) {
|
|
680
681
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
681
682
|
}
|
|
682
683
|
})
|
|
683
684
|
], Wallet.prototype, "send", 1);
|
|
684
|
-
|
|
685
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
685
686
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
686
|
-
logger:
|
|
687
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
687
688
|
methodName: "wallet.approve",
|
|
688
689
|
buildContext(thisArg) {
|
|
689
690
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
690
691
|
}
|
|
691
692
|
})
|
|
692
693
|
], Wallet.prototype, "approve", 1);
|
|
693
|
-
|
|
694
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
694
695
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
695
|
-
logger:
|
|
696
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
696
697
|
methodName: "wallet.addDelegatedSigner",
|
|
697
698
|
buildContext(thisArg) {
|
|
698
699
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
699
700
|
}
|
|
700
701
|
})
|
|
701
702
|
], Wallet.prototype, "addDelegatedSigner", 1);
|
|
702
|
-
|
|
703
|
+
_chunkW4VYO3P6cjs.__decorateClass.call(void 0, [
|
|
703
704
|
_commonsdkbase.WithLoggerContext.call(void 0, {
|
|
704
|
-
logger:
|
|
705
|
+
logger: _chunkBBUEX3DGcjs.walletsLogger,
|
|
705
706
|
methodName: "wallet.delegatedSigners",
|
|
706
707
|
buildContext(thisArg) {
|
|
707
708
|
return { chain: thisArg.chain, address: thisArg.address };
|
|
@@ -739,3 +740,4 @@ function toTokenLocator(token, chain) {
|
|
|
739
740
|
|
|
740
741
|
|
|
741
742
|
exports.Wallet = Wallet;
|
|
743
|
+
//# sourceMappingURL=chunk-TONAC74L.cjs.map
|