@crossmint/wallets-sdk 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/api/client.cjs +1 -1
  2. package/dist/api/client.d.cts +1 -1
  3. package/dist/api/client.d.ts +1 -1
  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 +3 -2
  10. package/dist/api/types.d.ts +3 -2
  11. package/dist/{chunk-GVFGQUCO.cjs → chunk-44GZ6TWG.cjs} +1 -1
  12. package/dist/{chunk-5HTPBFDH.cjs → chunk-6HV5TEO3.cjs} +1 -1
  13. package/dist/{chunk-OGGPNJY3.js → chunk-7M4G23OP.js} +1 -1
  14. package/dist/{chunk-XLWK4XHD.cjs → chunk-ABD3Q57M.cjs} +1 -1
  15. package/dist/chunk-BUB34V2P.cjs +1 -0
  16. package/dist/{chunk-VELN4PVT.js → chunk-BYEJFR3H.js} +1 -1
  17. package/dist/{chunk-WFS45YN4.cjs → chunk-C2K2QZZB.cjs} +1 -1
  18. package/dist/chunk-CCI4HX3K.js +1 -0
  19. package/dist/{chunk-DXPZTNTR.js → chunk-FXFKLSZ7.js} +1 -1
  20. package/dist/chunk-GJUCYEZA.js +1 -0
  21. package/dist/{chunk-33ZMLROF.cjs → chunk-GNI2JNVI.cjs} +1 -1
  22. package/dist/{chunk-MSKWNMPV.cjs → chunk-KEVMJO4P.cjs} +1 -1
  23. package/dist/{chunk-QTZTCEUF.js → chunk-LEKM6PTO.js} +1 -1
  24. package/dist/chunk-OOY3KFP2.js +1 -0
  25. package/dist/chunk-PDL3XF5M.js +1 -0
  26. package/dist/{chunk-EXGOZRL3.cjs → chunk-RNCCI6CR.cjs} +1 -1
  27. package/dist/{chunk-VBWFY7JR.js → chunk-VRQFPB2Y.js} +1 -1
  28. package/dist/chunk-VSHF63LP.cjs +1 -0
  29. package/dist/{chunk-37FBC6CT.js → chunk-WASEZVMN.js} +1 -1
  30. package/dist/{chunk-NIEQGTTW.js → chunk-WYVJPVOC.js} +1 -1
  31. package/dist/{chunk-JKPTRQD2.cjs → chunk-ZJRFG7PB.cjs} +1 -1
  32. package/dist/chunk-ZWDS66FS.cjs +1 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.cts +3 -3
  35. package/dist/index.d.ts +3 -3
  36. package/dist/index.js +1 -1
  37. package/dist/sdk.cjs +1 -1
  38. package/dist/sdk.js +1 -1
  39. package/dist/signers/email/email-iframe-manager.cjs +1 -1
  40. package/dist/signers/email/email-iframe-manager.d.cts +2 -1
  41. package/dist/signers/email/email-iframe-manager.d.ts +2 -1
  42. package/dist/signers/email/email-iframe-manager.js +1 -1
  43. package/dist/signers/email/email-signer-api-client.cjs +1 -1
  44. package/dist/signers/email/email-signer-api-client.js +1 -1
  45. package/dist/signers/email/email.cjs +1 -1
  46. package/dist/signers/email/email.js +1 -1
  47. package/dist/signers/email/index.cjs +1 -1
  48. package/dist/signers/email/index.js +1 -1
  49. package/dist/signers/index.cjs +1 -1
  50. package/dist/signers/index.js +1 -1
  51. package/dist/utils/constants.cjs +1 -1
  52. package/dist/utils/constants.js +1 -1
  53. package/dist/wallets/evm.cjs +1 -1
  54. package/dist/wallets/evm.d.cts +2 -2
  55. package/dist/wallets/evm.d.ts +2 -2
  56. package/dist/wallets/evm.js +1 -1
  57. package/dist/wallets/solana.cjs +1 -1
  58. package/dist/wallets/solana.d.cts +2 -2
  59. package/dist/wallets/solana.d.ts +2 -2
  60. package/dist/wallets/solana.js +1 -1
  61. package/dist/wallets/types.d.cts +30 -2
  62. package/dist/wallets/types.d.ts +30 -2
  63. package/dist/wallets/wallet-factory.cjs +1 -1
  64. package/dist/wallets/wallet-factory.js +1 -1
  65. package/dist/wallets/wallet.cjs +1 -1
  66. package/dist/wallets/wallet.d.cts +20 -26
  67. package/dist/wallets/wallet.d.ts +20 -26
  68. package/dist/wallets/wallet.js +1 -1
  69. package/package.json +2 -2
  70. package/dist/chunk-3D5RTPTJ.js +0 -1
  71. package/dist/chunk-3ZKXOCI7.cjs +0 -1
  72. package/dist/chunk-IIS42MVC.js +0 -1
  73. package/dist/chunk-PSBX4PZW.cjs +0 -1
  74. package/dist/chunk-QK3HMP6H.cjs +0 -1
  75. package/dist/chunk-U34BYZY2.js +0 -1
  76. package/dist/chunk-YHRRQBIE.js +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEXGOZRL3cjs = require('../chunk-EXGOZRL3.cjs');require('../chunk-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkEXGOZRL3cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkRNCCI6CRcjs = require('../chunk-RNCCI6CR.cjs');require('../chunk-6HV5TEO3.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkRNCCI6CRcjs.a;
@@ -17,7 +17,7 @@ declare class ApiClient extends CrossmintApiClient {
17
17
  approveSignature(walletLocator: WalletLocator, signatureId: string, params: ApproveSignatureParams): Promise<ApproveSignatureResponse>;
18
18
  getSignature(walletLocator: EvmWalletLocator, signatureId: string): Promise<GetSignatureResponse>;
19
19
  getTransactions(walletLocator: WalletLocator): Promise<GetTransactionsResponse>;
20
- unstable_getNfts(params: {
20
+ experimental_getNfts(params: {
21
21
  address: string;
22
22
  perPage: number;
23
23
  page: number;
@@ -17,7 +17,7 @@ declare class ApiClient extends CrossmintApiClient {
17
17
  approveSignature(walletLocator: WalletLocator, signatureId: string, params: ApproveSignatureParams): Promise<ApproveSignatureResponse>;
18
18
  getSignature(walletLocator: EvmWalletLocator, signatureId: string): Promise<GetSignatureResponse>;
19
19
  getTransactions(walletLocator: WalletLocator): Promise<GetTransactionsResponse>;
20
- unstable_getNfts(params: {
20
+ experimental_getNfts(params: {
21
21
  address: string;
22
22
  perPage: number;
23
23
  page: number;
@@ -1 +1 @@
1
- import{a}from"../chunk-VELN4PVT.js";import"../chunk-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import{a}from"../chunk-BYEJFR3H.js";import"../chunk-CCI4HX3K.js";import"../chunk-7ENJXL4H.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 _chunkEXGOZRL3cjs = require('../chunk-EXGOZRL3.cjs');require('../chunk-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkEXGOZRL3cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-6HXIZLEQ.cjs');var _chunkRNCCI6CRcjs = require('../chunk-RNCCI6CR.cjs');require('../chunk-6HV5TEO3.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-ECAM5KTH.cjs');require('../chunk-XALFCQKD.cjs');exports.ApiClient = _chunkRNCCI6CRcjs.a;
@@ -1,5 +1,5 @@
1
1
  export { ApiClient } from './client.cjs';
2
- export { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, Balances, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator } from './types.cjs';
2
+ export { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, 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, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, Balances, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator } from './types.js';
2
+ export { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, 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-VELN4PVT.js";import"../chunk-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
1
+ import"../chunk-5IFDVB4Y.js";import{a}from"../chunk-BYEJFR3H.js";import"../chunk-CCI4HX3K.js";import"../chunk-7ENJXL4H.js";import"../chunk-KBJA7JDT.js";import"../chunk-BW7YYVZE.js";export{a as ApiClient};
@@ -11,6 +11,7 @@ type CreateTransactionResponse = CreateTransactionSuccessResponse | WalletsV1Con
11
11
  type ApproveTransactionParams = SubmitApprovalDto;
12
12
  type ApproveTransactionResponse = WalletsV1ControllerGetTransaction4Response | WalletsV1ControllerSubmitApprovals4Error;
13
13
  type GetTransactionResponse = WalletsV1Alpha2TransactionResponseDto | WalletsV1ControllerGetTransaction4Error;
14
+ type GetTransactionSuccessResponse = WalletsV1Alpha2TransactionResponseDto;
14
15
  type CreateSignatureParams = CreateSignatureRequestDto;
15
16
  type CreateSignatureResponse = WalletsV1Alpha2SignatureResponseDto | WalletsV1ControllerCreateSignatureRequest4Error;
16
17
  type ApproveSignatureParams = SubmitApprovalDto;
@@ -19,7 +20,7 @@ type GetSignatureResponse = WalletsV1Alpha2SignatureResponseDto | WalletsV1Contr
19
20
  type GetTransactionsResponse = WalletsV1Alpha2TransactionsResponseDto | WalletsV1ControllerGetTransactionsWithoutChain4Error;
20
21
  type GetNftsResponse = Nftevm | Nftsol | FetchContentFromWalletError;
21
22
  type GetBalanceResponse = WalletBalanceUnstableResponseDto | BalanceControllerGetBalanceForLocator2Error;
22
- type Balances = WalletBalanceUnstableResponseDto;
23
+ type GetBalanceSuccessResponse = WalletBalanceUnstableResponseDto;
23
24
  type GetActivityResponse = WalletsV1Alpha2ActivityResponseDto | WalletV1Alpha2ErrorDto;
24
25
  type Activity = WalletsV1Alpha2ActivityResponseDto;
25
26
  type RegisterSignerParams = CreateSignerInputDto;
@@ -35,4 +36,4 @@ type SolanaAddress = string;
35
36
  type SolanaWalletLocator = `me:${WalletType}` | SolanaAddress;
36
37
  type WalletLocator = EvmWalletLocator | SolanaWalletLocator;
37
38
 
38
- export type { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, Balances, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator };
39
+ export type { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator };
@@ -11,6 +11,7 @@ type CreateTransactionResponse = CreateTransactionSuccessResponse | WalletsV1Con
11
11
  type ApproveTransactionParams = SubmitApprovalDto;
12
12
  type ApproveTransactionResponse = WalletsV1ControllerGetTransaction4Response | WalletsV1ControllerSubmitApprovals4Error;
13
13
  type GetTransactionResponse = WalletsV1Alpha2TransactionResponseDto | WalletsV1ControllerGetTransaction4Error;
14
+ type GetTransactionSuccessResponse = WalletsV1Alpha2TransactionResponseDto;
14
15
  type CreateSignatureParams = CreateSignatureRequestDto;
15
16
  type CreateSignatureResponse = WalletsV1Alpha2SignatureResponseDto | WalletsV1ControllerCreateSignatureRequest4Error;
16
17
  type ApproveSignatureParams = SubmitApprovalDto;
@@ -19,7 +20,7 @@ type GetSignatureResponse = WalletsV1Alpha2SignatureResponseDto | WalletsV1Contr
19
20
  type GetTransactionsResponse = WalletsV1Alpha2TransactionsResponseDto | WalletsV1ControllerGetTransactionsWithoutChain4Error;
20
21
  type GetNftsResponse = Nftevm | Nftsol | FetchContentFromWalletError;
21
22
  type GetBalanceResponse = WalletBalanceUnstableResponseDto | BalanceControllerGetBalanceForLocator2Error;
22
- type Balances = WalletBalanceUnstableResponseDto;
23
+ type GetBalanceSuccessResponse = WalletBalanceUnstableResponseDto;
23
24
  type GetActivityResponse = WalletsV1Alpha2ActivityResponseDto | WalletV1Alpha2ErrorDto;
24
25
  type Activity = WalletsV1Alpha2ActivityResponseDto;
25
26
  type RegisterSignerParams = CreateSignerInputDto;
@@ -35,4 +36,4 @@ type SolanaAddress = string;
35
36
  type SolanaWalletLocator = `me:${WalletType}` | SolanaAddress;
36
37
  type WalletLocator = EvmWalletLocator | SolanaWalletLocator;
37
38
 
38
- export type { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, Balances, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator };
39
+ export type { Activity, ApproveSignatureParams, ApproveSignatureResponse, ApproveTransactionParams, ApproveTransactionResponse, CreateSignatureParams, CreateSignatureResponse, CreateTransactionParams, CreateTransactionResponse, CreateTransactionSuccessResponse, CreateWalletParams, CreateWalletResponse, DelegatedSigner, EvmWalletLocator, GetActivityResponse, GetBalanceResponse, GetBalanceSuccessResponse, GetDelegatedSignersResponse, GetNftsResponse, GetSignatureResponse, GetSignerResponse, GetTransactionResponse, GetTransactionSuccessResponse, GetTransactionsResponse, GetWalletResponse, GetWalletSuccessResponse, RegisterSignerParams, RegisterSignerResponse, SendParams, SendResponse, SolanaWalletLocator, WalletLocator };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXLWK4XHDcjs = require('./chunk-XLWK4XHD.cjs');var _chunkDYRSQN7Xcjs = require('./chunk-DYRSQN7X.cjs');var _chunkNVJN7LPYcjs = require('./chunk-NVJN7LPY.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkYO6BJ2DIcjs = require('./chunk-YO6BJ2DI.cjs');var _chunkDIZVZP5Pcjs = require('./chunk-DIZVZP5P.cjs');function w(r,e){switch(e.type){case"email":return new (0, _chunkXLWK4XHDcjs.a)(e);case"api-key":return r==="solana"?new (0, _chunkNVJN7LPYcjs.a)(e):new (0, _chunkYO6BJ2DIcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkAFYBD7FIcjs.a)(e):new (0, _chunkDIZVZP5Pcjs.a)(e);case"passkey":return new (0, _chunkDYRSQN7Xcjs.a)(e)}}exports.a = w;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkABD3Q57Mcjs = require('./chunk-ABD3Q57M.cjs');var _chunkDYRSQN7Xcjs = require('./chunk-DYRSQN7X.cjs');var _chunkNVJN7LPYcjs = require('./chunk-NVJN7LPY.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkYO6BJ2DIcjs = require('./chunk-YO6BJ2DI.cjs');var _chunkDIZVZP5Pcjs = require('./chunk-DIZVZP5P.cjs');function w(r,e){switch(e.type){case"email":return new (0, _chunkABD3Q57Mcjs.a)(e);case"api-key":return r==="solana"?new (0, _chunkNVJN7LPYcjs.a)(e):new (0, _chunkYO6BJ2DIcjs.a)(e);case"external-wallet":return r==="solana"?new (0, _chunkAFYBD7FIcjs.a)(e):new (0, _chunkDIZVZP5Pcjs.a)(e);case"passkey":return new (0, _chunkDYRSQN7Xcjs.a)(e)}}exports.a = w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.10.0";var p="WALLETS_SDK",c= exports.b =t,r= exports.c =s,d= exports.d =500;exports.a = p; exports.b = c; exports.c = r; exports.d = d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var s="@crossmint/wallets-sdk",t="0.10.2";var p="WALLETS_SDK",c= exports.b =t,r= exports.c =s,d= exports.d =500;exports.a = p; exports.b = c; exports.c = r; exports.d = d;
@@ -1 +1 @@
1
- import{b as i,c as s}from"./chunk-3D5RTPTJ.js";import{a as n}from"./chunk-7ENJXL4H.js";import{f as t}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as p,CrossmintApiClient as d}from"@crossmint/common-sdk-base";var a=class extends d{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:s,version:i}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e){return t(this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:"ed25519"}),headers:this.headers});if(!r.ok){let o=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${o}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===p.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new n("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{a};
1
+ import{b as i,c as s}from"./chunk-CCI4HX3K.js";import{a as n}from"./chunk-7ENJXL4H.js";import{f as t}from"./chunk-BW7YYVZE.js";import{APIKeyUsageOrigin as p,CrossmintApiClient as d}from"@crossmint/common-sdk-base";var a=class extends d{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:s,version:i}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e){return t(this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:"ed25519"}),headers:this.headers});if(!r.ok){let o=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${o}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===p.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new n("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};export{a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk3ZKXOCI7cjs = require('./chunk-3ZKXOCI7.cjs');var _chunkWFS45YN4cjs = require('./chunk-WFS45YN4.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var m=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}locator(){return`solana-keypair:${this.config.signerAddress}`}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.config._handshakeParent==null){let t=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let n=new (0, _chunk3ZKXOCI7cjs.a)({environment:t.environment});this.config._handshakeParent=yield n.initialize()}})}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,o,r;yield this.handleAuthRequired();let n=_bs582.default.decode(t),s=_web3js.VersionedTransaction.deserialize(n).message.serialize(),e=yield(r=this.config._handshakeParent)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:(o=(a=this.config.crossmint.experimental_customAuth)==null?void 0:a.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(s),encoding:"base58"}},options:h});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return{signature:e.signature.bytes}})}handleAuthRequired(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=yield(o=this.config._handshakeParent)==null?void 0:o.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(a=(e=this.config.crossmint.experimental_customAuth)==null?void 0:e.jwt)!=null?a:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:n,resolve:i,reject:s}=this.createAuthPromise();if(this._authPromise={promise:n,resolve:i,reject:s},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),r=>this.verifyOtp(r),()=>s(new _chunkZSWIQU3Ucjs.a))}catch(r){s(r)}try{yield n}catch(r){throw r}})}createAuthPromise(){let t,n;return{promise:new Promise((s,e)=>{t=s,n=e}),resolve:t,reject:n}}sendEmailWithOtp(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s,e,a;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=this.config._handshakeParent,n=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(e=(s=this.config.crossmint.experimental_customAuth)==null?void 0:s.jwt)!=null?e:"",apiKey:this.config.crossmint.apiKey},data:{authId:n}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(a=this._authPromise)==null||a.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,s,e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let n=this.config._handshakeParent;try{let r=yield n.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((r==null?void 0:r.status)==="success"){console.log("[verifyOtp] OTP validation successful"),this._needsAuth=!1,(e=this._authPromise)==null||e.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",r),this._needsAuth=!0;let g=(r==null?void 0:r.status)==="error"?r.error:"Failed to validate encrypted OTP";(a=this._authPromise)==null||a.reject(new Error(g))}catch(r){throw console.error("[verifyOtp] Error sending OTP validation request:",r),this._needsAuth=!0,(o=this._authPromise)==null||o.reject(r),r}})}static pregenerateSigner(t,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;if(t==null||((i=n.experimental_customAuth)==null?void 0:i.email)==null)throw new Error("Email is required to pregenerate a signer");try{let e=(yield new (0, _chunkWFS45YN4cjs.a)(n).pregenerateSigner(t!=null?t:n.experimental_customAuth.email)).publicKey;if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e));return e.bytes}catch(s){throw console.error("[EmailSigner] Failed to pregenerate signer:",s),s}})}},h={timeoutMs:1e4,intervalMs:5e3};exports.a = m;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkZWDS66FScjs = require('./chunk-ZWDS66FS.cjs');var _chunkC2K2QZZBcjs = require('./chunk-C2K2QZZB.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _web3js = require('@solana/web3.js');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var _commonsdkbase = require('@crossmint/common-sdk-base');var p=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}locator(){return`solana-keypair:${this.config.signerAddress}`}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.config._handshakeParent==null){let t=_commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let n=new (0, _chunkZWDS66FScjs.a)({environment:t.environment});this.config._handshakeParent=yield n.initialize()}})}signMessage(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,o,r;yield this.handleAuthRequired();let n=_bs582.default.decode(t),s=_web3js.VersionedTransaction.deserialize(n).message.serialize(),e=yield(r=this.config._handshakeParent)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:(o=(a=this.config.crossmint.experimental_customAuth)==null?void 0:a.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:_bs582.default.encode(s),encoding:"base58"}},options:h});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return{signature:e.signature.bytes}})}handleAuthRequired(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=yield(o=this.config._handshakeParent)==null?void 0:o.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(a=(e=this.config.crossmint.experimental_customAuth)==null?void 0:e.jwt)!=null?a:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:n,resolve:i,reject:s}=this.createAuthPromise();if(this._authPromise={promise:n,resolve:i,reject:s},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),r=>this.verifyOtp(r),()=>s(new _chunkZSWIQU3Ucjs.a))}catch(r){s(r)}try{yield n}catch(r){throw r}})}createAuthPromise(){let t,n;return{promise:new Promise((s,e)=>{t=s,n=e}),resolve:t,reject:n}}sendEmailWithOtp(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var s,e,a;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=this.config._handshakeParent,n=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(e=(s=this.config.crossmint.experimental_customAuth)==null?void 0:s.jwt)!=null?e:"",apiKey:this.config.crossmint.apiKey},data:{authId:n}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(a=this._authPromise)==null||a.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,s,e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let n=this.config._handshakeParent;try{let r=yield n.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((r==null?void 0:r.status)==="success"){this._needsAuth=!1,(e=this._authPromise)==null||e.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",r),this._needsAuth=!0;let g=(r==null?void 0:r.status)==="error"?r.error:"Failed to validate encrypted OTP";(a=this._authPromise)==null||a.reject(new Error(g))}catch(r){throw console.error("[verifyOtp] Error sending OTP validation request:",r),this._needsAuth=!0,(o=this._authPromise)==null||o.reject(r),r}})}static pregenerateSigner(t,n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;if(t==null||((i=n.experimental_customAuth)==null?void 0:i.email)==null)throw new Error("Email is required to pregenerate a signer");try{let e=(yield new (0, _chunkC2K2QZZBcjs.a)(n).pregenerateSigner(t!=null?t:n.experimental_customAuth.email)).publicKey;if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e));return e.bytes}catch(s){throw console.error("[EmailSigner] Failed to pregenerate signer:",s),s}})}},h={timeoutMs:1e4,intervalMs:5e3};exports.a = p;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkVSHF63LPcjs = require('./chunk-VSHF63LP.cjs');var _chunkAFYBD7FIcjs = require('./chunk-AFYBD7FI.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);var p=class m extends _chunkVSHF63LPcjs.a{constructor(a){super({chain:a.chain,address:a.address,owner:a.owner,signer:a.signer},_chunkVSHF63LPcjs.a.getApiClient(a))}static from(a){return new m(a)}sendTransaction(x){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({transaction:a,additionalSigners:n}){let l={transaction:_bs582.default.encode(a.serialize())},r=yield this.apiClient.createTransaction(this.walletLocator,{params:l});if(r.error)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(r));let h=n==null?void 0:n.map(o=>new (0, _chunkAFYBD7FIcjs.a)({type:"external-wallet",address:o.publicKey.toString(),onSignTransaction:e=>(e.sign([o]),Promise.resolve(e))}));return yield this.approveAndWait(r.id,h)})}};exports.a = p;
@@ -1 +1 @@
1
- import{b as n,c as i}from"./chunk-3D5RTPTJ.js";import{a as o}from"./chunk-7ENJXL4H.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/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()})}unstable_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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${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(`api/unstable/wallets/${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};
1
+ import{b as n,c as i}from"./chunk-CCI4HX3K.js";import{a as o}from"./chunk-7ENJXL4H.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/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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return r(this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${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(`api/unstable/wallets/${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};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5HTPBFDHcjs = require('./chunk-5HTPBFDH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var a=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunk5HTPBFDHcjs.c,version:_chunk5HTPBFDHcjs.b}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:"ed25519"}),headers:this.headers});if(!r.ok){let o=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${o}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6HV5TEO3cjs = require('./chunk-6HV5TEO3.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var a=class extends _commonsdkbase.CrossmintApiClient{constructor(e){super(e,{internalConfig:{sdkMetadata:{name:_chunk6HV5TEO3cjs.c,version:_chunk6HV5TEO3cjs.b}}});this.apiPrefix="api/v1/signers"}pregenerateSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield this.post(`${this.apiPrefix}/derive-public-key`,{body:JSON.stringify({authId:`email:${e}`,keyType:"ed25519"}),headers:this.headers});if(!r.ok){let o=yield r.text();throw new Error(`Failed to fetch public key: ${r.status} ${o}`)}return yield r.json()})}get isServerSide(){return this.parsedAPIKey.usageOrigin===_commonsdkbase.APIKeyUsageOrigin.SERVER}get environment(){if(!this.parsedAPIKey.isValid)throw new (0, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = a;
@@ -0,0 +1 @@
1
+ var s="@crossmint/wallets-sdk",t="0.10.2";var c="WALLETS_SDK",r=t,d=s,a=500;export{c as a,r as b,d as c,a as d};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-YHRRQBIE.js";import{k as p,o as c,q as f}from"./chunk-7ENJXL4H.js";import{a as w}from"./chunk-BJDS5BJG.js";import{f as r}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,http as E}from"viem";var C=class v extends s{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:s.getOptions(t)},s.getApiClient(t))}static from(t){return new v(t)}sendTransaction(t){return r(this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new f(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return r(this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new c(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return r(this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new p("Invalid typed data");let{name:g,version:h,chainId:y,verifyingContract:m,salt:D}=a;if(!g||!h||!y||!m)throw new p("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:g,version:h,chainId:Number(y),verifyingContract:m,salt:D},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new c(JSON.stringify(e));let l=e.id,T=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(T,l),yield this.waitForSignature(l)})}getViemClient(t){var a;return S({transport:(a=t==null?void 0:t.transport)!=null?a:E(),chain:w(this.chain)})}};export{C as a};
1
+ import{a as s}from"./chunk-OOY3KFP2.js";import{k as p,o as c,q as f}from"./chunk-7ENJXL4H.js";import{a as w}from"./chunk-BJDS5BJG.js";import{f as r}from"./chunk-BW7YYVZE.js";import{createPublicClient as S,http as E}from"viem";var T=class C extends s{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:s.getOptions(t)},s.getApiClient(t))}static from(t){return new C(t)}sendTransaction(t){return r(this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new f(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return r(this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new c(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return r(this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new p("Invalid typed data");let{name:g,version:h,chainId:y,verifyingContract:m,salt:v}=a;if(!g||!h||!y||!m)throw new p("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:g,version:h,chainId:Number(y),verifyingContract:m,salt:v},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new c(JSON.stringify(e));let l=e.id,D=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(D,l),yield this.waitForSignature(l)})}getViemClient(t){var a;return S({transport:(a=t==null?void 0:t.transport)!=null?a:E(),chain:w(this.chain)})}};export{T as a};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-OOY3KFP2.js";import{a as c}from"./chunk-T3ICQDFS.js";import{q as s}from"./chunk-7ENJXL4H.js";import{f as i}from"./chunk-BW7YYVZE.js";import f from"bs58";var p=class m extends t{constructor(a){super({chain:a.chain,address:a.address,owner:a.owner,signer:a.signer},t.getApiClient(a))}static from(a){return new m(a)}sendTransaction(W){return i(this,arguments,function*({transaction:a,additionalSigners:n}){let l={transaction:f.encode(a.serialize())},r=yield this.apiClient.createTransaction(this.walletLocator,{params:l});if(r.error)throw new s(JSON.stringify(r));let h=n==null?void 0:n.map(o=>new c({type:"external-wallet",address:o.publicKey.toString(),onSignTransaction:e=>(e.sign([o]),Promise.resolve(e))}));return yield this.approveAndWait(r.id,h)})}};export{p as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPSBX4PZWcjs = require('./chunk-PSBX4PZW.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var C=class v extends _chunkPSBX4PZWcjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkPSBX4PZWcjs.a.getOptions(t)},_chunkPSBX4PZWcjs.a.getApiClient(t))}static from(t){return new v(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data");let{name:g,version:h,chainId:y,verifyingContract:m,salt:D}=a;if(!g||!h||!y||!m)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:g,version:h,chainId:Number(y),verifyingContract:m,salt:D},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(e));let l=e.id,T=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(T,l),yield this.waitForSignature(l)})}getViemClient(t){var a;return _viem.createPublicClient.call(void 0, {transport:(a=t==null?void 0:t.transport)!=null?a:_viem.http.call(void 0, ),chain:_chunk6VJEBYPNcjs.a.call(void 0, this.chain)})}};exports.a = C;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVSHF63LPcjs = require('./chunk-VSHF63LP.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _viem = require('viem');var T=class C extends _chunkVSHF63LPcjs.a{constructor(t){super({chain:t.chain,address:t.address,owner:t.owner,signer:t.signer,options:_chunkVSHF63LPcjs.a.getOptions(t)},_chunkVSHF63LPcjs.a.getApiClient(t))}static from(t){return new C(t)}sendTransaction(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;let a=yield this.apiClient.createTransaction(this.walletLocator,{params:{signer:this.signer.locator(),chain:this.chain,calls:[{to:t.to,value:t.value?t.value.toString():"0",data:(i=t.data)!=null?i:"0x"}]}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));return yield this.approveAndWait(a.id)})}signMessage(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var n;let a=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-message",params:{message:t,signer:this.signer.locator(),chain:this.chain}});if("error"in a)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(a));let i=a.id,o=((n=a.approvals)==null?void 0:n.pending)||[];return yield this.approveSignature(o,i),yield this.waitForSignature(i)})}createTypedDataSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var u;let{domain:a,message:i,primaryType:o,types:n,chain:d}=t;if(!a||!i||!n||!d)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data");let{name:g,version:h,chainId:y,verifyingContract:m,salt:v}=a;if(!g||!h||!y||!m)throw new (0, _chunkCT2UGJELcjs.k)("Invalid typed data domain");let e=yield this.apiClient.createSignature(this.walletLocator,{type:"evm-typed-data",params:{typedData:{domain:{name:g,version:h,chainId:Number(y),verifyingContract:m,salt:v},message:i,primaryType:o,types:n},signer:this.signer.locator(),chain:d,isSmartWalletSignature:!1}});if("error"in e)throw new (0, _chunkCT2UGJELcjs.o)(JSON.stringify(e));let l=e.id,D=((u=e.approvals)==null?void 0:u.pending)||[];return yield this.approveSignature(D,l),yield this.waitForSignature(l)})}getViemClient(t){var a;return _viem.createPublicClient.call(void 0, {transport:(a=t==null?void 0:t.transport)!=null?a:_viem.http.call(void 0, ),chain:_chunk6VJEBYPNcjs.a.call(void 0, this.chain)})}};exports.a = T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJKPTRQD2cjs = require('./chunk-JKPTRQD2.cjs');var _chunkEXGOZRL3cjs = require('./chunk-EXGOZRL3.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunkEXGOZRL3cjs.a)(t);this.walletFactory=new (0, _chunkJKPTRQD2cjs.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 _chunkZJRFG7PBcjs = require('./chunk-ZJRFG7PB.cjs');var _chunkRNCCI6CRcjs = require('./chunk-RNCCI6CR.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var i=class o{constructor(t){let r=new (0, _chunkRNCCI6CRcjs.a)(t);this.walletFactory=new (0, _chunkZJRFG7PBcjs.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 n}from"./chunk-VBWFY7JR.js";import{a as i}from"./chunk-OV4CFQ36.js";import{a as o}from"./chunk-77QBSFHG.js";import{a}from"./chunk-T3ICQDFS.js";import{a as l}from"./chunk-2KK65AC6.js";import{a as t}from"./chunk-QTSZSHKK.js";function f(r,e){switch(e.type){case"email":return new n(e);case"api-key":return r==="solana"?new o(e):new l(e);case"external-wallet":return r==="solana"?new a(e):new t(e);case"passkey":return new i(e)}}export{f as a};
1
+ import{a as n}from"./chunk-VRQFPB2Y.js";import{a as i}from"./chunk-OV4CFQ36.js";import{a as o}from"./chunk-77QBSFHG.js";import{a}from"./chunk-T3ICQDFS.js";import{a as l}from"./chunk-2KK65AC6.js";import{a as t}from"./chunk-QTSZSHKK.js";function f(r,e){switch(e.type){case"email":return new n(e);case"api-key":return r==="solana"?new o(e):new l(e);case"external-wallet":return r==="solana"?new a(e):new t(e);case"passkey":return new i(e)}}export{f as a};
@@ -0,0 +1 @@
1
+ import{d as C}from"./chunk-CCI4HX3K.js";import{c as E,d as $,i as L,m as N,p as A,q as O,r as x,s as W,t as B,u as P,v as F,w as k}from"./chunk-7ENJXL4H.js";import{a as y,b,c,d as T,e as v,f as u}from"./chunk-BW7YYVZE.js";import{getEnvironmentForKey as J,isValidAddress as G}from"@crossmint/common-sdk-base";var m,l,_=class{constructor({chain:t,address:e,owner:r,signer:a,options:i},n){T(this,m);T(this,l);v(this,l,n),this.chain=t,this.address=e,this.owner=r,this.signer=a,v(this,m,i)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return c(this,l)}get options(){return c(this,m)}balances(t,e){return u(this,null,function*(){let r=this.chain==="solana"?"SOL":"ETH",a=[r,"USDC",...t!=null?t:[]],i=yield c(this,l).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:a.map(n=>n.toLowerCase())});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,r,t)})}transformBalanceResponse(t,e,r){let a=s=>{var w,f,S;let d,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(d=h.contractAddress),{symbol:s.token,name:s.token,amount:(f=s.amount)!=null?f:"0",contractAddress:d,decimals:s.decimals,rawAmount:(S=s.rawAmount)!=null?S:"0"}},i=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),n=t.find(s=>s.token.toLowerCase().includes("usdc")),g=t.filter(s=>{let d=s.token.toLowerCase();return!d.includes(e)&&!d.includes("usdc")&&(r==null?void 0:r.some(h=>d.includes(h.toLowerCase())))}),p=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:i!=null?a(i):p(e),usdc:n!=null?a(n):p("usdc"),tokens:g.map(a)}}experimental_nfts(t){return u(this,null,function*(){return yield c(this,l).experimental_getNfts(b(y({},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return u(this,null,function*(){return yield c(this,l).getTransactions(this.walletLocator)})}experimental_activity(){return u(this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,r){return u(this,null,function*(){let a=U(t),i=D(e,this.chain),n={recipient:a,amount:r},g=yield c(this,l).send(this.walletLocator,i,n);if("message"in g)throw new O(`Failed to send token: ${JSON.stringify(g.message)}`);return yield this.approveAndWait(g.id)})}addDelegatedSigner(e){return u(this,arguments,function*({signer:t}){var a,i;let r=yield c(this,l).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if("transaction"in r){let n=r.transaction.id;yield this.approveAndWait(n)}else{let n=(a=r.chains)==null?void 0:a[this.chain];if((n==null?void 0:n.status)==="awaiting-approval"){let g=((i=n.approvals)==null?void 0:i.pending)||[];yield this.approveSignature(g,n.id),yield this.waitForSignature(n.id);return}if((n==null?void 0:n.status)==="pending"){yield this.waitForSignature(n.id);return}}})}delegatedSigners(){return u(this,null,function*(){var e,r,a;let t=yield c(this,l).getWallet(this.walletLocator);if("error"in t)throw new $(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new E(`Wallet type ${t.type} not supported`);return(a=(r=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:r.map(i=>{let n=i.locator.indexOf(":");return{signer:`external-wallet:${n>=0?i.locator.slice(n+1):i.locator}`}}))!=null?a:[]})}get walletLocator(){return c(this,l).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return u(this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return u(this,null,function*(){var p,s,d,h;let r=yield c(this,l).getTransaction(this.walletLocator,t);if(r.error)throw new x(JSON.stringify(r));if(yield(d=(s=(p=c(this,m))==null?void 0:p.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:d.call(s),this.signer.type==="api-key")return r;let a=(h=r.approvals)==null?void 0:h.pending;if(a==null)return r;let i=[...e!=null?e:[],this.signer],n=yield Promise.all(a.map(w=>{let f=i.find(I=>I.locator()===w.signer);if(f==null)throw new L(`Signer ${w.signer} not found in pending approvals`);let S=r.walletType==="solana-smart-wallet"?r.onChain.transaction:w.message;return f.signTransaction(S)})),g=yield c(this,l).approveTransaction(this.walletLocator,r.id,{approvals:n.map(w=>y({signer:this.signer.locator()},w))});if(g.error)throw new k(JSON.stringify(g));return g})}approveSignature(t,e){return u(this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=t.find(i=>i.signer===this.signer.locator());if(!r)throw new L(`Signer ${this.signer.locator()} not found in pending approvals`);let a=yield this.signer.signMessage(r.message);return yield c(this,l).approveSignature(this.walletLocator,e,{approvals:[y({signer:this.signer.locator()},a)]}),a})}waitForSignature(t){return u(this,null,function*(){let e=null;do if(yield new Promise(r=>setTimeout(r,C)),e=yield c(this,l).getSignature(this.walletLocator,t),"error"in e)throw new A(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new N("Signature signing failed");if(!e.outputSignature)throw new A("Signature not available");return e.outputSignature})}waitForTransaction(n){return u(this,arguments,function*(t,e=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:a=2e3,initialBackoffMs:i=C}={}){let g=Date.now(),p;do{if(Date.now()-g>e)throw new W("Transaction confirmation timeout");if(p=yield c(this,l).getTransaction(this.walletLocator,t),p.error)throw new x(JSON.stringify(p));yield this.sleep(i),i=Math.min(i*r,a)}while(p.status==="pending");if(p.status==="failed")throw new B(`Transaction sending failed: ${JSON.stringify(p.error)}`);if(p.status==="awaiting-approval")throw new P("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=p.onChain.txId;if(s==null)throw new F("Transaction hash not found on transaction response");return{hash:s,explorerLink:R(p,this.apiClient.crossmint.apiKey)}})}sleep(t){return u(this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};m=new WeakMap,l=new WeakMap;function R(o,t){let e;if(o.walletType==="evm-smart-wallet")e=o.onChain.explorerLink;else if(o.walletType==="solana-smart-wallet"){let r=new URLSearchParams;J(t)!=="production"&&r.append("cluster","devnet"),e=`https://explorer.solana.com/tx/${o.onChain.txId}?${r.toString()}`}return(e==null||e==="")&&(e="Explorer link not available"),e}function U(o){if(typeof o=="string")return o;if("email"in o)return`email:${o.email}`;if("x"in o)return`x:${o.x}`;if("twitter"in o)return`twitter:${o.twitter}`;if("phone"in o)return`phoneNumber:${o.phone}`;if("userId"in o)return`userId:${o.userId}`;throw new Error("Invalid recipient locator")}function D(o,t){return G(o)?`${t}:${o}`:`${t}:${o.toLowerCase()}`}export{_ as a};
@@ -0,0 +1 @@
1
+ import{f as t}from"./chunk-BW7YYVZE.js";import{IFrameWindow as a}from"@crossmint/client-sdk-window";import{environmentUrlConfig as s,signerInboundEvents as m,signerOutboundEvents as h}from"@crossmint/client-signers";var i=class{constructor(n){this.config=n;this.handshakeParent=null}initialize(){return t(this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let n=new URL(s[this.config.environment]),e=yield this.createInvisibleIFrame(n.toString());return this.handshakeParent=yield a.init(e,{targetOrigin:n.origin,incomingEvents:h,outgoingEvents:m}),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(n){return t(this,null,function*(){let e=document.createElement("iframe");return e.src=n,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{e.onload=()=>r(e),e.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};export{i as a};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5HTPBFDHcjs = require('./chunk-5HTPBFDH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.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:_chunk5HTPBFDHcjs.c,version:_chunk5HTPBFDHcjs.b}}});this.apiPrefix="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()})}unstable_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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${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(`api/unstable/wallets/${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, _chunkCT2UGJELcjs.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 _chunk6HV5TEO3cjs = require('./chunk-6HV5TEO3.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.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:_chunk6HV5TEO3cjs.c,version:_chunk6HV5TEO3cjs.b}}});this.apiPrefix="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=new URLSearchParams;return t.append("chain",s.chain.toString()),(yield this.get(`${this.apiPrefix}/${e}/activity?${t.toString()}`,{headers:this.headers})).json()})}getBalance(e,s){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=new URLSearchParams;return t.append("tokenLocators",s.tokens.join(",")),t.append("chains",s.chains.join(",")),(yield this.get(`api/unstable/wallets/${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(`api/unstable/wallets/${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, _chunkCT2UGJELcjs.a)("Invalid API key");return this.parsedAPIKey.environment}get headers(){return{"Content-Type":"application/json"}}};exports.a = p;
@@ -1 +1 @@
1
- import{a as l}from"./chunk-U34BYZY2.js";import{a as u}from"./chunk-OGGPNJY3.js";import{a as d}from"./chunk-M4ELAV7U.js";import{f as c}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as f}from"@solana/web3.js";import p from"bs58";import{validateAPIKey as y}from"@crossmint/common-sdk-base";var m=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}locator(){return`solana-keypair:${this.config.signerAddress}`}initialize(){return c(this,null,function*(){if(this.config._handshakeParent==null){let t=y(this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let n=new l({environment:t.environment});this.config._handshakeParent=yield n.initialize()}})}signMessage(){return c(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(t){return c(this,null,function*(){var a,o,r;yield this.handleAuthRequired();let n=p.decode(t),s=f.deserialize(n).message.serialize(),e=yield(r=this.config._handshakeParent)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:(o=(a=this.config.crossmint.experimental_customAuth)==null?void 0:a.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:p.encode(s),encoding:"base58"}},options:h});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return{signature:e.signature.bytes}})}handleAuthRequired(){return c(this,null,function*(){var e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=yield(o=this.config._handshakeParent)==null?void 0:o.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(a=(e=this.config.crossmint.experimental_customAuth)==null?void 0:e.jwt)!=null?a:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:n,resolve:i,reject:s}=this.createAuthPromise();if(this._authPromise={promise:n,resolve:i,reject:s},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),r=>this.verifyOtp(r),()=>s(new d))}catch(r){s(r)}try{yield n}catch(r){throw r}})}createAuthPromise(){let t,n;return{promise:new Promise((s,e)=>{t=s,n=e}),resolve:t,reject:n}}sendEmailWithOtp(){return c(this,null,function*(){var s,e,a;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=this.config._handshakeParent,n=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(e=(s=this.config.crossmint.experimental_customAuth)==null?void 0:s.jwt)!=null?e:"",apiKey:this.config.crossmint.apiKey},data:{authId:n}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(a=this._authPromise)==null||a.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return c(this,null,function*(){var i,s,e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let n=this.config._handshakeParent;try{let r=yield n.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((r==null?void 0:r.status)==="success"){console.log("[verifyOtp] OTP validation successful"),this._needsAuth=!1,(e=this._authPromise)==null||e.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",r),this._needsAuth=!0;let g=(r==null?void 0:r.status)==="error"?r.error:"Failed to validate encrypted OTP";(a=this._authPromise)==null||a.reject(new Error(g))}catch(r){throw console.error("[verifyOtp] Error sending OTP validation request:",r),this._needsAuth=!0,(o=this._authPromise)==null||o.reject(r),r}})}static pregenerateSigner(t,n){return c(this,null,function*(){var i;if(t==null||((i=n.experimental_customAuth)==null?void 0:i.email)==null)throw new Error("Email is required to pregenerate a signer");try{let e=(yield new u(n).pregenerateSigner(t!=null?t:n.experimental_customAuth.email)).publicKey;if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e));return e.bytes}catch(s){throw console.error("[EmailSigner] Failed to pregenerate signer:",s),s}})}},h={timeoutMs:1e4,intervalMs:5e3};export{m as a};
1
+ import{a as l}from"./chunk-PDL3XF5M.js";import{a as u}from"./chunk-7M4G23OP.js";import{a as d}from"./chunk-M4ELAV7U.js";import{f as c}from"./chunk-BW7YYVZE.js";import{VersionedTransaction as f}from"@solana/web3.js";import m from"bs58";import{validateAPIKey as y}from"@crossmint/common-sdk-base";var p=class{constructor(t){this.config=t;this.type="email";this._needsAuth=!0;this._authPromise=null;this.initialize()}locator(){return`solana-keypair:${this.config.signerAddress}`}initialize(){return c(this,null,function*(){if(this.config._handshakeParent==null){let t=y(this.config.crossmint.apiKey);if(!t.isValid)throw new Error("Invalid API key");let n=new l({environment:t.environment});this.config._handshakeParent=yield n.initialize()}})}signMessage(){return c(this,null,function*(){return yield Promise.reject(new Error("signMessage method not implemented for email signer"))})}signTransaction(t){return c(this,null,function*(){var a,o,r;yield this.handleAuthRequired();let n=m.decode(t),s=f.deserialize(n).message.serialize(),e=yield(r=this.config._handshakeParent)==null?void 0:r.sendAction({event:"request:sign",responseEvent:"response:sign",data:{authData:{jwt:(o=(a=this.config.crossmint.experimental_customAuth)==null?void 0:a.jwt)!=null?o:"",apiKey:this.config.crossmint.apiKey},data:{keyType:"ed25519",bytes:m.encode(s),encoding:"base58"}},options:h});if((e==null?void 0:e.status)==="error")throw new Error(e.error);if((e==null?void 0:e.signature)==null)throw new Error("Failed to sign transaction");return{signature:e.signature.bytes}})}handleAuthRequired(){return c(this,null,function*(){var e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=yield(o=this.config._handshakeParent)==null?void 0:o.sendAction({event:"request:get-status",responseEvent:"response:get-status",data:{authData:{jwt:(a=(e=this.config.crossmint.experimental_customAuth)==null?void 0:e.jwt)!=null?a:"",apiKey:this.config.crossmint.apiKey}},options:h});if((t==null?void 0:t.status)!=="success")throw new Error(t==null?void 0:t.error);if(t.signerStatus==="ready"){this._needsAuth=!1;return}let{promise:n,resolve:i,reject:s}=this.createAuthPromise();if(this._authPromise={promise:n,resolve:i,reject:s},this.config.onAuthRequired)try{yield this.config.onAuthRequired(this._needsAuth,()=>this.sendEmailWithOtp(),r=>this.verifyOtp(r),()=>s(new d))}catch(r){s(r)}try{yield n}catch(r){throw r}})}createAuthPromise(){let t,n;return{promise:new Promise((s,e)=>{t=s,n=e}),resolve:t,reject:n}}sendEmailWithOtp(){return c(this,null,function*(){var s,e,a;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let t=this.config._handshakeParent,n=`email:${this.config.email}`,i=yield t.sendAction({event:"request:start-onboarding",responseEvent:"response:start-onboarding",data:{authData:{jwt:(e=(s=this.config.crossmint.experimental_customAuth)==null?void 0:s.jwt)!=null?e:"",apiKey:this.config.crossmint.apiKey},data:{authId:n}},options:h});if((i==null?void 0:i.status)==="success"&&i.signerStatus==="ready"){this._needsAuth=!1;return}(i==null?void 0:i.status)==="error"&&(console.error("[sendEmailWithOtp] Failed to send OTP:",i),(a=this._authPromise)==null||a.reject(new Error(i.error||"Failed to initiate OTP process.")))})}verifyOtp(t){return c(this,null,function*(){var i,s,e,a,o;if(this.config._handshakeParent==null)throw new Error("Handshake parent not initialized");let n=this.config._handshakeParent;try{let r=yield n.sendAction({event:"request:complete-onboarding",responseEvent:"response:complete-onboarding",data:{authData:{jwt:(s=(i=this.config.crossmint.experimental_customAuth)==null?void 0:i.jwt)!=null?s:"",apiKey:this.config.crossmint.apiKey},data:{onboardingAuthentication:{encryptedOtp:t}}},options:h});if((r==null?void 0:r.status)==="success"){this._needsAuth=!1,(e=this._authPromise)==null||e.resolve();return}console.error("[verifyOtp] Failed to validate OTP:",r),this._needsAuth=!0;let g=(r==null?void 0:r.status)==="error"?r.error:"Failed to validate encrypted OTP";(a=this._authPromise)==null||a.reject(new Error(g))}catch(r){throw console.error("[verifyOtp] Error sending OTP validation request:",r),this._needsAuth=!0,(o=this._authPromise)==null||o.reject(r),r}})}static pregenerateSigner(t,n){return c(this,null,function*(){var i;if(t==null||((i=n.experimental_customAuth)==null?void 0:i.email)==null)throw new Error("Email is required to pregenerate a signer");try{let e=(yield new u(n).pregenerateSigner(t!=null?t:n.experimental_customAuth.email)).publicKey;if(e==null)throw new Error("No public key found");if(e.encoding!=="base58"||e.keyType!=="ed25519"||e.bytes==null)throw new Error("Not supported. Expected public key to be in base58 encoding and ed25519 key type. Got: "+JSON.stringify(e));return e.bytes}catch(s){throw console.error("[EmailSigner] Failed to pregenerate signer:",s),s}})}},h={timeoutMs:1e4,intervalMs:5e3};export{p as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6HV5TEO3cjs = require('./chunk-6HV5TEO3.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _commonsdkbase = require('@crossmint/common-sdk-base');var m,l,_= exports.a =class{constructor({chain:t,address:e,owner:r,signer:a,options:i},n){_chunkXALFCQKDcjs.d.call(void 0, this,m);_chunkXALFCQKDcjs.d.call(void 0, this,l);_chunkXALFCQKDcjs.e.call(void 0, this,l,n),this.chain=t,this.address=e,this.owner=r,this.signer=a,_chunkXALFCQKDcjs.e.call(void 0, this,m,i)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,l)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,m)}balances(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=this.chain==="solana"?"SOL":"ETH",a=[r,"USDC",...t!=null?t:[]],i=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getBalance(this.address,{chains:e!=null?e:[this.chain],tokens:a.map(n=>n.toLowerCase())});if("error"in i)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(i.message)}`);return this.transformBalanceResponse(i,r,t)})}transformBalanceResponse(t,e,r){let a=s=>{var w,f,S;let d,h=(w=s.forChain)==null?void 0:w[this.chain];return h&&"contractAddress"in h&&(d=h.contractAddress),{symbol:s.token,name:s.token,amount:(f=s.amount)!=null?f:"0",contractAddress:d,decimals:s.decimals,rawAmount:(S=s.rawAmount)!=null?S:"0"}},i=t.find(s=>s.token===e||s.token.toLowerCase().includes(e)),n=t.find(s=>s.token.toLowerCase().includes("usdc")),g=t.filter(s=>{let d=s.token.toLowerCase();return!d.includes(e)&&!d.includes("usdc")&&(r==null?void 0:r.some(h=>d.includes(h.toLowerCase())))}),p=s=>({symbol:s,name:s,amount:"0",contractAddress:void 0,decimals:0,rawAmount:"0"});return{nativeToken:i!=null?a(i):p(e),usdc:n!=null?a(n):p("usdc"),tokens:g.map(a)}}experimental_nfts(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).experimental_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},t),{chain:this.chain,address:this.address}))})}experimental_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransactions(this.walletLocator)})}experimental_activity(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let t=yield this.apiClient.experimental_activity(this.walletLocator,{chain:this.chain});if("error"in t)throw new Error(`Failed to get activity: ${JSON.stringify(t.message)}`);return t})}send(t,e,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let a=U(t),i=D(e,this.chain),n={recipient:a,amount:r},g=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).send(this.walletLocator,i,n);if("message"in g)throw new (0, _chunkCT2UGJELcjs.q)(`Failed to send token: ${JSON.stringify(g.message)}`);return yield this.approveAndWait(g.id)})}addDelegatedSigner(e){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({signer:t}){var a,i;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).registerSigner(this.walletLocator,{signer:t,chain:this.chain==="solana"?void 0:this.chain});if("error"in r)throw new Error(`Failed to register signer: ${JSON.stringify(r.message)}`);if("transaction"in r){let n=r.transaction.id;yield this.approveAndWait(n)}else{let n=(a=r.chains)==null?void 0:a[this.chain];if((n==null?void 0:n.status)==="awaiting-approval"){let g=((i=n.approvals)==null?void 0:i.pending)||[];yield this.approveSignature(g,n.id),yield this.waitForSignature(n.id);return}if((n==null?void 0:n.status)==="pending"){yield this.waitForSignature(n.id);return}}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var e,r,a;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getWallet(this.walletLocator);if("error"in t)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new (0, _chunkCT2UGJELcjs.c)(`Wallet type ${t.type} not supported`);return(a=(r=(e=t==null?void 0:t.config)==null?void 0:e.delegatedSigners)==null?void 0:r.map(i=>{let n=i.locator.indexOf(":");return{signer:`external-wallet:${n>=0?i.locator.slice(n+1):i.locator}`}}))!=null?a:[]})}get walletLocator(){return _chunkXALFCQKDcjs.c.call(void 0, this,l).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransaction(t,e),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var p,s,d,h;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransaction(this.walletLocator,t);if(r.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(r));if(yield(d=(s=(p=_chunkXALFCQKDcjs.c.call(void 0, this,m))==null?void 0:p.experimental_callbacks)==null?void 0:s.onTransactionStart)==null?void 0:d.call(s),this.signer.type==="api-key")return r;let a=(h=r.approvals)==null?void 0:h.pending;if(a==null)return r;let i=[...e!=null?e:[],this.signer],n=yield Promise.all(a.map(w=>{let f=i.find(I=>I.locator()===w.signer);if(f==null)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${w.signer} not found in pending approvals`);let S=r.walletType==="solana-smart-wallet"?r.onChain.transaction:w.message;return f.signTransaction(S)})),g=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).approveTransaction(this.walletLocator,r.id,{approvals:n.map(w=>_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},w))});if(g.error)throw new (0, _chunkCT2UGJELcjs.w)(JSON.stringify(g));return g})}approveSignature(t,e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=t.find(i=>i.signer===this.signer.locator());if(!r)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signer.locator()} not found in pending approvals`);let a=yield this.signer.signMessage(r.message);return yield _chunkXALFCQKDcjs.c.call(void 0, this,l).approveSignature(this.walletLocator,e,{approvals:[_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},a)]}),a})}waitForSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=null;do if(yield new Promise(r=>setTimeout(r,_chunk6HV5TEO3cjs.d)),e=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getSignature(this.walletLocator,t),"error"in e)throw new (0, _chunkCT2UGJELcjs.p)(JSON.stringify(e));while(e===null||e.status==="pending");if(e.status==="failed")throw new (0, _chunkCT2UGJELcjs.m)("Signature signing failed");if(!e.outputSignature)throw new (0, _chunkCT2UGJELcjs.p)("Signature not available");return e.outputSignature})}waitForTransaction(n){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(t,e=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:a=2e3,initialBackoffMs:i=_chunk6HV5TEO3cjs.d}={}){let g=Date.now(),p;do{if(Date.now()-g>e)throw new (0, _chunkCT2UGJELcjs.s)("Transaction confirmation timeout");if(p=yield _chunkXALFCQKDcjs.c.call(void 0, this,l).getTransaction(this.walletLocator,t),p.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(p));yield this.sleep(i),i=Math.min(i*r,a)}while(p.status==="pending");if(p.status==="failed")throw new (0, _chunkCT2UGJELcjs.t)(`Transaction sending failed: ${JSON.stringify(p.error)}`);if(p.status==="awaiting-approval")throw new (0, _chunkCT2UGJELcjs.u)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let s=p.onChain.txId;if(s==null)throw new (0, _chunkCT2UGJELcjs.v)("Transaction hash not found on transaction response");return{hash:s,explorerLink:R(p,this.apiClient.crossmint.apiKey)}})}sleep(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(e=>setTimeout(e,t))})}};m=new WeakMap,l=new WeakMap;function R(o,t){let e;if(o.walletType==="evm-smart-wallet")e=o.onChain.explorerLink;else if(o.walletType==="solana-smart-wallet"){let r=new URLSearchParams;_commonsdkbase.getEnvironmentForKey.call(void 0, t)!=="production"&&r.append("cluster","devnet"),e=`https://explorer.solana.com/tx/${o.onChain.txId}?${r.toString()}`}return(e==null||e==="")&&(e="Explorer link not available"),e}function U(o){if(typeof o=="string")return o;if("email"in o)return`email:${o.email}`;if("x"in o)return`x:${o.x}`;if("twitter"in o)return`twitter:${o.twitter}`;if("phone"in o)return`phoneNumber:${o.phone}`;if("userId"in o)return`userId:${o.userId}`;throw new Error("Invalid recipient locator")}function D(o,t){return _commonsdkbase.isValidAddress.call(void 0, o)?`${t}:${o}`:`${t}:${o.toLowerCase()}`}exports.a = _;
@@ -1 +1 @@
1
- import{a as d}from"./chunk-YHRRQBIE.js";import{a as y}from"./chunk-QTZTCEUF.js";import{a as m}from"./chunk-VBWFY7JR.js";import{a as C}from"./chunk-FUUYGB4K.js";import{d as c,f as r}from"./chunk-7ENJXL4H.js";import{f as s}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as h}from"ox";var f=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return s(this,null,function*(){if(this.apiClient.isServerSide)throw new r("getOrCreateWallet is not supported on server side");let t=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return t&&!("error"in t)?(yield this.validateWalletConfig(t,e),this.createWalletInstance(t,e)):this.createWallet(e)})}getWallet(e,t){return s(this,null,function*(){if(!this.apiClient.isServerSide)throw new r("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new c(JSON.stringify(i));return this.createWalletInstance(i,t)})}createWallet(e){return s(this,null,function*(){var a,n,o,l,p;yield(o=(n=(a=e.options)==null?void 0:a.experimental_callbacks)==null?void 0:n.onWalletCreationStart)==null?void 0:o.call(n);let t;e.chain==="solana"?t={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(l=e.owner)!=null?l:void 0}:t={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let i=yield this.apiClient.createWallet(t);if("error"in i)throw new r(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,t){let i=this.toInternalSignerConfig(e,t.signer);return new d({chain:t.chain,address:e.address,signer:y(t.chain,i),options:t.options},this.apiClient)}toInternalSignerConfig(e,t){var i,a;if(t==null)throw new r("Signer is required to create a wallet");switch(t.type){case"api-key":{let n;switch(e.type){case"solana-smart-wallet":n=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(n=e.config.adminSigner.address);break}if(n==null)throw new r("Wallet signer 'api-key' has no address");return{type:"api-key",address:n}}case"external-wallet":return t;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:t.onCreatePasskey,onSignWithPasskey:t.onSignWithPasskey};throw new r("Passkey signer is not supported for this wallet type");case"email":{if(e.type!=="solana-smart-wallet"||e.config.adminSigner.type!=="solana-keypair")throw new r("Wallet signer 'email' has no address");let n=e.config.adminSigner.address;return{type:"email",email:(a=t.email)!=null?a:(i=this.apiClient.crossmint.experimental_customAuth)==null?void 0:i.email,signerAddress:n,crossmint:this.apiClient.crossmint,onAuthRequired:t.onAuthRequired,_handshakeParent:t._handshakeParent}}default:throw new Error("Invalid signer type")}}configureSigner(e,t){return s(this,null,function*(){var i;if((t==null?void 0:t.type)==="passkey"){let a=(i=t.name)!=null?i:`Crossmint Wallet ${Date.now()}`,n=t.onCreatePasskey?yield t.onCreatePasskey(a):yield h.createCredential({name:a});return{type:"evm-passkey",id:n.id,name:a,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,t)})}toExternalSignerConfig(e,t,i){return s(this,null,function*(){var a,n;if(!t||t.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(t.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:t.address};if(t.type==="passkey"&&i!=null){if((i==null?void 0:i.type)!=="evm-smart-wallet"||i.config.adminSigner.type!=="evm-passkey")throw new r("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:i.config.adminSigner.id,name:i.config.adminSigner.name,publicKey:{x:i.config.adminSigner.publicKey.x,y:i.config.adminSigner.publicKey.y}}}if(t.type==="email"){let o=(n=t.email)!=null?n:(a=this.apiClient.crossmint.experimental_customAuth)==null?void 0:a.email;if(o==null)throw new Error("Email is required to create a wallet with email signer");if(e!=="solana")throw new Error("Email signer is only supported for Solana wallets");return{type:"solana-keypair",address:yield m.pregenerateSigner(o,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,t){return s(this,null,function*(){if(t.owner!=null&&e.linkedUser!=null&&t.owner!==e.linkedUser)throw new r("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let i=yield this.toExternalSignerConfig(t.chain,t.signer,e),a=e.config.adminSigner;if(i&&a){if(i.type!==a.type)throw new r("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");C(i,a)}})}};export{f as a};
1
+ import{a as d}from"./chunk-OOY3KFP2.js";import{a as y}from"./chunk-LEKM6PTO.js";import{a as m}from"./chunk-VRQFPB2Y.js";import{a as C}from"./chunk-FUUYGB4K.js";import{d as c,f as r}from"./chunk-7ENJXL4H.js";import{f as s}from"./chunk-BW7YYVZE.js";import{WebAuthnP256 as h}from"ox";var f=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return s(this,null,function*(){if(this.apiClient.isServerSide)throw new r("getOrCreateWallet is not supported on server side");let t=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return t&&!("error"in t)?(yield this.validateWalletConfig(t,e),this.createWalletInstance(t,e)):this.createWallet(e)})}getWallet(e,t){return s(this,null,function*(){if(!this.apiClient.isServerSide)throw new r("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new c(JSON.stringify(i));return this.createWalletInstance(i,t)})}createWallet(e){return s(this,null,function*(){var a,n,o,l,p;yield(o=(n=(a=e.options)==null?void 0:a.experimental_callbacks)==null?void 0:n.onWalletCreationStart)==null?void 0:o.call(n);let t;e.chain==="solana"?t={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(l=e.owner)!=null?l:void 0}:t={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let i=yield this.apiClient.createWallet(t);if("error"in i)throw new r(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,t){let i=this.toInternalSignerConfig(e,t.signer);return new d({chain:t.chain,address:e.address,signer:y(t.chain,i),options:t.options},this.apiClient)}toInternalSignerConfig(e,t){var i,a;if(t==null)throw new r("Signer is required to create a wallet");switch(t.type){case"api-key":{let n;switch(e.type){case"solana-smart-wallet":n=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(n=e.config.adminSigner.address);break}if(n==null)throw new r("Wallet signer 'api-key' has no address");return{type:"api-key",address:n}}case"external-wallet":return t;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:t.onCreatePasskey,onSignWithPasskey:t.onSignWithPasskey};throw new r("Passkey signer is not supported for this wallet type");case"email":{if(e.type!=="solana-smart-wallet"||e.config.adminSigner.type!=="solana-keypair")throw new r("Wallet signer 'email' has no address");let n=e.config.adminSigner.address;return{type:"email",email:(a=t.email)!=null?a:(i=this.apiClient.crossmint.experimental_customAuth)==null?void 0:i.email,signerAddress:n,crossmint:this.apiClient.crossmint,onAuthRequired:t.onAuthRequired,_handshakeParent:t._handshakeParent}}default:throw new Error("Invalid signer type")}}configureSigner(e,t){return s(this,null,function*(){var i;if((t==null?void 0:t.type)==="passkey"){let a=(i=t.name)!=null?i:`Crossmint Wallet ${Date.now()}`,n=t.onCreatePasskey?yield t.onCreatePasskey(a):yield h.createCredential({name:a});return{type:"evm-passkey",id:n.id,name:a,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,t)})}toExternalSignerConfig(e,t,i){return s(this,null,function*(){var a,n;if(!t||t.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(t.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:t.address};if(t.type==="passkey"&&i!=null){if((i==null?void 0:i.type)!=="evm-smart-wallet"||i.config.adminSigner.type!=="evm-passkey")throw new r("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:i.config.adminSigner.id,name:i.config.adminSigner.name,publicKey:{x:i.config.adminSigner.publicKey.x,y:i.config.adminSigner.publicKey.y}}}if(t.type==="email"){let o=(n=t.email)!=null?n:(a=this.apiClient.crossmint.experimental_customAuth)==null?void 0:a.email;if(o==null)throw new Error("Email is required to create a wallet with email signer");if(e!=="solana")throw new Error("Email signer is only supported for Solana wallets");return{type:"solana-keypair",address:yield m.pregenerateSigner(o,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,t){return s(this,null,function*(){if(t.owner!=null&&e.linkedUser!=null&&t.owner!==e.linkedUser)throw new r("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let i=yield this.toExternalSignerConfig(t.chain,t.signer,e),a=e.config.adminSigner;if(i&&a){if(i.type!==a.type)throw new r("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");C(i,a)}})}};export{f as a};
@@ -1 +1 @@
1
- import{a as l}from"./chunk-37FBC6CT.js";import{a}from"./chunk-VELN4PVT.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as C}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{C as a,i as b};
1
+ import{a as l}from"./chunk-WASEZVMN.js";import{a}from"./chunk-BYEJFR3H.js";import{f as e}from"./chunk-BW7YYVZE.js";import{createCrossmint as C}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{C as a,i as b};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPSBX4PZWcjs = require('./chunk-PSBX4PZW.cjs');var _chunkGVFGQUCOcjs = require('./chunk-GVFGQUCO.cjs');var _chunkXLWK4XHDcjs = require('./chunk-XLWK4XHD.cjs');var _chunkRD5PG4M6cjs = require('./chunk-RD5PG4M6.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var f=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getOrCreateWallet is not supported on server side");let t=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return t&&!("error"in t)?(yield this.validateWalletConfig(t,e),this.createWalletInstance(t,e)):this.createWallet(e)})}getWallet(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(i));return this.createWalletInstance(i,t)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,n,o,l,p;yield(o=(n=(a=e.options)==null?void 0:a.experimental_callbacks)==null?void 0:n.onWalletCreationStart)==null?void 0:o.call(n);let t;e.chain==="solana"?t={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(l=e.owner)!=null?l:void 0}:t={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let i=yield this.apiClient.createWallet(t);if("error"in i)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,t){let i=this.toInternalSignerConfig(e,t.signer);return new (0, _chunkPSBX4PZWcjs.a)({chain:t.chain,address:e.address,signer:_chunkGVFGQUCOcjs.a.call(void 0, t.chain,i),options:t.options},this.apiClient)}toInternalSignerConfig(e,t){var i,a;if(t==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(t.type){case"api-key":{let n;switch(e.type){case"solana-smart-wallet":n=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(n=e.config.adminSigner.address);break}if(n==null)throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'api-key' has no address");return{type:"api-key",address:n}}case"external-wallet":return t;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:t.onCreatePasskey,onSignWithPasskey:t.onSignWithPasskey};throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");case"email":{if(e.type!=="solana-smart-wallet"||e.config.adminSigner.type!=="solana-keypair")throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'email' has no address");let n=e.config.adminSigner.address;return{type:"email",email:(a=t.email)!=null?a:(i=this.apiClient.crossmint.experimental_customAuth)==null?void 0:i.email,signerAddress:n,crossmint:this.apiClient.crossmint,onAuthRequired:t.onAuthRequired,_handshakeParent:t._handshakeParent}}default:throw new Error("Invalid signer type")}}configureSigner(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;if((t==null?void 0:t.type)==="passkey"){let a=(i=t.name)!=null?i:`Crossmint Wallet ${Date.now()}`,n=t.onCreatePasskey?yield t.onCreatePasskey(a):yield _ox.WebAuthnP256.createCredential({name:a});return{type:"evm-passkey",id:n.id,name:a,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,t)})}toExternalSignerConfig(e,t,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,n;if(!t||t.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(t.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:t.address};if(t.type==="passkey"&&i!=null){if((i==null?void 0:i.type)!=="evm-smart-wallet"||i.config.adminSigner.type!=="evm-passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:i.config.adminSigner.id,name:i.config.adminSigner.name,publicKey:{x:i.config.adminSigner.publicKey.x,y:i.config.adminSigner.publicKey.y}}}if(t.type==="email"){let o=(n=t.email)!=null?n:(a=this.apiClient.crossmint.experimental_customAuth)==null?void 0:a.email;if(o==null)throw new Error("Email is required to create a wallet with email signer");if(e!=="solana")throw new Error("Email signer is only supported for Solana wallets");return{type:"solana-keypair",address:yield _chunkXLWK4XHDcjs.a.pregenerateSigner(o,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(t.owner!=null&&e.linkedUser!=null&&t.owner!==e.linkedUser)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let i=yield this.toExternalSignerConfig(t.chain,t.signer,e),a=e.config.adminSigner;if(i&&a){if(i.type!==a.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRD5PG4M6cjs.a.call(void 0, i,a)}})}};exports.a = f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVSHF63LPcjs = require('./chunk-VSHF63LP.cjs');var _chunk44GZ6TWGcjs = require('./chunk-44GZ6TWG.cjs');var _chunkABD3Q57Mcjs = require('./chunk-ABD3Q57M.cjs');var _chunkRD5PG4M6cjs = require('./chunk-RD5PG4M6.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _ox = require('ox');var f=class{constructor(e){this.apiClient=e}getOrCreateWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getOrCreateWallet is not supported on server side");let t=yield this.apiClient.getWallet(`me:${e.chain==="solana"?"solana-smart-wallet":"evm-smart-wallet"}`);return t&&!("error"in t)?(yield this.validateWalletConfig(t,e),this.createWalletInstance(t,e)):this.createWallet(e)})}getWallet(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(!this.apiClient.isServerSide)throw new (0, _chunkCT2UGJELcjs.f)("getWallet is not supported on client side, use getOrCreateWallet instead");let i=yield this.apiClient.getWallet(e);if("error"in i)throw new (0, _chunkCT2UGJELcjs.d)(JSON.stringify(i));return this.createWalletInstance(i,t)})}createWallet(e){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,n,o,l,p;yield(o=(n=(a=e.options)==null?void 0:a.experimental_callbacks)==null?void 0:n.onWalletCreationStart)==null?void 0:o.call(n);let t;e.chain==="solana"?t={type:"solana-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(l=e.owner)!=null?l:void 0}:t={type:"evm-smart-wallet",config:{adminSigner:yield this.configureSigner(e.chain,e.signer)},linkedUser:(p=e.owner)!=null?p:void 0};let i=yield this.apiClient.createWallet(t);if("error"in i)throw new (0, _chunkCT2UGJELcjs.f)(JSON.stringify(i));return this.createWalletInstance(i,e)})}createWalletInstance(e,t){let i=this.toInternalSignerConfig(e,t.signer);return new (0, _chunkVSHF63LPcjs.a)({chain:t.chain,address:e.address,signer:_chunk44GZ6TWGcjs.a.call(void 0, t.chain,i),options:t.options},this.apiClient)}toInternalSignerConfig(e,t){var i,a;if(t==null)throw new (0, _chunkCT2UGJELcjs.f)("Signer is required to create a wallet");switch(t.type){case"api-key":{let n;switch(e.type){case"solana-smart-wallet":n=e.config.adminSigner.address;break;case"evm-smart-wallet":e.config.adminSigner.type==="evm-fireblocks-custodial"&&(n=e.config.adminSigner.address);break}if(n==null)throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'api-key' has no address");return{type:"api-key",address:n}}case"external-wallet":return t;case"passkey":if(e.type==="evm-smart-wallet"&&e.config.adminSigner.type==="evm-passkey")return{type:"passkey",id:e.config.adminSigner.id,name:e.config.adminSigner.name,onCreatePasskey:t.onCreatePasskey,onSignWithPasskey:t.onSignWithPasskey};throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");case"email":{if(e.type!=="solana-smart-wallet"||e.config.adminSigner.type!=="solana-keypair")throw new (0, _chunkCT2UGJELcjs.f)("Wallet signer 'email' has no address");let n=e.config.adminSigner.address;return{type:"email",email:(a=t.email)!=null?a:(i=this.apiClient.crossmint.experimental_customAuth)==null?void 0:i.email,signerAddress:n,crossmint:this.apiClient.crossmint,onAuthRequired:t.onAuthRequired,_handshakeParent:t._handshakeParent}}default:throw new Error("Invalid signer type")}}configureSigner(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i;if((t==null?void 0:t.type)==="passkey"){let a=(i=t.name)!=null?i:`Crossmint Wallet ${Date.now()}`,n=t.onCreatePasskey?yield t.onCreatePasskey(a):yield _ox.WebAuthnP256.createCredential({name:a});return{type:"evm-passkey",id:n.id,name:a,publicKey:{x:n.publicKey.x.toString(),y:n.publicKey.y.toString()}}}return yield this.toExternalSignerConfig(e,t)})}toExternalSignerConfig(e,t,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var a,n;if(!t||t.type==="api-key")return{type:e==="solana"?"solana-fireblocks-custodial":"evm-fireblocks-custodial"};if(t.type==="external-wallet")return{type:e==="solana"?"solana-keypair":"evm-keypair",address:t.address};if(t.type==="passkey"&&i!=null){if((i==null?void 0:i.type)!=="evm-smart-wallet"||i.config.adminSigner.type!=="evm-passkey")throw new (0, _chunkCT2UGJELcjs.f)("Passkey signer is not supported for this wallet type");return{type:"evm-passkey",id:i.config.adminSigner.id,name:i.config.adminSigner.name,publicKey:{x:i.config.adminSigner.publicKey.x,y:i.config.adminSigner.publicKey.y}}}if(t.type==="email"){let o=(n=t.email)!=null?n:(a=this.apiClient.crossmint.experimental_customAuth)==null?void 0:a.email;if(o==null)throw new Error("Email is required to create a wallet with email signer");if(e!=="solana")throw new Error("Email signer is only supported for Solana wallets");return{type:"solana-keypair",address:yield _chunkABD3Q57Mcjs.a.pregenerateSigner(o,this.apiClient.crossmint)}}throw new Error("Invalid signer type")})}validateWalletConfig(e,t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(t.owner!=null&&e.linkedUser!=null&&t.owner!==e.linkedUser)throw new (0, _chunkCT2UGJELcjs.f)("Wallet owner does not match existing wallet's linked user");if(e.type!=="solana-smart-wallet"&&e.type!=="evm-smart-wallet")return;let i=yield this.toExternalSignerConfig(t.chain,t.signer,e),a=e.config.adminSigner;if(i&&a){if(i.type!==a.type)throw new (0, _chunkCT2UGJELcjs.f)("The wallet signer type provided in the wallet config does not match the existing wallet's adminSigner type");_chunkRD5PG4M6cjs.a.call(void 0, i,a)}})}};exports.a = f;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXALFCQKDcjs = require('./chunk-XALFCQKD.cjs');var _clientsdkwindow = require('@crossmint/client-sdk-window');var _clientsigners = require('@crossmint/client-signers');var i=class{constructor(n){this.config=n;this.handshakeParent=null}initialize(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){if(this.handshakeParent)return this.handshakeParent;let n=new URL(_clientsigners.environmentUrlConfig[this.config.environment]),e=yield this.createInvisibleIFrame(n.toString());return this.handshakeParent=yield _clientsdkwindow.IFrameWindow.init(e,{targetOrigin:n.origin,incomingEvents:_clientsigners.signerOutboundEvents,outgoingEvents:_clientsigners.signerInboundEvents}),yield this.handshakeParent.handshakeWithChild(),this.handshakeParent})}createInvisibleIFrame(n){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let e=document.createElement("iframe");return e.src=n,Object.assign(e.style,{position:"absolute",opacity:"0",pointerEvents:"none",width:"0",height:"0",border:"none",top:"-9999px",left:"-9999px"}),new Promise((r,o)=>{e.onload=()=>r(e),e.onerror=()=>o(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};exports.a = i;
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk33ZMLROFcjs = require('./chunk-33ZMLROF.cjs');var _chunkQK3HMP6Hcjs = require('./chunk-QK3HMP6H.cjs');require('./chunk-MHKWLGN5.cjs');var _chunkMSKWNMPVcjs = require('./chunk-MSKWNMPV.cjs');var _chunkJKPTRQD2cjs = require('./chunk-JKPTRQD2.cjs');var _chunkPSBX4PZWcjs = require('./chunk-PSBX4PZW.cjs');require('./chunk-GVFGQUCO.cjs');require('./chunk-W5TFNIA7.cjs');require('./chunk-XLWK4XHD.cjs');require('./chunk-3ZKXOCI7.cjs');require('./chunk-WFS45YN4.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-EXGOZRL3.cjs');require('./chunk-5HTPBFDH.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.AuthRejectedError = _chunkZSWIQU3Ucjs.a; exports.CrossmintWallets = _chunkMSKWNMPVcjs.b; exports.EVMWallet = _chunk33ZMLROFcjs.a; exports.InvalidApiKeyError = _chunkCT2UGJELcjs.a; exports.InvalidEnvironmentError = _chunkCT2UGJELcjs.b; exports.InvalidMessageFormatError = _chunkCT2UGJELcjs.j; exports.InvalidSignerError = _chunkCT2UGJELcjs.i; exports.InvalidTypedDataError = _chunkCT2UGJELcjs.k; exports.InvalidWalletConfigError = _chunkCT2UGJELcjs.e; exports.MessageSigningNotSupportedError = _chunkCT2UGJELcjs.n; exports.PendingApprovalsError = _chunkCT2UGJELcjs.x; exports.SignatureNotAvailableError = _chunkCT2UGJELcjs.p; exports.SignatureNotCreatedError = _chunkCT2UGJELcjs.o; exports.SignatureNotFoundError = _chunkCT2UGJELcjs.l; exports.SignerTypeMismatchError = _chunkCT2UGJELcjs.h; exports.SigningFailedError = _chunkCT2UGJELcjs.m; exports.SolanaWallet = _chunkQK3HMP6Hcjs.a; exports.TransactionAwaitingApprovalError = _chunkCT2UGJELcjs.u; exports.TransactionConfirmationTimeoutError = _chunkCT2UGJELcjs.s; exports.TransactionFailedError = _chunkCT2UGJELcjs.w; exports.TransactionHashNotFoundError = _chunkCT2UGJELcjs.v; exports.TransactionNotAvailableError = _chunkCT2UGJELcjs.r; exports.TransactionNotCreatedError = _chunkCT2UGJELcjs.q; exports.TransactionSendingFailedError = _chunkCT2UGJELcjs.t; exports.Wallet = _chunkPSBX4PZWcjs.a; exports.WalletCreationError = _chunkCT2UGJELcjs.f; exports.WalletFactory = _chunkJKPTRQD2cjs.a; exports.WalletNotAvailableError = _chunkCT2UGJELcjs.d; exports.WalletTypeMismatchError = _chunkCT2UGJELcjs.g; exports.WalletTypeNotSupportedError = _chunkCT2UGJELcjs.c; exports.createCrossmint = _chunkMSKWNMPVcjs.a; exports.toViemChain = _chunk6VJEBYPNcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGNI2JNVIcjs = require('./chunk-GNI2JNVI.cjs');var _chunkBUB34V2Pcjs = require('./chunk-BUB34V2P.cjs');require('./chunk-MHKWLGN5.cjs');var _chunkKEVMJO4Pcjs = require('./chunk-KEVMJO4P.cjs');var _chunkZJRFG7PBcjs = require('./chunk-ZJRFG7PB.cjs');var _chunkVSHF63LPcjs = require('./chunk-VSHF63LP.cjs');require('./chunk-44GZ6TWG.cjs');require('./chunk-W5TFNIA7.cjs');require('./chunk-ABD3Q57M.cjs');require('./chunk-ZWDS66FS.cjs');require('./chunk-C2K2QZZB.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');var _chunkZSWIQU3Ucjs = require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-RNCCI6CR.cjs');require('./chunk-6HV5TEO3.cjs');var _chunkCT2UGJELcjs = require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');var _chunk6VJEBYPNcjs = require('./chunk-6VJEBYPN.cjs');require('./chunk-IR5WN6FQ.cjs');require('./chunk-GEY574TH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.AuthRejectedError = _chunkZSWIQU3Ucjs.a; exports.CrossmintWallets = _chunkKEVMJO4Pcjs.b; exports.EVMWallet = _chunkGNI2JNVIcjs.a; exports.InvalidApiKeyError = _chunkCT2UGJELcjs.a; exports.InvalidEnvironmentError = _chunkCT2UGJELcjs.b; exports.InvalidMessageFormatError = _chunkCT2UGJELcjs.j; exports.InvalidSignerError = _chunkCT2UGJELcjs.i; exports.InvalidTypedDataError = _chunkCT2UGJELcjs.k; exports.InvalidWalletConfigError = _chunkCT2UGJELcjs.e; exports.MessageSigningNotSupportedError = _chunkCT2UGJELcjs.n; exports.PendingApprovalsError = _chunkCT2UGJELcjs.x; exports.SignatureNotAvailableError = _chunkCT2UGJELcjs.p; exports.SignatureNotCreatedError = _chunkCT2UGJELcjs.o; exports.SignatureNotFoundError = _chunkCT2UGJELcjs.l; exports.SignerTypeMismatchError = _chunkCT2UGJELcjs.h; exports.SigningFailedError = _chunkCT2UGJELcjs.m; exports.SolanaWallet = _chunkBUB34V2Pcjs.a; exports.TransactionAwaitingApprovalError = _chunkCT2UGJELcjs.u; exports.TransactionConfirmationTimeoutError = _chunkCT2UGJELcjs.s; exports.TransactionFailedError = _chunkCT2UGJELcjs.w; exports.TransactionHashNotFoundError = _chunkCT2UGJELcjs.v; exports.TransactionNotAvailableError = _chunkCT2UGJELcjs.r; exports.TransactionNotCreatedError = _chunkCT2UGJELcjs.q; exports.TransactionSendingFailedError = _chunkCT2UGJELcjs.t; exports.Wallet = _chunkVSHF63LPcjs.a; exports.WalletCreationError = _chunkCT2UGJELcjs.f; exports.WalletFactory = _chunkZJRFG7PBcjs.a; exports.WalletNotAvailableError = _chunkCT2UGJELcjs.d; exports.WalletTypeMismatchError = _chunkCT2UGJELcjs.g; exports.WalletTypeNotSupportedError = _chunkCT2UGJELcjs.c; exports.createCrossmint = _chunkKEVMJO4Pcjs.a; exports.toViemChain = _chunk6VJEBYPNcjs.a;
package/dist/index.d.cts CHANGED
@@ -1,14 +1,14 @@
1
1
  export { CrossmintWallets } from './sdk.cjs';
2
2
  export { InvalidApiKeyError, InvalidEnvironmentError, InvalidMessageFormatError, InvalidSignerError, InvalidTypedDataError, InvalidWalletConfigError, MessageSigningNotSupportedError, PendingApprovalsError, SignatureNotAvailableError, SignatureNotCreatedError, SignatureNotFoundError, SignerTypeMismatchError, SigningFailedError, TransactionAwaitingApprovalError, TransactionConfirmationTimeoutError, TransactionFailedError, TransactionHashNotFoundError, TransactionNotAvailableError, TransactionNotCreatedError, TransactionSendingFailedError, WalletCreationError, WalletError, WalletNotAvailableError, WalletTypeMismatchError, WalletTypeNotSupportedError } from './utils/errors.cjs';
3
- export { UserLocator, Wallet } from './wallets/wallet.cjs';
3
+ export { Wallet } from './wallets/wallet.cjs';
4
4
  export { WalletArgsFor, WalletFactory } from './wallets/wallet-factory.cjs';
5
5
  export { SolanaWallet } from './wallets/solana.cjs';
6
6
  export { EVMWallet } from './wallets/evm.cjs';
7
- export { Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, WalletOptions } from './wallets/types.cjs';
7
+ export { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions } from './wallets/types.cjs';
8
8
  export { Chain, EVMChain, EVMSmartWalletChain, EVMSmartWalletMainnet, EVMSmartWalletTestnet, SolanaChain, toViemChain } from './chains/chains.cjs';
9
9
  export { ApiKeyInternalSignerConfig, ApiKeySignerConfig, AuthRejectedError, BaseSignResult, BaseSignerConfig, EmailInternalSignerConfig, EmailSignerConfig, ExternalWalletInternalSignerConfig, ExternalWalletSignerConfigForChain, InternalSignerConfig, PasskeyInternalSignerConfig, PasskeySignResult, PasskeySignerConfig, Signer, SignerConfigForChain } from './signers/types.cjs';
10
10
  export { Crossmint, EvmExternalWalletSignerConfig, GenericEIP1193Provider, SolanaExternalWalletSignerConfig, createCrossmint } from '@crossmint/common-sdk-base';
11
- export { Activity, Balances } from './api/types.cjs';
11
+ export { Activity } from './api/types.cjs';
12
12
  import './api/gen/types.gen.cjs';
13
13
  import './api/client.cjs';
14
14
  import 'viem/_types/actions/siwe/verifySiweMessage';
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
1
  export { CrossmintWallets } from './sdk.js';
2
2
  export { InvalidApiKeyError, InvalidEnvironmentError, InvalidMessageFormatError, InvalidSignerError, InvalidTypedDataError, InvalidWalletConfigError, MessageSigningNotSupportedError, PendingApprovalsError, SignatureNotAvailableError, SignatureNotCreatedError, SignatureNotFoundError, SignerTypeMismatchError, SigningFailedError, TransactionAwaitingApprovalError, TransactionConfirmationTimeoutError, TransactionFailedError, TransactionHashNotFoundError, TransactionNotAvailableError, TransactionNotCreatedError, TransactionSendingFailedError, WalletCreationError, WalletError, WalletNotAvailableError, WalletTypeMismatchError, WalletTypeNotSupportedError } from './utils/errors.js';
3
- export { UserLocator, Wallet } from './wallets/wallet.js';
3
+ export { Wallet } from './wallets/wallet.js';
4
4
  export { WalletArgsFor, WalletFactory } from './wallets/wallet-factory.js';
5
5
  export { SolanaWallet } from './wallets/solana.js';
6
6
  export { EVMWallet } from './wallets/evm.js';
7
- export { Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, WalletOptions } from './wallets/types.js';
7
+ export { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions } from './wallets/types.js';
8
8
  export { Chain, EVMChain, EVMSmartWalletChain, EVMSmartWalletMainnet, EVMSmartWalletTestnet, SolanaChain, toViemChain } from './chains/chains.js';
9
9
  export { ApiKeyInternalSignerConfig, ApiKeySignerConfig, AuthRejectedError, BaseSignResult, BaseSignerConfig, EmailInternalSignerConfig, EmailSignerConfig, ExternalWalletInternalSignerConfig, ExternalWalletSignerConfigForChain, InternalSignerConfig, PasskeyInternalSignerConfig, PasskeySignResult, PasskeySignerConfig, Signer, SignerConfigForChain } from './signers/types.js';
10
10
  export { Crossmint, EvmExternalWalletSignerConfig, GenericEIP1193Provider, SolanaExternalWalletSignerConfig, createCrossmint } from '@crossmint/common-sdk-base';
11
- export { Activity, Balances } from './api/types.js';
11
+ export { Activity } from './api/types.js';
12
12
  import './api/gen/types.gen.js';
13
13
  import './api/client.js';
14
14
  import 'viem/_types/actions/siwe/verifySiweMessage';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as F}from"./chunk-DXPZTNTR.js";import{a as D}from"./chunk-IIS42MVC.js";import"./chunk-PJUVPRKB.js";import{a as B,b as C}from"./chunk-NIEQGTTW.js";import{a as A}from"./chunk-37FBC6CT.js";import{a as y}from"./chunk-YHRRQBIE.js";import"./chunk-QTZTCEUF.js";import"./chunk-3W44OI5M.js";import"./chunk-VBWFY7JR.js";import"./chunk-U34BYZY2.js";import"./chunk-OGGPNJY3.js";import"./chunk-OV4CFQ36.js";import"./chunk-77QBSFHG.js";import"./chunk-T3ICQDFS.js";import{a as z}from"./chunk-M4ELAV7U.js";import"./chunk-FUUYGB4K.js";import"./chunk-5IFDVB4Y.js";import"./chunk-VELN4PVT.js";import"./chunk-3D5RTPTJ.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w}from"./chunk-7ENJXL4H.js";import"./chunk-KBJA7JDT.js";import{a as E}from"./chunk-BJDS5BJG.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-2KK65AC6.js";import"./chunk-QTSZSHKK.js";import"./chunk-BW7YYVZE.js";export{z as AuthRejectedError,C as CrossmintWallets,F as EVMWallet,o as InvalidApiKeyError,r as InvalidEnvironmentError,b as InvalidMessageFormatError,a as InvalidSignerError,c as InvalidTypedDataError,m as InvalidWalletConfigError,h as MessageSigningNotSupportedError,w as PendingApprovalsError,j as SignatureNotAvailableError,i as SignatureNotCreatedError,d as SignatureNotFoundError,x as SignerTypeMismatchError,g as SigningFailedError,D as SolanaWallet,s as TransactionAwaitingApprovalError,n as TransactionConfirmationTimeoutError,v as TransactionFailedError,u as TransactionHashNotFoundError,l as TransactionNotAvailableError,k as TransactionNotCreatedError,q as TransactionSendingFailedError,y as Wallet,p as WalletCreationError,A as WalletFactory,f as WalletNotAvailableError,t as WalletTypeMismatchError,e as WalletTypeNotSupportedError,B as createCrossmint,E as toViemChain};
1
+ import{a as F}from"./chunk-FXFKLSZ7.js";import{a as D}from"./chunk-GJUCYEZA.js";import"./chunk-PJUVPRKB.js";import{a as B,b as C}from"./chunk-WYVJPVOC.js";import{a as A}from"./chunk-WASEZVMN.js";import{a as y}from"./chunk-OOY3KFP2.js";import"./chunk-LEKM6PTO.js";import"./chunk-3W44OI5M.js";import"./chunk-VRQFPB2Y.js";import"./chunk-PDL3XF5M.js";import"./chunk-7M4G23OP.js";import"./chunk-OV4CFQ36.js";import"./chunk-77QBSFHG.js";import"./chunk-T3ICQDFS.js";import{a as z}from"./chunk-M4ELAV7U.js";import"./chunk-FUUYGB4K.js";import"./chunk-5IFDVB4Y.js";import"./chunk-BYEJFR3H.js";import"./chunk-CCI4HX3K.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a,j as b,k as c,l as d,m as g,n as h,o as i,p as j,q as k,r as l,s as n,t as q,u as s,v as u,w as v,x as w}from"./chunk-7ENJXL4H.js";import"./chunk-KBJA7JDT.js";import{a as E}from"./chunk-BJDS5BJG.js";import"./chunk-KKQBZXFE.js";import"./chunk-S3DYQVRD.js";import"./chunk-2KK65AC6.js";import"./chunk-QTSZSHKK.js";import"./chunk-BW7YYVZE.js";export{z as AuthRejectedError,C as CrossmintWallets,F as EVMWallet,o as InvalidApiKeyError,r as InvalidEnvironmentError,b as InvalidMessageFormatError,a as InvalidSignerError,c as InvalidTypedDataError,m as InvalidWalletConfigError,h as MessageSigningNotSupportedError,w as PendingApprovalsError,j as SignatureNotAvailableError,i as SignatureNotCreatedError,d as SignatureNotFoundError,x as SignerTypeMismatchError,g as SigningFailedError,D as SolanaWallet,s as TransactionAwaitingApprovalError,n as TransactionConfirmationTimeoutError,v as TransactionFailedError,u as TransactionHashNotFoundError,l as TransactionNotAvailableError,k as TransactionNotCreatedError,q as TransactionSendingFailedError,y as Wallet,p as WalletCreationError,A as WalletFactory,f as WalletNotAvailableError,t as WalletTypeMismatchError,e as WalletTypeNotSupportedError,B as createCrossmint,E as toViemChain};
package/dist/sdk.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMSKWNMPVcjs = require('./chunk-MSKWNMPV.cjs');require('./chunk-JKPTRQD2.cjs');require('./chunk-PSBX4PZW.cjs');require('./chunk-GVFGQUCO.cjs');require('./chunk-W5TFNIA7.cjs');require('./chunk-XLWK4XHD.cjs');require('./chunk-3ZKXOCI7.cjs');require('./chunk-WFS45YN4.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-EXGOZRL3.cjs');require('./chunk-5HTPBFDH.cjs');require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkMSKWNMPVcjs.b; exports.createCrossmint = _chunkMSKWNMPVcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKEVMJO4Pcjs = require('./chunk-KEVMJO4P.cjs');require('./chunk-ZJRFG7PB.cjs');require('./chunk-VSHF63LP.cjs');require('./chunk-44GZ6TWG.cjs');require('./chunk-W5TFNIA7.cjs');require('./chunk-ABD3Q57M.cjs');require('./chunk-ZWDS66FS.cjs');require('./chunk-C2K2QZZB.cjs');require('./chunk-DYRSQN7X.cjs');require('./chunk-NVJN7LPY.cjs');require('./chunk-AFYBD7FI.cjs');require('./chunk-ZSWIQU3U.cjs');require('./chunk-RD5PG4M6.cjs');require('./chunk-6HXIZLEQ.cjs');require('./chunk-RNCCI6CR.cjs');require('./chunk-6HV5TEO3.cjs');require('./chunk-CT2UGJEL.cjs');require('./chunk-ECAM5KTH.cjs');require('./chunk-YO6BJ2DI.cjs');require('./chunk-DIZVZP5P.cjs');require('./chunk-XALFCQKD.cjs');exports.CrossmintWallets = _chunkKEVMJO4Pcjs.b; exports.createCrossmint = _chunkKEVMJO4Pcjs.a;
package/dist/sdk.js CHANGED
@@ -1 +1 @@
1
- import{a,b}from"./chunk-NIEQGTTW.js";import"./chunk-37FBC6CT.js";import"./chunk-YHRRQBIE.js";import"./chunk-QTZTCEUF.js";import"./chunk-3W44OI5M.js";import"./chunk-VBWFY7JR.js";import"./chunk-U34BYZY2.js";import"./chunk-OGGPNJY3.js";import"./chunk-OV4CFQ36.js";import"./chunk-77QBSFHG.js";import"./chunk-T3ICQDFS.js";import"./chunk-M4ELAV7U.js";import"./chunk-FUUYGB4K.js";import"./chunk-5IFDVB4Y.js";import"./chunk-VELN4PVT.js";import"./chunk-3D5RTPTJ.js";import"./chunk-7ENJXL4H.js";import"./chunk-KBJA7JDT.js";import"./chunk-2KK65AC6.js";import"./chunk-QTSZSHKK.js";import"./chunk-BW7YYVZE.js";export{b as CrossmintWallets,a as createCrossmint};
1
+ import{a,b}from"./chunk-WYVJPVOC.js";import"./chunk-WASEZVMN.js";import"./chunk-OOY3KFP2.js";import"./chunk-LEKM6PTO.js";import"./chunk-3W44OI5M.js";import"./chunk-VRQFPB2Y.js";import"./chunk-PDL3XF5M.js";import"./chunk-7M4G23OP.js";import"./chunk-OV4CFQ36.js";import"./chunk-77QBSFHG.js";import"./chunk-T3ICQDFS.js";import"./chunk-M4ELAV7U.js";import"./chunk-FUUYGB4K.js";import"./chunk-5IFDVB4Y.js";import"./chunk-BYEJFR3H.js";import"./chunk-CCI4HX3K.js";import"./chunk-7ENJXL4H.js";import"./chunk-KBJA7JDT.js";import"./chunk-2KK65AC6.js";import"./chunk-QTSZSHKK.js";import"./chunk-BW7YYVZE.js";export{b as CrossmintWallets,a as createCrossmint};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3ZKXOCI7cjs = require('../../chunk-3ZKXOCI7.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailIframeManager = _chunk3ZKXOCI7cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZWDS66FScjs = require('../../chunk-ZWDS66FS.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailIframeManager = _chunkZWDS66FScjs.a;
@@ -1,8 +1,9 @@
1
1
  import { HandshakeParent } from '@crossmint/client-sdk-window';
2
2
  import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
3
+ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
3
4
 
4
5
  type IframeConfig = {
5
- environment: string;
6
+ environment: APIKeyEnvironmentPrefix;
6
7
  };
7
8
  declare class EmailIframeManager {
8
9
  private config;
@@ -1,8 +1,9 @@
1
1
  import { HandshakeParent } from '@crossmint/client-sdk-window';
2
2
  import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
3
+ import { APIKeyEnvironmentPrefix } from '@crossmint/common-sdk-base';
3
4
 
4
5
  type IframeConfig = {
5
- environment: string;
6
+ environment: APIKeyEnvironmentPrefix;
6
7
  };
7
8
  declare class EmailIframeManager {
8
9
  private config;
@@ -1 +1 @@
1
- import{a}from"../../chunk-U34BYZY2.js";import"../../chunk-BW7YYVZE.js";export{a as EmailIframeManager};
1
+ import{a}from"../../chunk-PDL3XF5M.js";import"../../chunk-BW7YYVZE.js";export{a as EmailIframeManager};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWFS45YN4cjs = require('../../chunk-WFS45YN4.cjs');require('../../chunk-5HTPBFDH.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSignerApiClient = _chunkWFS45YN4cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkC2K2QZZBcjs = require('../../chunk-C2K2QZZB.cjs');require('../../chunk-6HV5TEO3.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSignerApiClient = _chunkC2K2QZZBcjs.a;
@@ -1 +1 @@
1
- import{a}from"../../chunk-OGGPNJY3.js";import"../../chunk-3D5RTPTJ.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSignerApiClient};
1
+ import{a}from"../../chunk-7M4G23OP.js";import"../../chunk-CCI4HX3K.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSignerApiClient};