@crossmint/wallets-sdk 0.18.15 → 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 (99) 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/gen/types.gen.d.cts +8 -0
  6. package/dist/api/gen/types.gen.d.ts +8 -0
  7. package/dist/api/index.cjs +5 -5
  8. package/dist/api/index.js +4 -4
  9. package/dist/chains/chains.cjs +15 -3
  10. package/dist/chains/chains.d.cts +15 -1
  11. package/dist/chains/chains.d.ts +15 -1
  12. package/dist/chains/chains.js +16 -4
  13. package/dist/chains/definitions/tempoTestnet.cjs +2 -2
  14. package/dist/chains/definitions/tempoTestnet.d.cts +4 -4
  15. package/dist/chains/definitions/tempoTestnet.d.ts +4 -4
  16. package/dist/chains/definitions/tempoTestnet.js +1 -1
  17. package/dist/{chunk-5YX2BE4I.js → chunk-24DGWV3E.js} +10 -5
  18. package/dist/{chunk-OOVNMAQF.js → chunk-2APY4BUJ.js} +74 -24
  19. package/dist/{chunk-PRQOFWLH.cjs → chunk-2XDIXELO.cjs} +12 -3
  20. package/dist/{chunk-PADJ2CIV.cjs → chunk-4ID6ZK4A.cjs} +96 -46
  21. package/dist/{chunk-JDAWNKQ7.cjs → chunk-6LVFMXDR.cjs} +29 -24
  22. package/dist/{chunk-AUNZEGWS.cjs → chunk-6S7BKBVM.cjs} +7 -7
  23. package/dist/{chunk-SCU5YLUT.js → chunk-7EXE5FZJ.js} +10 -1
  24. package/dist/{chunk-WQDGFD34.js → chunk-7OW5LYR6.js} +2 -2
  25. package/dist/{chunk-IZJUOXOZ.js → chunk-AXQLP7Z6.js} +4 -4
  26. package/dist/{chunk-PHIXNAMT.js → chunk-AZQFMK3I.js} +10 -1
  27. package/dist/{chunk-CJWHHO4B.js → chunk-BQN5PNZK.js} +1 -1
  28. package/dist/{chunk-LFUXRLJR.js → chunk-DF3SZX2E.js} +1 -1
  29. package/dist/{chunk-OWRKZD7H.cjs → chunk-GEHZRAAJ.cjs} +69 -3
  30. package/dist/{chunk-VM6OLXBS.js → chunk-GWLAO3PX.js} +32 -9
  31. package/dist/{chunk-77HEKAFB.cjs → chunk-GXEWWYHT.cjs} +12 -3
  32. package/dist/{chunk-GSDBCRGH.js → chunk-IAZHXIFV.js} +3 -3
  33. package/dist/{chunk-BMXG52BZ.cjs → chunk-KVYY4QDB.cjs} +36 -13
  34. package/dist/{chunk-ZM437XPQ.js → chunk-MUIINXJY.js} +16 -4
  35. package/dist/{chunk-YZOPFNY3.js → chunk-MZBMV54C.js} +2 -2
  36. package/dist/{chunk-6H6ZBJC2.cjs → chunk-NN2NBBTN.cjs} +4 -4
  37. package/dist/{chunk-AKJOFUXU.cjs → chunk-PRNZJUHI.cjs} +9 -9
  38. package/dist/{chunk-AKAJ7UHQ.cjs → chunk-RJY4GT2D.cjs} +12 -3
  39. package/dist/{chunk-TOTOITTM.js → chunk-SAZ76VGQ.js} +2 -2
  40. package/dist/{chunk-QCTTQ4XE.cjs → chunk-SEV3UBGK.cjs} +32 -20
  41. package/dist/{chunk-OTI3LX45.cjs → chunk-TNASR6QE.cjs} +9 -9
  42. package/dist/{chunk-PJTTM5QQ.cjs → chunk-TQKCX7VN.cjs} +1 -1
  43. package/dist/{chunk-WMUNQJYD.cjs → chunk-VKXKQ5YI.cjs} +3 -3
  44. package/dist/{chunk-XVFUAZJY.js → chunk-WBTM7E5O.js} +69 -3
  45. package/dist/{chunk-YT64AZL6.cjs → chunk-XM4Y4HS5.cjs} +6 -6
  46. package/dist/{chunk-V65OBC5I.js → chunk-YDFIY5ER.js} +3 -3
  47. package/dist/{chunk-4ZFP3ST7.js → chunk-ZKWJY2VO.js} +10 -1
  48. package/dist/{chunk-NFQT5TFO.cjs → chunk-ZLPFQ56Q.cjs} +12 -12
  49. package/dist/index.cjs +18 -18
  50. package/dist/index.js +17 -17
  51. package/dist/logger/index.cjs +3 -3
  52. package/dist/logger/index.js +2 -2
  53. package/dist/logger/init.cjs +3 -3
  54. package/dist/logger/init.js +2 -2
  55. package/dist/sdk.cjs +18 -13
  56. package/dist/sdk.js +17 -12
  57. package/dist/signers/index.cjs +8 -8
  58. package/dist/signers/index.d.cts +1 -1
  59. package/dist/signers/index.d.ts +1 -1
  60. package/dist/signers/index.js +7 -7
  61. package/dist/signers/non-custodial/index.cjs +7 -7
  62. package/dist/signers/non-custodial/index.js +6 -6
  63. package/dist/signers/non-custodial/ncs-evm-signer.cjs +5 -5
  64. package/dist/signers/non-custodial/ncs-evm-signer.js +4 -4
  65. package/dist/signers/non-custodial/ncs-signer.cjs +4 -4
  66. package/dist/signers/non-custodial/ncs-signer.js +3 -3
  67. package/dist/signers/non-custodial/ncs-solana-signer.cjs +5 -5
  68. package/dist/signers/non-custodial/ncs-solana-signer.js +4 -4
  69. package/dist/signers/non-custodial/ncs-stellar-signer.cjs +5 -5
  70. package/dist/signers/non-custodial/ncs-stellar-signer.js +4 -4
  71. package/dist/utils/constants.cjs +2 -2
  72. package/dist/utils/constants.js +1 -1
  73. package/dist/wallets/__tests__/test-helpers.cjs +15 -8
  74. package/dist/wallets/__tests__/test-helpers.d.cts +2 -1
  75. package/dist/wallets/__tests__/test-helpers.d.ts +2 -1
  76. package/dist/wallets/__tests__/test-helpers.js +14 -7
  77. package/dist/wallets/evm.cjs +12 -12
  78. package/dist/wallets/evm.d.cts +20 -0
  79. package/dist/wallets/evm.d.ts +20 -0
  80. package/dist/wallets/evm.js +11 -11
  81. package/dist/wallets/solana.cjs +14 -9
  82. package/dist/wallets/solana.d.cts +6 -1
  83. package/dist/wallets/solana.d.ts +6 -1
  84. package/dist/wallets/solana.js +13 -8
  85. package/dist/wallets/stellar.cjs +14 -9
  86. package/dist/wallets/stellar.d.cts +6 -1
  87. package/dist/wallets/stellar.d.ts +6 -1
  88. package/dist/wallets/stellar.js +13 -8
  89. package/dist/wallets/types.d.cts +6 -2
  90. package/dist/wallets/types.d.ts +6 -2
  91. package/dist/wallets/wallet-factory.cjs +15 -10
  92. package/dist/wallets/wallet-factory.d.cts +1 -0
  93. package/dist/wallets/wallet-factory.d.ts +1 -0
  94. package/dist/wallets/wallet-factory.js +14 -9
  95. package/dist/wallets/wallet.cjs +13 -8
  96. package/dist/wallets/wallet.d.cts +7 -2
  97. package/dist/wallets/wallet.d.ts +7 -2
  98. package/dist/wallets/wallet.js +12 -7
  99. package/package.json +7 -7
@@ -1,7 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-VM6OLXBS.js";
4
+ } from "./chunk-GWLAO3PX.js";
5
+ import {
6
+ walletsLogger
7
+ } from "./chunk-DF3SZX2E.js";
5
8
  import {
6
9
  __async
7
10
  } from "./chunk-ASE2FXWP.js";
@@ -31,6 +34,8 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends NonCustodialSig
31
34
  yield this.handleAuthRequired();
32
35
  const jwt = this.getJwtOrThrow();
33
36
  const hexString = raw.replace("0x", "");
37
+ walletsLogger.info("sign: sending request", { keyType: "secp256k1" });
38
+ const startTime = Date.now();
34
39
  const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
35
40
  event: "request:sign",
36
41
  responseEvent: "response:sign",
@@ -47,6 +52,10 @@ var EVMNonCustodialSigner = class _EVMNonCustodialSigner extends NonCustodialSig
47
52
  },
48
53
  options: DEFAULT_EVENT_OPTIONS
49
54
  });
55
+ walletsLogger.info("sign: response received", {
56
+ status: res == null ? void 0 : res.status,
57
+ durationMs: Date.now() - startTime
58
+ });
50
59
  if ((res == null ? void 0 : res.status) === "error") {
51
60
  throw new Error(res.error);
52
61
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Wallet
3
- } from "./chunk-OOVNMAQF.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-LFUXRLJR.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,7 +1,10 @@
1
1
  import {
2
2
  DEFAULT_EVENT_OPTIONS,
3
3
  NonCustodialSigner
4
- } from "./chunk-VM6OLXBS.js";
4
+ } from "./chunk-GWLAO3PX.js";
5
+ import {
6
+ walletsLogger
7
+ } from "./chunk-DF3SZX2E.js";
5
8
  import {
6
9
  __async
7
10
  } from "./chunk-ASE2FXWP.js";
@@ -21,6 +24,8 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends NonCust
21
24
  var _a;
22
25
  yield this.handleAuthRequired();
23
26
  const jwt = this.getJwtOrThrow();
27
+ walletsLogger.info("sign: sending request", { keyType: "ed25519" });
28
+ const startTime = Date.now();
24
29
  const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
25
30
  event: "request:sign",
26
31
  responseEvent: "response:sign",
@@ -37,6 +42,10 @@ var StellarNonCustodialSigner = class _StellarNonCustodialSigner extends NonCust
37
42
  },
38
43
  options: DEFAULT_EVENT_OPTIONS
39
44
  });
45
+ walletsLogger.info("sign: response received", {
46
+ status: res == null ? void 0 : res.status,
47
+ durationMs: Date.now() - startTime
48
+ });
40
49
  if ((res == null ? void 0 : res.status) === "error") {
41
50
  throw new Error(res.error);
42
51
  }
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@crossmint/wallets-sdk";
3
- var version = "0.18.15";
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-CJWHHO4B.js";
4
+ } from "./chunk-BQN5PNZK.js";
5
5
 
6
6
  // src/logger/init.ts
7
7
  import {
@@ -6,11 +6,17 @@ var _chunkNIBKCMQ2cjs = require('./chunk-NIBKCMQ2.cjs');
6
6
  var _chunk55V4VMTXcjs = require('./chunk-55V4VMTX.cjs');
7
7
 
8
8
 
9
- var _chunk6H6ZBJC2cjs = require('./chunk-6H6ZBJC2.cjs');
9
+ var _chunkNN2NBBTNcjs = require('./chunk-NN2NBBTN.cjs');
10
10
 
11
11
 
12
12
  var _chunkHTSQPZHWcjs = require('./chunk-HTSQPZHW.cjs');
13
13
 
14
+
15
+ var _chunkXC2V34TScjs = require('./chunk-XC2V34TS.cjs');
16
+
17
+
18
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
19
+
14
20
  // src/chains/chains.ts
15
21
  var _commonsdkbase = require('@crossmint/common-sdk-base');
16
22
 
@@ -124,7 +130,7 @@ function toViemChain(chain) {
124
130
  case _commonsdkbase.BlockchainIncludingTestnet.ARC_TESTNET:
125
131
  return _chunkHTSQPZHWcjs.arcTestnet;
126
132
  case _commonsdkbase.BlockchainIncludingTestnet.TEMPO_TESTNET:
127
- return _chunk6H6ZBJC2cjs.tempoTestnet;
133
+ return _chunkNN2NBBTNcjs.tempoTestnet;
128
134
  case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT:
129
135
  case _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET:
130
136
  case _commonsdkbase.BlockchainIncludingTestnet.APECHAIN:
@@ -144,7 +150,67 @@ function toViemChain(chain) {
144
150
  throw new Error(`Unknown chain: ${chain}`);
145
151
  }
146
152
  }
153
+ function isTestnetChain(chain) {
154
+ return TESTNET_AA_CHAINS.includes(chain);
155
+ }
156
+ function isMainnetChain(chain) {
157
+ return PRODUCTION_AA_CHAINS.includes(chain);
158
+ }
159
+ var MAINNET_TO_TESTNET_MAP = {
160
+ [_commonsdkbase.BlockchainIncludingTestnet.ABSTRACT]: _commonsdkbase.BlockchainIncludingTestnet.ABSTRACT_TESTNET,
161
+ [_commonsdkbase.BlockchainIncludingTestnet.APECHAIN]: _commonsdkbase.BlockchainIncludingTestnet.CURTIS,
162
+ [_commonsdkbase.BlockchainIncludingTestnet.ARBITRUM]: _commonsdkbase.BlockchainIncludingTestnet.ARBITRUM_SEPOLIA,
163
+ [_commonsdkbase.BlockchainIncludingTestnet.BASE]: _commonsdkbase.BlockchainIncludingTestnet.BASE_SEPOLIA,
164
+ [_commonsdkbase.BlockchainIncludingTestnet.FLOW]: _commonsdkbase.BlockchainIncludingTestnet.FLOW_TESTNET,
165
+ [_commonsdkbase.BlockchainIncludingTestnet.MANTLE]: _commonsdkbase.BlockchainIncludingTestnet.MANTLE_SEPOLIA,
166
+ [_commonsdkbase.BlockchainIncludingTestnet.MODE]: _commonsdkbase.BlockchainIncludingTestnet.MODE_SEPOLIA,
167
+ [_commonsdkbase.BlockchainIncludingTestnet.OPTIMISM]: _commonsdkbase.BlockchainIncludingTestnet.OPTIMISM_SEPOLIA,
168
+ [_commonsdkbase.BlockchainIncludingTestnet.PLUME]: _commonsdkbase.BlockchainIncludingTestnet.PLUME_TESTNET,
169
+ [_commonsdkbase.BlockchainIncludingTestnet.POLYGON]: _commonsdkbase.BlockchainIncludingTestnet.POLYGON_AMOY,
170
+ [_commonsdkbase.BlockchainIncludingTestnet.SCROLL]: _commonsdkbase.BlockchainIncludingTestnet.SCROLL_SEPOLIA,
171
+ [_commonsdkbase.BlockchainIncludingTestnet.SEI_PACIFIC_1]: _commonsdkbase.BlockchainIncludingTestnet.SEI_ATLANTIC_2_TESTNET,
172
+ [_commonsdkbase.BlockchainIncludingTestnet.STORY]: _commonsdkbase.BlockchainIncludingTestnet.STORY_TESTNET,
173
+ [_commonsdkbase.BlockchainIncludingTestnet.WORLDCHAIN]: _commonsdkbase.BlockchainIncludingTestnet.WORLD_CHAIN_SEPOLIA,
174
+ [_commonsdkbase.BlockchainIncludingTestnet.ZORA]: _commonsdkbase.BlockchainIncludingTestnet.ZORA_SEPOLIA
175
+ };
176
+ function mainnetToTestnet(chain) {
177
+ return MAINNET_TO_TESTNET_MAP[chain];
178
+ }
179
+ function validateChainForEnvironment(chain, environment) {
180
+ if (chain === "solana" || chain === "stellar") {
181
+ return chain;
182
+ }
183
+ const evmChain = chain;
184
+ const isProductionEnv = environment === _commonsdkbase.APIKeyEnvironmentPrefix.PRODUCTION;
185
+ if (isProductionEnv && isTestnetChain(evmChain)) {
186
+ throw new (0, _chunkXC2V34TScjs.InvalidEnvironmentError)(
187
+ `Chain "${chain}" is a testnet chain and cannot be used in production. Please use a mainnet chain instead.`
188
+ );
189
+ }
190
+ if (!isProductionEnv && isMainnetChain(evmChain)) {
191
+ const testnetEquivalent = mainnetToTestnet(evmChain);
192
+ if (testnetEquivalent != null) {
193
+ _chunkVKXKQ5YIcjs.walletsLogger.debug("validateChainForEnvironment.autoConverted", {
194
+ chain,
195
+ convertedTo: testnetEquivalent,
196
+ environment,
197
+ message: `Chain "${chain}" is a mainnet chain and cannot be used in ${environment} environment. Automatically converted to "${testnetEquivalent}".`
198
+ });
199
+ return testnetEquivalent;
200
+ }
201
+ _chunkVKXKQ5YIcjs.walletsLogger.debug("validateChainForEnvironment.mismatch", {
202
+ chain,
203
+ environment,
204
+ message: `Chain "${chain}" is a mainnet chain and should not be used in ${environment} environment. No testnet equivalent is available. Please use a testnet chain instead.`
205
+ });
206
+ }
207
+ return chain;
208
+ }
209
+
210
+
211
+
212
+
147
213
 
148
214
 
149
215
 
150
- exports.toViemChain = toViemChain;
216
+ exports.toViemChain = toViemChain; exports.isTestnetChain = isTestnetChain; exports.isMainnetChain = isMainnetChain; exports.mainnetToTestnet = mainnetToTestnet; exports.validateChainForEnvironment = validateChainForEnvironment;
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-WJUPOCKJ.js";
7
7
  import {
8
8
  walletsLogger
9
- } from "./chunk-LFUXRLJR.js";
9
+ } from "./chunk-DF3SZX2E.js";
10
10
  import {
11
11
  __async,
12
12
  __decorateClass
@@ -64,7 +64,7 @@ var NonCustodialSigner = class {
64
64
  }
65
65
  initializeTEEConnection() {
66
66
  return __async(this, null, function* () {
67
- console.warn("TEE connection is not initialized, initializing now...");
67
+ walletsLogger.info("TEE connection not initialized, initializing now");
68
68
  const parsedAPIKey = validateAPIKey(this.config.crossmint.apiKey);
69
69
  if (!parsedAPIKey.isValid) {
70
70
  throw new Error("Invalid API key");
@@ -76,7 +76,7 @@ var NonCustodialSigner = class {
76
76
  if (this.config.clientTEEConnection == null) {
77
77
  throw new Error("Failed to initialize TEE connection");
78
78
  }
79
- console.log("TEE connection initialized successfully");
79
+ walletsLogger.info("TEE connection initialized successfully");
80
80
  });
81
81
  }
82
82
  handleAuthRequired() {
@@ -88,6 +88,8 @@ var NonCustodialSigner = class {
88
88
  `${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`
89
89
  );
90
90
  }
91
+ walletsLogger.info("get-status: sending request");
92
+ const startTime = Date.now();
91
93
  const signerResponse = yield clientTEEConnection.sendAction({
92
94
  event: "request:get-status",
93
95
  responseEvent: "response:get-status",
@@ -99,18 +101,26 @@ var NonCustodialSigner = class {
99
101
  },
100
102
  options: DEFAULT_EVENT_OPTIONS
101
103
  });
104
+ const durationMs = Date.now() - startTime;
102
105
  if ((signerResponse == null ? void 0 : signerResponse.status) !== "success") {
106
+ walletsLogger.error("get-status: failed", {
107
+ status: signerResponse == null ? void 0 : signerResponse.status,
108
+ error: signerResponse == null ? void 0 : signerResponse.error,
109
+ durationMs
110
+ });
103
111
  throw new Error(signerResponse == null ? void 0 : signerResponse.error);
104
112
  }
113
+ walletsLogger.info("get-status: response received", {
114
+ signerStatus: signerResponse.signerStatus,
115
+ durationMs
116
+ });
105
117
  if (signerResponse.signerStatus === "ready") {
106
118
  this._needsAuth = false;
107
119
  return;
108
120
  } else {
109
121
  this._needsAuth = true;
110
122
  }
111
- walletsLogger.info("Handling auth required", { signerResponse });
112
- walletsLogger.info("Needs auth", { needsAuth: this._needsAuth });
113
- walletsLogger.info("Config onAuthRequired", { onAuthRequired: this.config.onAuthRequired });
123
+ walletsLogger.info("Auth required, initiating OTP flow", { needsAuth: this._needsAuth });
114
124
  const { promise, resolve, reject } = this.createAuthPromise();
115
125
  this._authPromise = { promise, resolve, reject };
116
126
  if (this.config.onAuthRequired) {
@@ -176,6 +186,8 @@ var NonCustodialSigner = class {
176
186
  var _a, _b, _c;
177
187
  const handshakeParent = yield this.getTEEConnection();
178
188
  const authId = this.getAuthId();
189
+ walletsLogger.info("start-onboarding: sending request");
190
+ const startTime = Date.now();
179
191
  const response = yield handshakeParent.sendAction({
180
192
  event: "request:start-onboarding",
181
193
  responseEvent: "response:start-onboarding",
@@ -188,12 +200,17 @@ var NonCustodialSigner = class {
188
200
  },
189
201
  options: DEFAULT_EVENT_OPTIONS
190
202
  });
203
+ const durationMs = Date.now() - startTime;
204
+ walletsLogger.info("start-onboarding: response received", {
205
+ status: response == null ? void 0 : response.status,
206
+ durationMs
207
+ });
191
208
  if ((response == null ? void 0 : response.status) === "success" && response.signerStatus === "ready") {
192
209
  this._needsAuth = false;
193
210
  return;
194
211
  }
195
212
  if ((response == null ? void 0 : response.status) === "error") {
196
- console.error("[sendMessageWithOtp] Failed to send OTP:", response);
213
+ walletsLogger.error("start-onboarding: failed", { error: response.error });
197
214
  (_c = this._authPromise) == null ? void 0 : _c.reject(new Error(response.error || "Failed to initiate OTP process."));
198
215
  }
199
216
  });
@@ -210,6 +227,8 @@ var NonCustodialSigner = class {
210
227
  let response;
211
228
  try {
212
229
  const handshakeParent = yield this.getTEEConnection();
230
+ walletsLogger.info("complete-onboarding: sending request");
231
+ const startTime = Date.now();
213
232
  response = yield handshakeParent.sendAction({
214
233
  event: "request:complete-onboarding",
215
234
  responseEvent: "response:complete-onboarding",
@@ -224,8 +243,12 @@ var NonCustodialSigner = class {
224
243
  },
225
244
  options: DEFAULT_EVENT_OPTIONS
226
245
  });
246
+ walletsLogger.info("complete-onboarding: response received", {
247
+ status: response == null ? void 0 : response.status,
248
+ durationMs: Date.now() - startTime
249
+ });
227
250
  } catch (err) {
228
- console.error("[verifyOtp] Error sending OTP validation request:", err);
251
+ walletsLogger.error("complete-onboarding: error", { error: err });
229
252
  this._needsAuth = true;
230
253
  (_c = this._authPromise) == null ? void 0 : _c.reject(err);
231
254
  throw err;
@@ -246,7 +269,7 @@ var NonCustodialSigner = class {
246
269
  (_d = this._authPromise) == null ? void 0 : _d.resolve();
247
270
  return;
248
271
  }
249
- console.error("[verifyOtp] Failed to validate OTP:", JSON.stringify(response, null, 2));
272
+ walletsLogger.error("complete-onboarding: OTP validation failed", { status: response == null ? void 0 : response.status });
250
273
  this._needsAuth = true;
251
274
  const errorMessage = (response == null ? void 0 : response.status) === "error" ? response.error : "Failed to validate encrypted OTP";
252
275
  const error = new Error(errorMessage);
@@ -1,7 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunkBMXG52BZcjs = require('./chunk-BMXG52BZ.cjs');
4
+ var _chunkKVYY4QDBcjs = require('./chunk-KVYY4QDB.cjs');
5
+
6
+
7
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
5
8
 
6
9
 
7
10
  var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
@@ -9,7 +12,7 @@ var _chunkUO2J2ZB2cjs = require('./chunk-UO2J2ZB2.cjs');
9
12
  // src/signers/non-custodial/ncs-solana-signer.ts
10
13
  var _web3js = require('@solana/web3.js');
11
14
  var _bs58 = require('bs58'); var _bs582 = _interopRequireDefault(_bs58);
12
- var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkBMXG52BZcjs.NonCustodialSigner {
15
+ var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkKVYY4QDBcjs.NonCustodialSigner {
13
16
  constructor(config) {
14
17
  super(config);
15
18
  }
@@ -26,6 +29,8 @@ var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkBMX
26
29
  const transactionBytes = _bs582.default.decode(transaction);
27
30
  const deserializedTransaction = _web3js.VersionedTransaction.deserialize(transactionBytes);
28
31
  const messageData = deserializedTransaction.message.serialize();
32
+ _chunkVKXKQ5YIcjs.walletsLogger.info("sign: sending request", { keyType: "ed25519" });
33
+ const startTime = Date.now();
29
34
  const res = yield (_a = this.config.clientTEEConnection) == null ? void 0 : _a.sendAction({
30
35
  event: "request:sign",
31
36
  responseEvent: "response:sign",
@@ -40,7 +45,11 @@ var SolanaNonCustodialSigner = class _SolanaNonCustodialSigner extends _chunkBMX
40
45
  encoding: "base58"
41
46
  }
42
47
  },
43
- options: _chunkBMXG52BZcjs.DEFAULT_EVENT_OPTIONS
48
+ options: _chunkKVYY4QDBcjs.DEFAULT_EVENT_OPTIONS
49
+ });
50
+ _chunkVKXKQ5YIcjs.walletsLogger.info("sign: response received", {
51
+ status: res == null ? void 0 : res.status,
52
+ durationMs: Date.now() - startTime
44
53
  });
45
54
  if ((res == null ? void 0 : res.status) === "error") {
46
55
  throw new Error(res.error);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  WalletFactory
3
- } from "./chunk-ZM437XPQ.js";
3
+ } from "./chunk-MUIINXJY.js";
4
4
  import {
5
5
  ApiClient
6
- } from "./chunk-YZOPFNY3.js";
6
+ } from "./chunk-MZBMV54C.js";
7
7
  import {
8
8
  initWalletsLogger,
9
9
  walletsLogger
10
- } from "./chunk-LFUXRLJR.js";
10
+ } from "./chunk-DF3SZX2E.js";
11
11
  import {
12
12
  __async
13
13
  } from "./chunk-ASE2FXWP.js";
@@ -6,7 +6,7 @@ var _chunk4GFSUI2Icjs = require('./chunk-4GFSUI2I.cjs');
6
6
  var _chunkRHR6P2KPcjs = require('./chunk-RHR6P2KP.cjs');
7
7
 
8
8
 
9
- var _chunkWMUNQJYDcjs = require('./chunk-WMUNQJYD.cjs');
9
+ var _chunkVKXKQ5YIcjs = require('./chunk-VKXKQ5YI.cjs');
10
10
 
11
11
 
12
12
 
@@ -64,7 +64,7 @@ var NonCustodialSigner = class {
64
64
  }
65
65
  initializeTEEConnection() {
66
66
  return _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
67
- console.warn("TEE connection is not initialized, initializing now...");
67
+ _chunkVKXKQ5YIcjs.walletsLogger.info("TEE connection not initialized, initializing now");
68
68
  const parsedAPIKey = _commonsdkbase.validateAPIKey.call(void 0, this.config.crossmint.apiKey);
69
69
  if (!parsedAPIKey.isValid) {
70
70
  throw new Error("Invalid API key");
@@ -76,7 +76,7 @@ var NonCustodialSigner = class {
76
76
  if (this.config.clientTEEConnection == null) {
77
77
  throw new Error("Failed to initialize TEE connection");
78
78
  }
79
- console.log("TEE connection initialized successfully");
79
+ _chunkVKXKQ5YIcjs.walletsLogger.info("TEE connection initialized successfully");
80
80
  });
81
81
  }
82
82
  handleAuthRequired() {
@@ -88,6 +88,8 @@ var NonCustodialSigner = class {
88
88
  `${this.type} signer requires the onAuthRequired callback to handle OTP verification. This callback manages the authentication flow (sending OTP and verifying user input). If using our React/React Native SDK, this is handled automatically by the provider. For other environments, implement: onAuthRequired: (needsAuth, sendEmailWithOtp, verifyOtp, reject) => { /* your UI logic */ }`
89
89
  );
90
90
  }
91
+ _chunkVKXKQ5YIcjs.walletsLogger.info("get-status: sending request");
92
+ const startTime = Date.now();
91
93
  const signerResponse = yield clientTEEConnection.sendAction({
92
94
  event: "request:get-status",
93
95
  responseEvent: "response:get-status",
@@ -99,18 +101,26 @@ var NonCustodialSigner = class {
99
101
  },
100
102
  options: DEFAULT_EVENT_OPTIONS
101
103
  });
104
+ const durationMs = Date.now() - startTime;
102
105
  if ((signerResponse == null ? void 0 : signerResponse.status) !== "success") {
106
+ _chunkVKXKQ5YIcjs.walletsLogger.error("get-status: failed", {
107
+ status: signerResponse == null ? void 0 : signerResponse.status,
108
+ error: signerResponse == null ? void 0 : signerResponse.error,
109
+ durationMs
110
+ });
103
111
  throw new Error(signerResponse == null ? void 0 : signerResponse.error);
104
112
  }
113
+ _chunkVKXKQ5YIcjs.walletsLogger.info("get-status: response received", {
114
+ signerStatus: signerResponse.signerStatus,
115
+ durationMs
116
+ });
105
117
  if (signerResponse.signerStatus === "ready") {
106
118
  this._needsAuth = false;
107
119
  return;
108
120
  } else {
109
121
  this._needsAuth = true;
110
122
  }
111
- _chunkWMUNQJYDcjs.walletsLogger.info("Handling auth required", { signerResponse });
112
- _chunkWMUNQJYDcjs.walletsLogger.info("Needs auth", { needsAuth: this._needsAuth });
113
- _chunkWMUNQJYDcjs.walletsLogger.info("Config onAuthRequired", { onAuthRequired: this.config.onAuthRequired });
123
+ _chunkVKXKQ5YIcjs.walletsLogger.info("Auth required, initiating OTP flow", { needsAuth: this._needsAuth });
114
124
  const { promise, resolve, reject } = this.createAuthPromise();
115
125
  this._authPromise = { promise, resolve, reject };
116
126
  if (this.config.onAuthRequired) {
@@ -120,7 +130,7 @@ var NonCustodialSigner = class {
120
130
  () => this.sendMessageWithOtp(),
121
131
  (otp) => this.verifyOtp(otp),
122
132
  () => _chunkUO2J2ZB2cjs.__async.call(void 0, this, null, function* () {
123
- _chunkWMUNQJYDcjs.walletsLogger.info("Auth rejected", { authRejected: true });
133
+ _chunkVKXKQ5YIcjs.walletsLogger.info("Auth rejected", { authRejected: true });
124
134
  this._needsAuth = false;
125
135
  if (this.config.onAuthRequired != null) {
126
136
  yield this.config.onAuthRequired(
@@ -137,14 +147,14 @@ var NonCustodialSigner = class {
137
147
  })
138
148
  );
139
149
  } catch (error) {
140
- _chunkWMUNQJYDcjs.walletsLogger.error("handleAuthRequired error", { error });
150
+ _chunkVKXKQ5YIcjs.walletsLogger.error("handleAuthRequired error", { error });
141
151
  reject(error);
142
152
  }
143
153
  }
144
154
  try {
145
155
  yield promise;
146
156
  } catch (error) {
147
- _chunkWMUNQJYDcjs.walletsLogger.error("handleAuthRequired promise error", { error });
157
+ _chunkVKXKQ5YIcjs.walletsLogger.error("handleAuthRequired promise error", { error });
148
158
  throw error;
149
159
  }
150
160
  });
@@ -176,6 +186,8 @@ var NonCustodialSigner = class {
176
186
  var _a, _b, _c;
177
187
  const handshakeParent = yield this.getTEEConnection();
178
188
  const authId = this.getAuthId();
189
+ _chunkVKXKQ5YIcjs.walletsLogger.info("start-onboarding: sending request");
190
+ const startTime = Date.now();
179
191
  const response = yield handshakeParent.sendAction({
180
192
  event: "request:start-onboarding",
181
193
  responseEvent: "response:start-onboarding",
@@ -188,12 +200,17 @@ var NonCustodialSigner = class {
188
200
  },
189
201
  options: DEFAULT_EVENT_OPTIONS
190
202
  });
203
+ const durationMs = Date.now() - startTime;
204
+ _chunkVKXKQ5YIcjs.walletsLogger.info("start-onboarding: response received", {
205
+ status: response == null ? void 0 : response.status,
206
+ durationMs
207
+ });
191
208
  if ((response == null ? void 0 : response.status) === "success" && response.signerStatus === "ready") {
192
209
  this._needsAuth = false;
193
210
  return;
194
211
  }
195
212
  if ((response == null ? void 0 : response.status) === "error") {
196
- console.error("[sendMessageWithOtp] Failed to send OTP:", response);
213
+ _chunkVKXKQ5YIcjs.walletsLogger.error("start-onboarding: failed", { error: response.error });
197
214
  (_c = this._authPromise) == null ? void 0 : _c.reject(new Error(response.error || "Failed to initiate OTP process."));
198
215
  }
199
216
  });
@@ -210,6 +227,8 @@ var NonCustodialSigner = class {
210
227
  let response;
211
228
  try {
212
229
  const handshakeParent = yield this.getTEEConnection();
230
+ _chunkVKXKQ5YIcjs.walletsLogger.info("complete-onboarding: sending request");
231
+ const startTime = Date.now();
213
232
  response = yield handshakeParent.sendAction({
214
233
  event: "request:complete-onboarding",
215
234
  responseEvent: "response:complete-onboarding",
@@ -224,8 +243,12 @@ var NonCustodialSigner = class {
224
243
  },
225
244
  options: DEFAULT_EVENT_OPTIONS
226
245
  });
246
+ _chunkVKXKQ5YIcjs.walletsLogger.info("complete-onboarding: response received", {
247
+ status: response == null ? void 0 : response.status,
248
+ durationMs: Date.now() - startTime
249
+ });
227
250
  } catch (err) {
228
- console.error("[verifyOtp] Error sending OTP validation request:", err);
251
+ _chunkVKXKQ5YIcjs.walletsLogger.error("complete-onboarding: error", { error: err });
229
252
  this._needsAuth = true;
230
253
  (_c = this._authPromise) == null ? void 0 : _c.reject(err);
231
254
  throw err;
@@ -246,7 +269,7 @@ var NonCustodialSigner = class {
246
269
  (_d = this._authPromise) == null ? void 0 : _d.resolve();
247
270
  return;
248
271
  }
249
- console.error("[verifyOtp] Failed to validate OTP:", JSON.stringify(response, null, 2));
272
+ _chunkVKXKQ5YIcjs.walletsLogger.error("complete-onboarding: OTP validation failed", { status: response == null ? void 0 : response.status });
250
273
  this._needsAuth = true;
251
274
  const errorMessage = (response == null ? void 0 : response.status) === "error" ? response.error : "Failed to validate encrypted OTP";
252
275
  const error = new Error(errorMessage);
@@ -286,7 +309,7 @@ var NonCustodialSigner = class {
286
309
  };
287
310
  _chunkUO2J2ZB2cjs.__decorateClass.call(void 0, [
288
311
  _commonsdkbase.WithLoggerContext.call(void 0, {
289
- logger: _chunkWMUNQJYDcjs.walletsLogger,
312
+ logger: _chunkVKXKQ5YIcjs.walletsLogger,
290
313
  methodName: "handleAuthRequired"
291
314
  })
292
315
  ], NonCustodialSigner.prototype, "handleAuthRequired", 1);
@@ -4,20 +4,24 @@ import {
4
4
  } from "./chunk-ZP4ZZCIE.js";
5
5
  import {
6
6
  Wallet
7
- } from "./chunk-OOVNMAQF.js";
7
+ } from "./chunk-2APY4BUJ.js";
8
8
  import {
9
9
  assembleSigner
10
- } from "./chunk-V65OBC5I.js";
10
+ } from "./chunk-YDFIY5ER.js";
11
+ import {
12
+ validateChainForEnvironment
13
+ } from "./chunk-WBTM7E5O.js";
11
14
  import {
12
15
  WalletCreationError,
13
16
  WalletNotAvailableError
14
17
  } from "./chunk-SGINWAB6.js";
15
18
  import {
16
19
  walletsLogger
17
- } from "./chunk-LFUXRLJR.js";
20
+ } from "./chunk-DF3SZX2E.js";
18
21
  import {
19
22
  __async,
20
23
  __decorateClass,
24
+ __spreadProps,
21
25
  __spreadValues
22
26
  } from "./chunk-ASE2FXWP.js";
23
27
 
@@ -39,6 +43,7 @@ var WalletFactory = class {
39
43
  "getOrCreateWallet can only be called from client-side code.\n- Make sure you're running this in the browser (or another client environment), not on your server.\n- Use your Crossmint Client API Key (not a server key)."
40
44
  );
41
45
  }
46
+ args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
42
47
  const locator = this.getWalletLocator(args);
43
48
  walletsLogger.info("walletFactory.getOrCreateWallet.start");
44
49
  const existingWallet = yield this.apiClient.getWallet(locator);
@@ -49,7 +54,7 @@ var WalletFactory = class {
49
54
  return this.createWalletInstance(existingWallet, args);
50
55
  }
51
56
  walletsLogger.info("walletFactory.getOrCreateWallet.creating");
52
- return this.createWallet(args);
57
+ return this.createWalletInternal(args);
53
58
  });
54
59
  }
55
60
  getWallet(walletLocator, args) {
@@ -60,6 +65,7 @@ var WalletFactory = class {
60
65
  });
61
66
  throw new WalletCreationError("getWallet is not supported on client side, use getOrCreateWallet instead");
62
67
  }
68
+ args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
63
69
  walletsLogger.info("walletFactory.getWallet.start");
64
70
  const existingWallet = yield this.apiClient.getWallet(walletLocator);
65
71
  if ("error" in existingWallet) {
@@ -75,6 +81,12 @@ var WalletFactory = class {
75
81
  });
76
82
  }
77
83
  createWallet(args) {
84
+ return __async(this, null, function* () {
85
+ args = __spreadProps(__spreadValues({}, args), { chain: validateChainForEnvironment(args.chain, this.apiClient.environment) });
86
+ return this.createWalletInternal(args);
87
+ });
88
+ }
89
+ createWalletInternal(args) {
78
90
  return __async(this, null, function* () {
79
91
  var _a, _b, _c, _d, _e;
80
92
  yield (_c = (_b = (_a = args.options) == null ? void 0 : _a.experimental_callbacks) == null ? void 0 : _b.onWalletCreationStart) == null ? void 0 : _c.call(_b);
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-SGINWAB6.js";
4
4
  import {
5
5
  walletsLogger
6
- } from "./chunk-LFUXRLJR.js";
6
+ } from "./chunk-DF3SZX2E.js";
7
7
  import {
8
8
  SDK_NAME,
9
9
  SDK_VERSION
10
- } from "./chunk-CJWHHO4B.js";
10
+ } from "./chunk-BQN5PNZK.js";
11
11
  import {
12
12
  __async
13
13
  } from "./chunk-ASE2FXWP.js";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/chains/definitions/tempoTestnet.ts
2
2
  var _viem = require('viem');
3
3
  var tempoTestnet = _viem.defineChain.call(void 0, {
4
- id: 42429,
4
+ id: 42431,
5
5
  name: "Tempo Testnet",
6
6
  nativeCurrency: {
7
7
  decimals: 6,
@@ -9,12 +9,12 @@ var tempoTestnet = _viem.defineChain.call(void 0, {
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