@crossmint/wallets-sdk 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/api/__tests__/test-utils.cjs +5 -5
  2. package/dist/api/__tests__/test-utils.js +3 -3
  3. package/dist/api/client.cjs +4 -4
  4. package/dist/api/client.js +3 -3
  5. package/dist/api/index.cjs +5 -5
  6. package/dist/api/index.js +4 -4
  7. package/dist/chains/chains.cjs +11 -3
  8. package/dist/chains/chains.d.cts +13 -1
  9. package/dist/chains/chains.d.ts +13 -1
  10. package/dist/chains/chains.js +12 -4
  11. package/dist/chains/definitions/tempoTestnet.cjs +2 -2
  12. package/dist/chains/definitions/tempoTestnet.d.cts +4 -4
  13. package/dist/chains/definitions/tempoTestnet.d.ts +4 -4
  14. package/dist/chains/definitions/tempoTestnet.js +1 -1
  15. package/dist/{chunk-57HPJVTI.js → chunk-24DGWV3E.js} +5 -5
  16. package/dist/{chunk-XEZBA7I2.js → chunk-2APY4BUJ.js} +19 -6
  17. package/dist/{chunk-YFOUZXSM.cjs → chunk-2XDIXELO.cjs} +6 -6
  18. package/dist/{chunk-NXST74TX.cjs → chunk-4ID6ZK4A.cjs} +58 -45
  19. package/dist/{chunk-XQSMZXBR.cjs → chunk-6LVFMXDR.cjs} +24 -24
  20. package/dist/{chunk-TCNXKNBQ.cjs → chunk-6S7BKBVM.cjs} +7 -7
  21. package/dist/{chunk-YF4DYTBM.js → chunk-7EXE5FZJ.js} +2 -2
  22. package/dist/{chunk-L5IMC3NM.js → chunk-7OW5LYR6.js} +2 -2
  23. package/dist/{chunk-IZJUOXOZ.js → chunk-AXQLP7Z6.js} +4 -4
  24. package/dist/{chunk-N65K6TUY.js → chunk-AZQFMK3I.js} +2 -2
  25. package/dist/{chunk-KE6LX37B.js → chunk-BQN5PNZK.js} +1 -1
  26. package/dist/{chunk-S2AKC2CK.js → chunk-DF3SZX2E.js} +1 -1
  27. package/dist/{chunk-DIM3X4IX.cjs → chunk-GEHZRAAJ.cjs} +61 -3
  28. package/dist/{chunk-W3OYA42M.js → chunk-GWLAO3PX.js} +1 -1
  29. package/dist/{chunk-VWENCGQO.cjs → chunk-GXEWWYHT.cjs} +6 -6
  30. package/dist/{chunk-BBYNVHFR.js → chunk-IAZHXIFV.js} +3 -3
  31. package/dist/{chunk-REP547HH.cjs → chunk-KVYY4QDB.cjs} +18 -18
  32. package/dist/{chunk-7NKX266V.js → chunk-MUIINXJY.js} +11 -33
  33. package/dist/{chunk-6EP3PLGP.js → chunk-MZBMV54C.js} +2 -2
  34. package/dist/{chunk-6H6ZBJC2.cjs → chunk-NN2NBBTN.cjs} +4 -4
  35. package/dist/{chunk-JZQYCISB.cjs → chunk-PRNZJUHI.cjs} +9 -9
  36. package/dist/{chunk-VNPL3HFN.cjs → chunk-RJY4GT2D.cjs} +6 -6
  37. package/dist/{chunk-SUJQZWLJ.js → chunk-SAZ76VGQ.js} +2 -2
  38. package/dist/{chunk-EIZVQAZO.cjs → chunk-SEV3UBGK.cjs} +24 -46
  39. package/dist/{chunk-YXFIZNFL.cjs → chunk-TNASR6QE.cjs} +9 -9
  40. package/dist/{chunk-5CBGJLA4.cjs → chunk-TQKCX7VN.cjs} +1 -1
  41. package/dist/{chunk-FQV77LH4.cjs → chunk-VKXKQ5YI.cjs} +3 -3
  42. package/dist/{chunk-XSMIDXUA.js → chunk-WBTM7E5O.js} +61 -3
  43. package/dist/{chunk-JLW3Q65G.cjs → chunk-XM4Y4HS5.cjs} +6 -6
  44. package/dist/{chunk-ETCH6L2Y.js → chunk-YDFIY5ER.js} +3 -3
  45. package/dist/{chunk-7EZZGCYI.js → chunk-ZKWJY2VO.js} +2 -2
  46. package/dist/{chunk-C5F6IECX.cjs → chunk-ZLPFQ56Q.cjs} +12 -12
  47. package/dist/index.cjs +18 -18
  48. package/dist/index.js +17 -17
  49. package/dist/logger/index.cjs +3 -3
  50. package/dist/logger/index.js +2 -2
  51. package/dist/logger/init.cjs +3 -3
  52. package/dist/logger/init.js +2 -2
  53. package/dist/sdk.cjs +15 -15
  54. package/dist/sdk.js +14 -14
  55. package/dist/signers/index.cjs +8 -8
  56. package/dist/signers/index.d.cts +1 -1
  57. package/dist/signers/index.d.ts +1 -1
  58. package/dist/signers/index.js +7 -7
  59. package/dist/signers/non-custodial/index.cjs +7 -7
  60. package/dist/signers/non-custodial/index.js +6 -6
  61. package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
  62. package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
  63. package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
  64. package/dist/signers/non-custodial/ncs-signer.js +3 -3
  65. package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
  66. package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
  67. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
  68. package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
  69. package/dist/utils/constants.cjs +2 -2
  70. package/dist/utils/constants.js +1 -1
  71. package/dist/wallets/__tests__/test-helpers.cjs +13 -8
  72. package/dist/wallets/__tests__/test-helpers.js +12 -7
  73. package/dist/wallets/evm.cjs +12 -12
  74. package/dist/wallets/evm.js +11 -11
  75. package/dist/wallets/solana.cjs +14 -9
  76. package/dist/wallets/solana.d.cts +1 -1
  77. package/dist/wallets/solana.d.ts +1 -1
  78. package/dist/wallets/solana.js +13 -8
  79. package/dist/wallets/stellar.cjs +14 -9
  80. package/dist/wallets/stellar.d.cts +1 -1
  81. package/dist/wallets/stellar.d.ts +1 -1
  82. package/dist/wallets/stellar.js +13 -8
  83. package/dist/wallets/types.d.cts +1 -1
  84. package/dist/wallets/types.d.ts +1 -1
  85. package/dist/wallets/wallet-factory.cjs +13 -13
  86. package/dist/wallets/wallet-factory.d.cts +0 -1
  87. package/dist/wallets/wallet-factory.d.ts +0 -1
  88. package/dist/wallets/wallet-factory.js +12 -12
  89. package/dist/wallets/wallet.cjs +13 -8
  90. package/dist/wallets/wallet.d.cts +1 -0
  91. package/dist/wallets/wallet.d.ts +1 -0
  92. package/dist/wallets/wallet.js +12 -7
  93. package/package.json +6 -6
@@ -1,6 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkREP547HHcjs = require('./chunk-REP547HH.cjs');
3
+ var _chunkKVYY4QDBcjs = require('./chunk-KVYY4QDB.cjs');
4
+
5
+
6
+ var _chunkGEHZRAAJcjs = require('./chunk-GEHZRAAJ.cjs');
4
7
 
5
8
 
6
9
 
@@ -18,10 +21,10 @@ var _chunkREP547HHcjs = require('./chunk-REP547HH.cjs');
18
21
  var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
19
22
 
20
23
 
21
- var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
24
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
22
25
 
23
26
 
24
- var _chunk5CBGJLA4cjs = require('./chunk-5CBGJLA4.cjs');
27
+ var _chunkTQKCX7VNcjs = require('./chunk-TQKCX7VN.cjs');
25
28
 
26
29
 
27
30
 
@@ -70,7 +73,8 @@ var Wallet = class {
70
73
  }
71
74
  balances(tokens) {
72
75
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
73
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.balances.start");
76
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.balances.start");
77
+ const resolvedChain = this.resolveChainForEnvironment();
74
78
  let nativeToken;
75
79
  switch (this.chain) {
76
80
  case "solana":
@@ -85,20 +89,20 @@ var Wallet = class {
85
89
  }
86
90
  const allTokens = [nativeToken, "usdc", ...tokens != null ? tokens : []];
87
91
  const response = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).getBalance(this.address, {
88
- chains: [this.chain],
92
+ chains: [resolvedChain],
89
93
  tokens: allTokens
90
94
  });
91
95
  if ("error" in response) {
92
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.balances.error", { error: response });
96
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.balances.error", { error: response });
93
97
  throw new Error(`Failed to get balances for wallet: ${JSON.stringify(response.message)}`);
94
98
  }
95
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.balances.success");
99
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.balances.success");
96
100
  return this.transformBalanceResponse(response, nativeToken, tokens);
97
101
  });
98
102
  }
99
103
  stagingFund(amount, chain) {
100
104
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
101
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.stagingFund.start", {
105
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.stagingFund.start", {
102
106
  amount,
103
107
  chain: chain != null ? chain : this.chain
104
108
  });
@@ -110,12 +114,12 @@ var Wallet = class {
110
114
  chain: chain != null ? chain : this.chain
111
115
  });
112
116
  if ("error" in response) {
113
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.stagingFund.error", {
117
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.stagingFund.error", {
114
118
  error: response
115
119
  });
116
120
  throw new Error(`Failed to fund wallet: ${JSON.stringify(response.message)}`);
117
121
  }
118
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.stagingFund.success");
122
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.stagingFund.success");
119
123
  return response;
120
124
  });
121
125
  }
@@ -227,7 +231,8 @@ var Wallet = class {
227
231
  */
228
232
  experimental_activity() {
229
233
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
230
- const response = yield this.apiClient.experimental_activity(this.walletLocator, { chain: this.chain });
234
+ const resolvedChain = this.resolveChainForEnvironment();
235
+ const response = yield this.apiClient.experimental_activity(this.walletLocator, { chain: resolvedChain });
231
236
  if ("error" in response) {
232
237
  throw new Error(`Failed to get activity: ${JSON.stringify(response.message)}`);
233
238
  }
@@ -236,9 +241,10 @@ var Wallet = class {
236
241
  }
237
242
  send(to, token, amount, options) {
238
243
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
244
+ const resolvedChain = this.resolveChainForEnvironment();
239
245
  const recipient = toRecipientLocator(to);
240
- const tokenLocator = toTokenLocator(token, this.chain);
241
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.send.start", _chunkUO2J2ZB2cjs.__spreadValues.call(void 0, {
246
+ const tokenLocator = toTokenLocator(token, resolvedChain);
247
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.send.start", _chunkUO2J2ZB2cjs.__spreadValues.call(void 0, {
242
248
  recipient,
243
249
  token: tokenLocator,
244
250
  amount
@@ -250,7 +256,7 @@ var Wallet = class {
250
256
  }, (options == null ? void 0 : options.experimental_signer) != null ? { signer: options.experimental_signer } : {}), (options == null ? void 0 : options.transactionType) != null ? { transactionType: options.transactionType } : {});
251
257
  const transactionCreationResponse = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).send(this.walletLocator, tokenLocator, sendParams);
252
258
  if ("message" in transactionCreationResponse) {
253
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.send.error", {
259
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.send.error", {
254
260
  error: transactionCreationResponse
255
261
  });
256
262
  throw new (0, _chunkXC2V34TScjs.TransactionNotCreatedError)(
@@ -258,7 +264,7 @@ var Wallet = class {
258
264
  );
259
265
  }
260
266
  if (options == null ? void 0 : options.experimental_prepareOnly) {
261
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.send.prepared", {
267
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.send.prepared", {
262
268
  transactionId: transactionCreationResponse.id
263
269
  });
264
270
  return {
@@ -268,7 +274,7 @@ var Wallet = class {
268
274
  };
269
275
  }
270
276
  const result = yield this.approveTransactionAndWait(transactionCreationResponse.id);
271
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.send.success", {
277
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.send.success", {
272
278
  transactionId: transactionCreationResponse.id,
273
279
  hash: result.hash
274
280
  });
@@ -296,7 +302,7 @@ var Wallet = class {
296
302
  }
297
303
  approve(params) {
298
304
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
299
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.approve.start", {
305
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.approve.start", {
300
306
  transactionId: params.transactionId,
301
307
  signatureId: params.signatureId
302
308
  });
@@ -305,19 +311,19 @@ var Wallet = class {
305
311
  params.transactionId,
306
312
  params.options
307
313
  );
308
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.approve.success", {
314
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.approve.success", {
309
315
  transactionId: params.transactionId
310
316
  });
311
317
  return result;
312
318
  }
313
319
  if (params.signatureId != null) {
314
320
  const result = yield this.approveSignatureAndWait(params.signatureId, params.options);
315
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.approve.success", {
321
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.approve.success", {
316
322
  signatureId: params.signatureId
317
323
  });
318
324
  return result;
319
325
  }
320
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.approve.error", {
326
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.approve.error", {
321
327
  error: "Either transactionId or signatureId must be provided"
322
328
  });
323
329
  throw new Error("Either transactionId or signatureId must be provided");
@@ -326,39 +332,39 @@ var Wallet = class {
326
332
  addDelegatedSigner(params) {
327
333
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
328
334
  var _a, _b, _c;
329
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.start");
335
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.start");
330
336
  const response = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).registerSigner(this.walletLocator, {
331
337
  signer: params.signer,
332
338
  chain: this.chain === "solana" || this.chain === "stellar" ? void 0 : this.chain
333
339
  });
334
340
  if ("error" in response) {
335
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
341
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
336
342
  error: response
337
343
  });
338
344
  throw new Error(`Failed to register signer: ${JSON.stringify(response.message)}`);
339
345
  }
340
346
  if (this.chain === "solana" || this.chain === "stellar") {
341
347
  if (!("transaction" in response) || response.transaction == null) {
342
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
348
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
343
349
  error: "Expected transaction in response for Solana/Stellar chain"
344
350
  });
345
351
  throw new Error("Expected transaction in response for Solana/Stellar chain");
346
352
  }
347
353
  const transactionId = response.transaction.id;
348
354
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
349
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
355
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
350
356
  transactionId
351
357
  });
352
358
  return { transactionId };
353
359
  }
354
360
  yield this.approveTransactionAndWait(transactionId);
355
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
361
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
356
362
  transactionId
357
363
  });
358
364
  return void 0;
359
365
  }
360
366
  if (!("chains" in response)) {
361
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
367
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.addDelegatedSigner.error", {
362
368
  error: "Expected chains in response for EVM chain"
363
369
  });
364
370
  throw new Error("Expected chains in response for EVM chain");
@@ -366,42 +372,42 @@ var Wallet = class {
366
372
  const chainResponse = (_b = response.chains) == null ? void 0 : _b[this.chain];
367
373
  if ((_c = params.options) == null ? void 0 : _c.experimental_prepareOnly) {
368
374
  const signatureId = (chainResponse == null ? void 0 : chainResponse.status) !== "success" ? chainResponse == null ? void 0 : chainResponse.id : void 0;
369
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
375
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.prepared", {
370
376
  signatureId
371
377
  });
372
378
  return { signatureId };
373
379
  }
374
380
  if ((chainResponse == null ? void 0 : chainResponse.status) === "awaiting-approval") {
375
381
  yield this.approveSignatureAndWait(chainResponse.id);
376
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
382
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
377
383
  signatureId: chainResponse.id
378
384
  });
379
385
  return void 0;
380
386
  }
381
387
  if ((chainResponse == null ? void 0 : chainResponse.status) === "pending") {
382
388
  yield this.waitForSignature(chainResponse.id);
383
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
389
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.success", {
384
390
  signatureId: chainResponse.id
385
391
  });
386
392
  return void 0;
387
393
  }
388
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.addDelegatedSigner.success");
394
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.addDelegatedSigner.success");
389
395
  return void 0;
390
396
  });
391
397
  }
392
398
  delegatedSigners() {
393
399
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
394
400
  var _a, _b, _c;
395
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.delegatedSigners.start");
401
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.delegatedSigners.start");
396
402
  const walletResponse = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).getWallet(this.walletLocator);
397
403
  if ("error" in walletResponse) {
398
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.delegatedSigners.error", {
404
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.delegatedSigners.error", {
399
405
  error: walletResponse
400
406
  });
401
407
  throw new (0, _chunkXC2V34TScjs.WalletNotAvailableError)(JSON.stringify(walletResponse));
402
408
  }
403
409
  if (walletResponse.type !== "smart" || walletResponse.chainType !== "evm" && walletResponse.chainType !== "solana" && walletResponse.chainType !== "stellar") {
404
- _chunkFQV77LH4cjs.walletsLogger.error("wallet.delegatedSigners.error", {
410
+ _chunkVKXKQ5YIcjs.walletsLogger.error("wallet.delegatedSigners.error", {
405
411
  error: `Wallet type ${walletResponse.type} not supported`
406
412
  });
407
413
  throw new (0, _chunkXC2V34TScjs.WalletTypeNotSupportedError)(`Wallet type ${walletResponse.type} not supported`);
@@ -413,7 +419,7 @@ var Wallet = class {
413
419
  signer: `external-wallet:${address}`
414
420
  };
415
421
  })) != null ? _c : [];
416
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.delegatedSigners.success", {
422
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.delegatedSigners.success", {
417
423
  count: signers.length
418
424
  });
419
425
  return signers;
@@ -441,7 +447,7 @@ var Wallet = class {
441
447
  }
442
448
  preAuthIfNeeded() {
443
449
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
444
- if (this.signer instanceof _chunkREP547HHcjs.NonCustodialSigner) {
450
+ if (this.signer instanceof _chunkKVYY4QDBcjs.NonCustodialSigner) {
445
451
  yield this.signer.ensureAuthenticated();
446
452
  }
447
453
  });
@@ -449,6 +455,13 @@ var Wallet = class {
449
455
  get isSolanaWallet() {
450
456
  return this.chain === "solana";
451
457
  }
458
+ resolveChainForEnvironment() {
459
+ const resolvedChain = _chunkGEHZRAAJcjs.validateChainForEnvironment.call(void 0, this.chain, _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).environment);
460
+ if (resolvedChain !== this.chain) {
461
+ this.chain = resolvedChain;
462
+ }
463
+ return this.chain;
464
+ }
452
465
  approveTransactionAndWait(transactionId, options) {
453
466
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
454
467
  yield this.approveTransactionInternal(transactionId, options);
@@ -544,7 +557,7 @@ var Wallet = class {
544
557
  }
545
558
  executeApproveTransactionWithErrorHandling(transactionId, approvals) {
546
559
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
547
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.approve: submitting approval to API", { transactionId });
560
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.approve: submitting approval to API", { transactionId });
548
561
  const approvedTransaction = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).approveTransaction(this.walletLocator, transactionId, {
549
562
  approvals
550
563
  });
@@ -569,7 +582,7 @@ var Wallet = class {
569
582
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
570
583
  let signatureResponse = null;
571
584
  do {
572
- yield new Promise((resolve) => setTimeout(resolve, _chunk5CBGJLA4cjs.STATUS_POLLING_INTERVAL_MS));
585
+ yield new Promise((resolve) => setTimeout(resolve, _chunkTQKCX7VNcjs.STATUS_POLLING_INTERVAL_MS));
573
586
  signatureResponse = yield _chunkUO2J2ZB2cjs.__privateGet.call(void 0, this, _apiClient).getSignature(this.walletLocator, signatureId);
574
587
  if ("error" in signatureResponse) {
575
588
  throw new (0, _chunkXC2V34TScjs.SignatureNotAvailableError)(JSON.stringify(signatureResponse));
@@ -591,10 +604,10 @@ var Wallet = class {
591
604
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, arguments, function* (transactionId, timeoutMs = 6e4, {
592
605
  backoffMultiplier = 1.1,
593
606
  maxBackoffMs = 2e3,
594
- initialBackoffMs = _chunk5CBGJLA4cjs.STATUS_POLLING_INTERVAL_MS
607
+ initialBackoffMs = _chunkTQKCX7VNcjs.STATUS_POLLING_INTERVAL_MS
595
608
  } = {}) {
596
609
  var _a;
597
- _chunkFQV77LH4cjs.walletsLogger.info("wallet.approve: waiting for transaction confirmation", { transactionId, timeoutMs });
610
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallet.approve: waiting for transaction confirmation", { transactionId, timeoutMs });
598
611
  const startTime = Date.now();
599
612
  let transactionResponse;
600
613
  do {
@@ -643,7 +656,7 @@ _options = new WeakMap();
643
656
  _apiClient = new WeakMap();
644
657
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
645
658
  _commonsdkbase.WithLoggerContext.call(void 0, {
646
- logger: _chunkFQV77LH4cjs.walletsLogger,
659
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
647
660
  methodName: "wallet.balances",
648
661
  buildContext(thisArg) {
649
662
  return { chain: thisArg.chain, address: thisArg.address };
@@ -652,7 +665,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
652
665
  ], Wallet.prototype, "balances", 1);
653
666
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
654
667
  _commonsdkbase.WithLoggerContext.call(void 0, {
655
- logger: _chunkFQV77LH4cjs.walletsLogger,
668
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
656
669
  methodName: "wallet.stagingFund",
657
670
  buildContext(thisArg) {
658
671
  return { chain: thisArg.chain, address: thisArg.address };
@@ -661,7 +674,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
661
674
  ], Wallet.prototype, "stagingFund", 1);
662
675
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
663
676
  _commonsdkbase.WithLoggerContext.call(void 0, {
664
- logger: _chunkFQV77LH4cjs.walletsLogger,
677
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
665
678
  methodName: "wallet.send",
666
679
  buildContext(thisArg) {
667
680
  return { chain: thisArg.chain, address: thisArg.address };
@@ -670,7 +683,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
670
683
  ], Wallet.prototype, "send", 1);
671
684
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
672
685
  _commonsdkbase.WithLoggerContext.call(void 0, {
673
- logger: _chunkFQV77LH4cjs.walletsLogger,
686
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
674
687
  methodName: "wallet.approve",
675
688
  buildContext(thisArg) {
676
689
  return { chain: thisArg.chain, address: thisArg.address };
@@ -679,7 +692,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
679
692
  ], Wallet.prototype, "approve", 1);
680
693
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
681
694
  _commonsdkbase.WithLoggerContext.call(void 0, {
682
- logger: _chunkFQV77LH4cjs.walletsLogger,
695
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
683
696
  methodName: "wallet.addDelegatedSigner",
684
697
  buildContext(thisArg) {
685
698
  return { chain: thisArg.chain, address: thisArg.address };
@@ -688,7 +701,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
688
701
  ], Wallet.prototype, "addDelegatedSigner", 1);
689
702
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
690
703
  _commonsdkbase.WithLoggerContext.call(void 0, {
691
- logger: _chunkFQV77LH4cjs.walletsLogger,
704
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
692
705
  methodName: "wallet.delegatedSigners",
693
706
  buildContext(thisArg) {
694
707
  return { chain: thisArg.chain, address: thisArg.address };
@@ -1,17 +1,17 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNXST74TXcjs = require('./chunk-NXST74TX.cjs');
3
+ var _chunk4ID6ZK4Acjs = require('./chunk-4ID6ZK4A.cjs');
4
4
 
5
5
 
6
+ var _chunkGEHZRAAJcjs = require('./chunk-GEHZRAAJ.cjs');
6
7
 
7
8
 
8
- var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
9
9
 
10
10
 
11
- var _chunkDIM3X4IXcjs = require('./chunk-DIM3X4IX.cjs');
11
+ var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
12
12
 
13
13
 
14
- var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
14
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
15
15
 
16
16
 
17
17
 
@@ -20,7 +20,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
20
20
  // src/wallets/evm.ts
21
21
  var _viem = require('viem');
22
22
  var _commonsdkbase = require('@crossmint/common-sdk-base');
23
- var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
23
+ var _EVMWallet = class _EVMWallet extends _chunk4ID6ZK4Acjs.Wallet {
24
24
  constructor(wallet) {
25
25
  super(
26
26
  {
@@ -28,10 +28,10 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
28
28
  address: wallet.address,
29
29
  owner: wallet.owner,
30
30
  signer: wallet.signer,
31
- options: _chunkNXST74TXcjs.Wallet.getOptions(wallet),
31
+ options: _chunk4ID6ZK4Acjs.Wallet.getOptions(wallet),
32
32
  alias: wallet.alias
33
33
  },
34
- _chunkNXST74TXcjs.Wallet.getApiClient(wallet)
34
+ _chunk4ID6ZK4Acjs.Wallet.getApiClient(wallet)
35
35
  );
36
36
  }
37
37
  static from(wallet) {
@@ -43,12 +43,12 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
43
43
  sendTransaction(params) {
44
44
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
45
45
  var _a;
46
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.sendTransaction.start");
46
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.sendTransaction.start");
47
47
  yield this.preAuthIfNeeded();
48
48
  const builtTransaction = this.buildTransaction(params);
49
49
  const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
50
50
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
51
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
51
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
52
52
  transactionId: createdTransaction.id
53
53
  });
54
54
  return {
@@ -58,7 +58,7 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
58
58
  };
59
59
  }
60
60
  const result = yield this.approveTransactionAndWait(createdTransaction.id);
61
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.sendTransaction.success", {
61
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.sendTransaction.success", {
62
62
  transactionId: createdTransaction.id,
63
63
  hash: result.hash
64
64
  });
@@ -68,7 +68,7 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
68
68
  signMessage(params) {
69
69
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
70
70
  var _a;
71
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signMessage.start");
71
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signMessage.start");
72
72
  yield this.preAuthIfNeeded();
73
73
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
74
74
  type: "message",
@@ -79,11 +79,11 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
79
79
  }
80
80
  });
81
81
  if ("error" in signatureCreationResponse) {
82
- _chunkFQV77LH4cjs.walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
82
+ _chunkVKXKQ5YIcjs.walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
83
83
  throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
84
84
  }
85
85
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
86
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signMessage.prepared", {
86
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signMessage.prepared", {
87
87
  signatureId: signatureCreationResponse.id
88
88
  });
89
89
  return {
@@ -92,23 +92,23 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
92
92
  };
93
93
  }
94
94
  const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
95
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
95
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
96
96
  return result;
97
97
  });
98
98
  }
99
99
  signTypedData(params) {
100
100
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
101
101
  var _a;
102
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signTypedData.start");
102
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signTypedData.start");
103
103
  yield this.preAuthIfNeeded();
104
104
  const { domain, message, primaryType, types, chain } = params;
105
105
  if (!domain || !message || !types || !chain) {
106
- _chunkFQV77LH4cjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
106
+ _chunkVKXKQ5YIcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
107
107
  throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data");
108
108
  }
109
109
  const { name, version, chainId, verifyingContract, salt } = domain;
110
110
  if (!name || !version || !chainId || !verifyingContract) {
111
- _chunkFQV77LH4cjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
111
+ _chunkVKXKQ5YIcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
112
112
  throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data domain");
113
113
  }
114
114
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
@@ -131,11 +131,11 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
131
131
  }
132
132
  });
133
133
  if ("error" in signatureCreationResponse) {
134
- _chunkFQV77LH4cjs.walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
134
+ _chunkVKXKQ5YIcjs.walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
135
135
  throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
136
136
  }
137
137
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
138
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
138
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
139
139
  signatureId: signatureCreationResponse.id
140
140
  });
141
141
  return {
@@ -144,7 +144,7 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
144
144
  };
145
145
  }
146
146
  const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
147
- _chunkFQV77LH4cjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
147
+ _chunkVKXKQ5YIcjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
148
148
  return result;
149
149
  });
150
150
  }
@@ -157,7 +157,7 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
157
157
  var _a;
158
158
  return _viem.createPublicClient.call(void 0, {
159
159
  transport: (_a = params == null ? void 0 : params.transport) != null ? _a : _viem.http.call(void 0, ),
160
- chain: _chunkDIM3X4IXcjs.toViemChain.call(void 0, this.chain)
160
+ chain: _chunkGEHZRAAJcjs.toViemChain.call(void 0, this.chain)
161
161
  });
162
162
  }
163
163
  createTransaction(transaction, options) {
@@ -205,7 +205,7 @@ var _EVMWallet = class _EVMWallet extends _chunkNXST74TXcjs.Wallet {
205
205
  };
206
206
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
207
207
  _commonsdkbase.WithLoggerContext.call(void 0, {
208
- logger: _chunkFQV77LH4cjs.walletsLogger,
208
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
209
209
  methodName: "evmWallet.sendTransaction",
210
210
  buildContext(thisArg) {
211
211
  return { chain: thisArg.chain, address: thisArg.address };
@@ -214,7 +214,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
214
214
  ], _EVMWallet.prototype, "sendTransaction", 1);
215
215
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
216
216
  _commonsdkbase.WithLoggerContext.call(void 0, {
217
- logger: _chunkFQV77LH4cjs.walletsLogger,
217
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
218
218
  methodName: "evmWallet.signMessage",
219
219
  buildContext(thisArg) {
220
220
  return { chain: thisArg.chain, address: thisArg.address };
@@ -223,7 +223,7 @@ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
223
223
  ], _EVMWallet.prototype, "signMessage", 1);
224
224
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
225
225
  _commonsdkbase.WithLoggerContext.call(void 0, {
226
- logger: _chunkFQV77LH4cjs.walletsLogger,
226
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
227
227
  methodName: "evmWallet.signTypedData",
228
228
  buildContext(thisArg) {
229
229
  return { chain: thisArg.chain, address: thisArg.address };
@@ -1,13 +1,13 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkEIZVQAZOcjs = require('./chunk-EIZVQAZO.cjs');
3
+ var _chunkSEV3UBGKcjs = require('./chunk-SEV3UBGK.cjs');
4
4
 
5
5
 
6
- var _chunkC5F6IECXcjs = require('./chunk-C5F6IECX.cjs');
6
+ var _chunkZLPFQ56Qcjs = require('./chunk-ZLPFQ56Q.cjs');
7
7
 
8
8
 
9
9
 
10
- var _chunkFQV77LH4cjs = require('./chunk-FQV77LH4.cjs');
10
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
11
11
 
12
12
 
13
13
  var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
@@ -16,10 +16,10 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
16
16
  var _commonsdkbase = require('@crossmint/common-sdk-base');
17
17
  var CrossmintWallets = class _CrossmintWallets {
18
18
  constructor(crossmint) {
19
- _chunkFQV77LH4cjs.initWalletsLogger.call(void 0, crossmint.apiKey);
20
- const apiClient = new (0, _chunkC5F6IECXcjs.ApiClient)(crossmint);
21
- this.walletFactory = new (0, _chunkEIZVQAZOcjs.WalletFactory)(apiClient);
22
- _chunkFQV77LH4cjs.walletsLogger.info("wallets.sdk.initialized");
19
+ _chunkVKXKQ5YIcjs.initWalletsLogger.call(void 0, crossmint.apiKey);
20
+ const apiClient = new (0, _chunkZLPFQ56Qcjs.ApiClient)(crossmint);
21
+ this.walletFactory = new (0, _chunkSEV3UBGKcjs.WalletFactory)(apiClient);
22
+ _chunkVKXKQ5YIcjs.walletsLogger.info("wallets.sdk.initialized");
23
23
  }
24
24
  /**
25
25
  * Initialize the Wallets SDK
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-W3OYA42M.js";
4
+ } from "./chunk-GWLAO3PX.js";
5
5
  import {
6
6
  walletsLogger
7
- } from "./chunk-S2AKC2CK.js";
7
+ } from "./chunk-DF3SZX2E.js";
8
8
  import {
9
9
  __async
10
10
  } from "./chunk-ASE2FXWP.js";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Wallet
3
- } from "./chunk-XEZBA7I2.js";
3
+ } from "./chunk-2APY4BUJ.js";
4
4
  import {
5
5
  TransactionNotCreatedError
6
6
  } from "./chunk-SGINWAB6.js";
7
7
  import {
8
8
  walletsLogger
9
- } from "./chunk-S2AKC2CK.js";
9
+ } from "./chunk-DF3SZX2E.js";
10
10
  import {
11
11
  __async,
12
12
  __decorateClass
@@ -1,7 +1,7 @@
1
1
  // src/chains/definitions/tempoTestnet.ts
2
2
  import { defineChain } from "viem";
3
3
  var tempoTestnet = defineChain({
4
- id: 42429,
4
+ id: 42431,
5
5
  name: "Tempo Testnet",
6
6
  nativeCurrency: {
7
7
  decimals: 6,
@@ -9,12 +9,12 @@ var tempoTestnet = defineChain({
9
9
  symbol: "pathUSD"
10
10
  },
11
11
  rpcUrls: {
12
- default: { http: ["https://rpc.testnet.tempo.xyz"] }
12
+ default: { http: ["https://rpc.moderato.tempo.xyz"] }
13
13
  },
14
14
  blockExplorers: {
15
15
  default: {
16
- name: "Tempo Scout",
17
- url: "https://scout.tempo.xyz"
16
+ name: "Tempo Explorer",
17
+ url: "https://explore.tempo.xyz"
18
18
  }
19
19
  },
20
20
  testnet: true
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-W3OYA42M.js";
4
+ } from "./chunk-GWLAO3PX.js";
5
5
  import {
6
6
  walletsLogger
7
- } from "./chunk-S2AKC2CK.js";
7
+ } from "./chunk-DF3SZX2E.js";
8
8
  import {
9
9
  __async
10
10
  } from "./chunk-ASE2FXWP.js";
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@crossmint/wallets-sdk";
3
- var version = "0.19.0";
3
+ var version = "0.20.0";
4
4
 
5
5
  // src/utils/constants.ts
6
6
  var WALLETS_SERVICE = "WALLETS_SDK";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SDK_NAME,
3
3
  SDK_VERSION
4
- } from "./chunk-KE6LX37B.js";
4
+ } from "./chunk-BQN5PNZK.js";
5
5
 
6
6
  // src/logger/init.ts
7
7
  import {