@crossmint/wallets-sdk 0.18.8 → 0.18.10

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 (130) hide show
  1. package/dist/api/client.cjs +5 -5
  2. package/dist/api/client.js +4 -4
  3. package/dist/api/gen/client.gen.cjs +1 -1
  4. package/dist/api/gen/client.gen.js +1 -1
  5. package/dist/api/gen/index.cjs +4 -4
  6. package/dist/api/gen/index.js +3 -3
  7. package/dist/api/gen/sdk.gen.cjs +3 -3
  8. package/dist/api/gen/sdk.gen.js +2 -2
  9. package/dist/api/gen/types.gen.d.cts +35 -35
  10. package/dist/api/gen/types.gen.d.ts +35 -35
  11. package/dist/api/index.cjs +5 -5
  12. package/dist/api/index.js +4 -4
  13. package/dist/chains/chains.cjs +5 -4
  14. package/dist/chains/chains.d.cts +1 -1
  15. package/dist/chains/chains.d.ts +1 -1
  16. package/dist/chains/chains.js +4 -3
  17. package/dist/chains/definitions/arcTestnet.cjs +1 -1
  18. package/dist/chains/definitions/arcTestnet.js +1 -1
  19. package/dist/chains/definitions/story.cjs +1 -1
  20. package/dist/chains/definitions/story.js +1 -1
  21. package/dist/chains/definitions/storyTestnet.cjs +1 -1
  22. package/dist/chains/definitions/storyTestnet.js +1 -1
  23. package/dist/chains/definitions/tempoTestnet.cjs +7 -0
  24. package/dist/chains/definitions/tempoTestnet.d.cts +43 -0
  25. package/dist/chains/definitions/tempoTestnet.d.ts +43 -0
  26. package/dist/chains/definitions/tempoTestnet.js +7 -0
  27. package/dist/{chunk-ZTGRDOOH.js → chunk-2I2OFGNL.js} +1 -1
  28. package/dist/{chunk-ZPH2YLZO.js → chunk-3RSZDA3X.js} +2 -2
  29. package/dist/{chunk-MZBFXUHT.js → chunk-47WKYTRN.js} +1 -1
  30. package/dist/{chunk-BRNT3DZP.cjs → chunk-4GFSUI2I.cjs} +3 -3
  31. package/dist/{chunk-N3RG7OZW.cjs → chunk-5KFST6KH.cjs} +60 -37
  32. package/dist/chunk-6H6ZBJC2.cjs +25 -0
  33. package/dist/chunk-6Z5QSTIS.cjs +58 -0
  34. package/dist/{chunk-YSDATSFB.js → chunk-73EJIGRV.js} +30 -7
  35. package/dist/{chunk-AL77JANE.js → chunk-7GOUUPS4.js} +1 -1
  36. package/dist/{chunk-LLDPJU6L.cjs → chunk-AN7MHABM.cjs} +6 -6
  37. package/dist/{chunk-FPMW7Q5O.js → chunk-ASE2FXWP.js} +10 -0
  38. package/dist/{chunk-ZBW2YHQZ.cjs → chunk-AZIXXLMP.cjs} +29 -29
  39. package/dist/{chunk-RTRDZB52.js → chunk-BMMZIPXT.js} +1 -1
  40. package/dist/{chunk-V3QJQUT7.cjs → chunk-COR3CNRW.cjs} +128 -128
  41. package/dist/{chunk-SXR4KWXS.js → chunk-CQNVHQHH.js} +3 -3
  42. package/dist/{chunk-V3FETRWW.js → chunk-FOOISYCJ.js} +1 -1
  43. package/dist/{chunk-FWC2WXFN.cjs → chunk-GRAV7BTN.cjs} +31 -8
  44. package/dist/{chunk-6QEK7D2B.cjs → chunk-GROJZ247.cjs} +10 -4
  45. package/dist/{chunk-YBA7WO32.cjs → chunk-IOMKHF6R.cjs} +3 -3
  46. package/dist/{chunk-EYJQSDDI.js → chunk-IPO25BCU.js} +1 -1
  47. package/dist/{chunk-4NHVYWZC.js → chunk-IYTDGUGZ.js} +116 -50
  48. package/dist/chunk-IZJUOXOZ.js +25 -0
  49. package/dist/{chunk-CHGPNMRL.cjs → chunk-JSWTGW46.cjs} +3 -3
  50. package/dist/{chunk-K5HDSLUV.js → chunk-KMHPLOVX.js} +4 -4
  51. package/dist/{chunk-ASJVZCHA.js → chunk-LVSVT2VD.js} +1 -1
  52. package/dist/{chunk-SD7I7CQ4.cjs → chunk-MNJA5EPY.cjs} +6 -6
  53. package/dist/{chunk-2JCKWYGA.cjs → chunk-NBDHZJ44.cjs} +11 -11
  54. package/dist/{chunk-3ZIQQ4PW.js → chunk-NIHJXITI.js} +52 -29
  55. package/dist/{chunk-PROOTUIO.js → chunk-NJTKHWXR.js} +10 -4
  56. package/dist/{chunk-4CPLMKRO.cjs → chunk-OFQDCA2H.cjs} +1 -1
  57. package/dist/{chunk-PCFXTJL4.cjs → chunk-OWGPEA2A.cjs} +3 -3
  58. package/dist/{chunk-DQCXGBZM.js → chunk-PIFD6KNH.js} +1 -1
  59. package/dist/{chunk-WC7T2CR4.js → chunk-PK7J3Y3L.js} +1 -1
  60. package/dist/{chunk-R2OY54EJ.cjs → chunk-Q5KNPVYI.cjs} +3 -3
  61. package/dist/{chunk-Y24JAHPT.cjs → chunk-QXJZ75GW.cjs} +166 -100
  62. package/dist/{chunk-7L5EEVWT.js → chunk-R5TY6M5Z.js} +66 -9
  63. package/dist/{chunk-NUOU3SCU.js → chunk-RCK3ZEP7.js} +2 -2
  64. package/dist/{chunk-TR2CW644.js → chunk-SYZKDDGK.js} +2 -2
  65. package/dist/{chunk-EAMPCH35.cjs → chunk-TEQYWMHS.cjs} +13 -13
  66. package/dist/{chunk-BQF3R3BC.cjs → chunk-TYN3KL7U.cjs} +33 -10
  67. package/dist/{chunk-G5NYLGM5.cjs → chunk-UO2J2ZB2.cjs} +11 -1
  68. package/dist/{chunk-HNISEOCV.js → chunk-UPS2UQJO.js} +2 -2
  69. package/dist/{chunk-M4JBQNOI.cjs → chunk-UXNFYAIS.cjs} +71 -14
  70. package/dist/{chunk-ZFFB4RDK.js → chunk-UZN67GMO.js} +9 -9
  71. package/dist/{chunk-5BSYP2R3.cjs → chunk-WFGKVGZ2.cjs} +7 -7
  72. package/dist/{chunk-LLFD22UQ.cjs → chunk-XOCC3MPK.cjs} +3 -3
  73. package/dist/{chunk-V2DJ5TIR.js → chunk-YNLL6GP4.js} +29 -6
  74. package/dist/{chunk-VRMQGFQX.js → chunk-ZJUXMOUB.js} +1 -1
  75. package/dist/{chunk-BSC55MYK.cjs → chunk-ZNAGDENG.cjs} +3 -3
  76. package/dist/{chunk-7ECQJFYM.cjs → chunk-ZTEMOYS2.cjs} +3 -3
  77. package/dist/index.cjs +26 -25
  78. package/dist/index.js +25 -24
  79. package/dist/logger/index.cjs +4 -4
  80. package/dist/logger/index.js +3 -3
  81. package/dist/logger/init.cjs +4 -4
  82. package/dist/logger/init.js +3 -3
  83. package/dist/sdk.cjs +20 -20
  84. package/dist/sdk.js +19 -19
  85. package/dist/signers/evm-api-key.cjs +3 -3
  86. package/dist/signers/evm-api-key.js +2 -2
  87. package/dist/signers/evm-external-wallet.cjs +3 -3
  88. package/dist/signers/evm-external-wallet.js +2 -2
  89. package/dist/signers/index.cjs +14 -14
  90. package/dist/signers/index.js +13 -13
  91. package/dist/signers/non-custodial/index.cjs +7 -7
  92. package/dist/signers/non-custodial/index.js +6 -6
  93. package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
  94. package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
  95. package/dist/signers/non-custodial/ncs-iframe-manager.cjs +3 -3
  96. package/dist/signers/non-custodial/ncs-iframe-manager.js +2 -2
  97. package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
  98. package/dist/signers/non-custodial/ncs-signer.js +3 -3
  99. package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
  100. package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
  101. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
  102. package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
  103. package/dist/signers/passkey.cjs +3 -3
  104. package/dist/signers/passkey.js +2 -2
  105. package/dist/signers/solana-api-key.cjs +3 -3
  106. package/dist/signers/solana-api-key.js +2 -2
  107. package/dist/signers/solana-external-wallet.cjs +3 -3
  108. package/dist/signers/solana-external-wallet.js +2 -2
  109. package/dist/signers/stellar-external-wallet.cjs +3 -3
  110. package/dist/signers/stellar-external-wallet.js +2 -2
  111. package/dist/signers/types.cjs +1 -1
  112. package/dist/signers/types.js +1 -1
  113. package/dist/utils/constants.cjs +3 -3
  114. package/dist/utils/constants.js +2 -2
  115. package/dist/utils/errors.cjs +1 -1
  116. package/dist/utils/errors.js +1 -1
  117. package/dist/utils/signer-validation.cjs +1 -1
  118. package/dist/utils/signer-validation.js +1 -1
  119. package/dist/wallets/evm.cjs +15 -12
  120. package/dist/wallets/evm.js +14 -11
  121. package/dist/wallets/solana.cjs +13 -11
  122. package/dist/wallets/solana.js +12 -10
  123. package/dist/wallets/stellar.cjs +12 -10
  124. package/dist/wallets/stellar.js +11 -9
  125. package/dist/wallets/wallet-factory.cjs +18 -18
  126. package/dist/wallets/wallet-factory.js +17 -17
  127. package/dist/wallets/wallet.cjs +11 -9
  128. package/dist/wallets/wallet.js +10 -8
  129. package/package.json +3 -3
  130. package/dist/chunk-3LKDNHF5.cjs +0 -58
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Wallet
3
- } from "./chunk-4NHVYWZC.js";
3
+ } from "./chunk-IYTDGUGZ.js";
4
4
  import {
5
5
  InvalidTypedDataError,
6
6
  SignatureNotCreatedError,
@@ -8,15 +8,19 @@ import {
8
8
  } from "./chunk-SGINWAB6.js";
9
9
  import {
10
10
  toViemChain
11
- } from "./chunk-PROOTUIO.js";
11
+ } from "./chunk-NJTKHWXR.js";
12
12
  import {
13
- __async
14
- } from "./chunk-FPMW7Q5O.js";
13
+ walletsLogger
14
+ } from "./chunk-ZJUXMOUB.js";
15
+ import {
16
+ __async,
17
+ __decorateClass
18
+ } from "./chunk-ASE2FXWP.js";
15
19
 
16
20
  // src/wallets/evm.ts
17
21
  import { createPublicClient, encodeFunctionData, http } from "viem";
18
- import { isValidEvmAddress } from "@crossmint/common-sdk-base";
19
- var EVMWallet = class _EVMWallet extends Wallet {
22
+ import { isValidEvmAddress, WithLoggerContext } from "@crossmint/common-sdk-base";
23
+ var _EVMWallet = class _EVMWallet extends Wallet {
20
24
  constructor(wallet) {
21
25
  super(
22
26
  {
@@ -39,22 +43,32 @@ var EVMWallet = class _EVMWallet extends Wallet {
39
43
  sendTransaction(params) {
40
44
  return __async(this, null, function* () {
41
45
  var _a;
46
+ walletsLogger.info("evmWallet.sendTransaction.start");
42
47
  yield this.preAuthIfNeeded();
43
48
  const builtTransaction = this.buildTransaction(params);
44
49
  const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
45
50
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
51
+ walletsLogger.info("evmWallet.sendTransaction.prepared", {
52
+ transactionId: createdTransaction.id
53
+ });
46
54
  return {
47
55
  hash: void 0,
48
56
  explorerLink: void 0,
49
57
  transactionId: createdTransaction.id
50
58
  };
51
59
  }
52
- return yield this.approveTransactionAndWait(createdTransaction.id);
60
+ const result = yield this.approveTransactionAndWait(createdTransaction.id);
61
+ walletsLogger.info("evmWallet.sendTransaction.success", {
62
+ transactionId: createdTransaction.id,
63
+ hash: result.hash
64
+ });
65
+ return result;
53
66
  });
54
67
  }
55
68
  signMessage(params) {
56
69
  return __async(this, null, function* () {
57
70
  var _a;
71
+ walletsLogger.info("evmWallet.signMessage.start");
58
72
  yield this.preAuthIfNeeded();
59
73
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
60
74
  type: "message",
@@ -65,27 +79,36 @@ var EVMWallet = class _EVMWallet extends Wallet {
65
79
  }
66
80
  });
67
81
  if ("error" in signatureCreationResponse) {
82
+ walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
68
83
  throw new SignatureNotCreatedError(JSON.stringify(signatureCreationResponse));
69
84
  }
70
85
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
86
+ walletsLogger.info("evmWallet.signMessage.prepared", {
87
+ signatureId: signatureCreationResponse.id
88
+ });
71
89
  return {
72
90
  signature: void 0,
73
91
  signatureId: signatureCreationResponse.id
74
92
  };
75
93
  }
76
- return yield this.approveSignatureAndWait(signatureCreationResponse.id);
94
+ const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
95
+ walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
96
+ return result;
77
97
  });
78
98
  }
79
99
  signTypedData(params) {
80
100
  return __async(this, null, function* () {
81
101
  var _a;
102
+ walletsLogger.info("evmWallet.signTypedData.start");
82
103
  yield this.preAuthIfNeeded();
83
104
  const { domain, message, primaryType, types, chain } = params;
84
105
  if (!domain || !message || !types || !chain) {
106
+ walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
85
107
  throw new InvalidTypedDataError("Invalid typed data");
86
108
  }
87
109
  const { name, version, chainId, verifyingContract, salt } = domain;
88
110
  if (!name || !version || !chainId || !verifyingContract) {
111
+ walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
89
112
  throw new InvalidTypedDataError("Invalid typed data domain");
90
113
  }
91
114
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
@@ -108,15 +131,21 @@ var EVMWallet = class _EVMWallet extends Wallet {
108
131
  }
109
132
  });
110
133
  if ("error" in signatureCreationResponse) {
134
+ walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
111
135
  throw new SignatureNotCreatedError(JSON.stringify(signatureCreationResponse));
112
136
  }
113
137
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
138
+ walletsLogger.info("evmWallet.signTypedData.prepared", {
139
+ signatureId: signatureCreationResponse.id
140
+ });
114
141
  return {
115
142
  signature: void 0,
116
143
  signatureId: signatureCreationResponse.id
117
144
  };
118
145
  }
119
- return yield this.approveSignatureAndWait(signatureCreationResponse.id);
146
+ const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
147
+ walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
148
+ return result;
120
149
  });
121
150
  }
122
151
  getViemClient(params) {
@@ -169,6 +198,34 @@ var EVMWallet = class _EVMWallet extends Wallet {
169
198
  };
170
199
  }
171
200
  };
201
+ __decorateClass([
202
+ WithLoggerContext({
203
+ logger: walletsLogger,
204
+ methodName: "evmWallet.sendTransaction",
205
+ buildContext(thisArg) {
206
+ return { chain: thisArg.chain, address: thisArg.address };
207
+ }
208
+ })
209
+ ], _EVMWallet.prototype, "sendTransaction", 1);
210
+ __decorateClass([
211
+ WithLoggerContext({
212
+ logger: walletsLogger,
213
+ methodName: "evmWallet.signMessage",
214
+ buildContext(thisArg) {
215
+ return { chain: thisArg.chain, address: thisArg.address };
216
+ }
217
+ })
218
+ ], _EVMWallet.prototype, "signMessage", 1);
219
+ __decorateClass([
220
+ WithLoggerContext({
221
+ logger: walletsLogger,
222
+ methodName: "evmWallet.signTypedData",
223
+ buildContext(thisArg) {
224
+ return { chain: thisArg.chain, address: thisArg.address };
225
+ }
226
+ })
227
+ ], _EVMWallet.prototype, "signTypedData", 1);
228
+ var EVMWallet = _EVMWallet;
172
229
 
173
230
  export {
174
231
  EVMWallet
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  NcsIframeManager
3
- } from "./chunk-V3FETRWW.js";
3
+ } from "./chunk-FOOISYCJ.js";
4
4
  import {
5
5
  AuthRejectedError
6
6
  } from "./chunk-WJUPOCKJ.js";
7
7
  import {
8
8
  __async
9
- } from "./chunk-FPMW7Q5O.js";
9
+ } from "./chunk-ASE2FXWP.js";
10
10
 
11
11
  // src/signers/non-custodial/ncs-signer.ts
12
12
  import { validateAPIKey } from "@crossmint/common-sdk-base";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-NUOU3SCU.js";
4
+ } from "./chunk-RCK3ZEP7.js";
5
5
  import {
6
6
  __async
7
- } from "./chunk-FPMW7Q5O.js";
7
+ } from "./chunk-ASE2FXWP.js";
8
8
 
9
9
  // src/signers/non-custodial/ncs-stellar-signer.ts
10
10
  var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends NonCustodialSigner {
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkBRNT3DZPcjs = require('./chunk-BRNT3DZP.cjs');
3
+ var _chunk4GFSUI2Icjs = require('./chunk-4GFSUI2I.cjs');
4
4
 
5
5
 
6
6
  var _chunkRHR6P2KPcjs = require('./chunk-RHR6P2KP.cjs');
7
7
 
8
8
 
9
- var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
9
+ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
10
10
 
11
11
  // src/signers/non-custodial/ncs-signer.ts
12
12
  var _commonsdkbase = require('@crossmint/common-sdk-base');
@@ -28,13 +28,13 @@ var NonCustodialSigner = class {
28
28
  return this.config.address;
29
29
  }
30
30
  initialize() {
31
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
31
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
32
32
  if (this.config.clientTEEConnection == null) {
33
33
  const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
34
34
  if (!parsedAPIKey.isValid) {
35
35
  throw new Error("Invalid API key");
36
36
  }
37
- const iframeManager = new (0, _chunkBRNT3DZPcjs.NcsIframeManager)({
37
+ const iframeManager = new (0, _chunk4GFSUI2Icjs.NcsIframeManager)({
38
38
  environment: parsedAPIKey.environment
39
39
  });
40
40
  this.config.clientTEEConnection = yield iframeManager.initialize();
@@ -42,7 +42,7 @@ var NonCustodialSigner = class {
42
42
  });
43
43
  }
44
44
  getTEEConnection() {
45
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
45
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
46
46
  if (this.config.clientTEEConnection == null) {
47
47
  if (this._initializationPromise) {
48
48
  yield this._initializationPromise;
@@ -59,13 +59,13 @@ var NonCustodialSigner = class {
59
59
  });
60
60
  }
61
61
  initializeTEEConnection() {
62
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
62
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
63
63
  console.warn("TEE connection is not initialized, initializing now...");
64
64
  const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
65
65
  if (!parsedAPIKey.isValid) {
66
66
  throw new Error("Invalid API key");
67
67
  }
68
- const iframeManager = new (0, _chunkBRNT3DZPcjs.NcsIframeManager)({
68
+ const iframeManager = new (0, _chunk4GFSUI2Icjs.NcsIframeManager)({
69
69
  environment: parsedAPIKey.environment
70
70
  });
71
71
  this.config.clientTEEConnection = yield iframeManager.initialize();
@@ -76,7 +76,7 @@ var NonCustodialSigner = class {
76
76
  });
77
77
  }
78
78
  handleAuthRequired() {
79
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
79
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
80
80
  var _a, _b;
81
81
  const clientTEEConnection = yield this.getTEEConnection();
82
82
  if (this.config.onAuthRequired == null) {
@@ -112,7 +112,7 @@ var NonCustodialSigner = class {
112
112
  this._needsAuth,
113
113
  () => this.sendMessageWithOtp(),
114
114
  (otp) => this.verifyOtp(otp),
115
- () => _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
115
+ () => _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
116
116
  this._needsAuth = false;
117
117
  if (this.config.onAuthRequired != null) {
118
118
  yield this.config.onAuthRequired(
@@ -140,7 +140,7 @@ var NonCustodialSigner = class {
140
140
  });
141
141
  }
142
142
  ensureAuthenticated() {
143
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
143
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
144
144
  yield this.handleAuthRequired();
145
145
  });
146
146
  }
@@ -162,7 +162,7 @@ var NonCustodialSigner = class {
162
162
  return { promise, resolve: resolvePromise, reject: rejectPromise };
163
163
  }
164
164
  sendMessageWithOtp() {
165
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
165
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
166
166
  var _a, _b, _c;
167
167
  const handshakeParent = yield this.getTEEConnection();
168
168
  const authId = this.getAuthId();
@@ -195,7 +195,7 @@ var NonCustodialSigner = class {
195
195
  return `phone:${this.config.phone}`;
196
196
  }
197
197
  verifyOtp(encryptedOtp) {
198
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
198
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
199
199
  var _a, _b, _c, _d, _e;
200
200
  let response;
201
201
  try {
@@ -249,7 +249,7 @@ var NonCustodialSigner = class {
249
249
  * @throws {Error} If signer is not authenticated
250
250
  */
251
251
  _exportPrivateKey(exportTEEConnection) {
252
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
252
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
253
253
  yield this.handleAuthRequired();
254
254
  const jwt = this.getJwtOrThrow();
255
255
  const { scheme, encoding } = this.getChainKeyParams();
@@ -1,20 +1,24 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkY24JAHPTcjs = require('./chunk-Y24JAHPT.cjs');
3
+ var _chunkQXJZ75GWcjs = require('./chunk-QXJZ75GW.cjs');
4
4
 
5
5
 
6
- var _chunkR2OY54EJcjs = require('./chunk-R2OY54EJ.cjs');
6
+ var _chunkQ5KNPVYIcjs = require('./chunk-Q5KNPVYI.cjs');
7
7
 
8
8
 
9
9
  var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
10
10
 
11
11
 
12
- var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
12
+ var _chunkOWGPEA2Acjs = require('./chunk-OWGPEA2A.cjs');
13
+
14
+
15
+
16
+ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
13
17
 
14
18
  // src/wallets/solana.ts
15
19
  var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
16
20
  var _commonsdkbase = require('@crossmint/common-sdk-base');
17
- var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
21
+ var _SolanaWallet = class _SolanaWallet extends _chunkQXJZ75GWcjs.Wallet {
18
22
  constructor(wallet) {
19
23
  super(
20
24
  {
@@ -22,10 +26,10 @@ var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
22
26
  address: wallet.address,
23
27
  owner: wallet.owner,
24
28
  signer: wallet.signer,
25
- options: _chunkY24JAHPTcjs.Wallet.getOptions(wallet),
29
+ options: _chunkQXJZ75GWcjs.Wallet.getOptions(wallet),
26
30
  alias: wallet.alias
27
31
  },
28
- _chunkY24JAHPTcjs.Wallet.getApiClient(wallet)
32
+ _chunkQXJZ75GWcjs.Wallet.getApiClient(wallet)
29
33
  );
30
34
  }
31
35
  static from(wallet) {
@@ -35,11 +39,15 @@ var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
35
39
  return new _SolanaWallet(wallet);
36
40
  }
37
41
  sendTransaction(params) {
38
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
42
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
39
43
  var _a, _b;
44
+ _chunkOWGPEA2Acjs.walletsLogger.info("solanaWallet.sendTransaction.start");
40
45
  yield this.preAuthIfNeeded();
41
46
  const createdTransaction = yield this.createTransaction(params);
42
47
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
48
+ _chunkOWGPEA2Acjs.walletsLogger.info("solanaWallet.sendTransaction.prepared", {
49
+ transactionId: createdTransaction.id
50
+ });
43
51
  return {
44
52
  hash: void 0,
45
53
  explorerLink: void 0,
@@ -47,7 +55,7 @@ var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
47
55
  };
48
56
  }
49
57
  const _additionalSigners = (_b = params.additionalSigners) == null ? void 0 : _b.map(
50
- (signer) => new (0, _chunkR2OY54EJcjs.SolanaExternalWalletSigner)({
58
+ (signer) => new (0, _chunkQ5KNPVYIcjs.SolanaExternalWalletSigner)({
51
59
  type: "external-wallet",
52
60
  address: signer.publicKey.toString(),
53
61
  locator: `external-wallet:${signer.publicKey.toString()}`,
@@ -60,11 +68,16 @@ var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
60
68
  const options = {
61
69
  additionalSigners: _additionalSigners
62
70
  };
63
- return yield this.approveTransactionAndWait(createdTransaction.id, options);
71
+ const result = yield this.approveTransactionAndWait(createdTransaction.id, options);
72
+ _chunkOWGPEA2Acjs.walletsLogger.info("solanaWallet.sendTransaction.success", {
73
+ transactionId: createdTransaction.id,
74
+ hash: result.hash
75
+ });
76
+ return result;
64
77
  });
65
78
  }
66
79
  createTransaction(params) {
67
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
80
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
68
81
  var _a, _b;
69
82
  const signer = (_b = (_a = params.options) == null ? void 0 : _a.experimental_signer) != null ? _b : this.signer.locator();
70
83
  let serializedTransaction;
@@ -86,6 +99,16 @@ var SolanaWallet = class _SolanaWallet extends _chunkY24JAHPTcjs.Wallet {
86
99
  });
87
100
  }
88
101
  };
102
+ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
103
+ _commonsdkbase.WithLoggerContext.call(void 0, {
104
+ logger: _chunkOWGPEA2Acjs.walletsLogger,
105
+ methodName: "solanaWallet.sendTransaction",
106
+ buildContext(thisArg) {
107
+ return { chain: thisArg.chain, address: thisArg.address };
108
+ }
109
+ })
110
+ ], _SolanaWallet.prototype, "sendTransaction", 1);
111
+ var SolanaWallet = _SolanaWallet;
89
112
 
90
113
 
91
114
 
@@ -1,5 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
5
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
@@ -20,6 +21,14 @@ var __spreadValues = (a, b) => {
20
21
  return a;
21
22
  };
22
23
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __decorateClass = (decorators, target, key, kind) => {
25
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
26
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
27
+ if (decorator = decorators[i])
28
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
29
+ if (kind && result) __defProp(target, key, result);
30
+ return result;
31
+ };
23
32
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
24
33
  var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
25
34
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
@@ -52,4 +61,5 @@ var __async = (__this, __arguments, generator) => {
52
61
 
53
62
 
54
63
 
55
- exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__async = __async;
64
+
65
+ exports.__spreadValues = __spreadValues; exports.__spreadProps = __spreadProps; exports.__decorateClass = __decorateClass; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__async = __async;
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-NUOU3SCU.js";
4
+ } from "./chunk-RCK3ZEP7.js";
5
5
  import {
6
6
  __async
7
- } from "./chunk-FPMW7Q5O.js";
7
+ } from "./chunk-ASE2FXWP.js";
8
8
 
9
9
  // src/signers/non-custodial/ncs-evm-signer.ts
10
10
  import { PersonalMessage } from "ox";
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkY24JAHPTcjs = require('./chunk-Y24JAHPT.cjs');
3
+ var _chunkQXJZ75GWcjs = require('./chunk-QXJZ75GW.cjs');
4
4
 
5
5
 
6
6
 
@@ -8,15 +8,19 @@ var _chunkY24JAHPTcjs = require('./chunk-Y24JAHPT.cjs');
8
8
  var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
9
9
 
10
10
 
11
- var _chunk6QEK7D2Bcjs = require('./chunk-6QEK7D2B.cjs');
11
+ var _chunkGROJZ247cjs = require('./chunk-GROJZ247.cjs');
12
12
 
13
13
 
14
- var _chunkG5NYLGM5cjs = require('./chunk-G5NYLGM5.cjs');
14
+ var _chunkOWGPEA2Acjs = require('./chunk-OWGPEA2A.cjs');
15
+
16
+
17
+
18
+ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
15
19
 
16
20
  // src/wallets/evm.ts
17
21
  var _viem = require('viem');
18
22
  var _commonsdkbase = require('@crossmint/common-sdk-base');
19
- var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
23
+ var _EVMWallet = class _EVMWallet extends _chunkQXJZ75GWcjs.Wallet {
20
24
  constructor(wallet) {
21
25
  super(
22
26
  {
@@ -24,10 +28,10 @@ var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
24
28
  address: wallet.address,
25
29
  owner: wallet.owner,
26
30
  signer: wallet.signer,
27
- options: _chunkY24JAHPTcjs.Wallet.getOptions(wallet),
31
+ options: _chunkQXJZ75GWcjs.Wallet.getOptions(wallet),
28
32
  alias: wallet.alias
29
33
  },
30
- _chunkY24JAHPTcjs.Wallet.getApiClient(wallet)
34
+ _chunkQXJZ75GWcjs.Wallet.getApiClient(wallet)
31
35
  );
32
36
  }
33
37
  static from(wallet) {
@@ -37,24 +41,34 @@ var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
37
41
  return new _EVMWallet(wallet);
38
42
  }
39
43
  sendTransaction(params) {
40
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
44
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
41
45
  var _a;
46
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.sendTransaction.start");
42
47
  yield this.preAuthIfNeeded();
43
48
  const builtTransaction = this.buildTransaction(params);
44
49
  const createdTransaction = yield this.createTransaction(builtTransaction, params.options);
45
50
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
51
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.sendTransaction.prepared", {
52
+ transactionId: createdTransaction.id
53
+ });
46
54
  return {
47
55
  hash: void 0,
48
56
  explorerLink: void 0,
49
57
  transactionId: createdTransaction.id
50
58
  };
51
59
  }
52
- return yield this.approveTransactionAndWait(createdTransaction.id);
60
+ const result = yield this.approveTransactionAndWait(createdTransaction.id);
61
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.sendTransaction.success", {
62
+ transactionId: createdTransaction.id,
63
+ hash: result.hash
64
+ });
65
+ return result;
53
66
  });
54
67
  }
55
68
  signMessage(params) {
56
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
69
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
57
70
  var _a;
71
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signMessage.start");
58
72
  yield this.preAuthIfNeeded();
59
73
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
60
74
  type: "message",
@@ -65,27 +79,36 @@ var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
65
79
  }
66
80
  });
67
81
  if ("error" in signatureCreationResponse) {
82
+ _chunkOWGPEA2Acjs.walletsLogger.error("evmWallet.signMessage.error", { error: signatureCreationResponse });
68
83
  throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
69
84
  }
70
85
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
86
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signMessage.prepared", {
87
+ signatureId: signatureCreationResponse.id
88
+ });
71
89
  return {
72
90
  signature: void 0,
73
91
  signatureId: signatureCreationResponse.id
74
92
  };
75
93
  }
76
- return yield this.approveSignatureAndWait(signatureCreationResponse.id);
94
+ const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
95
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signMessage.success", { signatureId: signatureCreationResponse.id });
96
+ return result;
77
97
  });
78
98
  }
79
99
  signTypedData(params) {
80
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
100
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
81
101
  var _a;
102
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signTypedData.start");
82
103
  yield this.preAuthIfNeeded();
83
104
  const { domain, message, primaryType, types, chain } = params;
84
105
  if (!domain || !message || !types || !chain) {
106
+ _chunkOWGPEA2Acjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data" });
85
107
  throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data");
86
108
  }
87
109
  const { name, version, chainId, verifyingContract, salt } = domain;
88
110
  if (!name || !version || !chainId || !verifyingContract) {
111
+ _chunkOWGPEA2Acjs.walletsLogger.error("evmWallet.signTypedData.error", { error: "Invalid typed data domain" });
89
112
  throw new (0, _chunkXC2V34TScjs.InvalidTypedDataError)("Invalid typed data domain");
90
113
  }
91
114
  const signatureCreationResponse = yield this.apiClient.createSignature(this.walletLocator, {
@@ -108,26 +131,32 @@ var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
108
131
  }
109
132
  });
110
133
  if ("error" in signatureCreationResponse) {
134
+ _chunkOWGPEA2Acjs.walletsLogger.error("evmWallet.signTypedData.error", { error: signatureCreationResponse });
111
135
  throw new (0, _chunkXC2V34TScjs.SignatureNotCreatedError)(JSON.stringify(signatureCreationResponse));
112
136
  }
113
137
  if ((_a = params.options) == null ? void 0 : _a.experimental_prepareOnly) {
138
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signTypedData.prepared", {
139
+ signatureId: signatureCreationResponse.id
140
+ });
114
141
  return {
115
142
  signature: void 0,
116
143
  signatureId: signatureCreationResponse.id
117
144
  };
118
145
  }
119
- return yield this.approveSignatureAndWait(signatureCreationResponse.id);
146
+ const result = yield this.approveSignatureAndWait(signatureCreationResponse.id);
147
+ _chunkOWGPEA2Acjs.walletsLogger.info("evmWallet.signTypedData.success", { signatureId: signatureCreationResponse.id });
148
+ return result;
120
149
  });
121
150
  }
122
151
  getViemClient(params) {
123
152
  var _a;
124
153
  return _viem.createPublicClient.call(void 0, {
125
154
  transport: (_a = params == null ? void 0 : params.transport) != null ? _a : _viem.http.call(void 0, ),
126
- chain: _chunk6QEK7D2Bcjs.toViemChain.call(void 0, this.chain)
155
+ chain: _chunkGROJZ247cjs.toViemChain.call(void 0, this.chain)
127
156
  });
128
157
  }
129
158
  createTransaction(transaction, options) {
130
- return _chunkG5NYLGM5cjs.__async.call(void 0, this, null, function* () {
159
+ return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
131
160
  var _a;
132
161
  const signer = (_a = options == null ? void 0 : options.experimental_signer) != null ? _a : this.signer.locator();
133
162
  const transactionCreationResponse = yield this.apiClient.createTransaction(this.walletLocator, {
@@ -169,6 +198,34 @@ var EVMWallet = class _EVMWallet extends _chunkY24JAHPTcjs.Wallet {
169
198
  };
170
199
  }
171
200
  };
201
+ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
202
+ _commonsdkbase.WithLoggerContext.call(void 0, {
203
+ logger: _chunkOWGPEA2Acjs.walletsLogger,
204
+ methodName: "evmWallet.sendTransaction",
205
+ buildContext(thisArg) {
206
+ return { chain: thisArg.chain, address: thisArg.address };
207
+ }
208
+ })
209
+ ], _EVMWallet.prototype, "sendTransaction", 1);
210
+ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
211
+ _commonsdkbase.WithLoggerContext.call(void 0, {
212
+ logger: _chunkOWGPEA2Acjs.walletsLogger,
213
+ methodName: "evmWallet.signMessage",
214
+ buildContext(thisArg) {
215
+ return { chain: thisArg.chain, address: thisArg.address };
216
+ }
217
+ })
218
+ ], _EVMWallet.prototype, "signMessage", 1);
219
+ _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
220
+ _commonsdkbase.WithLoggerContext.call(void 0, {
221
+ logger: _chunkOWGPEA2Acjs.walletsLogger,
222
+ methodName: "evmWallet.signTypedData",
223
+ buildContext(thisArg) {
224
+ return { chain: thisArg.chain, address: thisArg.address };
225
+ }
226
+ })
227
+ ], _EVMWallet.prototype, "signTypedData", 1);
228
+ var EVMWallet = _EVMWallet;
172
229
 
173
230
 
174
231
 
@@ -1,30 +1,30 @@
1
1
  import {
2
2
  EVMNonCustodialSigner
3
- } from "./chunk-HNISEOCV.js";
3
+ } from "./chunk-UPS2UQJO.js";
4
4
  import {
5
5
  SolanaNonCustodialSigner
6
- } from "./chunk-ZPH2YLZO.js";
6
+ } from "./chunk-3RSZDA3X.js";
7
7
  import {
8
8
  StellarNonCustodialSigner
9
- } from "./chunk-TR2CW644.js";
9
+ } from "./chunk-SYZKDDGK.js";
10
10
  import {
11
11
  EVMApiKeySigner
12
- } from "./chunk-AL77JANE.js";
12
+ } from "./chunk-7GOUUPS4.js";
13
13
  import {
14
14
  EVMExternalWalletSigner
15
- } from "./chunk-MZBFXUHT.js";
15
+ } from "./chunk-47WKYTRN.js";
16
16
  import {
17
17
  PasskeySigner
18
- } from "./chunk-EYJQSDDI.js";
18
+ } from "./chunk-IPO25BCU.js";
19
19
  import {
20
20
  SolanaApiKeySigner
21
- } from "./chunk-ZTGRDOOH.js";
21
+ } from "./chunk-2I2OFGNL.js";
22
22
  import {
23
23
  SolanaExternalWalletSigner
24
- } from "./chunk-DQCXGBZM.js";
24
+ } from "./chunk-PIFD6KNH.js";
25
25
  import {
26
26
  StellarExternalWalletSigner
27
- } from "./chunk-WC7T2CR4.js";
27
+ } from "./chunk-PK7J3Y3L.js";
28
28
 
29
29
  // src/signers/index.ts
30
30
  function assembleSigner(chain, config) {