@crossmint/wallets-sdk 0.4.4 → 0.5.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 (101) hide show
  1. package/README.md +2 -2
  2. package/dist/api/client.cjs +1 -1
  3. package/dist/api/client.d.cts +2 -1
  4. package/dist/api/client.d.ts +2 -1
  5. package/dist/api/client.js +1 -1
  6. package/dist/api/gen/index.cjs +1 -1
  7. package/dist/api/gen/index.js +1 -1
  8. package/dist/api/index.cjs +1 -1
  9. package/dist/api/index.js +1 -1
  10. package/dist/chunk-2ZIKG3CS.js +1 -0
  11. package/dist/chunk-5IAK4UF2.js +1 -0
  12. package/dist/chunk-5RUCIXEI.js +1 -0
  13. package/dist/{chunk-7H5SWCHW.js → chunk-DGSYBCLX.js} +1 -1
  14. package/dist/chunk-F2QFCJX3.js +1 -0
  15. package/dist/{chunk-PKWM77FY.js → chunk-HDX4M5HF.js} +1 -1
  16. package/dist/chunk-HFXMVWL3.cjs +1 -0
  17. package/dist/{chunk-PM3T4AGY.cjs → chunk-JFUBHJ2C.cjs} +1 -1
  18. package/dist/chunk-MSRMPSW5.cjs +1 -0
  19. package/dist/{chunk-MHLSXIMU.cjs → chunk-RB66U3DD.cjs} +1 -1
  20. package/dist/chunk-RNRZUJGI.js +1 -0
  21. package/dist/chunk-SPJ2FDWR.cjs +1 -0
  22. package/dist/chunk-T6HM7QQL.cjs +1 -0
  23. package/dist/{chunk-Y7EK2YGJ.cjs → chunk-TOBEC7U6.cjs} +1 -1
  24. package/dist/{chunk-JQTFVFZU.cjs → chunk-VKRGUHT5.cjs} +1 -1
  25. package/dist/chunk-VS3KE22Y.cjs +1 -0
  26. package/dist/{chunk-F42LSTCB.js → chunk-WB2UB7CO.js} +1 -1
  27. package/dist/chunk-X5NCM4AR.js +1 -0
  28. package/dist/evm/chains/index.cjs +1 -1
  29. package/dist/evm/chains/index.js +1 -1
  30. package/dist/evm/index.cjs +1 -1
  31. package/dist/evm/index.d.cts +9 -5
  32. package/dist/evm/index.d.ts +9 -5
  33. package/dist/evm/index.js +1 -1
  34. package/dist/evm/types/signers.cjs +1 -0
  35. package/dist/evm/types/signers.d.cts +40 -0
  36. package/dist/evm/types/signers.d.ts +40 -0
  37. package/dist/evm/types/signers.js +0 -0
  38. package/dist/evm/types/wallet.cjs +1 -0
  39. package/dist/evm/types/wallet.d.cts +53 -0
  40. package/dist/evm/types/wallet.d.ts +53 -0
  41. package/dist/evm/types/wallet.js +0 -0
  42. package/dist/evm/utils.d.cts +1 -8
  43. package/dist/evm/utils.d.ts +1 -8
  44. package/dist/evm/wallet.cjs +1 -1
  45. package/dist/evm/wallet.d.cts +60 -6
  46. package/dist/evm/wallet.d.ts +60 -6
  47. package/dist/evm/wallet.js +1 -1
  48. package/dist/index.cjs +1 -1
  49. package/dist/index.d.cts +9 -6
  50. package/dist/index.d.ts +9 -6
  51. package/dist/index.js +1 -1
  52. package/dist/options-DGElO-xR.d.cts +121 -0
  53. package/dist/options-DmcWBOpe.d.ts +121 -0
  54. package/dist/sdk.cjs +1 -1
  55. package/dist/sdk.d.cts +10 -10
  56. package/dist/sdk.d.ts +10 -10
  57. package/dist/sdk.js +1 -1
  58. package/dist/services/types.d.cts +6 -7
  59. package/dist/services/types.d.ts +6 -7
  60. package/dist/services/wallet-factory.cjs +1 -1
  61. package/dist/services/wallet-factory.d.cts +9 -6
  62. package/dist/services/wallet-factory.d.ts +9 -6
  63. package/dist/services/wallet-factory.js +1 -1
  64. package/dist/solana/index.cjs +1 -1
  65. package/dist/solana/index.d.cts +6 -5
  66. package/dist/solana/index.d.ts +6 -5
  67. package/dist/solana/index.js +1 -1
  68. package/dist/solana/services/delegated-signers-service.cjs +1 -1
  69. package/dist/solana/services/delegated-signers-service.d.cts +4 -3
  70. package/dist/solana/services/delegated-signers-service.d.ts +4 -3
  71. package/dist/solana/services/delegated-signers-service.js +1 -1
  72. package/dist/solana/services/transactions-service.cjs +1 -1
  73. package/dist/solana/services/transactions-service.d.cts +4 -3
  74. package/dist/solana/services/transactions-service.d.ts +4 -3
  75. package/dist/solana/services/transactions-service.js +1 -1
  76. package/dist/solana/types/wallet.cjs +1 -0
  77. package/dist/solana/types/wallet.d.cts +55 -0
  78. package/dist/solana/types/wallet.d.ts +55 -0
  79. package/dist/solana/types/wallet.js +0 -0
  80. package/dist/solana/wallet.cjs +1 -1
  81. package/dist/solana/wallet.d.cts +4 -3
  82. package/dist/solana/wallet.d.ts +4 -3
  83. package/dist/solana/wallet.js +1 -1
  84. package/dist/utils/constants.cjs +1 -1
  85. package/dist/utils/constants.js +1 -1
  86. package/dist/utils/options.d.cts +5 -4
  87. package/dist/utils/options.d.ts +5 -4
  88. package/package.json +3 -3
  89. package/dist/chunk-4DWKY52P.js +0 -1
  90. package/dist/chunk-5B5J27AQ.js +0 -1
  91. package/dist/chunk-AHIFP6FO.js +0 -1
  92. package/dist/chunk-EMFY2JKN.cjs +0 -1
  93. package/dist/chunk-H2TRDPKO.cjs +0 -1
  94. package/dist/chunk-IWTTCVLW.cjs +0 -1
  95. package/dist/chunk-J37MFN6H.js +0 -1
  96. package/dist/chunk-JKTCTROJ.cjs +0 -1
  97. package/dist/chunk-M6HKZ25Q.js +0 -1
  98. package/dist/chunk-RRBALPQR.js +0 -1
  99. package/dist/chunk-SHKGFJQJ.cjs +0 -1
  100. package/dist/wallet-BElTi4Ug.d.cts +0 -358
  101. package/dist/wallet-D4BW725e.d.ts +0 -358
@@ -1,358 +0,0 @@
1
- import { EVMSmartWalletChain } from './evm/chains/index.cjs';
2
- import { SolanaSupportedToken } from './solana/tokens.cjs';
3
- import { SolanaNonCustodialSigner, SolanaSigner, SolanaSignerInput, SolanaNonCustodialSignerInput } from './solana/types/signers.cjs';
4
- import { ApiClient } from './api/client.cjs';
5
- import { SolanaWalletLocator, GetTransactionsResponse, GetSignerResponse, GetBalanceResponse, GetNftsResponse, EvmWalletLocator } from './api/types.cjs';
6
- import { WebAuthnP256 } from 'ox';
7
- import { Address, Hex, EIP1193Provider, Account, SignableMessage, TypedData, TypedDataDefinition, PublicClient, HttpTransport } from 'viem';
8
- import { VersionedTransaction, PublicKey, Connection } from '@solana/web3.js';
9
- import { SolanaApprovalsService } from './solana/services/approvals-service.cjs';
10
-
11
- declare class SolanaTransactionsService {
12
- private readonly walletLocator;
13
- private readonly apiClient;
14
- private readonly approvalsService;
15
- private readonly callbacks;
16
- constructor(walletLocator: SolanaWalletLocator, apiClient: ApiClient, approvalsService?: SolanaApprovalsService, callbacks?: Callbacks);
17
- createSignAndConfirm(params: {
18
- transaction: VersionedTransaction;
19
- signer?: SolanaNonCustodialSigner;
20
- additionalSigners?: SolanaNonCustodialSigner[];
21
- }): Promise<string>;
22
- getTransactions(): Promise<GetTransactionsResponse>;
23
- approveTransaction(transactionId: string, signers: SolanaNonCustodialSigner[]): Promise<void>;
24
- private create;
25
- waitForTransaction(transactionId: string, timeoutMs?: number): Promise<string>;
26
- }
27
-
28
- declare class SolanaDelegatedSignerService {
29
- private readonly walletLocator;
30
- private readonly transactionsService;
31
- private readonly apiClient;
32
- constructor(walletLocator: SolanaWalletLocator, transactionsService: SolanaTransactionsService, apiClient: ApiClient);
33
- registerDelegatedSigner(signer: string, adminSigner?: SolanaNonCustodialSigner): Promise<GetSignerResponse>;
34
- getDelegatedSigner(signer: string): Promise<GetSignerResponse>;
35
- }
36
-
37
- type Transaction$1 = VersionedTransaction;
38
- interface MPCTransactionParams {
39
- transaction: VersionedTransaction;
40
- additionalSigners?: SolanaNonCustodialSignerInput[];
41
- }
42
- interface SmartWalletTransactionParams {
43
- transaction: VersionedTransaction;
44
- additionalSigners?: SolanaNonCustodialSignerInput[];
45
- delegatedSigner?: SolanaNonCustodialSignerInput;
46
- }
47
- declare abstract class SolanaWallet {
48
- protected readonly apiClient: ApiClient;
49
- protected readonly publicKey: PublicKey;
50
- protected readonly client: Connection;
51
- protected readonly callbacks: Callbacks;
52
- protected readonly transactionsService: SolanaTransactionsService;
53
- protected readonly delegatedSignerService: SolanaDelegatedSignerService;
54
- constructor(apiClient: ApiClient, publicKey: PublicKey, client: Connection, callbacks: Callbacks);
55
- /**
56
- * Get the wallet public key
57
- * @returns The wallet public key
58
- */
59
- getPublicKey(): PublicKey;
60
- /**
61
- * Get the wallet address
62
- * @returns The wallet address
63
- */
64
- getAddress(): string;
65
- /**
66
- * Get the wallet balances
67
- * @param tokens - The tokens
68
- * @returns The balances
69
- */
70
- balances(tokens: SolanaSupportedToken[]): Promise<GetBalanceResponse>;
71
- /**
72
- * Get the wallet transactions
73
- * @returns The transactions
74
- */
75
- transactions(): Promise<GetTransactionsResponse>;
76
- /**
77
- * Get the wallet NFTs
78
- * @param perPage - The number of NFTs per page
79
- * @param page - The page number
80
- * @param locator - The wallet locator
81
- * @returns The NFTs
82
- */
83
- nfts(perPage: number, page: number, locator?: SolanaWalletLocator): Promise<GetNftsResponse>;
84
- protected get walletLocator(): SolanaWalletLocator;
85
- }
86
- declare class SolanaSmartWallet extends SolanaWallet {
87
- readonly adminSigner: SolanaSigner;
88
- constructor(apiClient: ApiClient, publicKey: PublicKey, adminSignerInput: SolanaSignerInput, client: Connection, callbacks: Callbacks);
89
- /**
90
- * Sign and submit a transaction
91
- * @param parameters - The transaction parameters
92
- * @returns The transaction hash
93
- */
94
- sendTransaction(parameters: SmartWalletTransactionParams): Promise<string>;
95
- /**
96
- * Add a delegated signer to the wallet
97
- * @param signer - The signer
98
- * @returns The delegated signer
99
- */
100
- addDelegatedSigner(signer: string): Promise<GetSignerResponse>;
101
- private getEffectiveTransactionSigner;
102
- }
103
- declare class SolanaMPCWallet extends SolanaWallet {
104
- /**
105
- * Sign and submit a transaction
106
- * @param parameters - The transaction parameters
107
- * @returns The transaction hash
108
- */
109
- sendTransaction(parameters: MPCTransactionParams): Promise<string>;
110
- }
111
-
112
- type Wallet = EVMSmartWallet | SolanaSmartWallet | SolanaMPCWallet;
113
- type Transaction = TransactionInput | Transaction$1;
114
- interface Callbacks {
115
- onWalletCreationStart?: () => Promise<void>;
116
- onWalletCreationComplete?: (wallet: Wallet) => Promise<void>;
117
- onWalletCreationFail?: (error: Error) => Promise<void>;
118
- onTransactionStart?: (transaction: Transaction) => Promise<void>;
119
- onTransactionComplete?: (transaction: Transaction) => Promise<void>;
120
- onTransactionFail?: (error: Error) => Promise<void>;
121
- }
122
- interface WalletOptions {
123
- experimental_callbacks?: Callbacks;
124
- }
125
-
126
- interface TransactionInput {
127
- to: Address;
128
- data?: Hex;
129
- value?: bigint;
130
- }
131
- type PasskeySigningCallback = (message: string) => Promise<{
132
- signature: Hex;
133
- metadata: WebAuthnP256.SignMetadata;
134
- }>;
135
- type PasskeyCreationCallback = (name: string) => Promise<{
136
- id: string;
137
- publicKey: {
138
- x: string;
139
- y: string;
140
- };
141
- }>;
142
- type EVMSignerInput = {
143
- type: "evm-keypair";
144
- address: string;
145
- signer: {
146
- type: "provider";
147
- provider: EIP1193Provider;
148
- } | {
149
- type: "viem_v2";
150
- account: Account;
151
- };
152
- } | {
153
- type: "evm-passkey";
154
- name?: string;
155
- signingCallback?: PasskeySigningCallback;
156
- creationCallback?: PasskeyCreationCallback;
157
- };
158
- type EVMSigner = EVMSignerInput & {
159
- locator: string;
160
- } & ({
161
- type: "evm-passkey";
162
- id: string;
163
- } | {
164
- type: "evm-keypair";
165
- });
166
- interface ViemWallet {
167
- /**
168
- * Get the wallet address
169
- * @returns The wallet address
170
- */
171
- getAddress: () => Address;
172
- /**
173
- * Get the wallet nonce
174
- * @param parameters - The parameters
175
- * @returns The nonce
176
- */
177
- getNonce?: ((parameters?: {
178
- key?: bigint | undefined;
179
- } | undefined) => Promise<bigint>) | undefined;
180
- /**
181
- * Sign a message
182
- * @param parameters - The parameters
183
- * @returns The signature
184
- */
185
- signMessage: (parameters: {
186
- message: SignableMessage;
187
- }) => Promise<Hex>;
188
- /**
189
- * Sign a typed data
190
- * @param parameters - The parameters
191
- * @returns The signature
192
- */
193
- signTypedData: <const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
194
- /**
195
- * Sign and submit a transaction
196
- * @param parameters - The transaction parameters
197
- * @returns The transaction hash
198
- */
199
- sendTransaction: (parameters: TransactionInput) => Promise<Hex>;
200
- }
201
- declare class EVMSmartWallet implements ViemWallet {
202
- readonly chain: EVMSmartWalletChain;
203
- private readonly apiClient;
204
- private readonly address;
205
- private readonly adminSigner;
206
- private readonly callbacks;
207
- readonly publicClient: PublicClient<HttpTransport>;
208
- constructor(chain: EVMSmartWalletChain, apiClient: ApiClient, address: Address, adminSigner: EVMSigner, callbacks: Callbacks);
209
- /**
210
- * Get the wallet balances
211
- * @param tokens - The tokens
212
- * @returns The balances
213
- */
214
- balances(tokens: Address[]): Promise<GetBalanceResponse>;
215
- /**
216
- * Get the wallet transactions
217
- * @returns The transactions
218
- */
219
- transactions(): Promise<{
220
- walletType: "evm-smart-wallet";
221
- params: {
222
- calls: Array<{
223
- address: string;
224
- functionName: string;
225
- abi: Array<{
226
- type: "error";
227
- inputs: Array<unknown>;
228
- name: string;
229
- } | {
230
- type: "event";
231
- anonymous?: boolean;
232
- inputs: Array<unknown & {
233
- indexed?: boolean;
234
- }>;
235
- name: string;
236
- } | ({
237
- constant?: boolean;
238
- gas?: number;
239
- payable?: boolean;
240
- } & ({
241
- type: "function";
242
- inputs: Array<unknown>;
243
- name: string;
244
- outputs: Array<unknown>;
245
- stateMutability: "pure" | "view" | "nonpayable" | "payable";
246
- } | {
247
- type: "constructor";
248
- inputs: Array<unknown>;
249
- stateMutability: "payable" | "nonpayable";
250
- } | {
251
- type: "fallback";
252
- inputs?: unknown;
253
- stateMutability: "payable" | "nonpayable";
254
- } | {
255
- type: "receive";
256
- stateMutability: "payable";
257
- }))>;
258
- args: Array<unknown>;
259
- value?: string;
260
- } | {
261
- to: string;
262
- value: string;
263
- data: unknown;
264
- }>;
265
- chain: "base" | "polygon" | "optimism" | "arbitrum" | "mode" | "story" | "bsc" | "base-sepolia" | "polygon-amoy" | "optimism-sepolia" | "arbitrum-sepolia" | "mode-sepolia" | "story-testnet";
266
- signer?: string;
267
- };
268
- onChain: {
269
- userOperation: {
270
- sender: string;
271
- nonce: string;
272
- callData: string;
273
- callGasLimit: string;
274
- verificationGasLimit: string;
275
- preVerificationGas: string;
276
- maxFeePerGas: string;
277
- maxPriorityFeePerGas: string;
278
- paymaster?: string;
279
- paymasterVerificationGasLimit?: string;
280
- paymasterData?: string;
281
- paymasterPostOpGasLimit?: string;
282
- signature: string;
283
- factory?: string;
284
- factoryData?: string;
285
- };
286
- userOperationHash: string;
287
- txId?: string;
288
- explorerLink?: string;
289
- };
290
- id: string;
291
- status: "awaiting-approval" | "pending" | "failed" | "success";
292
- approvals?: {
293
- pending: Array<{
294
- signer: string;
295
- message: string;
296
- }>;
297
- submitted: Array<{
298
- signature: string;
299
- submittedAt: number;
300
- signer: string;
301
- message: string;
302
- metadata?: {
303
- deviceInfo?: string;
304
- ipAddress?: string;
305
- userAgent?: string;
306
- };
307
- }>;
308
- required?: number;
309
- };
310
- createdAt: number;
311
- completedAt?: number;
312
- error?: {
313
- reason: "program_error";
314
- message: string;
315
- logs?: unknown;
316
- } | {
317
- reason: "execution_reverted";
318
- message: string;
319
- revert?: {
320
- type: "contract_call" | "wallet_authorization" | "wallet_deployment";
321
- reason: string;
322
- reasonData?: string;
323
- explorerLink?: string;
324
- simulationLink?: string;
325
- };
326
- };
327
- }[]>;
328
- /**
329
- * Get the wallet NFTs
330
- * @param perPage - The number of NFTs per page
331
- * @param page - The page number
332
- * @param chain - The chain
333
- * @param locator - The locator
334
- * @returns The NFTs
335
- */
336
- nfts(perPage: number, page: number, chain: string, locator?: EvmWalletLocator): Promise<GetNftsResponse>;
337
- getAddress(): `0x${string}`;
338
- getNonce(parameters?: {
339
- key?: bigint | undefined;
340
- } | undefined): Promise<bigint>;
341
- signMessage(parameters: {
342
- message: SignableMessage;
343
- }): Promise<Hex>;
344
- signTypedData<const typedData extends TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: TypedDataDefinition<typedData, primaryType>): Promise<Hex>;
345
- sendTransaction(parameters: TransactionInput): Promise<Hex>;
346
- private get walletLocator();
347
- private get signerLocator();
348
- private signWithAdminSigner;
349
- private createTransaction;
350
- private approveTransaction;
351
- private waitForTransaction;
352
- private createSignature;
353
- private createTypedDataSignature;
354
- private approveSignature;
355
- private waitForSignature;
356
- }
357
-
358
- export { type Callbacks as C, EVMSmartWallet as E, type PasskeyCreationCallback as P, SolanaSmartWallet as S, type TransactionInput as T, type ViemWallet as V, type WalletOptions as W, SolanaMPCWallet as a, type EVMSignerInput as b, type EVMSigner as c, type PasskeySigningCallback as d, SolanaTransactionsService as e, SolanaDelegatedSignerService as f, type Transaction$1 as g, type Wallet as h, type Transaction as i };