@crossmint/wallets-sdk 1.7.0 → 1.9.0
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.d.cts +1 -1
- package/dist/api/__tests__/constants.d.ts +1 -1
- package/dist/api/__tests__/test-utils.cjs +1 -1
- package/dist/api/__tests__/test-utils.d.cts +1 -1
- package/dist/api/__tests__/test-utils.d.ts +1 -1
- package/dist/api/__tests__/test-utils.js +1 -1
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.d.cts +1 -1
- package/dist/api/client.d.ts +1 -1
- package/dist/api/client.js +1 -1
- package/dist/api/index.cjs +1 -1
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/types.d.cts +1 -1
- package/dist/api/types.d.ts +1 -1
- package/dist/chains/adapters/evm.cjs +1 -1
- package/dist/chains/adapters/evm.d.cts +1 -1
- package/dist/chains/adapters/evm.d.ts +1 -1
- package/dist/chains/adapters/evm.js +1 -1
- package/dist/chains/adapters/solana.cjs +1 -1
- package/dist/chains/adapters/solana.d.cts +1 -1
- package/dist/chains/adapters/solana.d.ts +1 -1
- package/dist/chains/adapters/solana.js +1 -1
- package/dist/chains/adapters/stellar.cjs +1 -1
- package/dist/chains/adapters/stellar.d.cts +1 -1
- package/dist/chains/adapters/stellar.d.ts +1 -1
- package/dist/chains/adapters/stellar.js +1 -1
- package/dist/chains/chain-adapter.cjs +1 -1
- package/dist/chains/chain-adapter.d.cts +1 -1
- package/dist/chains/chain-adapter.d.ts +1 -1
- package/dist/chains/chain-adapter.js +1 -1
- package/dist/chains/chains.cjs +1 -1
- package/dist/chains/chains.js +1 -1
- package/dist/{chunk-CNXZJOVE.js → chunk-222WHEBO.js} +1 -1
- package/dist/{chunk-DDNFHKJR.cjs → chunk-23X5QOE6.cjs} +1 -1
- package/dist/{chunk-WT45L3WI.cjs → chunk-2F6CGFVL.cjs} +1 -1
- package/dist/chunk-2SUPM5NU.js +1 -0
- package/dist/chunk-2TVSRZ42.js +1 -0
- package/dist/{chunk-KQOBLF64.js → chunk-2UL2H43T.js} +1 -1
- package/dist/{chunk-R23CUQZX.js → chunk-464D53RC.js} +1 -1
- package/dist/chunk-4T45LK43.cjs +1 -0
- package/dist/{chunk-HIWBYW72.cjs → chunk-532BF2RA.cjs} +1 -1
- package/dist/{chunk-HJNJJGK6.js → chunk-5KGXMZFJ.js} +1 -1
- package/dist/{chunk-GCIDUJF2.js → chunk-5M4L42QQ.js} +1 -1
- package/dist/{chunk-BBMFGUOH.js → chunk-5OGNXLOH.js} +1 -1
- package/dist/{chunk-BZJ5TU7H.cjs → chunk-5UR3TR3H.cjs} +1 -1
- package/dist/chunk-6DEQI3XT.cjs +1 -0
- package/dist/{chunk-IUMKG7QD.js → chunk-6HB4WO5J.js} +1 -1
- package/dist/chunk-7AE4UN5A.cjs +1 -0
- package/dist/{chunk-VKXHD6UP.js → chunk-7HVCPMZA.js} +1 -1
- package/dist/{chunk-MYLHEIBD.cjs → chunk-AERFTEJI.cjs} +1 -1
- package/dist/{chunk-MQE44PAR.cjs → chunk-AOVIJZ3W.cjs} +2 -2
- package/dist/{chunk-CISUOQT6.js → chunk-BDQ6PRDN.js} +1 -1
- package/dist/{chunk-NML6ZUFM.cjs → chunk-BGQZNCXO.cjs} +1 -1
- package/dist/{chunk-BOB3OT66.cjs → chunk-CGQR7B2H.cjs} +1 -1
- package/dist/chunk-CTJQUZUF.js +1 -0
- package/dist/{chunk-UULZ22RQ.cjs → chunk-D36TJPDF.cjs} +1 -1
- package/dist/{chunk-WE32RGKM.js → chunk-DFIZFCX4.js} +1 -1
- package/dist/{chunk-QJALSMVI.js → chunk-DVTKFD3K.js} +1 -1
- package/dist/{chunk-ZUG5BIGQ.js → chunk-DX2WEUVJ.js} +1 -1
- package/dist/{chunk-U37UWZ6M.js → chunk-DZAG4SRY.js} +1 -1
- package/dist/{chunk-NFX2WUB6.js → chunk-E2GL7NJM.js} +1 -1
- package/dist/{chunk-BJZM3EV2.cjs → chunk-E7Z24LRS.cjs} +1 -1
- package/dist/{chunk-IZMSUJUW.cjs → chunk-EOXMCIRY.cjs} +1 -1
- package/dist/{chunk-SEXK7X55.cjs → chunk-EUNVW5NM.cjs} +1 -1
- package/dist/{chunk-R7S55N7J.cjs → chunk-EXOY4ZCV.cjs} +1 -1
- package/dist/{chunk-M4U7HAZ6.js → chunk-EZ6E5QGL.js} +1 -1
- package/dist/{chunk-OE4UVHAK.js → chunk-HBGLYYE4.js} +1 -1
- package/dist/{chunk-K4CPNZQP.cjs → chunk-HJIKAOPC.cjs} +1 -1
- package/dist/{chunk-EXY6WMAQ.cjs → chunk-HRRPQMFM.cjs} +1 -1
- package/dist/{chunk-OTFPEC53.js → chunk-HXN3ZART.js} +1 -1
- package/dist/{chunk-ZLKQZHEG.js → chunk-IASKJ4WS.js} +1 -1
- package/dist/chunk-IBQQA6L3.js +1 -0
- package/dist/{chunk-CIMSRCXA.cjs → chunk-IHJXAM3H.cjs} +1 -1
- package/dist/{chunk-MYWEABPN.cjs → chunk-ILCNZB3A.cjs} +1 -1
- package/dist/{chunk-ARN45RZ4.cjs → chunk-J42KB6M4.cjs} +1 -1
- package/dist/{chunk-VBM6V2GS.js → chunk-J4L3FCIC.js} +1 -1
- package/dist/chunk-J5W5S2WG.cjs +1 -0
- package/dist/{chunk-S7DYRZI2.js → chunk-J64QG3LS.js} +1 -1
- package/dist/{chunk-N2YQ7SK2.cjs → chunk-K2W3NIDO.cjs} +1 -1
- package/dist/{chunk-BCXIEWZK.cjs → chunk-KZ62YXDQ.cjs} +1 -1
- package/dist/chunk-LHAOCUXT.cjs +1 -0
- package/dist/chunk-LKYOZL7U.cjs +1 -0
- package/dist/{chunk-7FQTFYO6.cjs → chunk-LOZ4BC3H.cjs} +1 -1
- package/dist/{chunk-P4P3Q7F2.js → chunk-MLUAGHMI.js} +1 -1
- package/dist/{chunk-N6LXJTAC.js → chunk-N5LPV5FV.js} +1 -1
- package/dist/{chunk-V3BCKXZ6.js → chunk-NBM25TBK.js} +1 -1
- package/dist/{chunk-3WDIJIBZ.js → chunk-NVIW3CJW.js} +1 -1
- package/dist/{chunk-PH5XGZFF.cjs → chunk-O5SASZOH.cjs} +1 -1
- package/dist/{chunk-GZSM6NWF.cjs → chunk-OHR5JRFH.cjs} +1 -1
- package/dist/{chunk-GNON524X.js → chunk-PJKTUGX2.js} +1 -1
- package/dist/{chunk-72MJS3AC.cjs → chunk-PZC2L2XZ.cjs} +1 -1
- package/dist/chunk-QYNJ3CQP.cjs +1 -0
- package/dist/{chunk-DBWMNPH7.cjs → chunk-RJZ6ZFLX.cjs} +1 -1
- package/dist/chunk-SLPKMZNW.js +1 -0
- package/dist/{chunk-FOHYTIML.js → chunk-SRN6KQRK.js} +1 -1
- package/dist/{chunk-3PDACUM7.js → chunk-SSC676RL.js} +1 -1
- package/dist/{chunk-FN64UU7M.cjs → chunk-TM77X7C3.cjs} +1 -1
- package/dist/chunk-TVD45ZZM.cjs +1 -0
- package/dist/{chunk-XKMIK6EW.js → chunk-VMXMHGSE.js} +1 -1
- package/dist/{chunk-J5SLH6DG.js → chunk-VWYK4DKI.js} +1 -1
- package/dist/{chunk-EJCR7VKJ.js → chunk-WLTYJRB5.js} +1 -1
- package/dist/{chunk-DMNULXGD.js → chunk-YLMVZCBF.js} +1 -1
- package/dist/{chunk-XMN42YI5.cjs → chunk-Z5GCNZZH.cjs} +1 -1
- package/dist/{chunk-FO2AO5HQ.cjs → chunk-Z7GMI25O.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/logger/index.cjs +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/init.cjs +1 -1
- package/dist/logger/init.js +1 -1
- package/dist/sdk.cjs +1 -1
- package/dist/sdk.d.cts +2 -1
- package/dist/sdk.d.ts +2 -1
- package/dist/sdk.js +1 -1
- package/dist/signers/descriptors/api-key.cjs +1 -1
- package/dist/signers/descriptors/api-key.d.cts +1 -1
- package/dist/signers/descriptors/api-key.d.ts +1 -1
- package/dist/signers/descriptors/api-key.js +1 -1
- package/dist/signers/descriptors/device.cjs +1 -1
- package/dist/signers/descriptors/device.d.cts +1 -1
- package/dist/signers/descriptors/device.d.ts +1 -1
- package/dist/signers/descriptors/device.js +1 -1
- package/dist/signers/descriptors/email.cjs +1 -1
- package/dist/signers/descriptors/email.d.cts +1 -1
- package/dist/signers/descriptors/email.d.ts +1 -1
- package/dist/signers/descriptors/email.js +1 -1
- package/dist/signers/descriptors/external-wallet.cjs +1 -1
- package/dist/signers/descriptors/external-wallet.d.cts +1 -1
- package/dist/signers/descriptors/external-wallet.d.ts +1 -1
- package/dist/signers/descriptors/external-wallet.js +1 -1
- package/dist/signers/descriptors/index.cjs +1 -1
- package/dist/signers/descriptors/index.d.cts +1 -1
- package/dist/signers/descriptors/index.d.ts +1 -1
- package/dist/signers/descriptors/index.js +1 -1
- package/dist/signers/descriptors/passkey.d.cts +1 -1
- package/dist/signers/descriptors/passkey.d.ts +1 -1
- package/dist/signers/descriptors/phone.cjs +1 -1
- package/dist/signers/descriptors/phone.d.cts +1 -1
- package/dist/signers/descriptors/phone.d.ts +1 -1
- package/dist/signers/descriptors/phone.js +1 -1
- package/dist/signers/descriptors/server.d.cts +1 -1
- package/dist/signers/descriptors/server.d.ts +1 -1
- package/dist/signers/descriptors/types.d.cts +1 -1
- package/dist/signers/descriptors/types.d.ts +1 -1
- package/dist/signers/device.d.cts +1 -1
- package/dist/signers/device.d.ts +1 -1
- package/dist/signers/evm-api-key.d.cts +1 -1
- package/dist/signers/evm-api-key.d.ts +1 -1
- package/dist/signers/evm-external-wallet.d.cts +1 -1
- package/dist/signers/evm-external-wallet.d.ts +1 -1
- package/dist/signers/external-wallet-signer.d.cts +1 -1
- package/dist/signers/external-wallet-signer.d.ts +1 -1
- package/dist/signers/index.cjs +1 -1
- package/dist/signers/index.d.cts +1 -1
- package/dist/signers/index.d.ts +1 -1
- package/dist/signers/index.js +1 -1
- package/dist/signers/non-custodial/index.cjs +1 -1
- package/dist/signers/non-custodial/index.d.cts +1 -1
- package/dist/signers/non-custodial/index.d.ts +1 -1
- package/dist/signers/non-custodial/index.js +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-evm-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-solana-signer.js +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.cjs +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.cts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.d.ts +1 -1
- package/dist/signers/non-custodial/ncs-stellar-signer.js +1 -1
- package/dist/signers/passkey.d.cts +1 -1
- package/dist/signers/passkey.d.ts +1 -1
- package/dist/signers/server/assemble-server-signer.d.cts +1 -1
- package/dist/signers/server/assemble-server-signer.d.ts +1 -1
- package/dist/signers/server/evm-server-signer.d.cts +1 -1
- package/dist/signers/server/evm-server-signer.d.ts +1 -1
- package/dist/signers/server/helpers/derive-server-signer.d.cts +1 -1
- package/dist/signers/server/helpers/derive-server-signer.d.ts +1 -1
- package/dist/signers/server/helpers/index.d.cts +1 -1
- package/dist/signers/server/helpers/index.d.ts +1 -1
- package/dist/signers/server/index.d.cts +1 -1
- package/dist/signers/server/index.d.ts +1 -1
- package/dist/signers/server/resolver.d.cts +1 -1
- package/dist/signers/server/resolver.d.ts +1 -1
- package/dist/signers/server/solana-server-signer.d.cts +1 -1
- package/dist/signers/server/solana-server-signer.d.ts +1 -1
- package/dist/signers/server/stellar-server-signer.d.cts +1 -1
- package/dist/signers/server/stellar-server-signer.d.ts +1 -1
- package/dist/signers/solana-api-key.d.cts +1 -1
- package/dist/signers/solana-api-key.d.ts +1 -1
- package/dist/signers/solana-external-wallet.cjs +1 -1
- package/dist/signers/solana-external-wallet.d.cts +1 -1
- package/dist/signers/solana-external-wallet.d.ts +1 -1
- package/dist/signers/solana-external-wallet.js +1 -1
- package/dist/signers/stellar-external-wallet.d.cts +1 -1
- package/dist/signers/stellar-external-wallet.d.ts +1 -1
- package/dist/signers/types.d.cts +1 -1
- package/dist/signers/types.d.ts +1 -1
- package/dist/{types-DnpNYkDF.d.ts → types-Cd9b04Z6.d.ts} +3 -0
- package/dist/{types-DUaBfLJv.d.cts → types-XtGH-kml.d.cts} +3 -0
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.d.cts +1 -1
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.cjs +1 -1
- package/dist/utils/device-signers/IframeDeviceSignerKeyStorage.js +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.cts +1 -1
- package/dist/utils/device-signers/createDeviceSigner.d.ts +1 -1
- package/dist/utils/device-signers/index.cjs +1 -1
- package/dist/utils/device-signers/index.d.cts +1 -1
- package/dist/utils/device-signers/index.d.ts +1 -1
- package/dist/utils/device-signers/index.js +1 -1
- package/dist/utils/errors.cjs +1 -1
- package/dist/utils/errors.d.cts +11 -3
- package/dist/utils/errors.d.ts +11 -3
- package/dist/utils/errors.js +1 -1
- package/dist/utils/locators.cjs +1 -1
- package/dist/utils/locators.d.cts +1 -1
- package/dist/utils/locators.d.ts +1 -1
- package/dist/utils/locators.js +1 -1
- package/dist/utils/signer-locator.cjs +1 -1
- package/dist/utils/signer-locator.d.cts +1 -1
- package/dist/utils/signer-locator.d.ts +1 -1
- package/dist/utils/signer-locator.js +1 -1
- package/dist/utils/signer-mapping.cjs +1 -1
- package/dist/utils/signer-mapping.d.cts +1 -1
- package/dist/utils/signer-mapping.d.ts +1 -1
- package/dist/utils/signer-mapping.js +1 -1
- package/dist/utils/signer-validation.cjs +1 -1
- package/dist/utils/signer-validation.js +1 -1
- package/dist/wallets/__tests__/test-helpers.cjs +1 -1
- package/dist/wallets/__tests__/test-helpers.d.cts +2 -1
- package/dist/wallets/__tests__/test-helpers.d.ts +2 -1
- package/dist/wallets/__tests__/test-helpers.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.d.cts +2 -1
- package/dist/wallets/evm.d.ts +2 -1
- package/dist/wallets/evm.js +1 -1
- package/dist/wallets/services/balance-formatter.cjs +1 -1
- package/dist/wallets/services/balance-formatter.d.cts +1 -1
- package/dist/wallets/services/balance-formatter.d.ts +1 -1
- package/dist/wallets/services/balance-formatter.js +1 -1
- package/dist/wallets/services/device-recovery-service.cjs +1 -1
- package/dist/wallets/services/device-recovery-service.d.cts +1 -1
- package/dist/wallets/services/device-recovery-service.d.ts +1 -1
- package/dist/wallets/services/device-recovery-service.js +1 -1
- package/dist/wallets/services/operation-poller.cjs +1 -1
- package/dist/wallets/services/operation-poller.d.cts +2 -1
- package/dist/wallets/services/operation-poller.d.ts +2 -1
- package/dist/wallets/services/operation-poller.js +1 -1
- package/dist/wallets/services/signer-manager.cjs +1 -1
- package/dist/wallets/services/signer-manager.d.cts +1 -1
- package/dist/wallets/services/signer-manager.d.ts +1 -1
- package/dist/wallets/services/signer-manager.js +1 -1
- package/dist/wallets/solana.cjs +1 -1
- package/dist/wallets/solana.d.cts +2 -1
- package/dist/wallets/solana.d.ts +2 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.d.cts +2 -1
- package/dist/wallets/stellar.d.ts +2 -1
- package/dist/wallets/stellar.js +1 -1
- package/dist/wallets/types.d.cts +1 -1
- package/dist/wallets/types.d.ts +1 -1
- package/dist/wallets/wallet-factory.cjs +1 -1
- package/dist/wallets/wallet-factory.d.cts +5 -7
- package/dist/wallets/wallet-factory.d.ts +5 -7
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.d.cts +3 -6
- package/dist/wallets/wallet.d.ts +3 -6
- package/dist/wallets/wallet.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-3F4FMM3R.cjs +0 -1
- package/dist/chunk-6CNBIQGF.cjs +0 -1
- package/dist/chunk-EXFV7SBW.cjs +0 -1
- package/dist/chunk-FXMXIAPL.js +0 -1
- package/dist/chunk-GIXJ5P3D.cjs +0 -1
- package/dist/chunk-HIKDNSEI.cjs +0 -1
- package/dist/chunk-LSJDT5QL.cjs +0 -1
- package/dist/chunk-M5A2GB2R.js +0 -1
- package/dist/chunk-NLMPNCXE.js +0 -1
- package/dist/chunk-OI6QI264.cjs +0 -1
- package/dist/chunk-T6VDXOWC.js +0 -1
- package/dist/chunk-TGFHY5PL.js +0 -1
- package/dist/chunk-U6SAS52Q.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ33QM2IDcjs = require('../../chunk-J33QM2ID.cjs');var _chunkAERFTEJIcjs = require('../../chunk-AERFTEJI.cjs');require('../../chunk-LHAOCUXT.cjs');require('../../chunk-ILCNZB3A.cjs');require('../../chunk-J5W5S2WG.cjs');var _chunkDSIFRRBScjs = require('../../chunk-DSIFRRBS.cjs');var _vitest = require('vitest');var P=({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=>P({data:e}),b= exports.createMockErrorResponse =(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B= exports.createMockCrossmint =(e={})=>{let t=_chunkDSIFRRBScjs.a.call(void 0, {apiKey:_chunkJ33QM2IDcjs.m},e);return _chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{setJwt:_vitest.vi.fn().mockReturnThis()})},L= exports.createTestApiClient =e=>new (0, _chunkAERFTEJIcjs.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)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();_vitest.expect.call(void 0, l(a)).toBe(!0),l(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)=>_chunkDSIFRRBScjs.h.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 u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();_vitest.expect.call(void 0, l(m)).toBe(!0)}}),Q= exports.testNetworkError =(e,t)=>_chunkDSIFRRBScjs.h.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)=>_chunkDSIFRRBScjs.h.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)=>_chunkDSIFRRBScjs.h.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)=>_chunkDSIFRRBScjs.h.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={})=>_chunkDSIFRRBScjs.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={})=>_chunkDSIFRRBScjs.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 l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(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=_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {apiKey:e},t&&{overrideBaseUrl:t}),n),a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},s),{setJwt:()=>a});return new (0, _chunkAERFTEJIcjs.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 _chunkDSIFRRBScjs.h.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:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(_chunkDSIFRRBScjs.a.call(void 0, {chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function pe(e,t,n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function le(e,t){_vitest.expect.call(void 0, l(e)).toBe(!0),t&&_vitest.expect.call(void 0, e.message).toBeDefined()}function ue(e){_vitest.expect.call(void 0, C(e)).toBe(!0)}function de(e){_vitest.expect.call(void 0, $(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(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)=>_chunkDSIFRRBScjs.h.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(l(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:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(_chunkJ33QM2IDcjs.j);continue}yield x(_chunkJ33QM2IDcjs.i)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),me= exports.fundWalletAndWait =(e,t,n=1,s="usdxm",a="base-sepolia")=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){return I(e,t,n,s,a)}),fe= exports.sendTokenAndApprove =(e,t,n,s,a)=>_chunkDSIFRRBScjs.h.call(void 0, void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(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")=>_chunkDSIFRRBScjs.h.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 = b; exports.createMockResponse = P; 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 = le; exports.expectRequestBody = q; exports.expectRequestPath = N; exports.expectSuccessTransactionResponse = de; exports.expectSuccessWalletResponse = ue; exports.extractFetchCall = Y; exports.fundWallet = I; exports.fundWalletAndWait = me; exports.isErrorResponse = l; exports.isSuccessTransactionResponse = $; exports.isSuccessWalletResponse = C; 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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MockedFunction } from 'vitest';
|
|
2
2
|
import { Crossmint } from '@crossmint/common-sdk-base';
|
|
3
3
|
import { ApiClient } from '../client.cjs';
|
|
4
|
-
import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-
|
|
4
|
+
import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-XtGH-kml.cjs';
|
|
5
5
|
import '../../chains/chains.cjs';
|
|
6
6
|
import 'viem';
|
|
7
7
|
import '../gen/types.gen.cjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MockedFunction } from 'vitest';
|
|
2
2
|
import { Crossmint } from '@crossmint/common-sdk-base';
|
|
3
3
|
import { ApiClient } from '../client.js';
|
|
4
|
-
import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-
|
|
4
|
+
import { ah as WalletLocator, aq as GetTransactionResponse, ar as SendResponse, as as CreateWalletResponse, at as CreateWalletParams, aa as FundWalletResponse } from '../../types-Cd9b04Z6.js';
|
|
5
5
|
import '../../chains/chains.js';
|
|
6
6
|
import 'viem';
|
|
7
7
|
import '../gen/types.gen.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A,b as F,i as R,j as W,k as E,l as M,m as S}from"../../chunk-DIGDDKSF.js";import{a as w}from"../../chunk-
|
|
1
|
+
import{a as A,b as F,i as R,j as W,k as E,l as M,m as S}from"../../chunk-DIGDDKSF.js";import{a as w}from"../../chunk-HBGLYYE4.js";import"../../chunk-SLPKMZNW.js";import"../../chunk-HXN3ZART.js";import"../../chunk-IBQQA6L3.js";import{a as p,b as k,h as i}from"../../chunk-NU7VF7MC.js";import{expect as r,vi as y}from"vitest";var P=({data:e,status:t=200,ok:n=!0,statusText:s="OK"})=>({json:y.fn().mockResolvedValue(e),ok:n,status:t,statusText:s}),j=e=>P({data:e}),b=(e,t=400,n="Bad Request")=>P({data:e,status:t,ok:!1,statusText:n}),B=(e={})=>{let t=p({apiKey:S},e);return k(p({},t),{setJwt:y.fn().mockReturnThis()})},L=e=>new w(e||B()),Y=()=>{let e=L();return Object.defineProperty(e,"isServerSide",{get:()=>!0,configurable:!0}),e},z=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=(e,t)=>{r(e==null?void 0:e.path).toBe(t)},V=e=>{r(e["Content-Type"]).toBe("application/json")},q=(e,t)=>{r(e.body).toBe(JSON.stringify(t))},X=(e,t,n)=>{r(e).toBeDefined(),e&&(N(e,t),e.options.headers&&V(e.options.headers),n!==void 0&&e.options&&q(e.options,n))},Z=(e,t,n,s)=>i(void 0,null,function*(){t.mockResolvedValue(b(n,s));let a=yield e();r(l(a)).toBe(!0),l(a)&&(r(a.error).toBe(!0),n.message&&r(a.message).toBe(n.message))}),Q=(s,a,...o)=>i(void 0,[s,a,...o],function*(e,t,n=[]){for(let{status:c,message:g}of A){if(n.includes(c))continue;let u={error:!0,message:g};t.mockResolvedValueOnce(b(u,c));let m=yield e();r(l(m)).toBe(!0)}}),ee=(e,t)=>i(void 0,null,function*(){t.mockRejectedValue(new Error("Network error")),yield r(e()).rejects.toThrow("Network error")}),te=(e,t)=>i(void 0,null,function*(){let n={json:y.fn().mockRejectedValue(new Error("Invalid JSON")),ok:!0,status:200};t.mockResolvedValue(n),yield r(e()).rejects.toThrow()}),ne=(e,t)=>i(void 0,null,function*(){t.mockImplementation(()=>new Promise((n,s)=>setTimeout(()=>s(new Error("Request timeout")),0))),yield r(e()).rejects.toThrow("Request timeout")}),se=(e,t,n)=>i(void 0,null,function*(){t.mockResolvedValue(j(n));let s=yield e();r(s).toEqual(n)}),oe=(e={})=>p({address:F.evmAddress,chainType:"evm",type:"smart",config:{adminSigner:{type:"external-wallet",address:E.EVM_TEST}}},e),re=(e={})=>p({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 l(e){return typeof e=="object"&&e!==null&&"error"in e&&e.error===!0}function C(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)),ae=e=>/^0x[a-fA-F0-9]{40}$/.test(e),ie=e=>/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(e),ce=(e,t,n={})=>{let s=p(p({apiKey:e},t&&{overrideBaseUrl:t}),n),a=k(p({},s),{setJwt:()=>a});return new w(a)},v=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 pe(s,a){return i(this,arguments,function*(e,t,n={}){if(t.hasWallets())return t.getWallet();let{chainType:o="evm",type:c="mpc",owner:g,testName:u="default"}=n,m=g||`userId:integration-${u}-${Date.now()}`,f=yield e.createWallet(p({chainType:o,type:c},g&&{owner:m}));if(C(f))return t.addWallet(f.address),f.address})}function le(e,t,n){return i(this,null,function*(){let s=yield e.createWallet(n);return C(s)&&t.addWallet(s.address),s})}function ue(e,t){r(l(e)).toBe(!0),t&&r(e.message).toBeDefined()}function de(e){r(C(e)).toBe(!0)}function me(e){r($(e)).toBe(!0)}var I=(e,t,n,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){let o={amount:n,token:s,chain:a},c=yield e.fundWallet(t,o);if(l(c))throw new Error(`Failed to fund wallet: ${c.message||"Unknown error"}`);return yield x(R),c}),U=(a,o,c,...g)=>i(void 0,[a,o,c,...g],function*(e,t,n,s=M.APPROVE_TRANSACTION_MAX_RETRIES){var m;for(let f=0;f<s;f++){let d=yield e.getTransaction(t,n);if(l(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:""}))},h=yield e.approveTransaction(t,n,O);if(l(h))throw new Error(`Failed to approve transaction: ${h.message||"Unknown error"}`);yield x(W);continue}yield x(R)}let u=yield e.getTransaction(t,n);if(l(u))throw new Error(`Transaction not found after retries: ${u.message||"Unknown error"}`);if(!("status"in u))throw new Error("Transaction response missing status property");return u}),fe=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(void 0,null,function*(){return I(e,t,n,s,a)}),ge=(e,t,n,s,a)=>i(void 0,null,function*(){let o=yield e.send(t,n,{recipient:s,amount:a});if(l(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")}),Te=(e,t,n=1,s="usdxm",a="base-sepolia")=>i(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}});export{v as TestDataFactory,U as approveTransaction,ce as createIntegrationApiClient,B as createMockCrossmint,b as createMockErrorResponse,P as createMockResponse,re as createMockSendResponse,j as createMockSuccessResponse,oe as createMockWalletResponse,Y as createServerSideApiClient,L as createTestApiClient,le as createTestWallet,x as delay,pe as ensureWalletExists,Te as ensureWalletFunded,V as expectCommonHeaders,ue as expectErrorResponse,q as expectRequestBody,N as expectRequestPath,me as expectSuccessTransactionResponse,de as expectSuccessWalletResponse,z as extractFetchCall,I as fundWallet,fe as fundWalletAndWait,l as isErrorResponse,$ as isSuccessTransactionResponse,C as isSuccessWalletResponse,ae as isValidEthereumAddress,ie as isValidSolanaAddress,ge as sendTokenAndApprove,Q as testCommonHttpErrors,Z as testHttpErrorResponse,te as testInvalidJsonResponse,se as testMalformedResponse,ee as testNetworkError,ne as testTimeoutError,X as validateRequest};
|
package/dist/api/client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAERFTEJIcjs = require('../chunk-AERFTEJI.cjs');require('../chunk-LHAOCUXT.cjs');require('../chunk-ILCNZB3A.cjs');require('../chunk-J5W5S2WG.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunkAERFTEJIcjs.a;
|
package/dist/api/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
2
|
-
import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-
|
|
2
|
+
import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-XtGH-kml.cjs';
|
|
3
3
|
import { Chain } from '../chains/chains.cjs';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import './gen/types.gen.cjs';
|
package/dist/api/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
|
|
2
|
-
import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-
|
|
2
|
+
import { at as CreateWalletParams, as as CreateWalletResponse, ah as WalletLocator, az as GetWalletResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aq as GetTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aH as GetSignatureResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, aJ as GetBalanceResponse, aK as FundWalletParams, aa as FundWalletResponse, al as RegisterSignerParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, aj as GetSignerResponse, aN as SendParams, ar as SendResponse } from '../types-Cd9b04Z6.js';
|
|
3
3
|
import { Chain } from '../chains/chains.js';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import './gen/types.gen.js';
|
package/dist/api/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-HBGLYYE4.js";import"../chunk-SLPKMZNW.js";import"../chunk-HXN3ZART.js";import"../chunk-IBQQA6L3.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
|
package/dist/api/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunkAERFTEJIcjs = require('../chunk-AERFTEJI.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-LHAOCUXT.cjs');require('../chunk-ILCNZB3A.cjs');require('../chunk-J5W5S2WG.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunkAERFTEJIcjs.a;
|
package/dist/api/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ApiClient } from './client.cjs';
|
|
2
|
-
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-
|
|
2
|
+
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-XtGH-kml.cjs';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import '../chains/chains.cjs';
|
|
5
5
|
import 'viem';
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ApiClient } from './client.js';
|
|
2
|
-
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-
|
|
2
|
+
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-Cd9b04Z6.js';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import '../chains/chains.js';
|
|
5
5
|
import 'viem';
|
package/dist/api/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-
|
|
1
|
+
import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-HBGLYYE4.js";import"../chunk-KBJA7JDT.js";import"../chunk-SLPKMZNW.js";import"../chunk-HXN3ZART.js";import"../chunk-IBQQA6L3.js";import"../chunk-NU7VF7MC.js";export{a as ApiClient};
|
package/dist/api/types.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'viem';
|
|
2
2
|
import './gen/types.gen.cjs';
|
|
3
|
-
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-
|
|
3
|
+
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-XtGH-kml.cjs';
|
|
4
4
|
import '../chains/chains.cjs';
|
|
5
5
|
import 'ox';
|
|
6
6
|
import '@crossmint/client-sdk-window';
|
package/dist/api/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'viem';
|
|
2
2
|
import './gen/types.gen.js';
|
|
3
|
-
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-
|
|
3
|
+
export { aG as ApproveSignatureParams, ai as ApproveSignatureResponse, aC as ApproveTransactionParams, aD as ApproveTransactionResponse, aE as CreateSignatureParams, aF as CreateSignatureResponse, aA as CreateTransactionParams, aB as CreateTransactionResponse, aO as CreateTransactionSuccessResponse, at as CreateWalletParams, as as CreateWalletResponse, aK as FundWalletParams, aa as FundWalletResponse, aJ as GetBalanceResponse, ay as GetBalanceSuccessResponse, aH as GetSignatureResponse, aj as GetSignerResponse, aP as GetSignersResponse, aq as GetTransactionResponse, ac as GetTransactionSuccessResponse, ab as GetTransactionsResponse, aI as GetTransfersResponse, az as GetWalletResponse, aQ as GetWalletSuccessResponse, aR as RecoverySignerConfig, an as RegisterSignerChain, al as RegisterSignerParams, R as RegisterSignerPasskeyParams, ao as RegisterSignerResponse, aL as RemoveSignerParams, aM as RemoveSignerResponse, S as Scope, aN as SendParams, ar as SendResponse, a0 as Signer, G as TransferScope, H as Transfers, ah as WalletLocator } from '../types-Cd9b04Z6.js';
|
|
4
4
|
import '../chains/chains.js';
|
|
5
5
|
import 'ox';
|
|
6
6
|
import '@crossmint/client-sdk-window';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk23X5QOE6cjs = require('../../chunk-23X5QOE6.cjs');require('../../chunk-TM77X7C3.cjs');require('../../chunk-LHAOCUXT.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-ILCNZB3A.cjs');require('../../chunk-J5W5S2WG.cjs');require('../../chunk-DSIFRRBS.cjs');exports.evmChainAdapter = _chunk23X5QOE6cjs.a;
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
|
|
|
2
2
|
import '../chains.cjs';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-XtGH-kml.cjs';
|
|
6
6
|
import '../../api/gen/types.gen.cjs';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
|
|
|
2
2
|
import '../chains.js';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-Cd9b04Z6.js';
|
|
6
6
|
import '../../api/gen/types.gen.js';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-5KGXMZFJ.js";import"../../chunk-6HB4WO5J.js";import"../../chunk-SLPKMZNW.js";import"../../chunk-455NK5LB.js";import"../../chunk-HXN3ZART.js";import"../../chunk-IBQQA6L3.js";import"../../chunk-NU7VF7MC.js";export{a as evmChainAdapter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKZ62YXDQcjs = require('../../chunk-KZ62YXDQ.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-ILCNZB3A.cjs');require('../../chunk-J5W5S2WG.cjs');require('../../chunk-DSIFRRBS.cjs');exports.solanaChainAdapter = _chunkKZ62YXDQcjs.a;
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
|
|
|
2
2
|
import '../chains.cjs';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-XtGH-kml.cjs';
|
|
6
6
|
import '../../api/gen/types.gen.cjs';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
|
|
|
2
2
|
import '../chains.js';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-Cd9b04Z6.js';
|
|
6
6
|
import '../../api/gen/types.gen.js';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-DZAG4SRY.js";import"../../chunk-455NK5LB.js";import"../../chunk-HXN3ZART.js";import"../../chunk-IBQQA6L3.js";import"../../chunk-NU7VF7MC.js";export{a as solanaChainAdapter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPZC2L2XZcjs = require('../../chunk-PZC2L2XZ.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-ILCNZB3A.cjs');require('../../chunk-J5W5S2WG.cjs');require('../../chunk-DSIFRRBS.cjs');exports.stellarChainAdapter = _chunkPZC2L2XZcjs.a;
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.cjs';
|
|
|
2
2
|
import '../chains.cjs';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-XtGH-kml.cjs';
|
|
6
6
|
import '../../api/gen/types.gen.cjs';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -2,7 +2,7 @@ import { ChainAdapter } from '../chain-adapter.js';
|
|
|
2
2
|
import '../chains.js';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
|
-
import '../../types-
|
|
5
|
+
import '../../types-Cd9b04Z6.js';
|
|
6
6
|
import '../../api/gen/types.gen.js';
|
|
7
7
|
import 'ox';
|
|
8
8
|
import '@crossmint/client-sdk-window';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-IASKJ4WS.js";import"../../chunk-455NK5LB.js";import"../../chunk-HXN3ZART.js";import"../../chunk-IBQQA6L3.js";import"../../chunk-NU7VF7MC.js";export{a as stellarChainAdapter};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6DEQI3XTcjs = require('../chunk-6DEQI3XT.cjs');require('../chunk-23X5QOE6.cjs');require('../chunk-KZ62YXDQ.cjs');require('../chunk-PZC2L2XZ.cjs');require('../chunk-TM77X7C3.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-LHAOCUXT.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-ILCNZB3A.cjs');require('../chunk-J5W5S2WG.cjs');require('../chunk-DSIFRRBS.cjs');exports.getChainAdapter = _chunk6DEQI3XTcjs.a; exports.isSupportedChainType = _chunk6DEQI3XTcjs.b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from './chains.cjs';
|
|
2
|
-
import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-
|
|
2
|
+
import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-XtGH-kml.cjs';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../api/gen/types.gen.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from './chains.js';
|
|
2
|
-
import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-
|
|
2
|
+
import { an as RegisterSignerChain, ao as RegisterSignerResponse, a1 as PendingSignerOperation, ap as TokenBalance } from '../types-Cd9b04Z6.js';
|
|
3
3
|
import '@crossmint/common-sdk-base';
|
|
4
4
|
import 'viem';
|
|
5
5
|
import '../api/gen/types.gen.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-SSC676RL.js";import"../chunk-5KGXMZFJ.js";import"../chunk-DZAG4SRY.js";import"../chunk-IASKJ4WS.js";import"../chunk-6HB4WO5J.js";import"../chunk-OQZTL6ZG.js";import"../chunk-SLPKMZNW.js";import"../chunk-455NK5LB.js";import"../chunk-HXN3ZART.js";import"../chunk-IBQQA6L3.js";import"../chunk-NU7VF7MC.js";export{a as getChainAdapter,b as isSupportedChainType};
|
package/dist/chains/chains.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkE7Z24LRScjs = require('../chunk-E7Z24LRS.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-LHAOCUXT.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-ILCNZB3A.cjs');require('../chunk-J5W5S2WG.cjs');require('../chunk-DSIFRRBS.cjs');exports.isMainnetChain = _chunkE7Z24LRScjs.c; exports.isTestnetChain = _chunkE7Z24LRScjs.b; exports.isValidChain = _chunkE7Z24LRScjs.e; exports.mainnetToTestnet = _chunkE7Z24LRScjs.d; exports.toViemChain = _chunkE7Z24LRScjs.a; exports.validateChainForEnvironment = _chunkE7Z24LRScjs.f;
|
package/dist/chains/chains.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"../chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"../chunk-WLTYJRB5.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-SLPKMZNW.js";import"../chunk-455NK5LB.js";import"../chunk-HXN3ZART.js";import"../chunk-IBQQA6L3.js";import"../chunk-NU7VF7MC.js";export{c as isMainnetChain,b as isTestnetChain,e as isValidChain,d as mainnetToTestnet,a as toViemChain,f as validateChainForEnvironment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,b as o}from"./chunk-
|
|
1
|
+
import{a as s,b as o}from"./chunk-5OGNXLOH.js";import{a as r}from"./chunk-HXN3ZART.js";import{h as t}from"./chunk-NU7VF7MC.js";import{VersionedTransaction as u}from"@solana/web3.js";import a from"bs58";var g=class c extends s{constructor(n){super(n)}signMessage(){return t(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(n){return t(this,null,function*(){var i;yield this.handleAuthRequired();let d=this.getJwtOrThrow(),m=a.decode(n),y=u.deserialize(m).message.serialize();r.info("sign: sending request",{keyType:"ed25519"});let l=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:d,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:a.encode(new Uint8Array(y)),encoding:"base58"}},options:o});if(r.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-l}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return c.verifyPublicKeyFormat(e.publicKey),{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base58"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"base58"}}};export{g as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTM77X7C3cjs = require('./chunk-TM77X7C3.cjs');var _chunkLHAOCUXTcjs = require('./chunk-LHAOCUXT.cjs');var _chunkILCNZB3Acjs = require('./chunk-ILCNZB3A.cjs');var f={nativeToken:"eth",walletLocatorPrefix:"me:evm:smart",supportsSignatures:!0,addSignerChain(e){return e},extractAddSignerOperation(e,r,n){var a,t,o,d;if(!("chains"in e))throw _chunkILCNZB3Acjs.a.error("wallet.addSigner.error",{error:"Expected chains in response for EVM chain"}),new Error("Expected chains in response for EVM chain");if(((t=(a=e.chains)==null?void 0:a[r])==null?void 0:t.status)==="failed")throw _chunkILCNZB3Acjs.a.error("wallet.addSigner.failed",{chain:r,signerType:n.type,signerLocator:n.locator,chainStatus:(o=e.chains)==null?void 0:o[r]}),new (0, _chunkLHAOCUXTcjs.j)(`Signer registration failed for chain ${r} (signer: ${n.locator})`,JSON.stringify((d=e.chains)==null?void 0:d[r]));return _chunkTM77X7C3cjs.c.call(void 0, e,r)},balanceTokenFields(e){return e!=null&&"contractAddress"in e?{contractAddress:e.contractAddress}:{}},emptyBalanceTokenFields(){return{contractAddress:void 0}}};exports.a = f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTVD45ZZMcjs = require('./chunk-TVD45ZZM.cjs');var _chunkQYNJ3CQPcjs = require('./chunk-QYNJ3CQP.cjs');var _chunkQPCZFIUVcjs = require('./chunk-QPCZFIUV.cjs');var _chunkTM77X7C3cjs = require('./chunk-TM77X7C3.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var a,n,d,g,S,C,u,h,v,y,x= exports.a =class{constructor(r){_chunkDSIFRRBScjs.e.call(void 0, this,a);_chunkDSIFRRBScjs.e.call(void 0, this,n);_chunkDSIFRRBScjs.e.call(void 0, this,d);_chunkDSIFRRBScjs.e.call(void 0, this,g);_chunkDSIFRRBScjs.e.call(void 0, this,S);_chunkDSIFRRBScjs.e.call(void 0, this,C);_chunkDSIFRRBScjs.e.call(void 0, this,u);_chunkDSIFRRBScjs.e.call(void 0, this,h);_chunkDSIFRRBScjs.e.call(void 0, this,v);_chunkDSIFRRBScjs.e.call(void 0, this,y);_chunkDSIFRRBScjs.f.call(void 0, this,d,r.apiClient),_chunkDSIFRRBScjs.f.call(void 0, this,g,r.options),_chunkDSIFRRBScjs.f.call(void 0, this,S,r.chain),_chunkDSIFRRBScjs.f.call(void 0, this,C,r.walletAddress),_chunkDSIFRRBScjs.f.call(void 0, this,u,r.walletLocator),_chunkDSIFRRBScjs.f.call(void 0, this,h,r.serverSignerResolver),_chunkDSIFRRBScjs.f.call(void 0, this,n,r.recovery),_chunkDSIFRRBScjs.f.call(void 0, this,v,r.initialSigners),_chunkDSIFRRBScjs.f.call(void 0, this,y,r.signers),_chunkDSIFRRBScjs.f.call(void 0, this,a,r.signer)}get activeSigner(){return _chunkDSIFRRBScjs.d.call(void 0, this,a)}setActiveSigner(r){_chunkDSIFRRBScjs.f.call(void 0, this,a,r)}get recovery(){return _chunkDSIFRRBScjs.d.call(void 0, this,n)}descriptorContext(){var r,i,t,l,c;return{chain:_chunkDSIFRRBScjs.d.call(void 0, this,S),walletAddress:_chunkDSIFRRBScjs.d.call(void 0, this,C),crossmint:_chunkDSIFRRBScjs.d.call(void 0, this,d).crossmint,clientTEEConnection:(r=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:r.clientTEEConnection,resetSignerFrame:(i=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:i.resetSignerFrame,onAuthRequired:(l=(t=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:t.callbacks)==null?void 0:l.onAuthRequired,deviceSignerKeyStorage:(c=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:c.deviceSignerKeyStorage,serverSigners:_chunkDSIFRRBScjs.d.call(void 0, this,h)}}adoptRecoveryConfig(r){_chunkDSIFRRBScjs.f.call(void 0, this,n,r)}stripSecretFromRecovery(){let r=_chunkDSIFRRBScjs.d.call(void 0, this,h).resolvedRecoveryAddress;_chunkDSIFRRBScjs.d.call(void 0, this,n)!=null&&_chunkDSIFRRBScjs.d.call(void 0, this,n).type==="server"&&!_chunkQPCZFIUVcjs.f.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,n))&&r!=null&&_chunkDSIFRRBScjs.f.call(void 0, this,n,{type:"server",address:r})}assemble(r,i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var l,c;let t=_chunkQYNJ3CQPcjs.a.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,S),r,(l=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:l.deviceSignerKeyStorage);if(i!=null&&i.isAdminSigner)t.status="active";else{let f=yield this.getSignerState(t.locator());t.status=(c=f.signer)==null?void 0:c.status}return t})}require(){if(_chunkDSIFRRBScjs.d.call(void 0, this,a)==null){if(_chunkDSIFRRBScjs.d.call(void 0, this,v).length>1)throw new Error("No signer is set. This wallet has multiple signers configured. Call wallet.useSigner() to select which signer to use before signing operations.");let r=_chunkTVD45ZZMcjs.a.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,n).type),i=r.signerUnavailableReason();throw i!=null?new Error(i):r.canAutoAssemble(_chunkDSIFRRBScjs.d.call(void 0, this,n),this.descriptorContext())?new Error("This wallet is read-only because no signer was provided. Operations that require signing (send, approve, addSigner, etc.) are not available."):new Error("No signer is set. This wallet requires calling wallet.useSigner() before signing operations.")}return _chunkDSIFRRBScjs.d.call(void 0, this,a)}withRecoverySigner(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var f;let i=_chunkDSIFRRBScjs.d.call(void 0, this,a);if(_chunkQPCZFIUVcjs.f.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,n))&&!_chunkDSIFRRBScjs.d.call(void 0, this,h).hasRecoveryResolution)throw new Error('Cannot assemble server signer: no secret available. Call wallet.useSigner({ type: "server", secret: ... }) first with the recovery server secret.');let t=_chunkTVD45ZZMcjs.a.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,n).type),l=this.descriptorContext();if(_chunkDSIFRRBScjs.d.call(void 0, this,n)!=null&&_chunkDSIFRRBScjs.d.call(void 0, this,n).type==="external-wallet"&&!t.canAutoAssemble(_chunkDSIFRRBScjs.d.call(void 0, this,n),l))throw new Error('Cannot assemble external wallet signer: no onSign callback available. Call wallet.useSigner({ type: "external-wallet", address: "0x...", onSign: async (tx) => ... }) first.');let c=t.buildInternalConfig(_chunkDSIFRRBScjs.d.call(void 0, this,n),l);_chunkDSIFRRBScjs.f.call(void 0, this,a,_chunkQYNJ3CQPcjs.a.call(void 0, _chunkDSIFRRBScjs.d.call(void 0, this,S),c,(f=_chunkDSIFRRBScjs.d.call(void 0, this,g))==null?void 0:f.deviceSignerKeyStorage));try{return yield r()}finally{_chunkDSIFRRBScjs.f.call(void 0, this,a,i)}})}getSignerState(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i=null;try{i=yield _chunkDSIFRRBScjs.d.call(void 0, this,d).getSigner(_chunkDSIFRRBScjs.d.call(void 0, this,u).call(this),r)}catch(l){return{response:null,signer:null,pendingOperation:null}}if(i==null||typeof i!="object"||"error"in i)return{response:null,signer:null,pendingOperation:null};let t=_chunkTM77X7C3cjs.b.call(void 0, i,_chunkDSIFRRBScjs.d.call(void 0, this,S));return{response:i,signer:t,pendingOperation:_chunkTM77X7C3cjs.c.call(void 0, i,_chunkDSIFRRBScjs.d.call(void 0, this,S))}})}signerIsRegistered(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield _chunkDSIFRRBScjs.d.call(void 0, this,y).call(this)).some(t=>t.locator===r)})}isSignerApproved(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;let i=yield this.getSignerState(r);return this.isApprovedSignerStatus((t=i.signer)==null?void 0:t.status)})}isApprovedSignerStatus(r){return r==="success"||r==="active"}};a=new WeakMap,n=new WeakMap,d=new WeakMap,g=new WeakMap,S=new WeakMap,C=new WeakMap,u=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap;exports.a = x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as x,B as A,C as y,D as k,H as w,r as M,u as m,w as b,z as C}from"./chunk-SLPKMZNW.js";import{a as E}from"./chunk-HXN3ZART.js";import{d as S}from"./chunk-IBQQA6L3.js";import{h as l}from"./chunk-NU7VF7MC.js";function W(i,o,a,r){return l(this,null,function*(){var h,d;let{timeoutMs:e=6e4,initialBackoffMs:u=500,backoffMultiplier:n=1.5,maxBackoffMs:f=2e3,fastWindowMs:L=5e3}=r!=null?r:{};E.info("wallet.approve: waiting for transaction confirmation",{transactionId:a,timeoutMs:e});let p=Date.now(),c=u,t;do{if(Date.now()-p>e)throw new x("Transaction confirmation timeout");let s=Date.now();if(t=yield i.getTransaction(o,a),t.error)throw w(t),new C(JSON.stringify(t));if(t.status!=="pending")break;let T=Date.now()-p;T>L&&(c=Math.min(Math.round(c*n),f));let v=Date.now()-s;yield D(Math.max(1,Math.min(c-v,e-T)))}while(!0);if(t.status==="failed")throw new A(`Transaction sending failed: ${JSON.stringify(t)}`);if(t.status==="awaiting-approval")throw new y("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let P="txHash"in t.onChain&&typeof t.onChain.txHash=="string"?t.onChain.txHash:void 0,g=(h=t.onChain.txId)!=null?h:P;if(g==null)throw new k("Transaction hash not found on transaction response");return{hash:g,explorerLink:(d=t.onChain.explorerLink)!=null?d:"",transactionId:t.id}})}function B(i,o,a,r){return l(this,null,function*(){let{timeoutMs:e=6e4}=r!=null?r:{},u=Date.now(),n=null;do{if(Date.now()-u>e)throw new b("Signature confirmation timeout");if(yield new Promise(f=>setTimeout(f,S)),n=yield i.getSignature(o,a),"error"in n)throw w(n),new m(JSON.stringify(n))}while(n===null||n.status==="pending");if(n.status==="failed")throw new M("Signature signing failed");if(!n.outputSignature)throw new m("Signature not available");return{signature:n.outputSignature,signatureId:a}})}function D(i){return l(this,null,function*(){return new Promise(o=>setTimeout(o,i))})}export{W as a,B as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as se}from"./chunk-N5LPV5FV.js";import{a as ae,b as oe}from"./chunk-2SUPM5NU.js";import{a as ne}from"./chunk-DX2WEUVJ.js";import{a as ie}from"./chunk-5M4L42QQ.js";import{a as ee}from"./chunk-OMTJMVSG.js";import{a as F}from"./chunk-E2GL7NJM.js";import{a as D}from"./chunk-PJKTUGX2.js";import{a as re,b as te}from"./chunk-VMXMHGSE.js";import{a as Z}from"./chunk-5OGNXLOH.js";import{f as J}from"./chunk-DCKFFFPG.js";import{a as X,b as Y}from"./chunk-SSC676RL.js";import{b as Q}from"./chunk-6HB4WO5J.js";import{f as K}from"./chunk-WLTYJRB5.js";import{E as V,H as O,d as M,e as _,j as k,l as G,m as U,u as H,v as j,x as q,y as B,z}from"./chunk-SLPKMZNW.js";import{a as s}from"./chunk-HXN3ZART.js";import{a as f,b as N,c as R,d as i,e as b,f as m,h as o}from"./chunk-NU7VF7MC.js";import{WithLoggerContext as W}from"@crossmint/common-sdk-base";var I,c,T,P,l,w,E,L,x,A=class{constructor(e,r){b(this,I);b(this,c);b(this,T);b(this,P);b(this,l);b(this,w);b(this,E,[]);b(this,L);b(this,x,null);let{chain:t,address:n,owner:a,options:u,alias:S,recovery:p,apiRecoveryServerSignerAddress:g,apiDelegatedServerSignerAddresses:d,signers:y,signer:h}=e;m(this,c,r),this.chain=t,this.address=n,this.owner=a,m(this,I,u),this.alias=S;let C=null;g!=null?C=g:p.type==="server"&&J(p)&&(C=p.address),m(this,E,d!=null?d:[]),m(this,T,y!=null?y:[]),m(this,P,new ee({chain:t,projectId:i(this,c).projectId,environment:i(this,c).environment,apiRecoveryAddress:C,apiDelegatedAddresses:i(this,E),knownOnChainAddresses:()=>[...i(this,T).filter(v=>v.type==="server"&&J(v)).map(v=>v.address),...i(this,E)]})),m(this,l,new ne({apiClient:r,options:u,chain:t,walletAddress:this.address,walletLocator:()=>this.walletLocator,serverSignerResolver:i(this,P),recovery:p,initialSigners:i(this,T),signers:()=>this.signers(),signer:h})),m(this,w,new se({chain:t,walletAddress:this.address,options:u,signerManager:i(this,l),serverSignerResolver:i(this,P),signers:()=>this.signers(),addSigner:v=>this.addSigner(v),approveSignature:v=>this.approveSignatureAndWait(v),approveTransaction:v=>this.approveTransactionAndWait(v)})),m(this,L,this.initDefaultSigner())}get signer(){return i(this,l).activeSigner}waitForInit(){return o(this,null,function*(){yield i(this,L)})}initDefaultSigner(){return o(this,null,function*(){if(i(this,l).activeSigner!=null||(yield i(this,w).initDeviceSigner(),i(this,l).activeSigner!=null||i(this,w).needsRecovery))return;let e=i(this,T).length===0?i(this,l).recovery:i(this,T).length===1?i(this,T)[0]:null;if(e==null)return;let r=F(e.type),t=i(this,l).descriptorContext();if(!r.canAutoAssemble(e,t))return;let n=e===i(this,l).recovery;try{let a=r.buildInternalConfig(e,t);i(this,l).setActiveSigner(yield i(this,l).assemble(a,{isAdminSigner:n}))}catch(a){s.warn("wallet.initDefaultSigner.autoAssemblyFailed",{recoveryType:i(this,l).recovery.type,signerCount:i(this,T).length,error:a})}})}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}static getRecovery(e){return i(e,l).recovery}static getInitialSigners(e){return i(e,T)}static getApiRecoveryServerSignerAddress(e){var r;return(r=i(e,P).apiRecoveryAddress)!=null?r:void 0}static getApiDelegatedServerSignerAddresses(e){return i(e,E)}get apiClient(){return i(this,c)}get options(){return i(this,I)}get chainAdapter(){return X(this.chain)}resolveServerSignerApiLocator(e){return i(this,P).apiLocator(e)}get recovery(){return i(this,l).recovery}balances(e){return o(this,null,function*(){s.info("wallet.balances.start");let r=this.resolveChainForEnvironment(),t=this.chainAdapter.nativeToken,n=[t,"usdc",...e!=null?e:[]],a=yield i(this,c).getBalance(this.address,{chains:[r],tokens:n});if("error"in a)throw s.error("wallet.balances.error",{error:a}),new Error(`Failed to get balances for wallet: ${JSON.stringify(a.message)}`);return s.info("wallet.balances.success"),ie(a,this.chain,t,e)})}stagingFund(e,r){return o(this,null,function*(){s.info("wallet.stagingFund.start",{amount:e,chain:r!=null?r:this.chain});let t=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:r!=null?r:this.chain});if("error"in t)throw s.error("wallet.stagingFund.error",{error:t}),new Error(`Failed to fund wallet: ${JSON.stringify(t.message)}`);return s.info("wallet.stagingFund.success"),t})}nfts(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield i(this,c).getNfts(N(f({},e),{chain:r,address:this.address}));if(t!=null&&typeof t=="object"&&"error"in t)throw s.error("wallet.nfts.error",{error:t}),new Error(`Failed to get nfts: ${JSON.stringify(t.message)}`);return t})}transactions(){return o(this,null,function*(){let e=yield i(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}transaction(e){return o(this,null,function*(){let r=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new Error(`Failed to get transaction: ${JSON.stringify(r.message)}`);return r})}transfers(e){return o(this,null,function*(){let r=this.resolveChainForEnvironment(),t=yield this.apiClient.getTransfers(this.walletLocator,{chain:r,tokens:e.tokens,status:e.status});if("error"in t)throw new Error(`Failed to get transfers: ${JSON.stringify(t.message)}`);return t})}send(e,r,t,n){return o(this,null,function*(){let a=Number(t);if(Number.isNaN(a)||!Number.isFinite(a)||a<=0)throw new q(`Invalid transfer amount: "${t}". Amount must be a positive number greater than zero.`);let u=re(e),S=this.resolveChainForEnvironment(),p=te(r,S);s.info("wallet.send.start",f({recipient:u,token:p,amount:t},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{})),yield this.preAuthIfNeeded();let g=i(this,l).require(),d;(n==null?void 0:n.signer)==null?d=g.locator():typeof n.signer=="string"?d=n.signer:d=this.resolveServerSignerApiLocator(n.signer);let y=f({recipient:u,amount:t,signer:d},(n==null?void 0:n.transactionType)!=null?{transactionType:n.transactionType}:{}),h=yield i(this,c).send(this.walletLocator,p,y);if("message"in h)throw s.error("wallet.send.error",{error:h}),new B(`Failed to send token: ${JSON.stringify(h.message)}`);if((n==null?void 0:n.prepareOnly)===!0)return s.info("wallet.send.prepared",{transactionId:h.id}),{hash:void 0,explorerLink:void 0,transactionId:h.id};let C=yield this.approveTransactionAndWait(h.id);return s.info("wallet.send.success",{transactionId:h.id,hash:C.hash}),C})}approveTransaction(e){return o(this,null,function*(){return console.warn("approveTransaction is deprecated. Use approve instead. This method will be removed in the next major version."),yield this.approve(e)})}approve(e){return o(this,null,function*(){if(s.info("wallet.approve.start",{transactionId:e.transactionId,signatureId:e.signatureId}),yield this.preAuthIfNeeded(),e.transactionId!=null){let r=yield this.approveTransactionAndWait(e.transactionId,e.options);return s.info("wallet.approve.success",{transactionId:e.transactionId}),r}if(e.signatureId!=null){let r=yield this.approveSignatureAndWait(e.signatureId,e.options);return s.info("wallet.approve.success",{signatureId:e.signatureId}),r}throw s.error("wallet.approve.error",{error:"Either transactionId or signatureId must be provided"}),new Error("Either transactionId or signatureId must be provided")})}addSigner(e,r){return o(this,null,function*(){s.info("wallet.addSigner.start");let t=typeof e=="object"&&"type"in e&&e.type==="server"?this.resolveServerSignerApiLocator(e):e;return i(this,l).withRecoverySigner(()=>o(this,null,function*(){var h;let n=typeof t=="string"?t:D(t),a=yield i(this,l).getSignerState(n);if(a.signer!=null){if(i(this,l).isApprovedSignerStatus(a.signer.status))return(r==null?void 0:r.scopes)!=null&&s.warn("wallet.addSigner.scopesIgnored",{reason:"signer already approved",signerLocator:n}),s.info("wallet.addSigner.alreadyApproved"),this.completeSignerRegistration(a.signer,null,r);if(a.pendingOperation!=null){if((r==null?void 0:r.scopes)!=null)throw new Error("Cannot apply scopes when resuming a pending signer registration. Remove the pending signer and register it again with the desired scopes.");return s.info("wallet.addSigner.resuming",{operationType:a.pendingOperation.type,operationId:a.pendingOperation.id}),this.completeSignerRegistration(a.signer,a.pendingOperation,r)}}let u=typeof t=="string"?t:F(t.type).addSignerPayload(t,i(this,l).descriptorContext()),p=this.chain!=="solana"&&this.chain!=="stellar"?(h=r==null?void 0:r.deployImmediately)!=null?h:!0:void 0,g=yield i(this,c).registerSigner(this.walletLocator,f(f({signer:u,chain:this.chainAdapter.addSignerChain(this.chain)},(r==null?void 0:r.scopes)!=null&&{scopes:r.scopes}),p!=null&&{deployImmediately:p}));if("error"in g)throw s.error("wallet.addSigner.error",{error:g}),g.code===G?new U(g.message):new k(`Failed to register signer: ${JSON.stringify(g.message)}`);let d=Q(g,this.chain);if(d==null)throw new Error(`No approval found for chain ${this.chain} in register signer response`);let y=this.chainAdapter.extractAddSignerOperation(g,this.chain,{locator:n,type:e.type});return this.completeSignerRegistration(d,y,r)}))})}completeSignerRegistration(e,r,t){return o(this,null,function*(){if(t!=null&&t.prepareOnly){if(r==null)return f({},e);switch(r.type){case"transaction":{let n={transactionId:r.id};return s.info("wallet.addSigner.prepared",n),f(f({},e),n)}case"signature":{let n={signatureId:r.id};return s.info("wallet.addSigner.prepared",n),f(f({},e),n)}default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}}if(r!=null)switch(r.type){case"transaction":yield this.approveTransactionAndWait(r.id),s.info("wallet.addSigner.success",{transactionId:r.id});break;case"signature":yield this.approveSignatureAndWait(r.id),s.info("wallet.addSigner.success",{signatureId:r.id});break;default:{let n=r.type;throw new Error(`Unknown pending operation type: ${n}`)}}else s.info("wallet.addSigner.success");return N(f({},e),{status:"success"})})}removeSigner(e,r){return o(this,null,function*(){let t=this.resolveSignerLocator(e);return s.info("wallet.removeSigner.start",{signerLocator:t}),i(this,l).withRecoverySigner(()=>o(this,null,function*(){let n=yield i(this,c).removeSigner(this.walletLocator,t,{chain:this.chainAdapter.addSignerChain(this.chain)});if("error"in n)throw s.error("wallet.removeSigner.error",{error:n}),new Error(`Failed to remove signer: ${JSON.stringify(n)}`);let a=n.id;return r!=null&&r.prepareOnly?(s.info("wallet.removeSigner.prepared",{transactionId:a}),{transactionId:a,status:void 0}):(yield this.approveTransactionAndWait(a),s.info("wallet.removeSigner.success",{transactionId:a}),{transactionId:a,status:"success"})}))})}useSigner(e){return o(this,null,function*(){s.info("wallet.useSigner.start"),e.type==="server"&&i(this,P).resetDelegatedCache(),F(e.type).validateConfig(e);let r=!1;e.type==="device"?yield i(this,w).resolveAvailability(e):r=yield this.resolveNonDeviceSigner(e);let t=F(e.type).buildInternalConfig(e,i(this,l).descriptorContext()),n=D(e);i(this,l).setActiveSigner(yield i(this,l).assemble(t,{isAdminSigner:r})),s.info("wallet.useSigner.success",{signerLocator:n})})}resolveNonDeviceSigner(e){return o(this,null,function*(){if(e.type!=="passkey"&&e.type!=="server"&&this.isRecoverySigner(e))return i(this,w).onSignerSelected(),!0;if(e.type==="passkey"&&this.isPasskeyMissingId(e)&&!(yield this.tryAutoSelectPasskey(e))){if(this.isRecoverySigner(e))return i(this,w).onSignerSelected(),!0;throw new Error("No passkey signer is registered on this wallet.")}if(e.type==="server")return this.resolveServerSigner(e);let r=this.resolveSignerLocator(e);if(yield this.signerIsRegistered(r))return i(this,w).onSignerSelected(),!1;if(this.isRecoverySigner(e))return i(this,w).onSignerSelected(),!0;throw new Error(`Signer "${r}" is not registered in this wallet.`)})}resolveServerSigner(e){return o(this,null,function*(){let t=(yield this.signers()).map(a=>a.locator),n=i(this,P).resolveForUseSigner(e,t,()=>this.isRecoverySigner(e));switch(n.kind){case"delegated":return i(this,w).onSignerSelected(),!1;case"recovery":return i(this,l).stripSecretFromRecovery(),i(this,w).onSignerSelected(),!0;case"unregistered":throw new Error(n.message)}})}tryAutoSelectPasskey(e){return o(this,null,function*(){let t=(yield this.signers()).filter(n=>n.type==="passkey");if(t.length===0)return!1;if(t.length>1)throw new Error('Multiple passkey signers are registered on this wallet. Please specify the credential id: wallet.useSigner({ type: "passkey", id: "<credential-id>" })');return e.id=t[0].locator.replace("passkey:",""),!0})}resolveSignerLocator(e){return e.type==="server"?this.resolveServerSignerApiLocator(e):D(e)}isPasskeyMissingId(e){return e.id==null||e.id===""}signerIsRegistered(e){return o(this,null,function*(){return i(this,l).signerIsRegistered(e)})}isSignerApproved(e){return o(this,null,function*(){return i(this,l).isSignerApproved(e)})}needsRecovery(){return i(this,w).needsRecovery}recover(){return o(this,null,function*(){yield i(this,w).recover()})}signers(){return o(this,null,function*(){var a,u;s.info("wallet.signers.start");let e=yield i(this,c).getWallet(this.walletLocator);if("error"in e)throw s.error("wallet.signers.error",{error:e}),new _(JSON.stringify(e));if(!pe(e)){let S=e.type!=="smart"?`Wallet type ${e.type} not supported`:`Wallet chain type ${e.chainType} not supported`;throw s.error("wallet.signers.error",{error:S}),new M(S)}let r=(u=(a=e==null?void 0:e.config)==null?void 0:a.delegatedSigners)!=null?u:[],n=(yield Promise.all(r.map(S=>o(this,null,function*(){try{return(yield i(this,l).getSignerState(S.locator)).signer}catch(p){return null}})))).filter(S=>S!=null);return s.info("wallet.signers.success",{count:n.length}),n})}get walletLocator(){if(i(this,c).isServerSide)return this.address;{let e=this.chainAdapter.walletLocatorPrefix,r=this.alias!=null?`:alias:${this.alias}`:"";return e+r}}get signerManager(){return i(this,l)}preAuthIfNeeded(){return o(this,null,function*(){yield i(this,L),i(this,x)==null&&m(this,x,this.recover());try{yield i(this,x)}finally{m(this,x,null)}let e=i(this,l).require();e instanceof Z&&(yield e.ensureAuthenticated())})}isRecoverySigner(e){let r=i(this,l).recovery;if(r==null||r.type!==e.type)return!1;let t=F(e.type);return t.matchesRecovery(e,r,i(this,l).descriptorContext())?(t.adoptsRecoveryConfigOnMatch&&i(this,l).adoptRecoveryConfig(e),!0):!1}resolveChainForEnvironment(){let e=K(this.chain,i(this,c).environment);return e!==this.chain&&(this.chain=e),this.chain}approveTransactionAndWait(e,r){return o(this,null,function*(){return yield this.approveTransactionInternal(e,r),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,r){return o(this,null,function*(){let t=yield this.approveSignatureInternal(e,r);return!("error"in t)&&t.status==="success"&&t.outputSignature!=null?{signature:t.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,r){return o(this,null,function*(){var p,g;if(!this.chainAdapter.supportsSignatures)throw new Error("Approving signatures is only supported for EVM smart wallets");let t=i(this,l).require(),n=yield i(this,c).getSignature(this.walletLocator,e);if("error"in n)throw O(n),new H(JSON.stringify(n));if(t.type==="api-key")return n;if((r==null?void 0:r.approval)!=null){let d=[r.approval];return yield this.executeApproveSignatureWithErrorHandling(e,d)}let a=(p=n.approvals)==null?void 0:p.pending;if(a==null||a.length===0)return n;let u=[...(g=r==null?void 0:r.additionalSigners)!=null?g:[],t],S=yield Promise.all(a.map(d=>o(this,null,function*(){let y=u.find(C=>C.locator()===d.signer.locator);if(y==null)throw new k(`Signer ${d.signer.locator} not found in pending approvals`);let h=yield y.signMessage(d.message);return N(f({},h),{signer:y.locator()})})));return yield this.executeApproveSignatureWithErrorHandling(e,S)})}approveTransactionInternal(e,r){return o(this,null,function*(){var p,g,d,y,h;let t=yield i(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw O(t),new z(JSON.stringify(t));yield(d=(g=(p=i(this,I))==null?void 0:p.callbacks)==null?void 0:g.onTransactionStart)==null?void 0:d.call(g);let n=i(this,l).require();if(n.type==="api-key")return t;if((r==null?void 0:r.approval)!=null){let C=[r.approval];return yield this.executeApproveTransactionWithErrorHandling(e,C)}let a=(y=t.approvals)==null?void 0:y.pending;if(a==null||a.length===0)return t;let u=[...(h=r==null?void 0:r.additionalSigners)!=null?h:[],n],S=yield Promise.all(a.map(C=>o(this,null,function*(){let v=u.find(de=>de.locator()===C.signer.locator);if(v==null)throw new k(`Signer ${C.signer.locator} not found in pending approvals`);let le=v.type==="device",ce=t.chainType==="solana"&&"transaction"in t.onChain&&!le?t.onChain.transaction:C.message,ge=yield v.signTransaction(ce);return N(f({},ge),{signer:v.locator()})})));return yield this.executeApproveTransactionWithErrorHandling(e,S)})}executeApproveTransactionWithErrorHandling(e,r){return o(this,null,function*(){s.info("wallet.approve: submitting approval to API",{transactionId:e});let t=yield i(this,c).approveTransaction(this.walletLocator,e,{approvals:r});if(t.error)throw O(t),new V(JSON.stringify(t));return t})}executeApproveSignatureWithErrorHandling(e,r){return o(this,null,function*(){let t=yield i(this,c).approveSignature(this.walletLocator,e,{approvals:r});if(t.error)throw O(t),new j(JSON.stringify(t));return t})}waitForSignature(e){return o(this,null,function*(){return yield oe(i(this,c),this.walletLocator,e)})}waitForTransaction(n){return o(this,arguments,function*(e,r=6e4,t={}){return yield ae(i(this,c),this.walletLocator,e,f({timeoutMs:r},t))})}sleep(e){return o(this,null,function*(){return new Promise(r=>setTimeout(r,e))})}};I=new WeakMap,c=new WeakMap,T=new WeakMap,P=new WeakMap,l=new WeakMap,w=new WeakMap,E=new WeakMap,L=new WeakMap,x=new WeakMap,R([W({logger:s,methodName:"wallet.balances",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"balances",1),R([W({logger:s,methodName:"wallet.stagingFund",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"stagingFund",1),R([W({logger:s,methodName:"wallet.send",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"send",1),R([W({logger:s,methodName:"wallet.approve",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"approve",1),R([W({logger:s,methodName:"wallet.addSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"addSigner",1),R([W({logger:s,methodName:"wallet.removeSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"removeSigner",1),R([W({logger:s,methodName:"wallet.useSigner",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"useSigner",1),R([W({logger:s,methodName:"wallet.recover",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"recover",1),R([W({logger:s,methodName:"wallet.signers",buildContext(e){return{chain:e.chain,address:e.address}}})],A.prototype,"signers",1);function pe($){return $.type==="smart"&&Y($.chainType)}export{A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as g}from"./chunk-
|
|
1
|
+
import{a,b as g}from"./chunk-5OGNXLOH.js";import{a as s}from"./chunk-HXN3ZART.js";import{h as t}from"./chunk-NU7VF7MC.js";import{PersonalMessage as u}from"ox";import{isHex as h,toHex as l}from"viem";var c=class p extends a{constructor(e){super(e)}signMessage(e){return t(this,null,function*(){let i=h(e)?e:l(e),r=u.getSignPayload(i);return yield this.sign(r)})}signTransaction(e){return t(this,null,function*(){return yield this.sign(e)})}sign(e){return t(this,null,function*(){var o;yield this.handleAuthRequired();let i=this.getJwtOrThrow(),r=e.replace("0x","");s.info("sign: sending request",{keyType:"secp256k1"});let y=Date.now(),n=yield(o=this.config.clientTEEConnection)==null?void 0:o.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:i,apiKey:this.config.crossmint.apiKey},data:{keyType:"secp256k1",bytes:r,encoding:"hex"}},options:g});if(s.info("sign: response received",{status:n==null?void 0:n.status,durationMs:Date.now()-y}),(n==null?void 0:n.status)==="error")throw new Error(n.error);if((n==null?void 0:n.signature)==null)throw new Error("Failed to sign transaction");return p.verifyPublicKeyFormat(n.publicKey),{signature:n.signature.bytes}})}static verifyPublicKeyFormat(e){if(e==null)throw new Error("No public key found");if(e.encoding!=="hex"||e.keyType!=="secp256k1"||e.bytes==null)throw new Error("Not supported. Expected public key to be in hex encoding and secp256k1 key type. Got: "+JSON.stringify(e))}getChainKeyParams(){return{scheme:"secp256k1",encoding:"hex"}}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-CTJQUZUF.js";import{a as s}from"./chunk-5LNDUSMZ.js";import{a as l}from"./chunk-HBGLYYE4.js";import{a,b as i}from"./chunk-HXN3ZART.js";import{h as r}from"./chunk-NU7VF7MC.js";import{createCrossmint as C}from"@crossmint/common-sdk-base";import{WebAuthnP256 as p}from"ox";var o=class c{constructor(e){i(e.apiKey);let t=new l(e);this.walletFactory=new n(t),a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return r(this,null,function*(){if(typeof e=="string"){if(t==null)throw new Error("Args parameter is required when walletLocator is provided");return yield this.walletFactory.getWallet(e,t)}return yield this.walletFactory.getWallet(e)})}createWallet(e){return r(this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return r(this,null,function*(){return yield s(e,t)})}createPasskeySigner(e){return r(this,null,function*(){let t=yield p.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};export{C as a,o as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLHAOCUXTcjs = require('./chunk-LHAOCUXT.cjs');var _chunkILCNZB3Acjs = require('./chunk-ILCNZB3A.cjs');var _chunkJ5W5S2WGcjs = require('./chunk-J5W5S2WG.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');function R(i,o,a,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var h,d;let{timeoutMs:e=6e4,initialBackoffMs:u=500,backoffMultiplier:n=1.5,maxBackoffMs:f=2e3,fastWindowMs:L=5e3}=r!=null?r:{};_chunkILCNZB3Acjs.a.info("wallet.approve: waiting for transaction confirmation",{transactionId:a,timeoutMs:e});let p=Date.now(),c=u,t;do{if(Date.now()-p>e)throw new (0, _chunkLHAOCUXTcjs.A)("Transaction confirmation timeout");let s=Date.now();if(t=yield i.getTransaction(o,a),t.error)throw _chunkLHAOCUXTcjs.H.call(void 0, t),new (0, _chunkLHAOCUXTcjs.z)(JSON.stringify(t));if(t.status!=="pending")break;let T=Date.now()-p;T>L&&(c=Math.min(Math.round(c*n),f));let v=Date.now()-s;yield D(Math.max(1,Math.min(c-v,e-T)))}while(!0);if(t.status==="failed")throw new (0, _chunkLHAOCUXTcjs.B)(`Transaction sending failed: ${JSON.stringify(t)}`);if(t.status==="awaiting-approval")throw new (0, _chunkLHAOCUXTcjs.C)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let P="txHash"in t.onChain&&typeof t.onChain.txHash=="string"?t.onChain.txHash:void 0,g=(h=t.onChain.txId)!=null?h:P;if(g==null)throw new (0, _chunkLHAOCUXTcjs.D)("Transaction hash not found on transaction response");return{hash:g,explorerLink:(d=t.onChain.explorerLink)!=null?d:"",transactionId:t.id}})}function W(i,o,a,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let{timeoutMs:e=6e4}=r!=null?r:{},u=Date.now(),n=null;do{if(Date.now()-u>e)throw new (0, _chunkLHAOCUXTcjs.w)("Signature confirmation timeout");if(yield new Promise(f=>setTimeout(f,_chunkJ5W5S2WGcjs.d)),n=yield i.getSignature(o,a),"error"in n)throw _chunkLHAOCUXTcjs.H.call(void 0, n),new (0, _chunkLHAOCUXTcjs.u)(JSON.stringify(n))}while(n===null||n.status==="pending");if(n.status==="failed")throw new (0, _chunkLHAOCUXTcjs.r)("Signature signing failed");if(!n.outputSignature)throw new (0, _chunkLHAOCUXTcjs.u)("Signature not available");return{signature:n.outputSignature,signatureId:a}})}function D(i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return new Promise(o=>setTimeout(o,i))})}exports.a = R; exports.b = W;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5UR3TR3Hcjs = require('./chunk-5UR3TR3H.cjs');var _chunkILCNZB3Acjs = require('./chunk-ILCNZB3A.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var a=class g extends _chunk5UR3TR3Hcjs.a{constructor(n){super(n)}signMessage(){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for stellar signer"))})}signTransaction(n){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var i;yield this.handleAuthRequired();let c=this.getJwtOrThrow();_chunkILCNZB3Acjs.a.info("sign: sending request",{keyType:"ed25519"});let d=Date.now(),e=yield(i=this.config.clientTEEConnection)==null?void 0:i.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:c,apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:n,encoding:"base64"}},options:_chunk5UR3TR3Hcjs.b});if(_chunkILCNZB3Acjs.a.info("sign: response received",{status:e==null?void 0:e.status,durationMs:Date.now()-d}),(e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");if(g.verifyPublicKeyFormat(e.publicKey),e.signature.encoding!=="base64")throw new Error("Wrong encoding for signature. Expected base64, got "+e.signature.encoding);return{signature:e.signature.bytes}})}static verifyPublicKeyFormat(n){if(n==null)throw new Error("No public key found");if(n.encoding!=="base64"||n.keyType!=="ed25519"||n.bytes==null)throw new Error("Not supported. Expected public key to be in base64 encoding and ed25519 key type. Got: "+JSON.stringify(n))}getChainKeyParams(){return{scheme:"ed25519",encoding:"strkey"}}};exports.a = a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as g}from"./chunk-
|
|
1
|
+
import{c as g}from"./chunk-6HB4WO5J.js";import{j as s}from"./chunk-SLPKMZNW.js";import{a as i}from"./chunk-HXN3ZART.js";var h={nativeToken:"eth",walletLocatorPrefix:"me:evm:smart",supportsSignatures:!0,addSignerChain(e){return e},extractAddSignerOperation(e,r,n){var a,t,o,d;if(!("chains"in e))throw i.error("wallet.addSigner.error",{error:"Expected chains in response for EVM chain"}),new Error("Expected chains in response for EVM chain");if(((t=(a=e.chains)==null?void 0:a[r])==null?void 0:t.status)==="failed")throw i.error("wallet.addSigner.failed",{chain:r,signerType:n.type,signerLocator:n.locator,chainStatus:(o=e.chains)==null?void 0:o[r]}),new s(`Signer registration failed for chain ${r} (signer: ${n.locator})`,JSON.stringify((d=e.chains)==null?void 0:d[r]));return g(e,r)},balanceTokenFields(e){return e!=null&&"contractAddress"in e?{contractAddress:e.contractAddress}:{}},emptyBalanceTokenFields(){return{contractAddress:void 0}}};export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-SSC676RL.js";import{a as C}from"./chunk-OQZTL6ZG.js";import{a as u}from"./chunk-NU7VF7MC.js";function d(s,n){var e,l,r,i,a;let t=(e=s.chains)==null?void 0:e[n],o=m(n).balanceTokenFields(t);return u({symbol:(l=s.symbol)!=null?l:"",name:(r=s.name)!=null?r:"",amount:(i=s.amount)!=null?i:"0",decimals:s.decimals,rawAmount:(a=s.rawAmount)!=null?a:"0"},o)}function h(s,n){let t={symbol:s,name:s,amount:"0",decimals:0,rawAmount:"0"},o=m(n).emptyBalanceTokenFields();return u(u({},t),o)}function B(s,n,t){var r,i,a,f,p;if(n==null)return!0;let o=((r=s.symbol)!=null?r:"").toLowerCase();if(n.has(o))return!0;let e=(i=s.chains)==null?void 0:i[t];if(e==null)return!1;let l=C(t);if(l==="solana"&&"mintHash"in e){let c=(a=e.mintHash)==null?void 0:a.toLowerCase();return c!=null&&(n.has(c)||n.has(`solana:${c}`))}if(l==="stellar"&&"contractId"in e){let c=(f=e.contractId)==null?void 0:f.toLowerCase();return c!=null&&(n.has(c)||n.has(`stellar:${c}`))}if("contractAddress"in e){let c=(p=e.contractAddress)==null?void 0:p.toLowerCase();return c!=null&&(n.has(c)||n.has(`${t}:${c}`))}return!1}function g(s,n,t,o){let e=s.find(a=>a.symbol===t),l=s.find(a=>a.symbol==="usdc"),r=o!=null?new Set(o.map(a=>a.toLowerCase())):null,i=s.filter(a=>a.symbol!==t&&a.symbol!=="usdc"&&B(a,r,n));return{nativeToken:e!=null?d(e,n):h(t,n),usdc:l!=null?d(l,n):h("usdc",n),tokens:i.map(a=>d(a,n))}}export{g as a};
|