@crossmint/wallets-sdk 1.7.0 → 1.8.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-GIXJ5P3D.cjs → chunk-2FEUZYLP.cjs} +1 -1
- package/dist/{chunk-GZSM6NWF.cjs → chunk-2GKFULT7.cjs} +1 -1
- package/dist/{chunk-MYLHEIBD.cjs → chunk-577FVL6N.cjs} +1 -1
- package/dist/{chunk-72MJS3AC.cjs → chunk-5CGCTYQJ.cjs} +1 -1
- package/dist/{chunk-ZUG5BIGQ.js → chunk-6FHMUKOW.js} +1 -1
- package/dist/{chunk-IUMKG7QD.js → chunk-6HB4WO5J.js} +1 -1
- package/dist/{chunk-BJZM3EV2.cjs → chunk-6MQ7FVEV.cjs} +1 -1
- package/dist/{chunk-BZJ5TU7H.cjs → chunk-AAWVNX5D.cjs} +1 -1
- package/dist/{chunk-CNXZJOVE.js → chunk-ACJUNZGV.js} +1 -1
- package/dist/{chunk-LSJDT5QL.cjs → chunk-BXXQTV75.cjs} +1 -1
- package/dist/{chunk-OE4UVHAK.js → chunk-CIIIXKSM.js} +1 -1
- package/dist/{chunk-DMNULXGD.js → chunk-D3KX5W6W.js} +1 -1
- package/dist/{chunk-ARN45RZ4.cjs → chunk-DF753J5G.cjs} +1 -1
- package/dist/{chunk-U37UWZ6M.js → chunk-DXVNNTYG.js} +1 -1
- package/dist/{chunk-WE32RGKM.js → chunk-FDKID63Z.js} +1 -1
- package/dist/chunk-FQZQGXWS.js +1 -0
- package/dist/{chunk-EJCR7VKJ.js → chunk-GAGWB24A.js} +1 -1
- package/dist/{chunk-NLMPNCXE.js → chunk-H3XK3D3Y.js} +1 -1
- package/dist/{chunk-VBM6V2GS.js → chunk-H7FDW5J4.js} +1 -1
- package/dist/{chunk-CISUOQT6.js → chunk-HTZPHRO2.js} +1 -1
- package/dist/{chunk-N2YQ7SK2.cjs → chunk-HUD23LSC.cjs} +1 -1
- package/dist/{chunk-DDNFHKJR.cjs → chunk-ILJXME26.cjs} +1 -1
- package/dist/{chunk-EXY6WMAQ.cjs → chunk-INBDFSBN.cjs} +1 -1
- package/dist/chunk-IVKPY3XN.js +1 -0
- package/dist/{chunk-3PDACUM7.js → chunk-IYQVWJXN.js} +1 -1
- package/dist/{chunk-BOB3OT66.cjs → chunk-J6ETRZYR.cjs} +1 -1
- package/dist/{chunk-CIMSRCXA.cjs → chunk-JUVF537D.cjs} +1 -1
- package/dist/chunk-KIZY54AZ.cjs +1 -0
- package/dist/{chunk-HIKDNSEI.cjs → chunk-KWILWKSM.cjs} +1 -1
- package/dist/{chunk-U6SAS52Q.cjs → chunk-LFVAI5O6.cjs} +1 -1
- package/dist/{chunk-ZLKQZHEG.js → chunk-M7QSZTNV.js} +1 -1
- package/dist/{chunk-GCIDUJF2.js → chunk-MEJ7ZHBM.js} +1 -1
- package/dist/chunk-OZ6ZUQ4E.cjs +1 -0
- package/dist/{chunk-QJALSMVI.js → chunk-PHKB5VRX.js} +1 -1
- package/dist/{chunk-WT45L3WI.cjs → chunk-QEIZABXJ.cjs} +1 -1
- package/dist/{chunk-R23CUQZX.js → chunk-R3LWLFO3.js} +1 -1
- package/dist/{chunk-FO2AO5HQ.cjs → chunk-RZNLDJBS.cjs} +1 -1
- package/dist/{chunk-S7DYRZI2.js → chunk-SAZKNE6N.js} +1 -1
- package/dist/{chunk-HJNJJGK6.js → chunk-SXB2JOPU.js} +1 -1
- package/dist/{chunk-FN64UU7M.cjs → chunk-TM77X7C3.cjs} +1 -1
- package/dist/{chunk-HIWBYW72.cjs → chunk-UCZT2O73.cjs} +1 -1
- package/dist/{chunk-BBMFGUOH.js → chunk-UKNAZVRC.js} +1 -1
- package/dist/{chunk-OTFPEC53.js → chunk-UMQI4GDZ.js} +1 -1
- package/dist/{chunk-T6VDXOWC.js → chunk-V5VXKWOL.js} +1 -1
- package/dist/{chunk-N6LXJTAC.js → chunk-VE25YNP3.js} +1 -1
- package/dist/{chunk-BCXIEWZK.cjs → chunk-WVCLDF55.cjs} +1 -1
- package/dist/{chunk-K4CPNZQP.cjs → chunk-XNCZYX2V.cjs} +1 -1
- package/dist/{chunk-MYWEABPN.cjs → chunk-XRLBGNNW.cjs} +1 -1
- package/dist/{chunk-KQOBLF64.js → chunk-Y7XDNVFX.js} +1 -1
- package/dist/{chunk-7FQTFYO6.cjs → chunk-YUCK3VTX.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- 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 +1 -1
- package/dist/sdk.d.ts +1 -1
- package/dist/sdk.js +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/device.d.cts +1 -1
- package/dist/signers/descriptors/device.d.ts +1 -1
- package/dist/signers/descriptors/email.d.cts +1 -1
- package/dist/signers/descriptors/email.d.ts +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/index.d.cts +1 -1
- package/dist/signers/descriptors/index.d.ts +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.d.cts +1 -1
- package/dist/signers/descriptors/phone.d.ts +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.d.cts +1 -1
- package/dist/signers/solana-external-wallet.d.ts +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.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/locators.d.cts +1 -1
- package/dist/utils/locators.d.ts +1 -1
- package/dist/utils/signer-locator.d.cts +1 -1
- package/dist/utils/signer-locator.d.ts +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/wallets/__tests__/test-helpers.cjs +1 -1
- package/dist/wallets/__tests__/test-helpers.d.cts +1 -1
- package/dist/wallets/__tests__/test-helpers.d.ts +1 -1
- package/dist/wallets/__tests__/test-helpers.js +1 -1
- package/dist/wallets/evm.cjs +1 -1
- package/dist/wallets/evm.d.cts +1 -1
- package/dist/wallets/evm.d.ts +1 -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 +1 -1
- package/dist/wallets/services/operation-poller.d.ts +1 -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 +1 -1
- package/dist/wallets/solana.d.ts +1 -1
- package/dist/wallets/solana.js +1 -1
- package/dist/wallets/stellar.cjs +1 -1
- package/dist/wallets/stellar.d.cts +1 -1
- package/dist/wallets/stellar.d.ts +1 -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 +1 -1
- package/dist/wallets/wallet-factory.d.ts +1 -1
- package/dist/wallets/wallet-factory.js +1 -1
- package/dist/wallets/wallet.cjs +1 -1
- package/dist/wallets/wallet.d.cts +1 -1
- package/dist/wallets/wallet.d.ts +1 -1
- package/dist/wallets/wallet.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-6CNBIQGF.cjs +0 -1
- package/dist/chunk-FXMXIAPL.js +0 -1
- package/dist/chunk-M5A2GB2R.js +0 -1
- package/dist/chunk-OI6QI264.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 _chunk577FVL6Ncjs = require('../../chunk-577FVL6N.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.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, _chunk577FVL6Ncjs.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, _chunk577FVL6Ncjs.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-CIIIXKSM.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.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 _chunk577FVL6Ncjs = require('../chunk-577FVL6N.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunk577FVL6Ncjs.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-CIIIXKSM.js";import"../chunk-TGFHY5PL.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.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 _chunk577FVL6Ncjs = require('../chunk-577FVL6N.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.ApiClient = _chunk577FVL6Ncjs.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-CIIIXKSM.js";import"../chunk-KBJA7JDT.js";import"../chunk-TGFHY5PL.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.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 _chunkILJXME26cjs = require('../../chunk-ILJXME26.cjs');require('../../chunk-TM77X7C3.cjs');require('../../chunk-3F4FMM3R.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.evmChainAdapter = _chunkILJXME26cjs.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-SXB2JOPU.js";import"../../chunk-6HB4WO5J.js";import"../../chunk-TGFHY5PL.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.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 _chunkWVCLDF55cjs = require('../../chunk-WVCLDF55.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.solanaChainAdapter = _chunkWVCLDF55cjs.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-DXVNNTYG.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.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 _chunk5CGCTYQJcjs = require('../../chunk-5CGCTYQJ.cjs');require('../../chunk-CCIGWTAO.cjs');require('../../chunk-XRLBGNNW.cjs');require('../../chunk-KWILWKSM.cjs');require('../../chunk-DSIFRRBS.cjs');exports.stellarChainAdapter = _chunk5CGCTYQJcjs.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-M7QSZTNV.js";import"../../chunk-455NK5LB.js";import"../../chunk-UMQI4GDZ.js";import"../../chunk-FQZQGXWS.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 _chunkKIZY54AZcjs = require('../chunk-KIZY54AZ.cjs');require('../chunk-ILJXME26.cjs');require('../chunk-WVCLDF55.cjs');require('../chunk-5CGCTYQJ.cjs');require('../chunk-TM77X7C3.cjs');require('../chunk-ENU3EKBG.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.getChainAdapter = _chunkKIZY54AZcjs.a; exports.isSupportedChainType = _chunkKIZY54AZcjs.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-IYQVWJXN.js";import"../chunk-SXB2JOPU.js";import"../chunk-DXVNNTYG.js";import"../chunk-M7QSZTNV.js";import"../chunk-6HB4WO5J.js";import"../chunk-OQZTL6ZG.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.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 _chunk6MQ7FVEVcjs = require('../chunk-6MQ7FVEV.cjs');require('../chunk-5X4EOJFG.cjs');require('../chunk-HRUMWG2F.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-UE3WVHTM.cjs');require('../chunk-3F4FMM3R.cjs');require('../chunk-CCIGWTAO.cjs');require('../chunk-XRLBGNNW.cjs');require('../chunk-KWILWKSM.cjs');require('../chunk-DSIFRRBS.cjs');exports.isMainnetChain = _chunk6MQ7FVEVcjs.c; exports.isTestnetChain = _chunk6MQ7FVEVcjs.b; exports.isValidChain = _chunk6MQ7FVEVcjs.e; exports.mainnetToTestnet = _chunk6MQ7FVEVcjs.d; exports.toViemChain = _chunk6MQ7FVEVcjs.a; exports.validateChainForEnvironment = _chunk6MQ7FVEVcjs.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-GAGWB24A.js";import"../chunk-FT5EVMLB.js";import"../chunk-SVIKBM3S.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-KUP7H7X2.js";import"../chunk-TGFHY5PL.js";import"../chunk-455NK5LB.js";import"../chunk-UMQI4GDZ.js";import"../chunk-FQZQGXWS.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
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOZ6ZUQ4Ecjs = require('./chunk-OZ6ZUQ4E.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunkR7S55N7Jcjs = require('./chunk-R7S55N7J.cjs');var _chunkSEXK7X55cjs = require('./chunk-SEXK7X55.cjs');var _chunkQ66YRLSWcjs = require('./chunk-Q66YRLSW.cjs');var _chunk6MQ7FVEVcjs = require('./chunk-6MQ7FVEV.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var $="When 'signers' is provided to a method that may fetch an existing wallet, each specified signer must exist in that wallet's configuration.",u= exports.a =class{constructor(r){this.apiClient=r}getWallet(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let i,t;if(typeof r=="string"){if(!this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet with walletLocator is only available on the server side. Use getWallet(args) instead.");if(e==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet configuration is required when using walletLocator: https://docs.crossmint.com/sdk-reference/wallets/type-aliases/WalletArgsFor");i=r,t=e}else{if(this.apiClient.isServerSide)throw new (0, _chunk3F4FMM3Rcjs.g)("getWallet on server side requires a walletLocator parameter. Use getWallet(walletLocator, args) instead.");t=r,i=this.getWalletLocator(t)}let a=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},t),{chain:_chunk6MQ7FVEVcjs.f.call(void 0, t.chain,this.apiClient.environment)});_chunkXRLBGNNWcjs.a.info("walletFactory.getWallet.start");let n=yield this.apiClient.getWallet(i);if("error"in n)throw _chunkXRLBGNNWcjs.a.warn("walletFactory.getWallet.notFound",{error:n.error}),new (0, _chunk3F4FMM3Rcjs.e)(JSON.stringify(n));return _chunkXRLBGNNWcjs.a.info("walletFactory.getWallet.success",{address:n.address}),yield this.createWalletInstance(n,a)})}createWallet(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var o,c,d,h,C,p,F,P;let e=_chunkDSIFRRBScjs.b.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {},r),{chain:_chunk6MQ7FVEVcjs.f.call(void 0, r.chain,this.apiClient.environment)});if(yield(d=(c=(o=e.options)==null?void 0:o.callbacks)==null?void 0:c.onWalletCreationStart)==null?void 0:d.call(c),_chunkXRLBGNNWcjs.a.info("walletFactory.createWallet.start"),!this.apiClient.isServerSide&&e.owner!=null)throw _chunkXRLBGNNWcjs.a.error("walletFactory.createWallet.error",{error:"Owner field cannot be specified in client-side createWallet calls"}),new (0, _chunk3F4FMM3Rcjs.g)("Owner field cannot be specified in client-side createWallet calls. Owner is determined from JWT authentication.");let t=((h=e.options)==null?void 0:h.deviceSignerKeyStorage)!=null&&e.chain!=="solana"?this.ensureDeviceSignerInSigners(e):(C=e.signers)!=null?C:[],a=yield this.registerSigners(t,e.chain,(p=e.options)==null?void 0:p.deviceSignerKeyStorage),n;if(e.recovery.type==="passkey"&&e.recovery.id==null)n=yield this.createPasskeySigner(e.recovery);else if(e.recovery.type==="server"){let{derivedAddress:I}=_chunkQ66YRLSWcjs.b.call(void 0, e.recovery,e.chain,this.apiClient.projectId,this.apiClient.environment);n={type:"server",address:I}}else n=e.recovery;let s=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunkDSIFRRBScjs.a.call(void 0, _chunkDSIFRRBScjs.a.call(void 0, {adminSigner:n},e.plugins?{plugins:e.plugins}:{}),a!=null?{delegatedSigners:a}:{}),owner:(F=e.owner)!=null?F:void 0,alias:(P=e.alias)!=null?P:void 0});if("error"in s)throw _chunkXRLBGNNWcjs.a.error("walletFactory.createWallet.error",{error:s.error}),new (0, _chunk3F4FMM3Rcjs.g)(JSON.stringify(s));return _chunkXRLBGNNWcjs.a.info("walletFactory.createWallet.success",{address:s.address}),yield this.createWalletInstance(s,e)})}createWalletInstance(r,e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var h,C;this.validateExistingWalletConfig(r,e);let i=e,t=r.config.adminSigner,a=((h=i.recovery)==null?void 0:h.type)==="server"||((C=i.recovery)==null?void 0:C.type)==="external-wallet"?i.recovery:t,n=r.config.delegatedSigners,s=n;s!=null&&s.length===1&&(s[0].type==="server"||s[0].type==="external-wallet")&&(s=i.signers);let o=t.type==="server"&&"address"in t&&!("secret"in t)?t.address:void 0,c=(n!=null?n:[]).filter(p=>p.type==="server"&&"address"in p&&!("secret"in p)).map(p=>p.address),d=new (0, _chunkOZ6ZUQ4Ecjs.a)({chain:e.chain,address:r.address,owner:r.owner,options:e.options,alias:e.alias,recovery:a,apiRecoveryServerSignerAddress:o,apiDelegatedServerSignerAddresses:c,signers:s!=null?s:[]},this.apiClient);return yield d.waitForInit(),d})}getWalletLocator(r){return`me:${this.getChainType(r.chain)}:smart`+(r.alias!=null?`:alias:${r.alias}`:"")}createPasskeySigner(r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;if(r.type!=="passkey")throw new Error("Signer is not a passkey");let e=(t=r.name)!=null?t:`Crossmint Wallet ${Date.now()}`,i=r.onCreatePasskey?yield r.onCreatePasskey(e):yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:i.id,name:e,publicKey:{x:i.publicKey.x.toString(),y:i.publicKey.y.toString()}}})}ensureDeviceSignerInSigners(r){var t;let e=(t=r.signers)!=null?t:[];return e.some(a=>a.type==="device")?e:[...e,{type:"device"}]}validateExistingWalletConfig(r,e){if(e.owner!=null&&r.owner!=null&&_chunkSEXK7X55cjs.b.call(void 0, e.owner)!==_chunkSEXK7X55cjs.b.call(void 0, r.owner))throw new (0, _chunk3F4FMM3Rcjs.g)("Wallet owner does not match existing wallet's linked user");if(e.chain==="solana"&&r.chainType!=="solana"||e.chain!=="solana"&&r.chainType==="solana"||e.chain==="stellar"&&r.chainType!=="stellar"||e.chain!=="stellar"&&r.chainType==="stellar")throw new (0, _chunk3F4FMM3Rcjs.g)(`Wallet chain does not match existing wallet's chain. You must use chain: ${r.chainType}.`);if(r.type!=="smart")return;let i=e;if(i.recovery!=null||i.signers!=null){let t=r.config,a=t==null?void 0:t.adminSigner;if(i.recovery!=null&&a!=null){if(i.recovery.type!==a.type)throw new (0, _chunk3F4FMM3Rcjs.g)("The wallet recovery signer type does not match the existing wallet's recovery signer type");_chunkSEXK7X55cjs.c.call(void 0, i.recovery,a)}let n=i.signers;n!=null&&this.validateSigners(r,n,e.chain)}}validateSigners(r,e,i){let t=r.config,a=t==null?void 0:t.delegatedSigners;if(e.length!==0){if(a==null||a.length===0)throw new (0, _chunk3F4FMM3Rcjs.g)(`${e.length} signer(s) specified, but wallet "${r.address}" has no signers. ${$}`);for(let n of e){let s=a.find(o=>{if(this.isMatchingPasskeySigner(n,o,t)||o.type==="device"&&n.type==="device")return!0;if(n.type==="server"){let{primary:c,legacy:d}=_chunkQ66YRLSWcjs.c.call(void 0, n,i,this.apiClient.projectId,this.apiClient.environment);return o.locator===`server:${c.derivedAddress}`||d!=null&&o.locator===`server:${d.derivedAddress}`}return o.locator===_chunkR7S55N7Jcjs.a.call(void 0, n)});if(s==null){let o=a.map(c=>c.locator).join(", ");throw new (0, _chunk3F4FMM3Rcjs.g)(`Signer '${n.type}' does not exist in wallet "${r.address}". Available signers: ${o}. ${$}`)}_chunkSEXK7X55cjs.c.call(void 0, n,s)}}}isMatchingPasskeySigner(r,e,i){var a,n;let t=((n=(a=i.delegatedSigners)==null?void 0:a.filter(s=>s.type==="passkey").length)!=null?n:0)+(i.adminSigner.type==="passkey"?1:0);if(r.type==="passkey"){if(r.id==null&&t===1)return e.type==="passkey";if(r.id==null&&t>1)throw new (0, _chunk3F4FMM3Rcjs.g)("When creating a wallet with multiple passkeys, you must provide the passkey ID for each passkey.")}return!1}registerSigners(r,e,i){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){var t;return yield Promise.all((t=r==null?void 0:r.map(a=>_chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(a.type==="passkey")return a.id==null?{signer:yield this.createPasskeySigner(a)}:{signer:a};if(a.type==="device"){if(a.publicKey!=null)return{signer:{type:"device",publicKey:a.publicKey,name:a.name}};if(a.locator!=null)return{signer:a.locator};if(i==null)throw new (0, _chunk3F4FMM3Rcjs.g)("Device signer key storage is required for device signers");let n=yield _chunkGMU3ZYLScjs.a.call(void 0, i);return{signer:{type:"device",publicKey:n.publicKey,name:n.name}}}if(a.type==="server"&&e!=null){let{derivedAddress:n}=_chunkQ66YRLSWcjs.b.call(void 0, a,e,this.apiClient.projectId,this.apiClient.environment);return{signer:`server:${n}`}}return{signer:_chunkR7S55N7Jcjs.a.call(void 0, a)}})))!=null?t:[])})}getChainType(r){return r==="solana"?"solana":r==="stellar"?"stellar":"evm"}};_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkXRLBGNNWcjs.a,methodName:"walletFactory.getWallet",buildContext(r,e){if(typeof e[0]=="string"){let t=e[1];return{walletLocator:e[0],chain:t==null?void 0:t.chain}}let i=e[0];return{chain:i==null?void 0:i.chain}}})],u.prototype,"getWallet",1),_chunkDSIFRRBScjs.c.call(void 0, [_commonsdkbase.WithLoggerContext.call(void 0, {logger:_chunkXRLBGNNWcjs.a,methodName:"walletFactory.createWallet",buildContext(r,e){return{chain:e[0].chain}}})],u.prototype,"createWallet",1);exports.a = u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2FEUZYLPcjs = require('./chunk-2FEUZYLP.cjs');var _chunkGMU3ZYLScjs = require('./chunk-GMU3ZYLS.cjs');var _chunk577FVL6Ncjs = require('./chunk-577FVL6N.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _ox = require('ox');var o=class c{constructor(e){_chunkXRLBGNNWcjs.b.call(void 0, e.apiKey);let t=new (0, _chunk577FVL6Ncjs.a)(e);this.walletFactory=new (0, _chunk2FEUZYLPcjs.a)(t),_chunkXRLBGNNWcjs.a.info("wallets.sdk.initialized")}static from(e){return new c(e)}getWallet(e,t){return _chunkDSIFRRBScjs.h.call(void 0, 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 _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(e)})}createDeviceSigner(e,t){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return yield _chunkGMU3ZYLScjs.a.call(void 0, e,t)})}createPasskeySigner(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let t=yield _ox.WebAuthnP256.createCredential({name:e});return{type:"passkey",id:t.id,name:e,publicKey:{x:t.publicKey.x.toString(),y:t.publicKey.y.toString()}}})}};exports.a = _commonsdkbase.createCrossmint; exports.b = o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _chunkKWILWKSMcjs = require('./chunk-KWILWKSM.cjs');var _chunkDSIFRRBScjs = require('./chunk-DSIFRRBS.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var h=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkKWILWKSMcjs.c,version:_chunkKWILWKSMcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.unstableApiPrefix="api/unstable/wallets"}createWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;_chunkXRLBGNNWcjs.a.info("wallets.api.createWallet",{chainType:e.chainType,walletType:e.type});let n=yield(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json();return"error"in n?_chunkXRLBGNNWcjs.a.error("wallets.api.createWallet.error",{error:n.error,chainType:e.chainType}):"address"in n&&_chunkXRLBGNNWcjs.a.info("wallets.api.createWallet.success",{address:n.address,chainType:e.chainType}),n})}getWallet(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("wallets.api.getWallet",{locator:e});let r=yield(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json();return"error"in r?_chunkXRLBGNNWcjs.a.warn("wallets.api.getWallet.error",{locator:e,error:r.error}):"address"in r&&_chunkXRLBGNNWcjs.a.info("wallets.api.getWallet.success",{address:r.address,locator:e}),r})}createTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers})).json()})}getTransaction(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(r),headers:this.headers});return n.status===422?this.getSignature(e,s):n.json()})}getSignature(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}getNfts(e){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let r=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${r}/nfts?${s.toString()}`,{headers:this.headers})).json()})}getTransfers(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("chain",s.chain.toString()),s.tokens!=null&&r.append("tokens",s.tokens),r.append("status",s.status),(yield this.get(`${this.unstableApiPrefix}/${e}/transfers?${r.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=new URLSearchParams;return r.append("tokens",s.tokens.join(",")),r.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${r.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){if(this.environment===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION)throw new Error("Funding wallets is only supported in staging environment");return(yield this.post(`api/v1-alpha2/wallets/${e}/balances`,{body:JSON.stringify(s),headers:this.headers})).json()})}registerSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}removeSigner(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let n=encodeURIComponent(s),i=new URLSearchParams;r.chain&&i.append("chain",r.chain);let l=`${this.apiPrefix}/${e}/signers/${n}${i.size>0?`?${i.toString()}`:""}`;return(yield this.delete(l,{headers:this.headers})).json()})}getSigner(e,s){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){let r=encodeURIComponent(s);return(yield this.get(`${this.apiPrefix}/${e}/signers/${r}`,{headers:this.headers})).json()})}send(e,s,r){return _chunkDSIFRRBScjs.h.call(void 0, this,null,function*(){_chunkXRLBGNNWcjs.a.info("wallets.api.send",{walletLocator:e,tokenLocator:s,recipient:r.recipient});let i=yield(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(r),headers:this.headers})).json();return"error"in i?_chunkXRLBGNNWcjs.a.error("wallets.api.send.error",{walletLocator:e,tokenLocator:s,error:i.error}):"id"in i&&_chunkXRLBGNNWcjs.a.info("wallets.api.send.success",{walletLocator:e,transactionId:i.id}),i})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get projectId(){if(!this.parsedAPIKey.isValid)throw new (0, _chunk3F4FMM3Rcjs.a)("Invalid API key");return this.parsedAPIKey.projectId}get headers(){return{"Content-Type":"application/json"}}};exports.a = h;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var o={nativeToken:"xlm",walletLocatorPrefix:"me:stellar:smart",supportsSignatures:!1,addSignerChain(n){},extractAddSignerOperation(n,r,t){if(!("transaction"in n)||n.transaction==null)throw _chunkXRLBGNNWcjs.a.error("wallet.addSigner.error",{error:"Expected transaction in response for Solana/Stellar chain"}),new Error("Expected transaction in response for Solana/Stellar chain");return{type:"transaction",id:n.transaction.id}},balanceTokenFields(n){return n!=null&&"contractId"in n?{contractId:n.contractId}:n!=null&&"contractAddress"in n?{contractAddress:n.contractAddress}:{}},emptyBalanceTokenFields(){return{contractId:void 0}}};exports.a = o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-NFX2WUB6.js";import{a as A}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-NFX2WUB6.js";import{a as A}from"./chunk-FDKID63Z.js";import{f as w}from"./chunk-DCKFFFPG.js";import{b as R,c as b}from"./chunk-6HB4WO5J.js";import{d as e,e as o,f as s,h as p}from"./chunk-NU7VF7MC.js";var a,n,d,g,S,C,u,h,v,y,x=class{constructor(r){o(this,a);o(this,n);o(this,d);o(this,g);o(this,S);o(this,C);o(this,u);o(this,h);o(this,v);o(this,y);s(this,d,r.apiClient),s(this,g,r.options),s(this,S,r.chain),s(this,C,r.walletAddress),s(this,u,r.walletLocator),s(this,h,r.serverSignerResolver),s(this,n,r.recovery),s(this,v,r.initialSigners),s(this,y,r.signers),s(this,a,r.signer)}get activeSigner(){return e(this,a)}setActiveSigner(r){s(this,a,r)}get recovery(){return e(this,n)}descriptorContext(){var r,i,t,l,c;return{chain:e(this,S),walletAddress:e(this,C),crossmint:e(this,d).crossmint,clientTEEConnection:(r=e(this,g))==null?void 0:r.clientTEEConnection,resetSignerFrame:(i=e(this,g))==null?void 0:i.resetSignerFrame,onAuthRequired:(l=(t=e(this,g))==null?void 0:t.callbacks)==null?void 0:l.onAuthRequired,deviceSignerKeyStorage:(c=e(this,g))==null?void 0:c.deviceSignerKeyStorage,serverSigners:e(this,h)}}adoptRecoveryConfig(r){s(this,n,r)}stripSecretFromRecovery(){let r=e(this,h).resolvedRecoveryAddress;e(this,n)!=null&&e(this,n).type==="server"&&!w(e(this,n))&&r!=null&&s(this,n,{type:"server",address:r})}assemble(r,i){return p(this,null,function*(){var l,c;let t=A(e(this,S),r,(l=e(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(e(this,a)==null){if(e(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=m(e(this,n).type),i=r.signerUnavailableReason();throw i!=null?new Error(i):r.canAutoAssemble(e(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 e(this,a)}withRecoverySigner(r){return p(this,null,function*(){var f;let i=e(this,a);if(w(e(this,n))&&!e(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=m(e(this,n).type),l=this.descriptorContext();if(e(this,n)!=null&&e(this,n).type==="external-wallet"&&!t.canAutoAssemble(e(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(e(this,n),l);s(this,a,A(e(this,S),c,(f=e(this,g))==null?void 0:f.deviceSignerKeyStorage));try{return yield r()}finally{s(this,a,i)}})}getSignerState(r){return p(this,null,function*(){let i=null;try{i=yield e(this,d).getSigner(e(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=R(i,e(this,S));return{response:i,signer:t,pendingOperation:b(i,e(this,S))}})}signerIsRegistered(r){return p(this,null,function*(){return(yield e(this,y).call(this)).some(t=>t.locator===r)})}isSignerApproved(r){return p(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;export{x as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as o,b as a}from"./chunk-NU7VF7MC.js";function l(t){switch(t.type){case"passkey":return{type:"passkey",id:t.id,name:t.name,publicKey:t.publicKey,validatorContractVersion:t.validatorContractVersion,locator:t.locator};case"api-key":return{type:"api-key",address:t.address,locator:t.locator};case"external-wallet":return{type:"external-wallet",address:t.address,locator:t.locator};case"email":return{type:"email",email:t.email,address:t.address,locator:t.locator};case"phone":return{type:"phone",phone:t.phone,address:t.address,locator:t.locator};case"device":return{type:"device",publicKey:t.publicKey,locator:t.locator};case"server":return{type:"server",address:t.address,locator:t.locator};default:throw new Error(`Unknown signer type: ${t.type}`)}}function i(t,n){let e=l(t),s="scopes"in t?t.scopes:void 0;if(n==="solana"||n==="stellar"){let r="success";return"transaction"in t&&t.transaction!=null&&(r=t.transaction.status),o(a(o({},e),{status:r}),s!=null&&{scopes:s})}if("chains"in t&&t.chains!=null&&Object.keys(t.chains).length>0){let r=t.chains[n];return r==null?null:o(a(o({},e),{status:r.status}),s!=null&&{scopes:s})}return o(a(o({},e),{status:"success"}),s!=null&&{scopes:s})}function d(t,n){if(n==="solana"||n==="stellar")return"transaction"in t&&t.transaction!=null&&(t.transaction.status==="pending"||t.transaction.status==="awaiting-approval")?{type:"transaction",id:t.transaction.id}:null;if("chains"in t&&t.chains!=null){let e=t.chains[n];if(e!=null&&(e.status==="pending"||e.status==="awaiting-approval"))return{type:"onChain"in e?"transaction":"signature",id:e.id}}return null}function y(t,n){let e=a(o({},t),{status:n});return t.locator.indexOf(":")===-1&&(t.type==="api-key"?e.locator=t.locator:(e.locator=`external-wallet:${t.locator}`,e.type="external-wallet")),e}export{l as a,i as b,d as c,y as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5X4EOJFGcjs = require('./chunk-5X4EOJFG.cjs');var _chunkHRUMWG2Fcjs = require('./chunk-HRUMWG2F.cjs');var _chunkIR5WN6FQcjs = require('./chunk-IR5WN6FQ.cjs');var _chunkGEY574THcjs = require('./chunk-GEY574TH.cjs');var _chunkUE3WVHTMcjs = require('./chunk-UE3WVHTM.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5X4EOJFGcjs = require('./chunk-5X4EOJFG.cjs');var _chunkHRUMWG2Fcjs = require('./chunk-HRUMWG2F.cjs');var _chunkIR5WN6FQcjs = require('./chunk-IR5WN6FQ.cjs');var _chunkGEY574THcjs = require('./chunk-GEY574TH.cjs');var _chunkUE3WVHTMcjs = require('./chunk-UE3WVHTM.cjs');var _chunk3F4FMM3Rcjs = require('./chunk-3F4FMM3R.cjs');var _chunkXRLBGNNWcjs = require('./chunk-XRLBGNNW.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var _chains = require('viem/chains');var w=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.CURTIS,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,_commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET,_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET],D=[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT,_commonsdkbase.BlockchainIncludingTestnet.APECHAIN,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM,_commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA,_commonsdkbase.BlockchainIncludingTestnet.BASE,_commonsdkbase.BlockchainIncludingTestnet.BSC,_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM,_commonsdkbase.BlockchainIncludingTestnet.FLOW,_commonsdkbase.BlockchainIncludingTestnet.MANTLE,_commonsdkbase.BlockchainIncludingTestnet.MODE,_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM,_commonsdkbase.BlockchainIncludingTestnet.PLUME,_commonsdkbase.BlockchainIncludingTestnet.POLYGON,_commonsdkbase.BlockchainIncludingTestnet.SCROLL,_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1,_commonsdkbase.BlockchainIncludingTestnet.SHAPE,_commonsdkbase.BlockchainIncludingTestnet.STORY,_commonsdkbase.BlockchainIncludingTestnet.TEMPO,_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN,_commonsdkbase.BlockchainIncludingTestnet.ZORA];function X(t){switch(t){case _commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA:return _chains.baseSepolia;case _commonsdkbase.BlockchainIncludingTestnet.BASE:return _chains.base;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY:return _chains.polygonAmoy;case _commonsdkbase.BlockchainIncludingTestnet.POLYGON:return _chains.polygon;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA:return _chains.optimismSepolia;case _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM:return _chains.optimism;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA:return _chains.arbitrumSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM:return _chains.arbitrum;case _commonsdkbase.BlockchainIncludingTestnet.ARBITRUMNOVA:return _chains.arbitrumNova;case _commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET:return _chunkGEY574THcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.STORY:return _chunkIR5WN6FQcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA:return _chains.modeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.MODE:return _chains.mode;case _commonsdkbase.BlockchainIncludingTestnet.BSC:return _chains.bsc;case _commonsdkbase.BlockchainIncludingTestnet.SHAPE:return _chains.shape;case _commonsdkbase.BlockchainIncludingTestnet.ZORA:return _chains.zora;case _commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA:return _chains.zoraSepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA:return _chains.sepolia;case _commonsdkbase.BlockchainIncludingTestnet.ETHEREUM:return _chains.mainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW:return _chains.flowMainnet;case _commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET:return _chains.flowTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET:return _chains.plumeTestnet;case _commonsdkbase.BlockchainIncludingTestnet.PLUME:return _chains.plume;case _commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET:return _chunkHRUMWG2Fcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO:return _chunkUE3WVHTMcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET:return _chunk5X4EOJFGcjs.a;case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT:case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.APECHAIN:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE:case _commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL:case _commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA:case _commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1:case _commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET:case _commonsdkbase.BlockchainIncludingTestnet.CURTIS:case _commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN:case _commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA:throw new Error(`Chain ${t} is not yet supported in toViemChain function. Please add the appropriate viem chain definition.`);default:throw new Error(`Unknown chain: ${t}`)}}function I(t){return w.includes(t)}function C(t){return D.includes(t)}var Y={[_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT]:_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.APECHAIN]:_commonsdkbase.BlockchainIncludingTestnet.CURTIS,[_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM]:_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.BASE]:_commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM]:_commonsdkbase.BlockchainIncludingTestnet.ETHEREUM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.FLOW]:_commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.MANTLE]:_commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.MODE]:_commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM]:_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.PLUME]:_commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.POLYGON]:_commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,[_commonsdkbase.BlockchainIncludingTestnet.SCROLL]:_commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1]:_commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.STORY]:_commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,[_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN]:_commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.ZORA]:_commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA,[_commonsdkbase.BlockchainIncludingTestnet.TEMPO]:_commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET};function g(t){return Y[t]}function F(t){return t==="solana"||t==="stellar"||I(t)||C(t)}function ee(t,a){if(!F(t))throw new (0, _chunk3F4FMM3Rcjs.c)(`Unknown chain "${t}". Please use a supported chain name (e.g. "base-sepolia", "polygon", "solana", "stellar").`);if(t==="solana"||t==="stellar")return t;let r=t,T=a===_commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION;if(T&&I(r))throw new (0, _chunk3F4FMM3Rcjs.b)(`Chain "${t}" is a testnet chain and cannot be used in production. Please use a mainnet chain instead.`);if(!T&&C(r)){let n=g(r);if(n!=null)return _chunkXRLBGNNWcjs.a.debug("validateChainForEnvironment.autoConverted",{chain:t,convertedTo:n,environment:a,message:`Chain "${t}" is a mainnet chain and cannot be used in ${a} environment. Automatically converted to "${n}".`}),n;_chunkXRLBGNNWcjs.a.debug("validateChainForEnvironment.mismatch",{chain:t,environment:a,message:`Chain "${t}" is a mainnet chain and should not be used in ${a} environment. No testnet equivalent is available. Please use a testnet chain instead.`})}return t}exports.a = X; exports.b = I; exports.c = C; exports.d = g; exports.e = F; exports.f = ee;
|