@crossmint/wallets-sdk 0.10.0 → 0.10.1

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-NIEQGTTW.js → chunk-5YBA6OMB.js} +1 -1
  12. package/dist/{chunk-JKPTRQD2.cjs → chunk-6DC2ZKQS.cjs} +1 -1
  13. package/dist/chunk-6TBWSRGC.cjs +1 -0
  14. package/dist/{chunk-VBWFY7JR.js → chunk-6XMHUB2S.js} +1 -1
  15. package/dist/{chunk-GVFGQUCO.cjs → chunk-7LO5OKBZ.cjs} +1 -1
  16. package/dist/{chunk-MSKWNMPV.cjs → chunk-AAUYKB26.cjs} +1 -1
  17. package/dist/{chunk-5HTPBFDH.cjs → chunk-CRQ3CJEJ.cjs} +1 -1
  18. package/dist/{chunk-WFS45YN4.cjs → chunk-DTUVYDGJ.cjs} +1 -1
  19. package/dist/{chunk-EXGOZRL3.cjs → chunk-DWD4LQ5M.cjs} +1 -1
  20. package/dist/chunk-EHJBOM3P.js +1 -0
  21. package/dist/{chunk-VELN4PVT.js → chunk-FRTRIBDB.js} +1 -1
  22. package/dist/{chunk-DXPZTNTR.js → chunk-JW4BIROC.js} +1 -1
  23. package/dist/{chunk-OGGPNJY3.js → chunk-KVCFU4WS.js} +1 -1
  24. package/dist/{chunk-33ZMLROF.cjs → chunk-KZHAPWJW.cjs} +1 -1
  25. package/dist/{chunk-37FBC6CT.js → chunk-M6N7GTZQ.js} +1 -1
  26. package/dist/chunk-PDL3XF5M.js +1 -0
  27. package/dist/chunk-RENRYAET.js +1 -0
  28. package/dist/chunk-TFNFVJ4T.js +1 -0
  29. package/dist/{chunk-XLWK4XHD.cjs → chunk-TZEOWFDT.cjs} +1 -1
  30. package/dist/{chunk-QTZTCEUF.js → chunk-WOEOIU7C.js} +1 -1
  31. package/dist/chunk-WZU4XAJU.cjs +1 -0
  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 +3 -3
  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 _chunkXLWK4XHDcjs = require('../../chunk-XLWK4XHD.cjs');require('../../chunk-3ZKXOCI7.cjs');require('../../chunk-WFS45YN4.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-5HTPBFDH.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSigner = _chunkXLWK4XHDcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTZEOWFDTcjs = require('../../chunk-TZEOWFDT.cjs');require('../../chunk-ZWDS66FS.cjs');require('../../chunk-DTUVYDGJ.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-CRQ3CJEJ.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSigner = _chunkTZEOWFDTcjs.a;
@@ -1 +1 @@
1
- import{a}from"../../chunk-VBWFY7JR.js";import"../../chunk-U34BYZY2.js";import"../../chunk-OGGPNJY3.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-3D5RTPTJ.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSigner};
1
+ import{a}from"../../chunk-6XMHUB2S.js";import"../../chunk-PDL3XF5M.js";import"../../chunk-KVCFU4WS.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-EHJBOM3P.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-W5TFNIA7.cjs');var _chunkXLWK4XHDcjs = require('../../chunk-XLWK4XHD.cjs');require('../../chunk-3ZKXOCI7.cjs');require('../../chunk-WFS45YN4.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-5HTPBFDH.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSigner = _chunkXLWK4XHDcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-W5TFNIA7.cjs');var _chunkTZEOWFDTcjs = require('../../chunk-TZEOWFDT.cjs');require('../../chunk-ZWDS66FS.cjs');require('../../chunk-DTUVYDGJ.cjs');require('../../chunk-ZSWIQU3U.cjs');require('../../chunk-CRQ3CJEJ.cjs');require('../../chunk-CT2UGJEL.cjs');require('../../chunk-XALFCQKD.cjs');exports.EmailSigner = _chunkTZEOWFDTcjs.a;
@@ -1 +1 @@
1
- import"../../chunk-3W44OI5M.js";import{a}from"../../chunk-VBWFY7JR.js";import"../../chunk-U34BYZY2.js";import"../../chunk-OGGPNJY3.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-3D5RTPTJ.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSigner};
1
+ import"../../chunk-3W44OI5M.js";import{a}from"../../chunk-6XMHUB2S.js";import"../../chunk-PDL3XF5M.js";import"../../chunk-KVCFU4WS.js";import"../../chunk-M4ELAV7U.js";import"../../chunk-EHJBOM3P.js";import"../../chunk-7ENJXL4H.js";import"../../chunk-BW7YYVZE.js";export{a as EmailSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGVFGQUCOcjs = 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-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.assembleSigner = _chunkGVFGQUCOcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7LO5OKBZcjs = require('../chunk-7LO5OKBZ.cjs');require('../chunk-W5TFNIA7.cjs');require('../chunk-TZEOWFDT.cjs');require('../chunk-ZWDS66FS.cjs');require('../chunk-DTUVYDGJ.cjs');require('../chunk-DYRSQN7X.cjs');require('../chunk-NVJN7LPY.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-CRQ3CJEJ.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.assembleSigner = _chunk7LO5OKBZcjs.a;
@@ -1 +1 @@
1
- import{a}from"../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-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.js";import"../chunk-BW7YYVZE.js";export{a as assembleSigner};
1
+ import{a}from"../chunk-WOEOIU7C.js";import"../chunk-3W44OI5M.js";import"../chunk-6XMHUB2S.js";import"../chunk-PDL3XF5M.js";import"../chunk-KVCFU4WS.js";import"../chunk-OV4CFQ36.js";import"../chunk-77QBSFHG.js";import"../chunk-T3ICQDFS.js";import"../chunk-M4ELAV7U.js";import"../chunk-EHJBOM3P.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.js";import"../chunk-BW7YYVZE.js";export{a as assembleSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5HTPBFDHcjs = require('../chunk-5HTPBFDH.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunk5HTPBFDHcjs.c; exports.SDK_VERSION = _chunk5HTPBFDHcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunk5HTPBFDHcjs.d; exports.WALLETS_SERVICE = _chunk5HTPBFDHcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCRQ3CJEJcjs = require('../chunk-CRQ3CJEJ.cjs');require('../chunk-XALFCQKD.cjs');exports.SDK_NAME = _chunkCRQ3CJEJcjs.c; exports.SDK_VERSION = _chunkCRQ3CJEJcjs.b; exports.STATUS_POLLING_INTERVAL_MS = _chunkCRQ3CJEJcjs.d; exports.WALLETS_SERVICE = _chunkCRQ3CJEJcjs.a;
@@ -1 +1 @@
1
- import{a,b,c,d}from"../chunk-3D5RTPTJ.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
1
+ import{a,b,c,d}from"../chunk-EHJBOM3P.js";import"../chunk-BW7YYVZE.js";export{c as SDK_NAME,b as SDK_VERSION,d as STATUS_POLLING_INTERVAL_MS,a as WALLETS_SERVICE};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk33ZMLROFcjs = require('../chunk-33ZMLROF.cjs');require('../chunk-PSBX4PZW.cjs');require('../chunk-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-6VJEBYPN.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunk33ZMLROFcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKZHAPWJWcjs = require('../chunk-KZHAPWJW.cjs');require('../chunk-WZU4XAJU.cjs');require('../chunk-CRQ3CJEJ.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-6VJEBYPN.cjs');require('../chunk-IR5WN6FQ.cjs');require('../chunk-GEY574TH.cjs');require('../chunk-XALFCQKD.cjs');exports.EVMWallet = _chunkKZHAPWJWcjs.a;
@@ -4,7 +4,7 @@ import * as viem__types_actions_public_simulateBlocks from 'viem/_types/actions/
4
4
  import * as viem__types_actions_public_createAccessList from 'viem/_types/actions/public/createAccessList';
5
5
  import * as viem from 'viem';
6
6
  import { TypedData, TypedDataDefinition, HttpTransport } from 'viem';
7
- import { EVMTransactionInput } from './types.cjs';
7
+ import { EVMTransactionInput, Transaction } from './types.cjs';
8
8
  import { EVMChain, EVMSmartWalletChain } from '../chains/chains.cjs';
9
9
  import { Wallet } from './wallet.cjs';
10
10
  import '@solana/web3.js';
@@ -20,7 +20,7 @@ import '../api/client.cjs';
20
20
  declare class EVMWallet extends Wallet<EVMChain> {
21
21
  constructor(wallet: Wallet<EVMChain>);
22
22
  static from(wallet: Wallet<EVMChain>): EVMWallet;
23
- sendTransaction(params: EVMTransactionInput): Promise<string>;
23
+ sendTransaction(params: EVMTransactionInput): Promise<Transaction>;
24
24
  signMessage(message: string): Promise<string>;
25
25
  createTypedDataSignature<const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(params: TypedDataDefinition<typedData, primaryType> & {
26
26
  chain: EVMSmartWalletChain;
@@ -4,7 +4,7 @@ import * as viem__types_actions_public_simulateBlocks from 'viem/_types/actions/
4
4
  import * as viem__types_actions_public_createAccessList from 'viem/_types/actions/public/createAccessList';
5
5
  import * as viem from 'viem';
6
6
  import { TypedData, TypedDataDefinition, HttpTransport } from 'viem';
7
- import { EVMTransactionInput } from './types.js';
7
+ import { EVMTransactionInput, Transaction } from './types.js';
8
8
  import { EVMChain, EVMSmartWalletChain } from '../chains/chains.js';
9
9
  import { Wallet } from './wallet.js';
10
10
  import '@solana/web3.js';
@@ -20,7 +20,7 @@ import '../api/client.js';
20
20
  declare class EVMWallet extends Wallet<EVMChain> {
21
21
  constructor(wallet: Wallet<EVMChain>);
22
22
  static from(wallet: Wallet<EVMChain>): EVMWallet;
23
- sendTransaction(params: EVMTransactionInput): Promise<string>;
23
+ sendTransaction(params: EVMTransactionInput): Promise<Transaction>;
24
24
  signMessage(message: string): Promise<string>;
25
25
  createTypedDataSignature<const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(params: TypedDataDefinition<typedData, primaryType> & {
26
26
  chain: EVMSmartWalletChain;
@@ -1 +1 @@
1
- import{a}from"../chunk-DXPZTNTR.js";import"../chunk-YHRRQBIE.js";import"../chunk-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-BJDS5BJG.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
1
+ import{a}from"../chunk-JW4BIROC.js";import"../chunk-TFNFVJ4T.js";import"../chunk-EHJBOM3P.js";import"../chunk-7ENJXL4H.js";import"../chunk-BJDS5BJG.js";import"../chunk-KKQBZXFE.js";import"../chunk-S3DYQVRD.js";import"../chunk-BW7YYVZE.js";export{a as EVMWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQK3HMP6Hcjs = require('../chunk-QK3HMP6H.cjs');require('../chunk-PSBX4PZW.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunkQK3HMP6Hcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6TBWSRGCcjs = require('../chunk-6TBWSRGC.cjs');require('../chunk-WZU4XAJU.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-CRQ3CJEJ.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.SolanaWallet = _chunk6TBWSRGCcjs.a;
@@ -1,5 +1,5 @@
1
1
  import { SolanaChain } from '../chains/chains.cjs';
2
- import { SolanaTransactionInput } from './types.cjs';
2
+ import { SolanaTransactionInput, Transaction } from './types.cjs';
3
3
  import { Wallet } from './wallet.cjs';
4
4
  import 'viem';
5
5
  import '@solana/web3.js';
@@ -15,7 +15,7 @@ import '../api/client.cjs';
15
15
  declare class SolanaWallet extends Wallet<SolanaChain> {
16
16
  constructor(wallet: Wallet<SolanaChain>);
17
17
  static from(wallet: Wallet<SolanaChain>): SolanaWallet;
18
- sendTransaction({ transaction, additionalSigners }: SolanaTransactionInput): Promise<string>;
18
+ sendTransaction({ transaction, additionalSigners }: SolanaTransactionInput): Promise<Transaction>;
19
19
  }
20
20
 
21
21
  export { SolanaWallet };
@@ -1,5 +1,5 @@
1
1
  import { SolanaChain } from '../chains/chains.js';
2
- import { SolanaTransactionInput } from './types.js';
2
+ import { SolanaTransactionInput, Transaction } from './types.js';
3
3
  import { Wallet } from './wallet.js';
4
4
  import 'viem';
5
5
  import '@solana/web3.js';
@@ -15,7 +15,7 @@ import '../api/client.js';
15
15
  declare class SolanaWallet extends Wallet<SolanaChain> {
16
16
  constructor(wallet: Wallet<SolanaChain>);
17
17
  static from(wallet: Wallet<SolanaChain>): SolanaWallet;
18
- sendTransaction({ transaction, additionalSigners }: SolanaTransactionInput): Promise<string>;
18
+ sendTransaction({ transaction, additionalSigners }: SolanaTransactionInput): Promise<Transaction>;
19
19
  }
20
20
 
21
21
  export { SolanaWallet };
@@ -1 +1 @@
1
- import{a}from"../chunk-IIS42MVC.js";import"../chunk-YHRRQBIE.js";import"../chunk-T3ICQDFS.js";import"../chunk-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
1
+ import{a}from"../chunk-RENRYAET.js";import"../chunk-TFNFVJ4T.js";import"../chunk-T3ICQDFS.js";import"../chunk-EHJBOM3P.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as SolanaWallet};
@@ -1,6 +1,6 @@
1
1
  import { VersionedTransaction, Keypair } from '@solana/web3.js';
2
2
  import { CreateTransactionSuccessResponse } from '../api/types.cjs';
3
- export { Activity, Balances } from '../api/types.cjs';
3
+ export { Activity } from '../api/types.cjs';
4
4
  import { EVMSmartWalletChain } from '../chains/chains.cjs';
5
5
  import 'viem';
6
6
  import '../api/gen/types.gen.cjs';
@@ -26,5 +26,33 @@ type Callbacks = {
26
26
  type WalletOptions = {
27
27
  experimental_callbacks?: Callbacks;
28
28
  };
29
+ type TokenBalance = {
30
+ symbol: "SOL" | "ETH" | "USDC" | string;
31
+ name: string;
32
+ amount: string;
33
+ contractAddress?: string;
34
+ decimals?: number;
35
+ rawAmount?: string;
36
+ };
37
+ type Balances = {
38
+ nativeToken: TokenBalance;
39
+ usdc: TokenBalance;
40
+ tokens: TokenBalance[];
41
+ };
42
+ type UserLocator = {
43
+ email: string;
44
+ } | {
45
+ x: string;
46
+ } | {
47
+ twitter: string;
48
+ } | {
49
+ phone: string;
50
+ } | {
51
+ userId: string;
52
+ };
53
+ type Transaction = {
54
+ hash: string;
55
+ explorerLink: string;
56
+ };
29
57
 
30
- export type { Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, WalletOptions };
58
+ export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions };
@@ -1,6 +1,6 @@
1
1
  import { VersionedTransaction, Keypair } from '@solana/web3.js';
2
2
  import { CreateTransactionSuccessResponse } from '../api/types.js';
3
- export { Activity, Balances } from '../api/types.js';
3
+ export { Activity } from '../api/types.js';
4
4
  import { EVMSmartWalletChain } from '../chains/chains.js';
5
5
  import 'viem';
6
6
  import '../api/gen/types.gen.js';
@@ -26,5 +26,33 @@ type Callbacks = {
26
26
  type WalletOptions = {
27
27
  experimental_callbacks?: Callbacks;
28
28
  };
29
+ type TokenBalance = {
30
+ symbol: "SOL" | "ETH" | "USDC" | string;
31
+ name: string;
32
+ amount: string;
33
+ contractAddress?: string;
34
+ decimals?: number;
35
+ rawAmount?: string;
36
+ };
37
+ type Balances = {
38
+ nativeToken: TokenBalance;
39
+ usdc: TokenBalance;
40
+ tokens: TokenBalance[];
41
+ };
42
+ type UserLocator = {
43
+ email: string;
44
+ } | {
45
+ x: string;
46
+ } | {
47
+ twitter: string;
48
+ } | {
49
+ phone: string;
50
+ } | {
51
+ userId: string;
52
+ };
53
+ type Transaction = {
54
+ hash: string;
55
+ explorerLink: string;
56
+ };
29
57
 
30
- export type { Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, WalletOptions };
58
+ export type { Balances, Callbacks, DelegatedSigner, EVMTransactionInput, PendingApproval, SolanaTransactionInput, TokenBalance, Transaction, UserLocator, WalletOptions };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJKPTRQD2cjs = 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-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunkJKPTRQD2cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6DC2ZKQScjs = require('../chunk-6DC2ZKQS.cjs');require('../chunk-WZU4XAJU.cjs');require('../chunk-7LO5OKBZ.cjs');require('../chunk-W5TFNIA7.cjs');require('../chunk-TZEOWFDT.cjs');require('../chunk-ZWDS66FS.cjs');require('../chunk-DTUVYDGJ.cjs');require('../chunk-DYRSQN7X.cjs');require('../chunk-NVJN7LPY.cjs');require('../chunk-AFYBD7FI.cjs');require('../chunk-ZSWIQU3U.cjs');require('../chunk-RD5PG4M6.cjs');require('../chunk-CRQ3CJEJ.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-YO6BJ2DI.cjs');require('../chunk-DIZVZP5P.cjs');require('../chunk-XALFCQKD.cjs');exports.WalletFactory = _chunk6DC2ZKQScjs.a;
@@ -1 +1 @@
1
- import{a}from"../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-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
1
+ import{a}from"../chunk-M6N7GTZQ.js";import"../chunk-TFNFVJ4T.js";import"../chunk-WOEOIU7C.js";import"../chunk-3W44OI5M.js";import"../chunk-6XMHUB2S.js";import"../chunk-PDL3XF5M.js";import"../chunk-KVCFU4WS.js";import"../chunk-OV4CFQ36.js";import"../chunk-77QBSFHG.js";import"../chunk-T3ICQDFS.js";import"../chunk-M4ELAV7U.js";import"../chunk-FUUYGB4K.js";import"../chunk-EHJBOM3P.js";import"../chunk-7ENJXL4H.js";import"../chunk-2KK65AC6.js";import"../chunk-QTSZSHKK.js";import"../chunk-BW7YYVZE.js";export{a as WalletFactory};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPSBX4PZWcjs = require('../chunk-PSBX4PZW.cjs');require('../chunk-5HTPBFDH.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkPSBX4PZWcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkWZU4XAJUcjs = require('../chunk-WZU4XAJU.cjs');require('../chunk-CRQ3CJEJ.cjs');require('../chunk-CT2UGJEL.cjs');require('../chunk-XALFCQKD.cjs');exports.Wallet = _chunkWZU4XAJUcjs.a;
@@ -1,8 +1,8 @@
1
1
  import { Signer, PasskeySignResult, BaseSignResult } from '../signers/types.cjs';
2
2
  import { WalletsV1Alpha2TransactionResponseDto } from '../api/gen/types.gen.cjs';
3
3
  import { ApiClient } from '../api/client.cjs';
4
- import { Balances, GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.cjs';
5
- import { WalletOptions, DelegatedSigner, PendingApproval } from './types.cjs';
4
+ import { GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.cjs';
5
+ import { WalletOptions, Balances, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.cjs';
6
6
  import { Chain } from '../chains/chains.cjs';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -30,13 +30,18 @@ declare class Wallet<C extends Chain> {
30
30
  protected get apiClient(): ApiClient;
31
31
  protected get options(): WalletOptions | undefined;
32
32
  /**
33
- * Get the wallet balances
34
- * @param {string[]} params.tokens - The tokens
35
- * @param {Chain[]} params.chains - The chains (optional)
36
- * @returns {Promise<Balances>} The balances
33
+ * Get the wallet balances - always includes USDC and native token (ETH/SOL)
34
+ * @param {string[]} tokens - Additional tokens to request (optional: native token and usdc are always included)
35
+ * @param {Chain[]} chains - The chains (optional)
36
+ * @returns {Promise<Balances>} The balances structured as { nativeToken, usdc, tokens }
37
37
  * @throws {Error} If the balances cannot be retrieved
38
38
  */
39
- balances(tokens: string[], chains?: Chain[]): Promise<Balances>;
39
+ balances(tokens?: string[], chains?: Chain[]): Promise<Balances>;
40
+ /**
41
+ * Transform the API balance response to the new structure
42
+ * @private
43
+ */
44
+ private transformBalanceResponse;
40
45
  /**
41
46
  * Get the wallet NFTs
42
47
  * @param {Object} params - The parameters
@@ -44,9 +49,9 @@ declare class Wallet<C extends Chain> {
44
49
  * @param {number} params.page - The page number
45
50
  * @param {EvmWalletLocator} [params.locator] - The locator
46
51
  * @returns The NFTs
47
- * @unstable This API is unstable and may change in the future
52
+ * @experimental This API is experimental and may change in the future
48
53
  */
49
- unstable_nfts(params: {
54
+ experimental_nfts(params: {
50
55
  perPage: number;
51
56
  page: number;
52
57
  }): Promise<GetNftsResponse>;
@@ -54,7 +59,7 @@ declare class Wallet<C extends Chain> {
54
59
  * Get the wallet transactions
55
60
  * @returns The transactions
56
61
  */
57
- unstable_transactions(): Promise<GetTransactionsResponse>;
62
+ experimental_transactions(): Promise<GetTransactionsResponse>;
58
63
  /**
59
64
  * Get the wallet activity
60
65
  * @returns The activity
@@ -67,9 +72,9 @@ declare class Wallet<C extends Chain> {
67
72
  * @param {string | UserLocator} to - The recipient (address or user locator)
68
73
  * @param {string} token - The token (address or currency symbol)
69
74
  * @param {string} amount - The amount to send (decimal units)
70
- * @returns {string} The transaction hash
75
+ * @returns {Transaction} The transaction
71
76
  */
72
- send(to: string | UserLocator, token: string, amount: string): Promise<string>;
77
+ send(to: string | UserLocator, token: string, amount: string): Promise<Transaction>;
73
78
  /**
74
79
  * Add a delegated signer to the wallet
75
80
  * @param signer - The signer
@@ -81,7 +86,7 @@ declare class Wallet<C extends Chain> {
81
86
  delegatedSigners(): Promise<DelegatedSigner[]>;
82
87
  protected get walletLocator(): string;
83
88
  protected get isSolanaWallet(): boolean;
84
- protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<string>;
89
+ protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<Transaction>;
85
90
  protected approveTransaction(transactionId: string, additionalSigners?: Signer[]): Promise<WalletsV1Alpha2TransactionResponseDto>;
86
91
  protected approveSignature(pendingApprovals: Array<PendingApproval>, signatureId: string): Promise<PasskeySignResult | BaseSignResult>;
87
92
  protected waitForSignature(signatureId: string): Promise<string>;
@@ -89,19 +94,8 @@ declare class Wallet<C extends Chain> {
89
94
  initialBackoffMs?: number;
90
95
  backoffMultiplier?: number;
91
96
  maxBackoffMs?: number;
92
- }): Promise<string>;
97
+ }): Promise<Transaction>;
93
98
  protected sleep(ms: number): Promise<unknown>;
94
99
  }
95
- type UserLocator = {
96
- email: string;
97
- } | {
98
- x: string;
99
- } | {
100
- twitter: string;
101
- } | {
102
- phone: string;
103
- } | {
104
- userId: string;
105
- };
106
100
 
107
- export { type UserLocator, Wallet };
101
+ export { Wallet };
@@ -1,8 +1,8 @@
1
1
  import { Signer, PasskeySignResult, BaseSignResult } from '../signers/types.js';
2
2
  import { WalletsV1Alpha2TransactionResponseDto } from '../api/gen/types.gen.js';
3
3
  import { ApiClient } from '../api/client.js';
4
- import { Balances, GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.js';
5
- import { WalletOptions, DelegatedSigner, PendingApproval } from './types.js';
4
+ import { GetNftsResponse, GetTransactionsResponse, Activity } from '../api/types.js';
5
+ import { WalletOptions, Balances, UserLocator, Transaction, DelegatedSigner, PendingApproval } from './types.js';
6
6
  import { Chain } from '../chains/chains.js';
7
7
  import 'ox';
8
8
  import '@crossmint/client-sdk-window';
@@ -30,13 +30,18 @@ declare class Wallet<C extends Chain> {
30
30
  protected get apiClient(): ApiClient;
31
31
  protected get options(): WalletOptions | undefined;
32
32
  /**
33
- * Get the wallet balances
34
- * @param {string[]} params.tokens - The tokens
35
- * @param {Chain[]} params.chains - The chains (optional)
36
- * @returns {Promise<Balances>} The balances
33
+ * Get the wallet balances - always includes USDC and native token (ETH/SOL)
34
+ * @param {string[]} tokens - Additional tokens to request (optional: native token and usdc are always included)
35
+ * @param {Chain[]} chains - The chains (optional)
36
+ * @returns {Promise<Balances>} The balances structured as { nativeToken, usdc, tokens }
37
37
  * @throws {Error} If the balances cannot be retrieved
38
38
  */
39
- balances(tokens: string[], chains?: Chain[]): Promise<Balances>;
39
+ balances(tokens?: string[], chains?: Chain[]): Promise<Balances>;
40
+ /**
41
+ * Transform the API balance response to the new structure
42
+ * @private
43
+ */
44
+ private transformBalanceResponse;
40
45
  /**
41
46
  * Get the wallet NFTs
42
47
  * @param {Object} params - The parameters
@@ -44,9 +49,9 @@ declare class Wallet<C extends Chain> {
44
49
  * @param {number} params.page - The page number
45
50
  * @param {EvmWalletLocator} [params.locator] - The locator
46
51
  * @returns The NFTs
47
- * @unstable This API is unstable and may change in the future
52
+ * @experimental This API is experimental and may change in the future
48
53
  */
49
- unstable_nfts(params: {
54
+ experimental_nfts(params: {
50
55
  perPage: number;
51
56
  page: number;
52
57
  }): Promise<GetNftsResponse>;
@@ -54,7 +59,7 @@ declare class Wallet<C extends Chain> {
54
59
  * Get the wallet transactions
55
60
  * @returns The transactions
56
61
  */
57
- unstable_transactions(): Promise<GetTransactionsResponse>;
62
+ experimental_transactions(): Promise<GetTransactionsResponse>;
58
63
  /**
59
64
  * Get the wallet activity
60
65
  * @returns The activity
@@ -67,9 +72,9 @@ declare class Wallet<C extends Chain> {
67
72
  * @param {string | UserLocator} to - The recipient (address or user locator)
68
73
  * @param {string} token - The token (address or currency symbol)
69
74
  * @param {string} amount - The amount to send (decimal units)
70
- * @returns {string} The transaction hash
75
+ * @returns {Transaction} The transaction
71
76
  */
72
- send(to: string | UserLocator, token: string, amount: string): Promise<string>;
77
+ send(to: string | UserLocator, token: string, amount: string): Promise<Transaction>;
73
78
  /**
74
79
  * Add a delegated signer to the wallet
75
80
  * @param signer - The signer
@@ -81,7 +86,7 @@ declare class Wallet<C extends Chain> {
81
86
  delegatedSigners(): Promise<DelegatedSigner[]>;
82
87
  protected get walletLocator(): string;
83
88
  protected get isSolanaWallet(): boolean;
84
- protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<string>;
89
+ protected approveAndWait(transactionId: string, additionalSigners?: Signer[]): Promise<Transaction>;
85
90
  protected approveTransaction(transactionId: string, additionalSigners?: Signer[]): Promise<WalletsV1Alpha2TransactionResponseDto>;
86
91
  protected approveSignature(pendingApprovals: Array<PendingApproval>, signatureId: string): Promise<PasskeySignResult | BaseSignResult>;
87
92
  protected waitForSignature(signatureId: string): Promise<string>;
@@ -89,19 +94,8 @@ declare class Wallet<C extends Chain> {
89
94
  initialBackoffMs?: number;
90
95
  backoffMultiplier?: number;
91
96
  maxBackoffMs?: number;
92
- }): Promise<string>;
97
+ }): Promise<Transaction>;
93
98
  protected sleep(ms: number): Promise<unknown>;
94
99
  }
95
- type UserLocator = {
96
- email: string;
97
- } | {
98
- x: string;
99
- } | {
100
- twitter: string;
101
- } | {
102
- phone: string;
103
- } | {
104
- userId: string;
105
- };
106
100
 
107
- export { type UserLocator, Wallet };
101
+ export { Wallet };
@@ -1 +1 @@
1
- import{a}from"../chunk-YHRRQBIE.js";import"../chunk-3D5RTPTJ.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
1
+ import{a}from"../chunk-TFNFVJ4T.js";import"../chunk-EHJBOM3P.js";import"../chunk-7ENJXL4H.js";import"../chunk-BW7YYVZE.js";export{a as Wallet};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/wallets-sdk",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -25,9 +25,9 @@
25
25
  "tweetnacl": "1.0.3",
26
26
  "viem": "2.23.6",
27
27
  "@crossmint/common-sdk-auth": "1.0.37",
28
- "@crossmint/common-sdk-base": "0.8.0",
29
28
  "@crossmint/client-sdk-window": "1.0.0",
30
- "@crossmint/client-signers": "0.0.16"
29
+ "@crossmint/common-sdk-base": "0.8.0",
30
+ "@crossmint/client-signers": "0.0.17"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hey-api/openapi-ts": "0.69.2",
@@ -1 +0,0 @@
1
- var s="@crossmint/wallets-sdk",t="0.10.0";var c="WALLETS_SDK",r=t,d=s,a=500;export{c as a,r as b,d as c,a as d};
@@ -1 +0,0 @@
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 r=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("https://signers.crossmint.com/");n.searchParams.set("environment",this.config.environment);let 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((i,a)=>{e.onload=()=>i(e),e.onerror=()=>a(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};exports.a = r;
@@ -1 +0,0 @@
1
- import{a as t}from"./chunk-YHRRQBIE.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(r){super({chain:r.chain,address:r.address,owner:r.owner,signer:r.signer},t.getApiClient(r))}static from(r){return new m(r)}sendTransaction(W){return i(this,arguments,function*({transaction:r,additionalSigners:n}){let l={transaction:f.encode(r.serialize())},a=yield this.apiClient.createTransaction(this.walletLocator,{params:l});if(a.error)throw new s(JSON.stringify(a));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(a.id,h)})}};export{p as a};
@@ -1 +0,0 @@
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 w,o,I= exports.a =class{constructor({chain:t,address:i,owner:r,signer:s,options:n},e){_chunkXALFCQKDcjs.d.call(void 0, this,w);_chunkXALFCQKDcjs.d.call(void 0, this,o);_chunkXALFCQKDcjs.e.call(void 0, this,o,e),this.chain=t,this.address=i,this.owner=r,this.signer=s,_chunkXALFCQKDcjs.e.call(void 0, this,w,n)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return _chunkXALFCQKDcjs.c.call(void 0, this,o)}get options(){return _chunkXALFCQKDcjs.c.call(void 0, this,w)}balances(t,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).getBalance(this.address,{chains:i!=null?i:[this.chain],tokens:t});if("error"in r)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(r.error)}`);return r})}unstable_nfts(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,o).unstable_getNfts(_chunkXALFCQKDcjs.b.call(void 0, _chunkXALFCQKDcjs.a.call(void 0, {},t),{chain:this.chain,address:this.address}))})}unstable_transactions(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield _chunkXALFCQKDcjs.c.call(void 0, this,o).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.error)}`);return t})}send(t,i,r){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let s=k(t),n=U(i,this.chain),e={recipient:s,amount:r},c=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).send(this.walletLocator,n,e);if("message"in c)throw new (0, _chunkCT2UGJELcjs.q)(`Failed to send token: ${JSON.stringify(c.message)}`);return yield this.approveAndWait(c.id)})}addDelegatedSigner(i){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({signer:t}){var s,n;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).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.error)}`);if("transaction"in r){let e=r.transaction.id;yield this.approveAndWait(e)}else{let e=(s=r.chains)==null?void 0:s[this.chain];if((e==null?void 0:e.status)==="awaiting-approval"){let c=((n=e.approvals)==null?void 0:n.pending)||[];yield this.approveSignature(c,e.id),yield this.waitForSignature(e.id);return}if((e==null?void 0:e.status)==="pending"){yield this.waitForSignature(e.id);return}}})}delegatedSigners(){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var i,r,s;let t=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).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(s=(r=(i=t==null?void 0:t.config)==null?void 0:i.delegatedSigners)==null?void 0:r.map(n=>{let e=n.locator.indexOf(":");return{signer:`external-wallet:${e>=0?n.locator.slice(e+1):n.locator}`}}))!=null?s:[]})}get walletLocator(){return _chunkXALFCQKDcjs.c.call(void 0, this,o).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return yield this.approveTransaction(t,i),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,i){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){var g,h,u,b;let r=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).getTransaction(this.walletLocator,t);if(r.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(r));if(yield(u=(h=(g=_chunkXALFCQKDcjs.c.call(void 0, this,w))==null?void 0:g.experimental_callbacks)==null?void 0:h.onTransactionStart)==null?void 0:u.call(h),this.signer.type==="api-key")return r;let s=(b=r.approvals)==null?void 0:b.pending;if(s==null)return r;let n=[...i!=null?i:[],this.signer],e=yield Promise.all(s.map(d=>{let A=n.find(D=>D.locator()===d.signer);if(A==null)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${d.signer} not found in pending approvals`);let J=r.walletType==="solana-smart-wallet"?r.onChain.transaction:d.message;return A.signTransaction(J)})),c=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).approveTransaction(this.walletLocator,r.id,{approvals:e.map(d=>_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},d))});if(c.error)throw new (0, _chunkCT2UGJELcjs.w)(JSON.stringify(c));return c})}approveSignature(t,i){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(n=>n.signer===this.signer.locator());if(!r)throw new (0, _chunkCT2UGJELcjs.i)(`Signer ${this.signer.locator()} not found in pending approvals`);let s=yield this.signer.signMessage(r.message);return yield _chunkXALFCQKDcjs.c.call(void 0, this,o).approveSignature(this.walletLocator,i,{approvals:[_chunkXALFCQKDcjs.a.call(void 0, {signer:this.signer.locator()},s)]}),s})}waitForSignature(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){let i=null;do if(yield new Promise(r=>setTimeout(r,_chunk5HTPBFDHcjs.d)),i=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).getSignature(this.walletLocator,t),"error"in i)throw new (0, _chunkCT2UGJELcjs.p)(JSON.stringify(i));while(i===null||i.status==="pending");if(i.status==="failed")throw new (0, _chunkCT2UGJELcjs.m)("Signature signing failed");if(!i.outputSignature)throw new (0, _chunkCT2UGJELcjs.p)("Signature not available");return i.outputSignature})}waitForTransaction(e){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*(t,i=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:s=2e3,initialBackoffMs:n=_chunk5HTPBFDHcjs.d}={}){let c=Date.now(),g;do{if(Date.now()-c>i)throw new (0, _chunkCT2UGJELcjs.s)("Transaction confirmation timeout");if(g=yield _chunkXALFCQKDcjs.c.call(void 0, this,o).getTransaction(this.walletLocator,t),g.error)throw new (0, _chunkCT2UGJELcjs.r)(JSON.stringify(g));yield this.sleep(n),n=Math.min(n*r,s)}while(g.status==="pending");if(g.status==="failed")throw new (0, _chunkCT2UGJELcjs.t)(`Transaction sending failed: ${JSON.stringify(g.error)}`);if(g.status==="awaiting-approval")throw new (0, _chunkCT2UGJELcjs.u)("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let h=g.onChain.txId;if(h==null)throw new (0, _chunkCT2UGJELcjs.v)("Transaction hash not found on transaction response");return h})}sleep(t){return _chunkXALFCQKDcjs.f.call(void 0, this,null,function*(){return new Promise(i=>setTimeout(i,t))})}};w=new WeakMap,o=new WeakMap;function k(a){if(typeof a=="string")return a;if("email"in a)return`email:${a.email}`;if("x"in a)return`x:${a.x}`;if("twitter"in a)return`twitter:${a.twitter}`;if("phone"in a)return`phoneNumber:${a.phone}`;if("userId"in a)return`userId:${a.userId}`;throw new Error("Invalid recipient locator")}function U(a,t){return _commonsdkbase.isValidAddress.call(void 0, a)?`${t}:${a}`:`${t}:${a.toLowerCase()}`}exports.a = I;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkPSBX4PZWcjs = require('./chunk-PSBX4PZW.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 _chunkPSBX4PZWcjs.a{constructor(r){super({chain:r.chain,address:r.address,owner:r.owner,signer:r.signer},_chunkPSBX4PZWcjs.a.getApiClient(r))}static from(r){return new m(r)}sendTransaction(x){return _chunkXALFCQKDcjs.f.call(void 0, this,arguments,function*({transaction:r,additionalSigners:n}){let l={transaction:_bs582.default.encode(r.serialize())},a=yield this.apiClient.createTransaction(this.walletLocator,{params:l});if(a.error)throw new (0, _chunkCT2UGJELcjs.q)(JSON.stringify(a));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(a.id,h)})}};exports.a = p;
@@ -1 +0,0 @@
1
- import{f as t}from"./chunk-BW7YYVZE.js";import{IFrameWindow as s}from"@crossmint/client-sdk-window";import{signerInboundEvents as o,signerOutboundEvents as h}from"@crossmint/client-signers";var r=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("https://signers.crossmint.com/");n.searchParams.set("environment",this.config.environment);let e=yield this.createInvisibleIFrame(n.toString());return this.handshakeParent=yield s.init(e,{targetOrigin:n.origin,incomingEvents:h,outgoingEvents:o}),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((i,a)=>{e.onload=()=>i(e),e.onerror=()=>a(new Error("Failed to load iframe content")),document.body.appendChild(e)})})}};export{r as a};
@@ -1 +0,0 @@
1
- import{d as S}from"./chunk-3D5RTPTJ.js";import{c as N,d as E,i as v,m as $,p as T,q as x,r as C,s as O,t as W,u as F,v as P,w as _}from"./chunk-7ENJXL4H.js";import{a as f,b as L,c as l,d as m,e as y,f as p}from"./chunk-BW7YYVZE.js";import{isValidAddress as M}from"@crossmint/common-sdk-base";var w,o,I=class{constructor({chain:t,address:i,owner:r,signer:s,options:n},e){m(this,w);m(this,o);y(this,o,e),this.chain=t,this.address=i,this.owner=r,this.signer=s,y(this,w,n)}static getApiClient(t){return t.apiClient}static getOptions(t){return t.options}get apiClient(){return l(this,o)}get options(){return l(this,w)}balances(t,i){return p(this,null,function*(){let r=yield l(this,o).getBalance(this.address,{chains:i!=null?i:[this.chain],tokens:t});if("error"in r)throw new Error(`Failed to get balances for wallet: ${JSON.stringify(r.error)}`);return r})}unstable_nfts(t){return p(this,null,function*(){return yield l(this,o).unstable_getNfts(L(f({},t),{chain:this.chain,address:this.address}))})}unstable_transactions(){return p(this,null,function*(){return yield l(this,o).getTransactions(this.walletLocator)})}experimental_activity(){return p(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.error)}`);return t})}send(t,i,r){return p(this,null,function*(){let s=k(t),n=U(i,this.chain),e={recipient:s,amount:r},c=yield l(this,o).send(this.walletLocator,n,e);if("message"in c)throw new x(`Failed to send token: ${JSON.stringify(c.message)}`);return yield this.approveAndWait(c.id)})}addDelegatedSigner(i){return p(this,arguments,function*({signer:t}){var s,n;let r=yield l(this,o).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.error)}`);if("transaction"in r){let e=r.transaction.id;yield this.approveAndWait(e)}else{let e=(s=r.chains)==null?void 0:s[this.chain];if((e==null?void 0:e.status)==="awaiting-approval"){let c=((n=e.approvals)==null?void 0:n.pending)||[];yield this.approveSignature(c,e.id),yield this.waitForSignature(e.id);return}if((e==null?void 0:e.status)==="pending"){yield this.waitForSignature(e.id);return}}})}delegatedSigners(){return p(this,null,function*(){var i,r,s;let t=yield l(this,o).getWallet(this.walletLocator);if("error"in t)throw new E(JSON.stringify(t));if(t.type!=="solana-smart-wallet"&&t.type!=="evm-smart-wallet")throw new N(`Wallet type ${t.type} not supported`);return(s=(r=(i=t==null?void 0:t.config)==null?void 0:i.delegatedSigners)==null?void 0:r.map(n=>{let e=n.locator.indexOf(":");return{signer:`external-wallet:${e>=0?n.locator.slice(e+1):n.locator}`}}))!=null?s:[]})}get walletLocator(){return l(this,o).isServerSide?this.address:`me:${this.isSolanaWallet?"solana-smart-wallet":"evm-smart-wallet"}`}get isSolanaWallet(){return this.chain==="solana"}approveAndWait(t,i){return p(this,null,function*(){return yield this.approveTransaction(t,i),yield this.sleep(1e3),yield this.waitForTransaction(t)})}approveTransaction(t,i){return p(this,null,function*(){var g,h,u,b;let r=yield l(this,o).getTransaction(this.walletLocator,t);if(r.error)throw new C(JSON.stringify(r));if(yield(u=(h=(g=l(this,w))==null?void 0:g.experimental_callbacks)==null?void 0:h.onTransactionStart)==null?void 0:u.call(h),this.signer.type==="api-key")return r;let s=(b=r.approvals)==null?void 0:b.pending;if(s==null)return r;let n=[...i!=null?i:[],this.signer],e=yield Promise.all(s.map(d=>{let A=n.find(D=>D.locator()===d.signer);if(A==null)throw new v(`Signer ${d.signer} not found in pending approvals`);let J=r.walletType==="solana-smart-wallet"?r.onChain.transaction:d.message;return A.signTransaction(J)})),c=yield l(this,o).approveTransaction(this.walletLocator,r.id,{approvals:e.map(d=>f({signer:this.signer.locator()},d))});if(c.error)throw new _(JSON.stringify(c));return c})}approveSignature(t,i){return p(this,null,function*(){if(this.isSolanaWallet)throw new Error("Approving signatures is only supported for EVM smart wallets");let r=t.find(n=>n.signer===this.signer.locator());if(!r)throw new v(`Signer ${this.signer.locator()} not found in pending approvals`);let s=yield this.signer.signMessage(r.message);return yield l(this,o).approveSignature(this.walletLocator,i,{approvals:[f({signer:this.signer.locator()},s)]}),s})}waitForSignature(t){return p(this,null,function*(){let i=null;do if(yield new Promise(r=>setTimeout(r,S)),i=yield l(this,o).getSignature(this.walletLocator,t),"error"in i)throw new T(JSON.stringify(i));while(i===null||i.status==="pending");if(i.status==="failed")throw new $("Signature signing failed");if(!i.outputSignature)throw new T("Signature not available");return i.outputSignature})}waitForTransaction(e){return p(this,arguments,function*(t,i=6e4,{backoffMultiplier:r=1.1,maxBackoffMs:s=2e3,initialBackoffMs:n=S}={}){let c=Date.now(),g;do{if(Date.now()-c>i)throw new O("Transaction confirmation timeout");if(g=yield l(this,o).getTransaction(this.walletLocator,t),g.error)throw new C(JSON.stringify(g));yield this.sleep(n),n=Math.min(n*r,s)}while(g.status==="pending");if(g.status==="failed")throw new W(`Transaction sending failed: ${JSON.stringify(g.error)}`);if(g.status==="awaiting-approval")throw new F("Transaction is awaiting approval. Please submit required approvals before waiting for completion.");let h=g.onChain.txId;if(h==null)throw new P("Transaction hash not found on transaction response");return h})}sleep(t){return p(this,null,function*(){return new Promise(i=>setTimeout(i,t))})}};w=new WeakMap,o=new WeakMap;function k(a){if(typeof a=="string")return a;if("email"in a)return`email:${a.email}`;if("x"in a)return`x:${a.x}`;if("twitter"in a)return`twitter:${a.twitter}`;if("phone"in a)return`phoneNumber:${a.phone}`;if("userId"in a)return`userId:${a.userId}`;throw new Error("Invalid recipient locator")}function U(a,t){return M(a)?`${t}:${a}`:`${t}:${a.toLowerCase()}`}export{I as a};