@crossmint/wallets-sdk 0.18.1 → 0.18.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/api/client.cjs +1 -1
  2. package/dist/api/client.d.cts +4 -4
  3. package/dist/api/client.d.ts +4 -4
  4. package/dist/api/client.js +1 -1
  5. package/dist/api/index.cjs +1 -1
  6. package/dist/api/index.d.cts +1 -1
  7. package/dist/api/index.d.ts +1 -1
  8. package/dist/api/index.js +1 -1
  9. package/dist/api/types.d.cts +4 -2
  10. package/dist/api/types.d.ts +4 -2
  11. package/dist/{chunk-JGDPLNDH.cjs → chunk-3SW6AJSG.cjs} +1 -1
  12. package/dist/{chunk-KGLYT5HO.cjs → chunk-7HTB7WKD.cjs} +1 -1
  13. package/dist/{chunk-QQZLJV7S.cjs → chunk-CXTC3YDL.cjs} +1 -1
  14. package/dist/chunk-DV6ZRFKV.js +1 -0
  15. package/dist/{chunk-BNSVVKEI.cjs → chunk-DX7VVXY5.cjs} +1 -1
  16. package/dist/{chunk-YL5ARMHR.js → chunk-FATVK26C.js} +1 -1
  17. package/dist/{chunk-7QNCQNKP.js → chunk-GKZFI322.js} +1 -1
  18. package/dist/{chunk-XOXEWAVO.js → chunk-HQAKCIYM.js} +1 -1
  19. package/dist/chunk-KFJLRIY7.js +1 -0
  20. package/dist/chunk-M2UBZY5S.cjs +1 -0
  21. package/dist/{chunk-RAP5FL3G.cjs → chunk-NP32UO2G.cjs} +1 -1
  22. package/dist/{chunk-TDZA25S6.cjs → chunk-QMXG67T3.cjs} +1 -1
  23. package/dist/{chunk-LVE6KVLA.js → chunk-SLG7HGGL.js} +1 -1
  24. package/dist/{chunk-W66Q5FPX.js → chunk-YWXQIFVZ.js} +1 -1
  25. package/dist/chunk-Z54LVUDS.js +1 -0
  26. package/dist/{chunk-KHRWQHDT.cjs → chunk-ZWMB3QLR.cjs} +2 -2
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +1 -1
  29. package/dist/sdk.cjs +1 -1
  30. package/dist/sdk.js +1 -1
  31. package/dist/utils/constants.cjs +1 -1
  32. package/dist/utils/constants.js +1 -1
  33. package/dist/wallets/evm.cjs +1 -1
  34. package/dist/wallets/evm.js +1 -1
  35. package/dist/wallets/solana.cjs +1 -1
  36. package/dist/wallets/solana.js +1 -1
  37. package/dist/wallets/stellar.cjs +1 -1
  38. package/dist/wallets/stellar.js +1 -1
  39. package/dist/wallets/wallet-factory.cjs +1 -1
  40. package/dist/wallets/wallet-factory.js +1 -1
  41. package/dist/wallets/wallet.cjs +1 -1
  42. package/dist/wallets/wallet.d.cts +12 -1
  43. package/dist/wallets/wallet.d.ts +12 -1
  44. package/dist/wallets/wallet.js +1 -1
  45. package/package.json +4 -4
  46. package/dist/chunk-24NXTPLV.js +0 -1
  47. package/dist/chunk-2VOPSORH.js +0 -1
  48. package/dist/chunk-FT4OJWXH.cjs +0 -1
  49. package/dist/chunk-G5DCGRZ6.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKGLYT5HOcjs = require('../chunk-KGLYT5HO.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkKGLYT5HOcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7HTB7WKDcjs = require('../chunk-7HTB7WKD.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunk7HTB7WKDcjs.a;
@@ -1,6 +1,5 @@
1
- import * as _crossmint_common_sdk_base from '@crossmint/common-sdk-base';
2
- import { CrossmintApiClient, Crossmint } from '@crossmint/common-sdk-base';
3
- import { CreateWalletParams, CreateWalletResponse, WalletLocator, GetWalletResponse, CreateTransactionParams, CreateTransactionResponse, ApproveTransactionParams, ApproveTransactionResponse, GetTransactionResponse, CreateSignatureParams, CreateSignatureResponse, ApproveSignatureParams, ApproveSignatureResponse, GetSignatureResponse, GetTransactionsResponse, GetNftsResponse, GetActivityResponse, GetBalanceResponse, RegisterSignerParams, RegisterSignerResponse, GetSignerResponse, SendParams, SendResponse } from './types.cjs';
1
+ import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
2
+ import { CreateWalletParams, CreateWalletResponse, WalletLocator, GetWalletResponse, CreateTransactionParams, CreateTransactionResponse, ApproveTransactionParams, ApproveTransactionResponse, GetTransactionResponse, CreateSignatureParams, CreateSignatureResponse, ApproveSignatureParams, ApproveSignatureResponse, GetSignatureResponse, GetTransactionsResponse, GetNftsResponse, GetActivityResponse, GetBalanceResponse, FundWalletParams, FundWalletResponse, RegisterSignerParams, RegisterSignerResponse, GetSignerResponse, SendParams, SendResponse } from './types.cjs';
4
3
  import { Chain } from '../chains/chains.cjs';
5
4
  import 'viem';
6
5
  import './gen/types.gen.cjs';
@@ -31,11 +30,12 @@ declare class ApiClient extends CrossmintApiClient {
31
30
  chains: Chain[];
32
31
  tokens: string[];
33
32
  }): Promise<GetBalanceResponse>;
33
+ fundWallet(walletLocator: WalletLocator, params: FundWalletParams): Promise<FundWalletResponse>;
34
34
  registerSigner(walletLocator: WalletLocator, params: RegisterSignerParams): Promise<RegisterSignerResponse>;
35
35
  getSigner(walletLocator: WalletLocator, signer: string): Promise<GetSignerResponse>;
36
36
  send(walletLocator: WalletLocator, tokenLocator: string, params: SendParams): Promise<SendResponse>;
37
37
  get isServerSide(): boolean;
38
- get environment(): _crossmint_common_sdk_base.APIKeyEnvironmentPrefix;
38
+ get environment(): APIKeyEnvironmentPrefix;
39
39
  private get headers();
40
40
  }
41
41
 
@@ -1,6 +1,5 @@
1
- import * as _crossmint_common_sdk_base from '@crossmint/common-sdk-base';
2
- import { CrossmintApiClient, Crossmint } from '@crossmint/common-sdk-base';
3
- import { CreateWalletParams, CreateWalletResponse, WalletLocator, GetWalletResponse, CreateTransactionParams, CreateTransactionResponse, ApproveTransactionParams, ApproveTransactionResponse, GetTransactionResponse, CreateSignatureParams, CreateSignatureResponse, ApproveSignatureParams, ApproveSignatureResponse, GetSignatureResponse, GetTransactionsResponse, GetNftsResponse, GetActivityResponse, GetBalanceResponse, RegisterSignerParams, RegisterSignerResponse, GetSignerResponse, SendParams, SendResponse } from './types.js';
1
+ import { CrossmintApiClient, Crossmint, APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
2
+ import { CreateWalletParams, CreateWalletResponse, WalletLocator, GetWalletResponse, CreateTransactionParams, CreateTransactionResponse, ApproveTransactionParams, ApproveTransactionResponse, GetTransactionResponse, CreateSignatureParams, CreateSignatureResponse, ApproveSignatureParams, ApproveSignatureResponse, GetSignatureResponse, GetTransactionsResponse, GetNftsResponse, GetActivityResponse, GetBalanceResponse, FundWalletParams, FundWalletResponse, RegisterSignerParams, RegisterSignerResponse, GetSignerResponse, SendParams, SendResponse } from './types.js';
4
3
  import { Chain } from '../chains/chains.js';
5
4
  import 'viem';
6
5
  import './gen/types.gen.js';
@@ -31,11 +30,12 @@ declare class ApiClient extends CrossmintApiClient {
31
30
  chains: Chain[];
32
31
  tokens: string[];
33
32
  }): Promise<GetBalanceResponse>;
33
+ fundWallet(walletLocator: WalletLocator, params: FundWalletParams): Promise<FundWalletResponse>;
34
34
  registerSigner(walletLocator: WalletLocator, params: RegisterSignerParams): Promise<RegisterSignerResponse>;
35
35
  getSigner(walletLocator: WalletLocator, signer: string): Promise<GetSignerResponse>;
36
36
  send(walletLocator: WalletLocator, tokenLocator: string, params: SendParams): Promise<SendResponse>;
37
37
  get isServerSide(): boolean;
38
- get environment(): _crossmint_common_sdk_base.APIKeyEnvironmentPrefix;
38
+ get environment(): APIKeyEnvironmentPrefix;
39
39
  private get headers();
40
40
  }
41
41
 
@@ -1 +1 @@
1
- import{a}from"../chunk-G5DCGRZ6.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import{a}from"../chunk-DV6ZRFKV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunkKGLYT5HOcjs = require('../chunk-KGLYT5HO.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkKGLYT5HOcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunk7HTB7WKDcjs = require('../chunk-7HTB7WKD.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunk7HTB7WKDcjs.a;
@@ -1,5 +1,5 @@
1
1
  export { ApiClient } from './client.cjs';
2
- export { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator } from './types.cjs';
2
+ export { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, FundWalletParams, FundWalletResponse, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator } from './types.cjs';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import '../chains/chains.cjs';
5
5
  import 'viem';
@@ -1,5 +1,5 @@
1
1
  export { ApiClient } from './client.js';
2
- export { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator } from './types.js';
2
+ export { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, FundWalletParams, FundWalletResponse, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator } from './types.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-G5DCGRZ6.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-DV6ZRFKV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
@@ -1,5 +1,5 @@
1
1
  import { Address } from 'viem';
2
- import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV1ControllerSubmitApprovals4Error, WalletsV1ControllerGetTransaction4Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV1ControllerCreateSignatureRequest4Error, WalletsV1ControllerSubmitSignatureApprovals4Error, WalletsV1ControllerGetSignature4Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV1ControllerGetTransactionsWithoutChain4Error, WalletNftsResponseDto, WalletsV1Alpha2ActivityResponseDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV1ControllerCreateDelegatedSigner4Error, WalletsV1ControllerGetDelegatedSigner4Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.cjs';
2
+ import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV1ControllerSubmitApprovals4Error, WalletsV1ControllerGetTransaction4Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV1ControllerCreateSignatureRequest4Error, WalletsV1ControllerSubmitSignatureApprovals4Error, WalletsV1ControllerGetSignature4Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV1ControllerGetTransactionsWithoutChain4Error, WalletNftsResponseDto, WalletsV1Alpha2ActivityResponseDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, FundWalletAmountDto, BalanceControllerFundWallet2Responses, BalanceControllerFundWallet2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV1ControllerCreateDelegatedSigner4Error, WalletsV1ControllerGetDelegatedSigner4Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.cjs';
3
3
 
4
4
  type CreateWalletParams = CreateWalletV2025Dto;
5
5
  type GetWalletSuccessResponse = WalletV2025ResponseDto;
@@ -28,6 +28,8 @@ type GetBalanceResponse = WalletBalanceV20250609ResponseDto | BalanceControllerG
28
28
  type GetBalanceSuccessResponse = WalletBalanceV20250609ResponseDto;
29
29
  type GetActivityResponse = WalletsV1Alpha2ActivityResponseDto | WalletV1Alpha2ErrorDto;
30
30
  type Activity = WalletsV1Alpha2ActivityResponseDto;
31
+ type FundWalletParams = FundWalletAmountDto;
32
+ type FundWalletResponse = BalanceControllerFundWallet2Responses | BalanceControllerFundWallet2Error;
31
33
  type RegisterSignerChain = Extract<CreateSignerV2025InputDto, {
32
34
  chain: string;
33
35
  }>["chain"];
@@ -50,4 +52,4 @@ type EvmWalletLocator = `me:evm:${WalletType}` | Address;
50
52
  type SolanaWalletLocator = `me:solana:${WalletType}` | SolanaAddress;
51
53
  type WalletLocator = EvmWalletLocator | SolanaWalletLocator;
52
54
 
53
- export type { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator };
55
+ export type { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, FundWalletParams, FundWalletResponse, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator };
@@ -1,5 +1,5 @@
1
1
  import { Address } from 'viem';
2
- import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV1ControllerSubmitApprovals4Error, WalletsV1ControllerGetTransaction4Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV1ControllerCreateSignatureRequest4Error, WalletsV1ControllerSubmitSignatureApprovals4Error, WalletsV1ControllerGetSignature4Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV1ControllerGetTransactionsWithoutChain4Error, WalletNftsResponseDto, WalletsV1Alpha2ActivityResponseDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV1ControllerCreateDelegatedSigner4Error, WalletsV1ControllerGetDelegatedSigner4Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.js';
2
+ import { CreateWalletV2025Dto, WalletV2025ResponseDto, WalletV1Alpha2ErrorDto, CreateTransactionV2025Dto, WalletsTransactionV2025ResponseDto, WalletV1Alpha2TransactionErrorDto, SubmitApprovalV2025Dto, WalletsV1ControllerSubmitApprovals4Error, WalletsV1ControllerGetTransaction4Error, CreateSignatureV2025Dto, WalletsSignatureV2025ResponseDto, WalletsV1ControllerCreateSignatureRequest4Error, WalletsV1ControllerSubmitSignatureApprovals4Error, WalletsV1ControllerGetSignature4Error, WalletsMultipleTransactionV2025ResponseDto, WalletsV1ControllerGetTransactionsWithoutChain4Error, WalletNftsResponseDto, WalletsV1Alpha2ActivityResponseDto, WalletBalanceV20250609ResponseDto, BalanceControllerGetBalanceForLocator2Error, FundWalletAmountDto, BalanceControllerFundWallet2Responses, BalanceControllerFundWallet2Error, CreateSignerV2025InputDto, DelegatedSignerV2025Dto, WalletsV1ControllerCreateDelegatedSigner4Error, WalletsV1ControllerGetDelegatedSigner4Error, SendTokenDto, WalletsSendTokenControllerSendToken2Response } from './gen/types.gen.js';
3
3
 
4
4
  type CreateWalletParams = CreateWalletV2025Dto;
5
5
  type GetWalletSuccessResponse = WalletV2025ResponseDto;
@@ -28,6 +28,8 @@ type GetBalanceResponse = WalletBalanceV20250609ResponseDto | BalanceControllerG
28
28
  type GetBalanceSuccessResponse = WalletBalanceV20250609ResponseDto;
29
29
  type GetActivityResponse = WalletsV1Alpha2ActivityResponseDto | WalletV1Alpha2ErrorDto;
30
30
  type Activity = WalletsV1Alpha2ActivityResponseDto;
31
+ type FundWalletParams = FundWalletAmountDto;
32
+ type FundWalletResponse = BalanceControllerFundWallet2Responses | BalanceControllerFundWallet2Error;
31
33
  type RegisterSignerChain = Extract<CreateSignerV2025InputDto, {
32
34
  chain: string;
33
35
  }>["chain"];
@@ -50,4 +52,4 @@ type EvmWalletLocator = `me:evm:${WalletType}` | Address;
50
52
  type SolanaWalletLocator = `me:solana:${WalletType}` | SolanaAddress;
51
53
  type WalletLocator = EvmWalletLocator | SolanaWalletLocator;
52
54
 
53
- export type { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator };
55
+ export type { Activity, AdminSignerConfig, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, FundWalletParams, FundWalletResponse, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerChain, RegisterSignerParams, RegisterSignerPasskeyParams, RegisterSignerResponse, SendParams, SendResponse, WalletLocator };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.18.1";var p="WALLETS_SDK",r= exports.b =t,c= exports.c =s,a= exports.d =500;exports.a = p; exports.b = r; exports.c = c; exports.d = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.18.3";var p="WALLETS_SDK",r= exports.b =t,c= exports.c =s,a= exports.d =500;exports.a = p; exports.b = r; exports.c = c; exports.d = a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJGDPLNDHcjs = require('./chunk-JGDPLNDH.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var p=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunkJGDPLNDHcjs.c,version:_chunkJGDPLNDHcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return _chunkXALFCQKDcjs.f.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,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkXALFCQKDcjs.f.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,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}registerSigner(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkO4FVTK7Xcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3SW6AJSGcjs = require('./chunk-3SW6AJSG.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var p=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunk3SW6AJSGcjs.c,version:_chunk3SW6AJSGcjs.b}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return _chunkXALFCQKDcjs.f.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,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return _chunkXALFCQKDcjs.f.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,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return _chunkXALFCQKDcjs.f.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 _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkO4FVTK7Xcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFT4OJWXHcjs = require('./chunk-FT4OJWXH.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkFT4OJWXHcjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkFT4OJWXHcjs.a.getOptions(n),alias:n.alias},_chunkFT4OJWXHcjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidStellarAddress.call(void 0, n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(s));return s})}};exports.a = d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var d=class u extends _chunkM2UBZY5Scjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkM2UBZY5Scjs.a.getOptions(n),alias:n.alias},_chunkM2UBZY5Scjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidStellarAddress.call(void 0, n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(s));return s})}};exports.a = d;
@@ -0,0 +1 @@
1
+ import{b as n,c as i}from"./chunk-Z54LVUDS.js";import{a as o}from"./chunk-PSXRNSOE.js";import{f as r}from"./chunk-BW7YYVZE.js";import{APIKeyEnvironmentPrefix as c,APIKeyUsageOrigin as h,CrossmintApiClient as l}from"@crossmint/common-sdk-base";var p=class extends l{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:i,version:n}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return r(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return r(this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return r(this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}fundWallet(e,s){return r(this,null,function*(){if(this.environment===c.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 r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===h.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{p as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKHRWQHDTcjs = require('./chunk-KHRWQHDT.cjs');var _chunkKGLYT5HOcjs = require('./chunk-KGLYT5HO.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunkKGLYT5HOcjs.a)(t);this.walletFactory=new (0, _chunkKHRWQHDTcjs.a)(r)}static from(t){return new o(t)}getOrCreateWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(t)})}};exports.a = _commonsdkbase.createCrossmint; exports.b = i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZWMB3QLRcjs = require('./chunk-ZWMB3QLR.cjs');var _chunk7HTB7WKDcjs = require('./chunk-7HTB7WKD.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunk7HTB7WKDcjs.a)(t);this.walletFactory=new (0, _chunkZWMB3QLRcjs.a)(r)}static from(t){return new o(t)}getOrCreateWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.walletFactory.createWallet(t)})}};exports.a = _commonsdkbase.createCrossmint; exports.b = i;
@@ -1 +1 @@
1
- import{a as c}from"./chunk-2VOPSORH.js";import{k as p,o as d,r as y}from"./chunk-PSXRNSOE.js";import{a as f}from"./chunk-RJZV72YF.js";import{f as s}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,encodeFunctionData as I,http as x}from"viem";import{isValidEvmAddress as E}from"@crossmint/common-sdk-base";var m=class w extends c{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:c.getOptions(t),alias:t.alias},c.getApiClient(t))}static from(t){if(!E(t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return s(this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return s(this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new d(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return s(this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new p("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new p("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new d(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return S({transport:(e=t==null?void 0:t.transport)!=null?e:x(),chain:f(this.chain)})}createTransaction(t,e){return s(this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new y(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:I({abi:t.abi,functionName:t.functionName,args:t.args})}}};export{m as a};
1
+ import{a as c}from"./chunk-KFJLRIY7.js";import{k as p,o as d,r as y}from"./chunk-PSXRNSOE.js";import{a as f}from"./chunk-RJZV72YF.js";import{f as s}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,encodeFunctionData as I,http as x}from"viem";import{isValidEvmAddress as E}from"@crossmint/common-sdk-base";var m=class w extends c{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:c.getOptions(t),alias:t.alias},c.getApiClient(t))}static from(t){if(!E(t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return s(this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return s(this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new d(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return s(this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new p("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new p("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new d(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return S({transport:(e=t==null?void 0:t.transport)!=null?e:x(),chain:f(this.chain)})}createTransaction(t,e){return s(this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new y(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:I({abi:t.abi,functionName:t.functionName,args:t.args})}}};export{m as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-2VOPSORH.js";import{a as d}from"./chunk-6PVKL5RC.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as c}from"./chunk-BW7YYVZE.js";import f from"bs58";import{isValidSolanaAddress as h}from"@crossmint/common-sdk-base";var u=class T extends o{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:o.getOptions(n),alias:n.alias},o.getApiClient(n))}static from(n){if(!h(n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return c(this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new d({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return c(this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=f.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new l(JSON.stringify(a));return a})}};export{u as a};
1
+ import{a as o}from"./chunk-KFJLRIY7.js";import{a as d}from"./chunk-6PVKL5RC.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as c}from"./chunk-BW7YYVZE.js";import f from"bs58";import{isValidSolanaAddress as h}from"@crossmint/common-sdk-base";var u=class T extends o{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:o.getOptions(n),alias:n.alias},o.getApiClient(n))}static from(n){if(!h(n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return c(this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new d({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return c(this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=f.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new l(JSON.stringify(a));return a})}};export{u as a};
@@ -1 +1 @@
1
- import{a}from"./chunk-2VOPSORH.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as o}from"./chunk-BW7YYVZE.js";import{isValidStellarAddress as f}from"@crossmint/common-sdk-base";var d=class u extends a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:a.getOptions(n),alias:n.alias},a.getApiClient(n))}static from(n){if(!f(n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return o(this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return o(this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new l(JSON.stringify(s));return s})}};export{d as a};
1
+ import{a}from"./chunk-KFJLRIY7.js";import{r as l}from"./chunk-PSXRNSOE.js";import{f as o}from"./chunk-BW7YYVZE.js";import{isValidStellarAddress as f}from"@crossmint/common-sdk-base";var d=class u extends a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:a.getOptions(n),alias:n.alias},a.getApiClient(n))}static from(n){if(!f(n.address))throw new Error("Wallet is not a Stellar wallet");return new u(n)}sendTransaction(n){return o(this,null,function*(){var r;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((r=n.options)!=null&&r.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let e={};return yield this.approveTransactionAndWait(t.id,e)})}createTransaction(n){return o(this,null,function*(){var c;let{contractId:t,options:e}=n,r=(c=e==null?void 0:e.experimental_signer)!=null?c:this.signer.locator(),i;if("transaction"in n)i={type:"serialized-transaction",serializedTransaction:n.transaction,contractId:t};else{let{method:h,memo:p,args:T}=n;i={type:"contract-call",contractId:t,method:h,memo:p!=null?{type:"text",value:p}:void 0,args:T}}let s=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:i,signer:r}});if("error"in s)throw new l(JSON.stringify(s));return s})}};export{d as a};
@@ -0,0 +1 @@
1
+ import{a as J}from"./chunk-HJ5EDMTA.js";import{d as O}from"./chunk-Z54LVUDS.js";import{c as W,d as L,i as E,m as N,p as x,q as I,r as _,s as P,t as k,u as F,v as $,w as B,x as R}from"./chunk-PSXRNSOE.js";import{a as f,b as A,c as u,d as b,e as C,f as l}from"./chunk-BW7YYVZE.js";import{isValidAddress as G}from"@crossmint/common-sdk-base";var y,c,H=class{constructor(e,t){b(this,y);b(this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;C(this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,C(this,y,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return u(this,c)}get options(){return u(this,y)}experimental_apiClient(){return u(this,c)}balances(e,t){return l(this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield u(this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}stagingFund(e,t){return l(this,null,function*(){let r=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:t!=null?t:this.chain});if("error"in r)throw new Error(`Failed to fund wallet: ${JSON.stringify(r.message)}`);return r})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,T,v,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),f({symbol:(w=a.symbol)!=null?w:"",name:(T=a.name)!=null?T:"",amount:(v=a.amount)!=null?v:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},f(f({},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return l(this,null,function*(){return yield u(this,c).experimental_getNfts(A(f({},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return l(this,null,function*(){let e=yield u(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return l(this,null,function*(){let t=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return l(this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return l(this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=f({recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield u(this,c).send(this.walletLocator,h,g);if("message"in i)throw new _(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return l(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 l(this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return l(this,null,function*(){var n,s,h;let t=yield u(this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return l(this,null,function*(){var t,r,n;let e=yield u(this,c).getWallet(this.walletLocator);if("error"in e)throw new L(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new W(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(u(this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return l(this,null,function*(){this.signer instanceof J&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return l(this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return l(this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return l(this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield u(this,c).getSignature(this.walletLocator,e);if("error"in r)throw new x(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new E(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>A(f({},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return l(this,null,function*(){var i,a,o,p,m;let r=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new P(JSON.stringify(r));if(yield(o=(a=(i=u(this,y))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let T=s.find(S=>S.locator()===w.signer.locator);if(T==null)throw new E(`Signer ${w.signer} not found in pending approvals`);let v=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return T.signTransaction(v)}))).map(w=>A(f({},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new R(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new I(JSON.stringify(r));return r})}waitForSignature(e){return l(this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,O)),t=yield u(this,c).getSignature(this.walletLocator,e),"error"in t)throw new x(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new N("Signature signing failed");if(!t.outputSignature)throw new x("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return l(this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=O}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new k("Transaction confirmation timeout");if(i=yield u(this,c).getTransaction(this.walletLocator,e),i.error)throw new P(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new F(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new $("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new B("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return l(this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};y=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return G(d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}export{H as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunk3SW6AJSGcjs = require('./chunk-3SW6AJSG.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var y,c,H= exports.a =class{constructor(e,t){_chunkXALFCQKDcjs.d.call(void 0, this,y);_chunkXALFCQKDcjs.d.call(void 0, this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;_chunkXALFCQKDcjs.e.call(void 0, this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,_chunkXALFCQKDcjs.e.call(void 0, this,y,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,y)}experimental_apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}balances(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}stagingFund(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.apiClient.fundWallet(this.address,{amount:e,token:"usdxm",chain:t!=null?t:this.chain});if("error"in r)throw new Error(`Failed to fund wallet: ${JSON.stringify(r.message)}`);return r})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,T,v,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),_chunkXALFCQKDcjs.a.call(void 0, {symbol:(w=a.symbol)!=null?w:"",name:(T=a.name)!=null?T:"",amount:(v=a.amount)!=null?v:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=_chunkXALFCQKDcjs.a.call(void 0, {recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).send(this.walletLocator,h,g);if("message"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, 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 _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,s,h;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,r,n;let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getWallet(this.walletLocator);if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new (0, _chunkO4FVTK7Xcjs.c)(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(_chunkXALFCQKDcjs.c.call(void 0, this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){this.signer instanceof _chunk2YH3NVVKcjs.a&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a,o,p,m;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(r));if(yield(o=(a=(i=_chunkXALFCQKDcjs.c.call(void 0, this,y))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let T=s.find(S=>S.locator()===w.signer.locator);if(T==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${w.signer} not found in pending approvals`);let v=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return T.signTransaction(v)}))).map(w=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.x)(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.q)(JSON.stringify(r));return r})}waitForSignature(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,_chunk3SW6AJSGcjs.d)),t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e),"error"in t)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.m)("Signature signing failed");if(!t.outputSignature)throw new (0, _chunkO4FVTK7Xcjs.p)("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=_chunk3SW6AJSGcjs.d}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new (0, _chunkO4FVTK7Xcjs.t)("Transaction confirmation timeout");if(i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e),i.error)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.u)(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new (0, _chunkO4FVTK7Xcjs.v)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new (0, _chunkO4FVTK7Xcjs.w)("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};y=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return _commonsdkbase.isValidAddress.call(void 0, d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}exports.a = H;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkFT4OJWXHcjs = require('./chunk-FT4OJWXH.cjs');var _chunkHRSVFJNDcjs = require('./chunk-HRSVFJND.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var u=class T extends _chunkFT4OJWXHcjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkFT4OJWXHcjs.a.getOptions(n),alias:n.alias},_chunkFT4OJWXHcjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new (0, _chunkHRSVFJNDcjs.a)({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=_bs582.default.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(a));return a})}};exports.a = u;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkHRSVFJNDcjs = require('./chunk-HRSVFJND.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var u=class T extends _chunkM2UBZY5Scjs.a{constructor(n){super({chain:n.chain,address:n.address,owner:n.owner,signer:n.signer,options:_chunkM2UBZY5Scjs.a.getOptions(n),alias:n.alias},_chunkM2UBZY5Scjs.a.getApiClient(n))}static from(n){if(!_commonsdkbase.isValidSolanaAddress.call(void 0, n.address))throw new Error("Wallet is not a Solana wallet");return new T(n)}sendTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;yield this.preAuthIfNeeded();let t=yield this.createTransaction(n);if((e=n.options)!=null&&e.experimental_prepareOnly)return{hash:void 0,explorerLink:void 0,transactionId:t.id};let a={additionalSigners:(i=n.additionalSigners)==null?void 0:i.map(s=>new (0, _chunkHRSVFJNDcjs.a)({type:"external-wallet",address:s.publicKey.toString(),locator:`external-wallet:${s.publicKey.toString()}`,onSignTransaction:p=>(p.sign([s]),Promise.resolve(p))}))};return yield this.approveTransactionAndWait(t.id,a)})}createTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,i;let t=(i=(e=n.options)==null?void 0:e.experimental_signer)!=null?i:this.signer.locator(),r;"serializedTransaction"in n?r=n.serializedTransaction:r=_bs582.default.encode(n.transaction.serialize());let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{transaction:r,signer:t}});if("error"in a)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(a));return a})}};exports.a = u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFT4OJWXHcjs = require('./chunk-FT4OJWXH.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkWZFHEUWTcjs = require('./chunk-WZFHEUWT.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class w extends _chunkFT4OJWXHcjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkFT4OJWXHcjs.a.getOptions(t),alias:t.alias},_chunkFT4OJWXHcjs.a.getApiClient(t))}static from(t){if(!_commonsdkbase.isValidEvmAddress.call(void 0, t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return _viem.createPublicClient.call(void 0, {transport:(e=t==null?void 0:t.transport)!=null?e:_viem.http.call(void 0, ),chain:_chunkWZFHEUWTcjs.a.call(void 0, this.chain)})}createTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:_viem.encodeFunctionData.call(void 0, {abi:t.abi,functionName:t.functionName,args:t.args})}}};exports.a = m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkWZFHEUWTcjs = require('./chunk-WZFHEUWT.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class w extends _chunkM2UBZY5Scjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkM2UBZY5Scjs.a.getOptions(t),alias:t.alias},_chunkM2UBZY5Scjs.a.getApiClient(t))}static from(t){if(!_commonsdkbase.isValidEvmAddress.call(void 0, t.address))throw new Error("Wallet is not an EVM wallet");return new w(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;yield this.preAuthIfNeeded();let e=this.buildTransaction(t),n=yield this.createTransaction(e,t.options);return(i=t.options)!=null&&i.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:n.id}:yield this.approveTransactionAndWait(n.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;yield this.preAuthIfNeeded();let e=yield this.apiClient.createSignature(this.walletLocator,{type:"message",params:{message:t.message,signer:this.signer.locator(),chain:this.chain}});if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(e));return(n=t.options)!=null&&n.experimental_prepareOnly?{signature:void 0,signatureId:e.id}:yield this.approveSignatureAndWait(e.id)})}signTypedData(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var T;yield this.preAuthIfNeeded();let{domain:e,message:n,primaryType:i,types:a,chain:r}=t;if(!e||!n||!a||!r)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data");let{name:u,version:l,chainId:h,verifyingContract:g,salt:C}=e;if(!u||!l||!h||!g)throw new (0, _chunkO4FVTK7Xcjs.k)("Invalid typed data domain");let o=yield this.apiClient.createSignature(this.walletLocator,{type:"typed-data",params:{typedData:{domain:{name:u,version:l,chainId:Number(h),verifyingContract:g,salt:C},message:n,primaryType:i,types:a},signer:this.signer.locator(),chain:r}});if("error"in o)throw new (0, _chunkO4FVTK7Xcjs.o)(JSON.stringify(o));return(T=t.options)!=null&&T.experimental_prepareOnly?{signature:void 0,signatureId:o.id}:yield this.approveSignatureAndWait(o.id)})}getViemClient(t){var e;return _viem.createPublicClient.call(void 0, {transport:(e=t==null?void 0:t.transport)!=null?e:_viem.http.call(void 0, ),chain:_chunkWZFHEUWTcjs.a.call(void 0, this.chain)})}createTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a;let n=(a=e==null?void 0:e.experimental_signer)!=null?a:this.signer.locator(),i=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:n,chain:this.chain,calls:[t]}});if("error"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(JSON.stringify(i));return i})}buildTransaction(t){var e,n,i,a,r;if("transaction"in t)return{transaction:t.transaction};if(t.abi==null)return{to:t.to,value:(n=(e=t.value)==null?void 0:e.toString())!=null?n:"0",data:(i=t.data)!=null?i:"0x"};if(!t.functionName)throw new Error("Function name is required");return{to:t.to,value:(r=(a=t.value)==null?void 0:a.toString())!=null?r:"0",data:_viem.encodeFunctionData.call(void 0, {abi:t.abi,functionName:t.functionName,args:t.args})}}};exports.a = m;
@@ -1 +1 @@
1
- import{a as l}from"./chunk-W66Q5FPX.js";import{a}from"./chunk-G5DCGRZ6.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as p}from"@crossmint/common-sdk-base";var i=class o{constructor(t){let r=new a(t);this.walletFactory=new l(r)}static from(t){return new o(t)}getOrCreateWallet(t){return e(this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return e(this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return e(this,null,function*(){return yield this.walletFactory.createWallet(t)})}};export{p as a,i as b};
1
+ import{a as l}from"./chunk-YWXQIFVZ.js";import{a}from"./chunk-DV6ZRFKV.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as p}from"@crossmint/common-sdk-base";var i=class o{constructor(t){let r=new a(t);this.walletFactory=new l(r)}static from(t){return new o(t)}getOrCreateWallet(t){return e(this,null,function*(){return yield this.walletFactory.getOrCreateWallet(t)})}getWallet(t,r){return e(this,null,function*(){return yield this.walletFactory.getWallet(t,r)})}createWallet(t){return e(this,null,function*(){return yield this.walletFactory.createWallet(t)})}};export{p as a,i as b};
@@ -1,3 +1,3 @@
1
- import{a as S}from"./chunk-BQZES4ST.js";import{a as y}from"./chunk-2VOPSORH.js";import{a as f}from"./chunk-UNBXKCNN.js";import{d as m,f as r}from"./chunk-PSXRNSOE.js";import{a as c,f as d}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as W}from"ox";var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return d(this,null,function*(){if(this.apiClient.isServerSide)throw new r(`getOrCreateWallet can only be called from client-side code.
1
+ import{a as S}from"./chunk-BQZES4ST.js";import{a as y}from"./chunk-KFJLRIY7.js";import{a as f}from"./chunk-UNBXKCNN.js";import{d as m,f as r}from"./chunk-PSXRNSOE.js";import{a as c,f as d}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as W}from"ox";var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return d(this,null,function*(){if(this.apiClient.isServerSide)throw new r(`getOrCreateWallet can only be called from client-side code.
2
2
  - Make sure you're running this in the browser (or another client environment), not on your server.
3
3
  - Use your Crossmint Client API Key (not a server key).`);let i=this.getWalletLocator(e),n=yield this.apiClient.getWallet(i);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,i){return d(this,null,function*(){if(!this.apiClient.isServerSide)throw new r("getWallet is not supported on client side, use getOrCreateWallet instead");let n=yield this.apiClient.getWallet(e);if("error"in n)throw new m(JSON.stringify(n));return this.createWalletInstance(n,i)})}createWallet(e){return d(this,null,function*(){var t,a,s,o,l;yield(s=(a=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:s.call(a),this.mutateSignerFromCustomAuth(e,!0);let i=e.signer.type==="passkey"?yield this.createPasskeyAdminSigner(e.signer):e.signer,n=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:c(c({adminSigner:i},e!=null&&e.plugins?{plugins:e.plugins}:{}),e.delegatedSigners!=null?{delegatedSigners:e.delegatedSigners}:{}),owner:(o=e.owner)!=null?o:void 0,alias:(l=e.alias)!=null?l:void 0});if("error"in n)throw new r(JSON.stringify(n));return this.createWalletInstance(n,e)})}createWalletInstance(e,i){this.validateExistingWalletConfig(e,i);let n=this.toInternalSignerConfig(e,i.signer,i.options);return new y({chain:i.chain,address:e.address,owner:e.owner,signer:f(i.chain,n),options:i.options,alias:i.alias},this.apiClient)}toInternalSignerConfig(e,i,n){var t,a,s,o,l,C;if(!(e.chainType==="evm"||e.chainType==="solana"||e.chainType==="stellar"))throw new r(`Wallet type ${e.chainType} is not supported`);if(i==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new r("Signer is required to create a wallet");switch(i.type){case"api-key":{if(((a=e.config)==null?void 0:a.adminSigner.type)!=="api-key")throw new r("API key signer does not match the wallet's signer type");return{type:"api-key",address:e.config.adminSigner.address,locator:e.config.adminSigner.locator}}case"external-wallet":if(((s=e.config)==null?void 0:s.adminSigner.type)!=="external-wallet")throw new r("External wallet signer does not match the wallet's signer type");return c(c({},e.config.adminSigner),i);case"passkey":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="passkey")throw new r("Passkey signer does not match the wallet's signer type");return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,locator:e.config.adminSigner.locator,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};case"email":{if(((l=e.config)==null?void 0:l.adminSigner.type)!=="email")throw new r("Email signer does not match the wallet's signer type");let{locator:h,email:g,address:p}=e.config.adminSigner;return{type:"email",email:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}case"phone":{if(((C=e.config)==null?void 0:C.adminSigner.type)!=="phone")throw new r("Phone signer does not match the wallet's signer type");let{locator:h,phone:g,address:p}=e.config.adminSigner;return{type:"phone",phone:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}default:throw new Error("Invalid signer type")}}getWalletLocator(e){return`me:${this.getChainType(e.chain)}:smart`+(e.alias!=null?`:alias:${e.alias}`:"")}createPasskeyAdminSigner(e){return d(this,null,function*(){var t;if(e.type!=="passkey")throw new Error("Signer is not a passkey");let i=(t=e.name)!=null?t:`Crossmint Wallet ${Date.now()}`,n=e.onCreatePasskey?yield e.onCreatePasskey(i):yield W.createCredential({name:i});return{type:"passkey",id:n.id,name:i,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}})}mutateSignerFromCustomAuth(e,i=!1){var t,a;let{experimental_customAuth:n}=this.apiClient.crossmint;e.signer.type==="email"&&(n==null?void 0:n.email)!=null&&(e.signer.email=(t=e.signer.email)!=null?t:n.email),e.signer.type==="phone"&&(n==null?void 0:n.phone)!=null&&(e.signer.phone=(a=e.signer.phone)!=null?a:n.phone),e.signer.type==="external-wallet"&&(n==null?void 0:n.externalWalletSigner)!=null&&(e.signer=i?{type:"external-wallet",address:n.externalWalletSigner.address}:n.externalWalletSigner)}validateExistingWalletConfig(e,i){var a;if(this.mutateSignerFromCustomAuth(i),i.owner!=null&&e.owner!=null&&i.owner!==e.owner)throw new r("Wallet owner does not match existing wallet's linked user");if(i.chain==="solana"&&e.chainType!=="solana"||i.chain!=="solana"&&e.chainType==="solana"||i.chain==="stellar"&&e.chainType!=="stellar"||i.chain!=="stellar"&&e.chainType==="stellar")throw new r(`Wallet chain does not match existing wallet's chain. You must use chain: ${e.chainType}.`);if(e.type!=="smart")return;let n=i.signer,t=(a=e==null?void 0:e.config)==null?void 0:a.adminSigner;if(n!=null&&t!=null){if(n.type!==t.type)throw new r("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");S(n,t)}i.delegatedSigners!=null&&this.validateDelegatedSigners(e,i.delegatedSigners)}validateDelegatedSigners(e,i){var t;let n=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners;if(i.length!==0){if(n==null||n.length===0)throw new r(`${i.length} delegated signer(s) specified, but wallet "${e.address}" has no delegated signers. ${u}`);for(let a of i)if(n.find(o=>o.locator===a.signer)==null){let o=n.map(l=>l.locator).join(", ");throw new r(`Delegated signer '${a.signer}' does not exist in wallet "${e.address}". Available delegated signers: ${o}. ${u}`)}}}getChainType(e){return e==="solana"?"solana":e==="stellar"?"stellar":"evm"}};export{w as a};
@@ -0,0 +1 @@
1
+ var s="@crossmint/wallets-sdk",t="0.18.3";var r="WALLETS_SDK",c=t,a=s,d=500;export{r as a,c as b,a as c,d};
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKRV3IXJUcjs = require('./chunk-KRV3IXJU.cjs');var _chunkFT4OJWXHcjs = require('./chunk-FT4OJWXH.cjs');var _chunkWYYAPI4Gcjs = require('./chunk-WYYAPI4G.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w= exports.a =class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkO4FVTK7Xcjs.f)(`getOrCreateWallet can only be called from client-side code.
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKRV3IXJUcjs = require('./chunk-KRV3IXJU.cjs');var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');var _chunkWYYAPI4Gcjs = require('./chunk-WYYAPI4G.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var u="When 'delegatedSigners' is provided to a method that may fetch an existing wallet, each specified delegated signer must exist in that wallet's configuration.",w= exports.a =class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkO4FVTK7Xcjs.f)(`getOrCreateWallet can only be called from client-side code.
2
2
  - Make sure you're running this in the browser (or another client environment), not on your server.
3
- - Use your Crossmint Client API Key (not a server key).`);let i=this.getWalletLocator(e),n=yield this.apiClient.getWallet(i);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkO4FVTK7Xcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let n=yield this.apiClient.getWallet(e);if("error"in n)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(n));return this.createWalletInstance(n,i)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,a,s,o,l;yield(s=(a=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:s.call(a),this.mutateSignerFromCustomAuth(e,!0);let i=e.signer.type==="passkey"?yield this.createPasskeyAdminSigner(e.signer):e.signer,n=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {adminSigner:i},e!=null&&e.plugins?{plugins:e.plugins}:{}),e.delegatedSigners!=null?{delegatedSigners:e.delegatedSigners}:{}),owner:(o=e.owner)!=null?o:void 0,alias:(l=e.alias)!=null?l:void 0});if("error"in n)throw new (0, _chunkO4FVTK7Xcjs.f)(JSON.stringify(n));return this.createWalletInstance(n,e)})}createWalletInstance(e,i){this.validateExistingWalletConfig(e,i);let n=this.toInternalSignerConfig(e,i.signer,i.options);return new (0, _chunkFT4OJWXHcjs.a)({chain:i.chain,address:e.address,owner:e.owner,signer:_chunkWYYAPI4Gcjs.a.call(void 0, i.chain,n),options:i.options,alias:i.alias},this.apiClient)}toInternalSignerConfig(e,i,n){var t,a,s,o,l,C;if(!(e.chainType==="evm"||e.chainType==="solana"||e.chainType==="stellar"))throw new (0, _chunkO4FVTK7Xcjs.f)(`Wallet type ${e.chainType} is not supported`);if(i==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new (0, _chunkO4FVTK7Xcjs.f)("Signer is required to create a wallet");switch(i.type){case"api-key":{if(((a=e.config)==null?void 0:a.adminSigner.type)!=="api-key")throw new (0, _chunkO4FVTK7Xcjs.f)("API key signer does not match the wallet's signer type");return{type:"api-key",address:e.config.adminSigner.address,locator:e.config.adminSigner.locator}}case"external-wallet":if(((s=e.config)==null?void 0:s.adminSigner.type)!=="external-wallet")throw new (0, _chunkO4FVTK7Xcjs.f)("External wallet signer does not match the wallet's signer type");return _chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e.config.adminSigner),i);case"passkey":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="passkey")throw new (0, _chunkO4FVTK7Xcjs.f)("Passkey signer does not match the wallet's signer type");return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,locator:e.config.adminSigner.locator,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};case"email":{if(((l=e.config)==null?void 0:l.adminSigner.type)!=="email")throw new (0, _chunkO4FVTK7Xcjs.f)("Email signer does not match the wallet's signer type");let{locator:h,email:g,address:p}=e.config.adminSigner;return{type:"email",email:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}case"phone":{if(((C=e.config)==null?void 0:C.adminSigner.type)!=="phone")throw new (0, _chunkO4FVTK7Xcjs.f)("Phone signer does not match the wallet's signer type");let{locator:h,phone:g,address:p}=e.config.adminSigner;return{type:"phone",phone:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}default:throw new Error("Invalid signer type")}}getWalletLocator(e){return`me:${this.getChainType(e.chain)}:smart`+(e.alias!=null?`:alias:${e.alias}`:"")}createPasskeyAdminSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if(e.type!=="passkey")throw new Error("Signer is not a passkey");let i=(t=e.name)!=null?t:`Crossmint Wallet ${Date.now()}`,n=e.onCreatePasskey?yield e.onCreatePasskey(i):yield _ox.WebAuthnP256.createCredential({name:i});return{type:"passkey",id:n.id,name:i,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}})}mutateSignerFromCustomAuth(e,i=!1){var t,a;let{experimental_customAuth:n}=this.apiClient.crossmint;e.signer.type==="email"&&(n==null?void 0:n.email)!=null&&(e.signer.email=(t=e.signer.email)!=null?t:n.email),e.signer.type==="phone"&&(n==null?void 0:n.phone)!=null&&(e.signer.phone=(a=e.signer.phone)!=null?a:n.phone),e.signer.type==="external-wallet"&&(n==null?void 0:n.externalWalletSigner)!=null&&(e.signer=i?{type:"external-wallet",address:n.externalWalletSigner.address}:n.externalWalletSigner)}validateExistingWalletConfig(e,i){var a;if(this.mutateSignerFromCustomAuth(i),i.owner!=null&&e.owner!=null&&i.owner!==e.owner)throw new (0, _chunkO4FVTK7Xcjs.f)("Wallet owner does not match existing wallet's linked user");if(i.chain==="solana"&&e.chainType!=="solana"||i.chain!=="solana"&&e.chainType==="solana"||i.chain==="stellar"&&e.chainType!=="stellar"||i.chain!=="stellar"&&e.chainType==="stellar")throw new (0, _chunkO4FVTK7Xcjs.f)(`Wallet chain does not match existing wallet's chain. You must use chain: ${e.chainType}.`);if(e.type!=="smart")return;let n=i.signer,t=(a=e==null?void 0:e.config)==null?void 0:a.adminSigner;if(n!=null&&t!=null){if(n.type!==t.type)throw new (0, _chunkO4FVTK7Xcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkKRV3IXJUcjs.a.call(void 0, n,t)}i.delegatedSigners!=null&&this.validateDelegatedSigners(e,i.delegatedSigners)}validateDelegatedSigners(e,i){var t;let n=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners;if(i.length!==0){if(n==null||n.length===0)throw new (0, _chunkO4FVTK7Xcjs.f)(`${i.length} delegated signer(s) specified, but wallet "${e.address}" has no delegated signers. ${u}`);for(let a of i)if(n.find(o=>o.locator===a.signer)==null){let o=n.map(l=>l.locator).join(", ");throw new (0, _chunkO4FVTK7Xcjs.f)(`Delegated signer '${a.signer}' does not exist in wallet "${e.address}". Available delegated signers: ${o}. ${u}`)}}}getChainType(e){return e==="solana"?"solana":e==="stellar"?"stellar":"evm"}};exports.a = w;
3
+ - Use your Crossmint Client API Key (not a server key).`);let i=this.getWalletLocator(e),n=yield this.apiClient.getWallet(i);return n!=null&&!("error"in n)?this.createWalletInstance(n,e):this.createWallet(e)})}getWallet(e,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkO4FVTK7Xcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let n=yield this.apiClient.getWallet(e);if("error"in n)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(n));return this.createWalletInstance(n,i)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,a,s,o,l;yield(s=(a=(t=e.options)==null?void 0:t.experimental_callbacks)==null?void 0:a.onWalletCreationStart)==null?void 0:s.call(a),this.mutateSignerFromCustomAuth(e,!0);let i=e.signer.type==="passkey"?yield this.createPasskeyAdminSigner(e.signer):e.signer,n=yield this.apiClient.createWallet({type:"smart",chainType:this.getChainType(e.chain),config:_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {adminSigner:i},e!=null&&e.plugins?{plugins:e.plugins}:{}),e.delegatedSigners!=null?{delegatedSigners:e.delegatedSigners}:{}),owner:(o=e.owner)!=null?o:void 0,alias:(l=e.alias)!=null?l:void 0});if("error"in n)throw new (0, _chunkO4FVTK7Xcjs.f)(JSON.stringify(n));return this.createWalletInstance(n,e)})}createWalletInstance(e,i){this.validateExistingWalletConfig(e,i);let n=this.toInternalSignerConfig(e,i.signer,i.options);return new (0, _chunkM2UBZY5Scjs.a)({chain:i.chain,address:e.address,owner:e.owner,signer:_chunkWYYAPI4Gcjs.a.call(void 0, i.chain,n),options:i.options,alias:i.alias},this.apiClient)}toInternalSignerConfig(e,i,n){var t,a,s,o,l,C;if(!(e.chainType==="evm"||e.chainType==="solana"||e.chainType==="stellar"))throw new (0, _chunkO4FVTK7Xcjs.f)(`Wallet type ${e.chainType} is not supported`);if(i==null&&((t=e.config)==null?void 0:t.adminSigner)==null)throw new (0, _chunkO4FVTK7Xcjs.f)("Signer is required to create a wallet");switch(i.type){case"api-key":{if(((a=e.config)==null?void 0:a.adminSigner.type)!=="api-key")throw new (0, _chunkO4FVTK7Xcjs.f)("API key signer does not match the wallet's signer type");return{type:"api-key",address:e.config.adminSigner.address,locator:e.config.adminSigner.locator}}case"external-wallet":if(((s=e.config)==null?void 0:s.adminSigner.type)!=="external-wallet")throw new (0, _chunkO4FVTK7Xcjs.f)("External wallet signer does not match the wallet's signer type");return _chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e.config.adminSigner),i);case"passkey":if(((o=e.config)==null?void 0:o.adminSigner.type)!=="passkey")throw new (0, _chunkO4FVTK7Xcjs.f)("Passkey signer does not match the wallet's signer type");return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,locator:e.config.adminSigner.locator,onCreatePasskey:i.onCreatePasskey,onSignWithPasskey:i.onSignWithPasskey};case"email":{if(((l=e.config)==null?void 0:l.adminSigner.type)!=="email")throw new (0, _chunkO4FVTK7Xcjs.f)("Email signer does not match the wallet's signer type");let{locator:h,email:g,address:p}=e.config.adminSigner;return{type:"email",email:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}case"phone":{if(((C=e.config)==null?void 0:C.adminSigner.type)!=="phone")throw new (0, _chunkO4FVTK7Xcjs.f)("Phone signer does not match the wallet's signer type");let{locator:h,phone:g,address:p}=e.config.adminSigner;return{type:"phone",phone:g,locator:h,address:p,crossmint:this.apiClient.crossmint,onAuthRequired:i.onAuthRequired,clientTEEConnection:n==null?void 0:n.clientTEEConnection}}default:throw new Error("Invalid signer type")}}getWalletLocator(e){return`me:${this.getChainType(e.chain)}:smart`+(e.alias!=null?`:alias:${e.alias}`:"")}createPasskeyAdminSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t;if(e.type!=="passkey")throw new Error("Signer is not a passkey");let i=(t=e.name)!=null?t:`Crossmint Wallet ${Date.now()}`,n=e.onCreatePasskey?yield e.onCreatePasskey(i):yield _ox.WebAuthnP256.createCredential({name:i});return{type:"passkey",id:n.id,name:i,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}})}mutateSignerFromCustomAuth(e,i=!1){var t,a;let{experimental_customAuth:n}=this.apiClient.crossmint;e.signer.type==="email"&&(n==null?void 0:n.email)!=null&&(e.signer.email=(t=e.signer.email)!=null?t:n.email),e.signer.type==="phone"&&(n==null?void 0:n.phone)!=null&&(e.signer.phone=(a=e.signer.phone)!=null?a:n.phone),e.signer.type==="external-wallet"&&(n==null?void 0:n.externalWalletSigner)!=null&&(e.signer=i?{type:"external-wallet",address:n.externalWalletSigner.address}:n.externalWalletSigner)}validateExistingWalletConfig(e,i){var a;if(this.mutateSignerFromCustomAuth(i),i.owner!=null&&e.owner!=null&&i.owner!==e.owner)throw new (0, _chunkO4FVTK7Xcjs.f)("Wallet owner does not match existing wallet's linked user");if(i.chain==="solana"&&e.chainType!=="solana"||i.chain!=="solana"&&e.chainType==="solana"||i.chain==="stellar"&&e.chainType!=="stellar"||i.chain!=="stellar"&&e.chainType==="stellar")throw new (0, _chunkO4FVTK7Xcjs.f)(`Wallet chain does not match existing wallet's chain. You must use chain: ${e.chainType}.`);if(e.type!=="smart")return;let n=i.signer,t=(a=e==null?void 0:e.config)==null?void 0:a.adminSigner;if(n!=null&&t!=null){if(n.type!==t.type)throw new (0, _chunkO4FVTK7Xcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkKRV3IXJUcjs.a.call(void 0, n,t)}i.delegatedSigners!=null&&this.validateDelegatedSigners(e,i.delegatedSigners)}validateDelegatedSigners(e,i){var t;let n=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners;if(i.length!==0){if(n==null||n.length===0)throw new (0, _chunkO4FVTK7Xcjs.f)(`${i.length} delegated signer(s) specified, but wallet "${e.address}" has no delegated signers. ${u}`);for(let a of i)if(n.find(o=>o.locator===a.signer)==null){let o=n.map(l=>l.locator).join(", ");throw new (0, _chunkO4FVTK7Xcjs.f)(`Delegated signer '${a.signer}' does not exist in wallet "${e.address}". Available delegated signers: ${o}. ${u}`)}}}getChainType(e){return e==="solana"?"solana":e==="stellar"?"stellar":"evm"}};exports.a = w;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTDZA25S6cjs = require('./chunk-TDZA25S6.cjs');var _chunkRAP5FL3Gcjs = require('./chunk-RAP5FL3G.cjs');var _chunkQQZLJV7Scjs = require('./chunk-QQZLJV7S.cjs');var _chunkBNSVVKEIcjs = require('./chunk-BNSVVKEI.cjs');require('./chunk-KHRWQHDT.cjs');require('./chunk-KRV3IXJU.cjs');var _chunkFT4OJWXHcjs = require('./chunk-FT4OJWXH.cjs');require('./chunk-WYYAPI4G.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-KO6QYKDX.cjs');require('./chunk-2XVV7Z43.cjs');require('./chunk-HPHVJ6BA.cjs');require('./chunk-2YH3NVVK.cjs');require('./chunk-MQP5VZCA.cjs');require('./chunk-YWPTI2QO.cjs');require('./chunk-4KXOWU5E.cjs');require('./chunk-HRSVFJND.cjs');require('./chunk-C3T63EC7.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunkKGLYT5HOcjs = require('./chunk-KGLYT5HO.cjs');require('./chunk-JGDPLNDH.cjs');require('./chunk-O4FVTK7X.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-WZFHEUWT.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YZ4HRYSL.cjs');require('./chunk-M4TOGGLV.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkBNSVVKEIcjs.b; exports.EVMWallet = _chunkTDZA25S6cjs.a; exports.SolanaWallet = _chunkRAP5FL3Gcjs.a; exports.StellarWallet = _chunkQQZLJV7Scjs.a; exports.Wallet = _chunkFT4OJWXHcjs.a; exports.WalletsApiClient = _chunkKGLYT5HOcjs.a; exports.createCrossmint = _chunkBNSVVKEIcjs.a; exports.isExportableSigner = _chunk5QIW67NUcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQMXG67T3cjs = require('./chunk-QMXG67T3.cjs');var _chunkNP32UO2Gcjs = require('./chunk-NP32UO2G.cjs');var _chunkCXTC3YDLcjs = require('./chunk-CXTC3YDL.cjs');var _chunkDX7VVXY5cjs = require('./chunk-DX7VVXY5.cjs');require('./chunk-ZWMB3QLR.cjs');require('./chunk-KRV3IXJU.cjs');var _chunkM2UBZY5Scjs = require('./chunk-M2UBZY5S.cjs');require('./chunk-WYYAPI4G.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-KO6QYKDX.cjs');require('./chunk-2XVV7Z43.cjs');require('./chunk-HPHVJ6BA.cjs');require('./chunk-2YH3NVVK.cjs');require('./chunk-MQP5VZCA.cjs');require('./chunk-YWPTI2QO.cjs');require('./chunk-4KXOWU5E.cjs');require('./chunk-HRSVFJND.cjs');require('./chunk-C3T63EC7.cjs');var _chunk5QIW67NUcjs = require('./chunk-5QIW67NU.cjs');require('./chunk-6HXIZLEQ.cjs');var _chunk7HTB7WKDcjs = require('./chunk-7HTB7WKD.cjs');require('./chunk-3SW6AJSG.cjs');require('./chunk-O4FVTK7X.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-WZFHEUWT.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YZ4HRYSL.cjs');require('./chunk-M4TOGGLV.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkDX7VVXY5cjs.b; exports.EVMWallet = _chunkQMXG67T3cjs.a; exports.SolanaWallet = _chunkNP32UO2Gcjs.a; exports.StellarWallet = _chunkCXTC3YDLcjs.a; exports.Wallet = _chunkM2UBZY5Scjs.a; exports.WalletsApiClient = _chunk7HTB7WKDcjs.a; exports.createCrossmint = _chunkDX7VVXY5cjs.a; exports.isExportableSigner = _chunk5QIW67NUcjs.b;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as o}from"./chunk-YL5ARMHR.js";import{a as l}from"./chunk-7QNCQNKP.js";import{a as i}from"./chunk-XOXEWAVO.js";import{a as t,b as a}from"./chunk-LVE6KVLA.js";import"./chunk-W66Q5FPX.js";import"./chunk-BQZES4ST.js";import{a as r}from"./chunk-2VOPSORH.js";import"./chunk-UNBXKCNN.js";import"./chunk-YDZRBHS3.js";import"./chunk-VY634F3J.js";import"./chunk-H4T4IXCF.js";import"./chunk-WQP2FSVI.js";import"./chunk-HJ5EDMTA.js";import"./chunk-JUSY5XEE.js";import"./chunk-UBOWSXW3.js";import"./chunk-IGBQEAD5.js";import"./chunk-6PVKL5RC.js";import"./chunk-2SHDBC47.js";import{b as n}from"./chunk-P6JJHAAV.js";import"./chunk-5IFDVB4Y.js";import{a as e}from"./chunk-G5DCGRZ6.js";import"./chunk-24NXTPLV.js";import"./chunk-PSXRNSOE.js";import"./chunk-KBJA7JDT.js";import"./chunk-RJZV72YF.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-LW6JSI4J.js";import"./chunk-3APSOOE3.js";import"./chunk-BW7YYVZE.js";export{a as CrossmintWallets,o as EVMWallet,l as SolanaWallet,i as StellarWallet,r as Wallet,e as WalletsApiClient,t as createCrossmint,n as isExportableSigner};
1
+ import{a as o}from"./chunk-FATVK26C.js";import{a as l}from"./chunk-GKZFI322.js";import{a as i}from"./chunk-HQAKCIYM.js";import{a as t,b as a}from"./chunk-SLG7HGGL.js";import"./chunk-YWXQIFVZ.js";import"./chunk-BQZES4ST.js";import{a as r}from"./chunk-KFJLRIY7.js";import"./chunk-UNBXKCNN.js";import"./chunk-YDZRBHS3.js";import"./chunk-VY634F3J.js";import"./chunk-H4T4IXCF.js";import"./chunk-WQP2FSVI.js";import"./chunk-HJ5EDMTA.js";import"./chunk-JUSY5XEE.js";import"./chunk-UBOWSXW3.js";import"./chunk-IGBQEAD5.js";import"./chunk-6PVKL5RC.js";import"./chunk-2SHDBC47.js";import{b as n}from"./chunk-P6JJHAAV.js";import"./chunk-5IFDVB4Y.js";import{a as e}from"./chunk-DV6ZRFKV.js";import"./chunk-Z54LVUDS.js";import"./chunk-PSXRNSOE.js";import"./chunk-KBJA7JDT.js";import"./chunk-RJZV72YF.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-LW6JSI4J.js";import"./chunk-3APSOOE3.js";import"./chunk-BW7YYVZE.js";export{a as CrossmintWallets,o as EVMWallet,l as SolanaWallet,i as StellarWallet,r as Wallet,e as WalletsApiClient,t as createCrossmint,n as isExportableSigner};
package/dist/sdk.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBNSVVKEIcjs = require('./chunk-BNSVVKEI.cjs');require('./chunk-KHRWQHDT.cjs');require('./chunk-KRV3IXJU.cjs');require('./chunk-FT4OJWXH.cjs');require('./chunk-WYYAPI4G.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-KO6QYKDX.cjs');require('./chunk-2XVV7Z43.cjs');require('./chunk-HPHVJ6BA.cjs');require('./chunk-2YH3NVVK.cjs');require('./chunk-MQP5VZCA.cjs');require('./chunk-YWPTI2QO.cjs');require('./chunk-4KXOWU5E.cjs');require('./chunk-HRSVFJND.cjs');require('./chunk-C3T63EC7.cjs');require('./chunk-5QIW67NU.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-KGLYT5HO.cjs');require('./chunk-JGDPLNDH.cjs');require('./chunk-O4FVTK7X.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-YZ4HRYSL.cjs');require('./chunk-M4TOGGLV.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkBNSVVKEIcjs.b; exports.createCrossmint = _chunkBNSVVKEIcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkDX7VVXY5cjs = require('./chunk-DX7VVXY5.cjs');require('./chunk-ZWMB3QLR.cjs');require('./chunk-KRV3IXJU.cjs');require('./chunk-M2UBZY5S.cjs');require('./chunk-WYYAPI4G.cjs');require('./chunk-PO6S7UR3.cjs');require('./chunk-KO6QYKDX.cjs');require('./chunk-2XVV7Z43.cjs');require('./chunk-HPHVJ6BA.cjs');require('./chunk-2YH3NVVK.cjs');require('./chunk-MQP5VZCA.cjs');require('./chunk-YWPTI2QO.cjs');require('./chunk-4KXOWU5E.cjs');require('./chunk-HRSVFJND.cjs');require('./chunk-C3T63EC7.cjs');require('./chunk-5QIW67NU.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-7HTB7WKD.cjs');require('./chunk-3SW6AJSG.cjs');require('./chunk-O4FVTK7X.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-YZ4HRYSL.cjs');require('./chunk-M4TOGGLV.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkDX7VVXY5cjs.b; exports.createCrossmint = _chunkDX7VVXY5cjs.a;
package/dist/sdk.js CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-LVE6KVLA.js";import"./chunk-W66Q5FPX.js";import"./chunk-BQZES4ST.js";import"./chunk-2VOPSORH.js";import"./chunk-UNBXKCNN.js";import"./chunk-YDZRBHS3.js";import"./chunk-VY634F3J.js";import"./chunk-H4T4IXCF.js";import"./chunk-WQP2FSVI.js";import"./chunk-HJ5EDMTA.js";import"./chunk-JUSY5XEE.js";import"./chunk-UBOWSXW3.js";import"./chunk-IGBQEAD5.js";import"./chunk-6PVKL5RC.js";import"./chunk-2SHDBC47.js";import"./chunk-P6JJHAAV.js";import"./chunk-5IFDVB4Y.js";import"./chunk-G5DCGRZ6.js";import"./chunk-24NXTPLV.js";import"./chunk-PSXRNSOE.js";import"./chunk-KBJA7JDT.js";import"./chunk-LW6JSI4J.js";import"./chunk-3APSOOE3.js";import"./chunk-BW7YYVZE.js";export{b as CrossmintWallets,a as createCrossmint};
1
+ import{a,b}from"./chunk-SLG7HGGL.js";import"./chunk-YWXQIFVZ.js";import"./chunk-BQZES4ST.js";import"./chunk-KFJLRIY7.js";import"./chunk-UNBXKCNN.js";import"./chunk-YDZRBHS3.js";import"./chunk-VY634F3J.js";import"./chunk-H4T4IXCF.js";import"./chunk-WQP2FSVI.js";import"./chunk-HJ5EDMTA.js";import"./chunk-JUSY5XEE.js";import"./chunk-UBOWSXW3.js";import"./chunk-IGBQEAD5.js";import"./chunk-6PVKL5RC.js";import"./chunk-2SHDBC47.js";import"./chunk-P6JJHAAV.js";import"./chunk-5IFDVB4Y.js";import"./chunk-DV6ZRFKV.js";import"./chunk-Z54LVUDS.js";import"./chunk-PSXRNSOE.js";import"./chunk-KBJA7JDT.js";import"./chunk-LW6JSI4J.js";import"./chunk-3APSOOE3.js";import"./chunk-BW7YYVZE.js";export{b as CrossmintWallets,a as createCrossmint};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJGDPLNDHcjs = require('../chunk-JGDPLNDH.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkJGDPLNDHcjs.c; exports.SDK_VERSION = _chunkJGDPLNDHcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkJGDPLNDHcjs.d; exports.WALLETS_SERVICE = _chunkJGDPLNDHcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3SW6AJSGcjs = require('../chunk-3SW6AJSG.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunk3SW6AJSGcjs.c; exports.SDK_VERSION = _chunk3SW6AJSGcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunk3SW6AJSGcjs.d; exports.WALLETS_SERVICE = _chunk3SW6AJSGcjs.a;
@@ -1 +1 @@
1
- import{a,b,c,d}from"../chunk-24NXTPLV.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
1
+ import{a,b,c,d}from"../chunk-Z54LVUDS.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTDZA25S6cjs = require('../chunk-TDZA25S6.cjs');require('../chunk-FT4OJWXH.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-WZFHEUWT.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunkTDZA25S6cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQMXG67T3cjs = require('../chunk-QMXG67T3.cjs');require('../chunk-M2UBZY5S.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-WZFHEUWT.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunkQMXG67T3cjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-YL5ARMHR.js";import"../chunk-2VOPSORH.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-RJZV72YF.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
1
+ import{a}from"../chunk-FATVK26C.js";import"../chunk-KFJLRIY7.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-RJZV72YF.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRAP5FL3Gcjs = require('../chunk-RAP5FL3G.cjs');require('../chunk-FT4OJWXH.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkRAP5FL3Gcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNP32UO2Gcjs = require('../chunk-NP32UO2G.cjs');require('../chunk-M2UBZY5S.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkNP32UO2Gcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-7QNCQNKP.js";import"../chunk-2VOPSORH.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-6PVKL5RC.js";import"../chunk-P6JJHAAV.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
1
+ import{a}from"../chunk-GKZFI322.js";import"../chunk-KFJLRIY7.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-6PVKL5RC.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQQZLJV7Scjs = require('../chunk-QQZLJV7S.cjs');require('../chunk-FT4OJWXH.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.StellarWallet = _chunkQQZLJV7Scjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCXTC3YDLcjs = require('../chunk-CXTC3YDL.cjs');require('../chunk-M2UBZY5S.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.StellarWallet = _chunkCXTC3YDLcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-XOXEWAVO.js";import"../chunk-2VOPSORH.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as StellarWallet};
1
+ import{a}from"../chunk-HQAKCIYM.js";import"../chunk-KFJLRIY7.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as StellarWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKHRWQHDTcjs = require('../chunk-KHRWQHDT.cjs');require('../chunk-KRV3IXJU.cjs');require('../chunk-FT4OJWXH.cjs');require('../chunk-WYYAPI4G.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-YWPTI2QO.cjs');require('../chunk-4KXOWU5E.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-C3T63EC7.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-YZ4HRYSL.cjs');require('../chunk-M4TOGGLV.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkKHRWQHDTcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZWMB3QLRcjs = require('../chunk-ZWMB3QLR.cjs');require('../chunk-KRV3IXJU.cjs');require('../chunk-M2UBZY5S.cjs');require('../chunk-WYYAPI4G.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-YWPTI2QO.cjs');require('../chunk-4KXOWU5E.cjs');require('../chunk-HRSVFJND.cjs');require('../chunk-C3T63EC7.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-YZ4HRYSL.cjs');require('../chunk-M4TOGGLV.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkZWMB3QLRcjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-W66Q5FPX.js";import"../chunk-BQZES4ST.js";import"../chunk-2VOPSORH.js";import"../chunk-UNBXKCNN.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-6PVKL5RC.js";import"../chunk-2SHDBC47.js";import"../chunk-P6JJHAAV.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-LW6JSI4J.js";import"../chunk-3APSOOE3.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
1
+ import{a}from"../chunk-YWXQIFVZ.js";import"../chunk-BQZES4ST.js";import"../chunk-KFJLRIY7.js";import"../chunk-UNBXKCNN.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-UBOWSXW3.js";import"../chunk-IGBQEAD5.js";import"../chunk-6PVKL5RC.js";import"../chunk-2SHDBC47.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-LW6JSI4J.js";import"../chunk-3APSOOE3.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFT4OJWXHcjs = require('../chunk-FT4OJWXH.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-JGDPLNDH.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkFT4OJWXHcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkM2UBZY5Scjs = require('../chunk-M2UBZY5S.cjs');require('../chunk-PO6S7UR3.cjs');require('../chunk-KO6QYKDX.cjs');require('../chunk-2XVV7Z43.cjs');require('../chunk-HPHVJ6BA.cjs');require('../chunk-2YH3NVVK.cjs');require('../chunk-MQP5VZCA.cjs');require('../chunk-5QIW67NU.cjs');require('../chunk-3SW6AJSG.cjs');require('../chunk-O4FVTK7X.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkM2UBZY5Scjs.a;
@@ -1,5 +1,5 @@
1
1
  import { ApiClient } from '../api/client.cjs';
2
- import { GetTransactionsResponse, GetTransactionSuccessResponse, Activity, RegisterSignerPasskeyParams, WalletLocator, ApproveSignatureResponse } from '../api/types.cjs';
2
+ import { FundWalletResponse, GetTransactionsResponse, GetTransactionSuccessResponse, Activity, RegisterSignerPasskeyParams, WalletLocator, ApproveSignatureResponse } from '../api/types.cjs';
3
3
  import { WalletNftsResponseDto, WalletsTransactionV2025ResponseDto } from '../api/gen/types.gen.cjs';
4
4
  import { WalletOptions, Balances, TransactionInputOptions, UserLocator, Transaction, PrepareOnly, ApproveParams, ApproveResult, AddDelegatedSignerOptions, AddDelegatedSignerReturnType, DelegatedSigner, ApproveOptions, Signature } from './types.cjs';
5
5
  import { Chain } from '../chains/chains.cjs';
@@ -46,6 +46,17 @@ declare class Wallet<C extends Chain> {
46
46
  * @throws {Error} If the balances cannot be retrieved
47
47
  */
48
48
  balances(tokens?: string[], chains?: Chain[]): Promise<Balances<C>>;
49
+ /**
50
+ * Funds the wallet with Crossmint's stablecoin (USDXM).
51
+ *
52
+ * **Note:** This method is only available in staging environments and exclusively supports USDXM tokens.
53
+ * It cannot be used in production environments.
54
+ * @param amount - The amount of USDXM to fund the wallet with
55
+ * @param chain - Optional chain to fund on. If not provided, uses the wallet's default chain
56
+ * @returns The funding response
57
+ * @throws {Error} If the funding operation fails or if called in a production environment
58
+ */
59
+ stagingFund(amount: number, chain?: Chain): Promise<FundWalletResponse>;
49
60
  /**
50
61
  * Transform the API balance response to the new structure
51
62
  * @private
@@ -1,5 +1,5 @@
1
1
  import { ApiClient } from '../api/client.js';
2
- import { GetTransactionsResponse, GetTransactionSuccessResponse, Activity, RegisterSignerPasskeyParams, WalletLocator, ApproveSignatureResponse } from '../api/types.js';
2
+ import { FundWalletResponse, GetTransactionsResponse, GetTransactionSuccessResponse, Activity, RegisterSignerPasskeyParams, WalletLocator, ApproveSignatureResponse } from '../api/types.js';
3
3
  import { WalletNftsResponseDto, WalletsTransactionV2025ResponseDto } from '../api/gen/types.gen.js';
4
4
  import { WalletOptions, Balances, TransactionInputOptions, UserLocator, Transaction, PrepareOnly, ApproveParams, ApproveResult, AddDelegatedSignerOptions, AddDelegatedSignerReturnType, DelegatedSigner, ApproveOptions, Signature } from './types.js';
5
5
  import { Chain } from '../chains/chains.js';
@@ -46,6 +46,17 @@ declare class Wallet<C extends Chain> {
46
46
  * @throws {Error} If the balances cannot be retrieved
47
47
  */
48
48
  balances(tokens?: string[], chains?: Chain[]): Promise<Balances<C>>;
49
+ /**
50
+ * Funds the wallet with Crossmint's stablecoin (USDXM).
51
+ *
52
+ * **Note:** This method is only available in staging environments and exclusively supports USDXM tokens.
53
+ * It cannot be used in production environments.
54
+ * @param amount - The amount of USDXM to fund the wallet with
55
+ * @param chain - Optional chain to fund on. If not provided, uses the wallet's default chain
56
+ * @returns The funding response
57
+ * @throws {Error} If the funding operation fails or if called in a production environment
58
+ */
59
+ stagingFund(amount: number, chain?: Chain): Promise<FundWalletResponse>;
49
60
  /**
50
61
  * Transform the API balance response to the new structure
51
62
  * @private
@@ -1 +1 @@
1
- import{a}from"../chunk-2VOPSORH.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-24NXTPLV.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
1
+ import{a}from"../chunk-KFJLRIY7.js";import"../chunk-YDZRBHS3.js";import"../chunk-VY634F3J.js";import"../chunk-H4T4IXCF.js";import"../chunk-WQP2FSVI.js";import"../chunk-HJ5EDMTA.js";import"../chunk-JUSY5XEE.js";import"../chunk-P6JJHAAV.js";import"../chunk-Z54LVUDS.js";import"../chunk-PSXRNSOE.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/wallets-sdk",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -27,9 +27,9 @@
27
27
  "tweetnacl": "1.0.3",
28
28
  "viem": "2.33.1",
29
29
  "@crossmint/client-sdk-window": "1.0.5",
30
- "@crossmint/client-signers": "0.0.20",
31
- "@crossmint/common-sdk-auth": "1.0.58",
32
- "@crossmint/common-sdk-base": "0.9.7"
30
+ "@crossmint/client-signers": "0.1.0",
31
+ "@crossmint/common-sdk-auth": "1.0.59",
32
+ "@crossmint/common-sdk-base": "0.9.8"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hey-api/openapi-ts": "0.69.2",
@@ -1 +0,0 @@
1
- var s="@crossmint/wallets-sdk",t="0.18.1";var r="WALLETS_SDK",c=t,a=s,d=500;export{r as a,c as b,a as c,d};
@@ -1 +0,0 @@
1
- import{a as J}from"./chunk-HJ5EDMTA.js";import{d as O}from"./chunk-24NXTPLV.js";import{c as L,d as W,i as E,m as N,p as x,q as I,r as _,s as P,t as k,u as $,v as F,w as B,x as R}from"./chunk-PSXRNSOE.js";import{a as f,b as A,c as u,d as b,e as C,f as l}from"./chunk-BW7YYVZE.js";import{isValidAddress as G}from"@crossmint/common-sdk-base";var T,c,H=class{constructor(e,t){b(this,T);b(this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;C(this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,C(this,T,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return u(this,c)}get options(){return u(this,T)}experimental_apiClient(){return u(this,c)}balances(e,t){return l(this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield u(this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,v,y,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),f({symbol:(w=a.symbol)!=null?w:"",name:(v=a.name)!=null?v:"",amount:(y=a.amount)!=null?y:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},f(f({},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return l(this,null,function*(){return yield u(this,c).experimental_getNfts(A(f({},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return l(this,null,function*(){let e=yield u(this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return l(this,null,function*(){let t=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return l(this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return l(this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=f({recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield u(this,c).send(this.walletLocator,h,g);if("message"in i)throw new _(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return l(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 l(this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return l(this,null,function*(){var n,s,h;let t=yield u(this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return l(this,null,function*(){var t,r,n;let e=yield u(this,c).getWallet(this.walletLocator);if("error"in e)throw new W(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new L(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(u(this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return l(this,null,function*(){this.signer instanceof J&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return l(this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return l(this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return l(this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield u(this,c).getSignature(this.walletLocator,e);if("error"in r)throw new x(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new E(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>A(f({},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return l(this,null,function*(){var i,a,o,p,m;let r=yield u(this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new P(JSON.stringify(r));if(yield(o=(a=(i=u(this,T))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let v=s.find(S=>S.locator()===w.signer.locator);if(v==null)throw new E(`Signer ${w.signer} not found in pending approvals`);let y=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return v.signTransaction(y)}))).map(w=>A(f({},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new R(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return l(this,null,function*(){let r=yield u(this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new I(JSON.stringify(r));return r})}waitForSignature(e){return l(this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,O)),t=yield u(this,c).getSignature(this.walletLocator,e),"error"in t)throw new x(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new N("Signature signing failed");if(!t.outputSignature)throw new x("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return l(this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=O}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new k("Transaction confirmation timeout");if(i=yield u(this,c).getTransaction(this.walletLocator,e),i.error)throw new P(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new $(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new F("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new B("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return l(this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};T=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return G(d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}export{H as a};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2YH3NVVKcjs = require('./chunk-2YH3NVVK.cjs');var _chunkJGDPLNDHcjs = require('./chunk-JGDPLNDH.cjs');var _chunkO4FVTK7Xcjs = require('./chunk-O4FVTK7X.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var T,c,H= exports.a =class{constructor(e,t){_chunkXALFCQKDcjs.d.call(void 0, this,T);_chunkXALFCQKDcjs.d.call(void 0, this,c);let{chain:r,address:n,owner:s,signer:h,options:g,alias:i}=e;_chunkXALFCQKDcjs.e.call(void 0, this,c,t),this.chain=r,this.address=n,this.owner=s,this.signer=h,_chunkXALFCQKDcjs.e.call(void 0, this,T,g),this.alias=i}static getApiClient(e){return e.apiClient}static getOptions(e){return e.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,T)}experimental_apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,c)}balances(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r;switch(this.chain){case"solana":r="sol";break;case"stellar":r="xlm";break;default:r="eth";break}let n=[r,"usdc",...e!=null?e:[]],s=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getBalance(this.address,{chains:t!=null?t:[this.chain],tokens:n});if("error"in s)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(s.message)}`);return this.transformBalanceResponse(s,r,e)})}transformBalanceResponse(e,t,r){let n=a=>{var m,w,v,y,S;let o=(m=a.chains)==null?void 0:m[this.chain],p={};return this.chain==="solana"&&o!=null&&"mintHash"in o?p={mintHash:o.mintHash}:this.chain==="stellar"&&o!=null&&"contractId"in o?p={contractId:o.contractId}:o!=null&&"contractAddress"in o&&(p={contractAddress:o.contractAddress}),_chunkXALFCQKDcjs.a.call(void 0, {symbol:(w=a.symbol)!=null?w:"",name:(v=a.name)!=null?v:"",amount:(y=a.amount)!=null?y:"0",decimals:a.decimals,rawAmount:(S=a.rawAmount)!=null?S:"0"},p)},s=e.find(a=>a.symbol===t),h=e.find(a=>a.symbol==="usdc"),g=e.filter(a=>a.symbol!==t&&a.symbol!=="usdc"),i=a=>{let o={symbol:a,name:a,amount:"0",decimals:0,rawAmount:"0"},p={};return this.chain==="solana"?p={mintHash:void 0}:this.chain==="stellar"?p={contractId:void 0}:p={contractAddress:void 0},_chunkXALFCQKDcjs.a.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),p)};return{nativeToken:s!=null?n(s):i(t),usdc:h!=null?n(h):i("usdc"),tokens:g.map(n)}}experimental_nfts(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,c).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},e),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransactions(this.walletLocator);if("error"in e)throw new Error(`Failed to get transactions: ${JSON.stringify(e.message)}`);return e})}experimental_transaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in t)throw new Error(`Failed to get transaction: ${JSON.stringify(t.error)}`);return t})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in e)throw new Error(`Failed to get activity: ${JSON.stringify(e.message)}`);return e})}send(e,t,r,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){yield this.preAuthIfNeeded();let s=D(e),h=M(t,this.chain),g=_chunkXALFCQKDcjs.a.call(void 0, {recipient:s,amount:r},(n==null?void 0:n.experimental_signer)!=null?{signer:n.experimental_signer}:{}),i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).send(this.walletLocator,h,g);if("message"in i)throw new (0, _chunkO4FVTK7Xcjs.r)(`Failed to send token: ${JSON.stringify(i.message)}`);return n!=null&&n.experimental_prepareOnly?{hash:void 0,explorerLink:void 0,transactionId:i.id}:yield this.approveTransactionAndWait(i.id)})}approveTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, 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 _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(e.transactionId!=null)return yield this.approveTransactionAndWait(e.transactionId,e.options);if(e.signatureId!=null)return yield this.approveSignatureAndWait(e.signatureId,e.options);throw new Error("Either transactionId or signatureId must be provided")})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n,s,h;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).registerSigner(this.walletLocator,{signer:e.signer,chain:this.chain==="solana"||this.chain==="stellar"?void 0:this.chain});if("error"in t)throw new Error(`Failed to register signer: ${JSON.stringify(t.message)}`);if(this.chain==="solana"||this.chain==="stellar"){if(!("transaction"in t)||t.transaction==null)throw new Error("Expected transaction in response for Solana/Stellar chain");let g=t.transaction.id;if((n=e.options)!=null&&n.experimental_prepareOnly)return{transactionId:g};yield this.approveTransactionAndWait(g);return}if(!("chains"in t))throw new Error("Expected chains in response for EVM chain");let r=(s=t.chains)==null?void 0:s[this.chain];if((h=e.options)!=null&&h.experimental_prepareOnly)return{signatureId:(r==null?void 0:r.status)!=="success"?r==null?void 0:r.id:void 0};if((r==null?void 0:r.status)==="awaiting-approval"){yield this.approveSignatureAndWait(r.id);return}if((r==null?void 0:r.status)==="pending"){yield this.waitForSignature(r.id);return}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var t,r,n;let e=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getWallet(this.walletLocator);if("error"in e)throw new (0, _chunkO4FVTK7Xcjs.d)(JSON.stringify(e));if(e.type!=="smart"||e.chainType!=="evm"&&e.chainType!=="solana"&&e.chainType!=="stellar")throw new (0, _chunkO4FVTK7Xcjs.c)(`Wallet type ${e.type} not supported`);return(n=(r=(t=e==null?void 0:e.config)==null?void 0:t.delegatedSigners)==null?void 0:r.map(s=>{let h=s.locator.indexOf(":");return{signer:`external-wallet:${h>=0?s.locator.slice(h+1):s.locator}`}}))!=null?n:[]})}get walletLocator(){if(_chunkXALFCQKDcjs.c.call(void 0, this,c).isServerSide)return this.address;{let e;switch(this.chain){case"stellar":e="me:stellar:smart";break;case"solana":e="me:solana:smart";break;default:e="me:evm:smart";break}let t=this.alias!=null?`:alias:${this.alias}`:"";return e+t}}preAuthIfNeeded(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){this.signer instanceof _chunk2YH3NVVKcjs.a&&(yield this.signer.ensureAuthenticated())})}get isSolanaWallet(){return this.chain==="solana"}approveTransactionAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransactionInternal(e,t),yield this.sleep(1e3),yield this.waitForTransaction(e)})}approveSignatureAndWait(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.approveSignatureInternal(e,t);return!("error"in r)&&r.status==="success"&&r.outputSignature!=null?{signature:r.outputSignature,signatureId:e}:(yield this.sleep(1e3),yield this.waitForSignature(e))})}approveSignatureInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a;if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(r));if(this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let o=[t.experimental_approval];return yield this.executeApproveSignatureWithErrorHandling(e,o)}let n=(i=r.approvals)==null?void 0:i.pending;if(n==null)return r;let s=[...(a=t==null?void 0:t.additionalSigners)!=null?a:[],this.signer],g=(yield Promise.all(n.map(o=>{let p=s.find(m=>m.locator()===o.signer.locator);if(p==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${o.signer} not found in pending approvals`);return p.signMessage(o.message)}))).map(o=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},o),{signer:this.signer.locator()}));return yield this.executeApproveSignatureWithErrorHandling(e,g)})}approveTransactionInternal(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,a,o,p,m;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e);if("error"in r)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(r));if(yield(o=(a=(i=_chunkXALFCQKDcjs.c.call(void 0, this,T))==null?void 0:i.experimental_callbacks)==null?void 0:a.onTransactionStart)==null?void 0:o.call(a),this.signer.type==="api-key")return r;if((t==null?void 0:t.experimental_approval)!=null){let w=[t.experimental_approval];return yield this.executeApproveTransactionWithErrorHandling(e,w)}let n=(p=r.approvals)==null?void 0:p.pending;if(n==null)return r;let s=[...(m=t==null?void 0:t.additionalSigners)!=null?m:[],this.signer],g=(yield Promise.all(n.map(w=>{let v=s.find(S=>S.locator()===w.signer.locator);if(v==null)throw new (0, _chunkO4FVTK7Xcjs.i)(`Signer ${w.signer} not found in pending approvals`);let y=r.chainType==="solana"&&"transaction"in r.onChain?r.onChain.transaction:w.message;return v.signTransaction(y)}))).map(w=>_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},w),{signer:this.signer.locator()}));return yield this.executeApproveTransactionWithErrorHandling(e,g)})}executeApproveTransactionWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveTransaction(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.x)(JSON.stringify(r));return r})}executeApproveSignatureWithErrorHandling(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).approveSignature(this.walletLocator,e,{approvals:t});if(r.error)throw new (0, _chunkO4FVTK7Xcjs.q)(JSON.stringify(r));return r})}waitForSignature(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=null;do if(yield new Promise(r=>setTimeout(r,_chunkJGDPLNDHcjs.d)),t=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getSignature(this.walletLocator,e),"error"in t)throw new (0, _chunkO4FVTK7Xcjs.p)(JSON.stringify(t));while(t===null||t.status==="pending");if(t.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.m)("Signature signing failed");if(!t.outputSignature)throw new (0, _chunkO4FVTK7Xcjs.p)("Signature not available");return{signature:t.outputSignature,signatureId:e}})}waitForTransaction(h){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(e,t=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:n=2e3,initialBackoffMs:s=_chunkJGDPLNDHcjs.d}={}){var o;let g=Date.now(),i;do{if(Date.now()-g>t)throw new (0, _chunkO4FVTK7Xcjs.t)("Transaction confirmation timeout");if(i=yield _chunkXALFCQKDcjs.c.call(void 0, this,c).getTransaction(this.walletLocator,e),i.error)throw new (0, _chunkO4FVTK7Xcjs.s)(JSON.stringify(i));yield this.sleep(s),s=Math.min(s*r,n)}while(i.status==="pending");if(i.status==="failed")throw new (0, _chunkO4FVTK7Xcjs.u)(`Transaction sending failed: ${JSON.stringify(i.error)}`);if(i.status==="awaiting-approval")throw new (0, _chunkO4FVTK7Xcjs.v)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let a=i.onChain.txId;if(a==null)throw new (0, _chunkO4FVTK7Xcjs.w)("Transaction hash not found on transaction response");return{hash:a,explorerLink:(o=i.onChain.explorerLink)!=null?o:"",transactionId:i.id}})}sleep(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(t=>setTimeout(t,e))})}};T=new WeakMap,c=new WeakMap;function D(d){if(typeof d=="string")return d;if("email"in d)return`email:${d.email}`;if("x"in d)return`x:${d.x}`;if("twitter"in d)return`twitter:${d.twitter}`;if("phone"in d)return`phoneNumber:${d.phone}`;if("userId"in d)return`userId:${d.userId}`;throw new Error("Invalid recipient locator")}function M(d,e){return _commonsdkbase.isValidAddress.call(void 0, d)?`${e}:${d}`:`${e}:${d.toLowerCase()}`}exports.a = H;
@@ -1 +0,0 @@
1
- import{b as n,c as i}from"./chunk-24NXTPLV.js";import{a as o}from"./chunk-PSXRNSOE.js";import{f as r}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as c,CrossmintApiClient as h}from"@crossmint/common-sdk-base";var p=class extends h{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:i,version:n}}});this.apiPrefix="api/2025-06-09/wallets";this.legacyApiPrefix="api/2022-06-09/wallets"}createWallet(e){return r(this,null,function*(){let s=this.isServerSide?`${this.apiPrefix}`:`${this.apiPrefix}/me`;return(yield this.post(s,{body:JSON.stringify(e),headers:this.headers})).json()})}getWallet(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}`,{headers:this.headers})).json()})}createTransaction(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveTransaction(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/transactions/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getTransaction(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions/${s}`,{headers:this.headers})).json()})}createSignature(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures`,{body:JSON.stringify(s),headers:this.headers})).json()})}approveSignature(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signatures/${s}/approvals`,{body:JSON.stringify(t),headers:this.headers})).json()})}getSignature(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signatures/${s}`,{headers:this.headers})).json()})}getTransactions(e){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/transactions`,{headers:this.headers})).json()})}experimental_getNfts(e){return r(this,null,function*(){let s=new URLSearchParams;s.append("page",e.page.toString()),s.append("perPage",e.perPage.toString());let t=`${e.chain}:${e.address}`;return(yield this.get(`${this.apiPrefix}/${t}/nfts?${s.toString()}`,{headers:this.headers})).json()})}experimental_activity(e,s){return r(this,null,function*(){let t=e;this.isServerSide||(t=`me:${s.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);let a=new URLSearchParams;return a.append("chain",s.chain.toString()),(yield this.get(`${this.legacyApiPrefix}/${t}/activity?${a.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokens",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`${this.apiPrefix}/${e}/balances?${t.toString()}`,{headers:this.headers})).json()})}registerSigner(e,s){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/signers`,{body:JSON.stringify(s),headers:this.headers})).json()})}getSigner(e,s){return r(this,null,function*(){return(yield this.get(`${this.apiPrefix}/${e}/signers/${s}`,{headers:this.headers})).json()})}send(e,s,t){return r(this,null,function*(){return(yield this.post(`${this.apiPrefix}/${e}/tokens/${s}/transfers`,{body:JSON.stringify(t),headers:this.headers})).json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===c.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new o("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{p as a};