@rhinestone/deposit-modal 0.1.39 → 0.1.41

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 (38) hide show
  1. package/dist/{DepositModalReown-UMUTS37L.cjs → DepositModalReown-GAQLILGK.cjs} +17 -8
  2. package/dist/{DepositModalReown-YTUE3XAB.mjs → DepositModalReown-WS6WNWJP.mjs} +15 -6
  3. package/dist/{WithdrawModalReown-XXCOZYVU.mjs → WithdrawModalReown-7CSCY55U.mjs} +4 -4
  4. package/dist/{WithdrawModalReown-2CWNDVJD.cjs → WithdrawModalReown-GCOVYZN2.cjs} +7 -7
  5. package/dist/{chunk-K7BHCDJQ.cjs → chunk-37CTMJMO.cjs} +181 -96
  6. package/dist/{chunk-TK7BVWX6.mjs → chunk-6PRJUXTM.mjs} +1487 -287
  7. package/dist/{chunk-CFLZYWX7.mjs → chunk-KWAFKVV6.mjs} +120 -35
  8. package/dist/{chunk-AHOFT42H.cjs → chunk-LT3QKJI2.cjs} +458 -115
  9. package/dist/{chunk-SJEIKMVO.mjs → chunk-MBOH6XW3.mjs} +26 -13
  10. package/dist/{chunk-FLXTBFMZ.cjs → chunk-NELAYNA3.cjs} +11 -0
  11. package/dist/{chunk-VTTEVMB6.cjs → chunk-PTSYSG4U.cjs} +1551 -351
  12. package/dist/{chunk-V7I5T4SW.cjs → chunk-PWPW7GFB.cjs} +25 -12
  13. package/dist/{chunk-IC2M2DZ7.mjs → chunk-QIK6ONMQ.mjs} +392 -49
  14. package/dist/{chunk-I7RYTI4G.mjs → chunk-ZJQZEIHA.mjs} +11 -0
  15. package/dist/constants.cjs +2 -2
  16. package/dist/constants.d.cts +6 -6
  17. package/dist/constants.d.ts +6 -6
  18. package/dist/constants.mjs +1 -1
  19. package/dist/deposit.cjs +4 -4
  20. package/dist/deposit.d.cts +2 -2
  21. package/dist/deposit.d.ts +2 -2
  22. package/dist/deposit.mjs +3 -3
  23. package/dist/index.cjs +5 -5
  24. package/dist/index.d.cts +1 -1
  25. package/dist/index.d.ts +1 -1
  26. package/dist/index.mjs +4 -4
  27. package/dist/reown.cjs +5 -5
  28. package/dist/reown.d.cts +1 -1
  29. package/dist/reown.d.ts +1 -1
  30. package/dist/reown.mjs +4 -4
  31. package/dist/styles.css +64 -0
  32. package/dist/{types-CIaQPR6F.d.cts → types-CybmMKTE.d.cts} +9 -7
  33. package/dist/{types-Bp2n2RQ3.d.ts → types-e8CHSm2u.d.ts} +9 -7
  34. package/dist/withdraw.cjs +4 -4
  35. package/dist/withdraw.d.cts +2 -2
  36. package/dist/withdraw.d.ts +2 -2
  37. package/dist/withdraw.mjs +3 -3
  38. package/package.json +18 -1
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkFLXTBFMZcjs = require('./chunk-FLXTBFMZ.cjs');
10
+ var _chunkNELAYNA3cjs = require('./chunk-NELAYNA3.cjs');
11
11
 
12
12
  // src/components/ui/Modal.tsx
13
13
 
@@ -139,6 +139,79 @@ function Modal({
139
139
  }
140
140
  Modal.displayName = "Modal";
141
141
 
142
+ // src/core/debug.ts
143
+ function truncateString(value, max = 240) {
144
+ if (value.length <= max) return value;
145
+ return `${value.slice(0, max)}...`;
146
+ }
147
+ function normalizeForLog(value, depth = 0) {
148
+ if (depth > 3) return "[MaxDepth]";
149
+ if (value === null || value === void 0) return value;
150
+ if (typeof value === "bigint") return value.toString();
151
+ if (typeof value === "string") return truncateString(value);
152
+ if (typeof value === "number" || typeof value === "boolean") return value;
153
+ if (value instanceof Error) {
154
+ return {
155
+ name: value.name,
156
+ message: value.message,
157
+ stack: value.stack ? truncateString(value.stack, 600) : void 0
158
+ };
159
+ }
160
+ if (Array.isArray(value)) {
161
+ return value.slice(0, 12).map((entry) => normalizeForLog(entry, depth + 1));
162
+ }
163
+ if (typeof value === "object") {
164
+ const input = value;
165
+ const output = {};
166
+ for (const [key, raw] of Object.entries(input)) {
167
+ const keyLower = key.toLowerCase();
168
+ if (keyLower.includes("signature") || keyLower.includes("privatekey") || keyLower.includes("sessiondetails")) {
169
+ output[key] = "[Redacted]";
170
+ continue;
171
+ }
172
+ output[key] = normalizeForLog(raw, depth + 1);
173
+ }
174
+ return output;
175
+ }
176
+ return String(value);
177
+ }
178
+ function debugLog(enabled, scope, message, data) {
179
+ if (!enabled) return;
180
+ if (data === void 0) {
181
+ console.log(`[deposit-modal:${scope}] ${message}`);
182
+ return;
183
+ }
184
+ console.log(
185
+ `[deposit-modal:${scope}] ${message}`,
186
+ normalizeForLog(data)
187
+ );
188
+ }
189
+ function debugError(enabled, scope, message, error, data) {
190
+ if (!enabled) return;
191
+ const payload = data === void 0 ? { error: normalizeForLog(error) } : { error: normalizeForLog(error), meta: normalizeForLog(data) };
192
+ console.error(`[deposit-modal:${scope}] ${message}`, payload);
193
+ }
194
+
195
+ // src/core/caip.ts
196
+ var SOLANA_MAINNET_GENESIS = "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
197
+ var SOLANA_MAINNET_CAIP2 = `solana:${SOLANA_MAINNET_GENESIS}`;
198
+ function toEvmCaip2(chainId) {
199
+ return `eip155:${chainId}`;
200
+ }
201
+ function parseEvmChainId(value) {
202
+ if (typeof value === "number" && Number.isFinite(value)) {
203
+ return value;
204
+ }
205
+ if (typeof value !== "string") return null;
206
+ const match = value.match(/^eip155:(\d+)$/);
207
+ if (!_optionalChain([match, 'optionalAccess', _ => _[1]])) return null;
208
+ const parsed = Number.parseInt(match[1], 10);
209
+ return Number.isFinite(parsed) ? parsed : null;
210
+ }
211
+ function isSolanaCaip2(value) {
212
+ return typeof value === "string" && value.startsWith("solana:");
213
+ }
214
+
142
215
  // src/core/deposit-service.ts
143
216
  function jsonReplacer(_key, value) {
144
217
  return typeof value === "bigint" ? value.toString() : value;
@@ -187,6 +260,7 @@ function normalizeSetupAccountResponse(raw) {
187
260
  targetChain: data.targetChain,
188
261
  targetToken: data.targetToken,
189
262
  needsRegistration: data.needsRegistration,
263
+ solanaDepositAddress: data.solanaDepositAddress,
190
264
  accountParams: data.accountParams,
191
265
  sessionDetailsUnsigned: data.sessionDetailsUnsigned ? {
192
266
  hashesAndChainIds: data.sessionDetailsUnsigned.hashesAndChainIds.map(
@@ -208,30 +282,67 @@ function buildSessionDetails(unsigned, signature) {
208
282
  signature
209
283
  };
210
284
  }
211
- function createDepositService(baseUrl) {
285
+ function createDepositService(baseUrl, options) {
212
286
  const normalizedBaseUrl = baseUrl.replace(/\/$/, "");
287
+ const debug = _optionalChain([options, 'optionalAccess', _2 => _2.debug]) === true;
288
+ const scope = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _3 => _3.debugScope]), () => ( "service"));
213
289
  function apiUrl(path) {
214
290
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
215
291
  return `${normalizedBaseUrl}${normalizedPath}`;
216
292
  }
293
+ function shortRef(value) {
294
+ if (value.length <= 20) return value;
295
+ return `${value.slice(0, 10)}...${value.slice(-8)}`;
296
+ }
217
297
  return {
218
298
  async setupAccount(params) {
219
- const response = await fetch(apiUrl("/setup-account"), {
299
+ const url = apiUrl("/setup-account");
300
+ debugLog(debug, scope, "setupAccount:request", {
301
+ url,
302
+ ownerAddress: params.ownerAddress,
303
+ targetChain: params.targetChain,
304
+ targetToken: params.targetToken,
305
+ forceRegister: params.forceRegister
306
+ });
307
+ const response = await fetch(url, {
220
308
  method: "POST",
221
309
  headers: { "Content-Type": "application/json" },
222
310
  body: JSON.stringify(params)
223
311
  });
224
312
  if (!response.ok) {
225
313
  const error = await response.json().catch(() => ({ error: "Unknown error" }));
314
+ debugError(
315
+ debug,
316
+ scope,
317
+ "setupAccount:failed",
318
+ error,
319
+ { status: response.status, ownerAddress: params.ownerAddress }
320
+ );
226
321
  throw new Error(
227
322
  error.error || `Setup account failed: ${response.status}`
228
323
  );
229
324
  }
230
- return normalizeSetupAccountResponse(await response.json());
325
+ const normalized = normalizeSetupAccountResponse(await response.json());
326
+ debugLog(debug, scope, "setupAccount:success", {
327
+ smartAccount: normalized.smartAccount,
328
+ needsRegistration: normalized.needsRegistration,
329
+ isRegistered: normalized.isRegistered,
330
+ hasSolanaDepositAddress: Boolean(normalized.solanaDepositAddress)
331
+ });
332
+ return normalized;
231
333
  },
232
334
  async registerAccount(params) {
233
335
  const { eoaAddress, sessionOwner, ...account } = params;
234
- const response = await fetch(apiUrl("/register"), {
336
+ const url = apiUrl("/register");
337
+ debugLog(debug, scope, "registerAccount:request", {
338
+ url,
339
+ address: params.address,
340
+ targetChain: params.target.chain,
341
+ targetToken: params.target.token,
342
+ eoaAddress,
343
+ sessionOwner
344
+ });
345
+ const response = await fetch(url, {
235
346
  method: "POST",
236
347
  headers: { "Content-Type": "application/json" },
237
348
  body: JSON.stringify(
@@ -245,19 +356,41 @@ function createDepositService(baseUrl) {
245
356
  });
246
357
  if (!response.ok) {
247
358
  const error = await response.json().catch(() => ({ error: "Unknown error" }));
359
+ debugError(
360
+ debug,
361
+ scope,
362
+ "registerAccount:failed",
363
+ error,
364
+ { status: response.status, address: params.address }
365
+ );
248
366
  throw new Error(
249
367
  error.error || `Registration failed: ${response.status}`
250
368
  );
251
369
  }
252
- return response.json();
370
+ const result = await response.json();
371
+ debugLog(debug, scope, "registerAccount:success", {
372
+ address: params.address,
373
+ evmDepositAddress: _optionalChain([result, 'optionalAccess', _4 => _4.evmDepositAddress]),
374
+ hasSolanaDepositAddress: Boolean(_optionalChain([result, 'optionalAccess', _5 => _5.solanaDepositAddress]))
375
+ });
376
+ return result;
253
377
  },
254
378
  async fetchPortfolio(address) {
255
- const response = await fetch(apiUrl(`/portfolio/${address}`), {
379
+ const url = apiUrl(`/portfolio/${address}`);
380
+ debugLog(debug, scope, "fetchPortfolio:request", { url, address });
381
+ const response = await fetch(url, {
256
382
  method: "GET",
257
383
  headers: { "Content-Type": "application/json" }
258
384
  });
259
385
  if (!response.ok) {
260
386
  const error = await response.json().catch(() => ({ error: "Unknown error" }));
387
+ debugError(
388
+ debug,
389
+ scope,
390
+ "fetchPortfolio:failed",
391
+ error,
392
+ { status: response.status, address }
393
+ );
261
394
  throw new Error(
262
395
  error.error || `Portfolio fetch failed: ${response.status}`
263
396
  );
@@ -265,18 +398,95 @@ function createDepositService(baseUrl) {
265
398
  const data = await response.json();
266
399
  const direct = normalizeDirectPortfolio(data);
267
400
  if (direct.tokens.length > 0) {
401
+ debugLog(debug, scope, "fetchPortfolio:success", {
402
+ address,
403
+ source: "direct",
404
+ tokenCount: direct.tokens.length,
405
+ totalUsd: direct.totalUsd
406
+ });
268
407
  return direct;
269
408
  }
270
409
  const portfolioData = extractOrchestratorPortfolio(data);
271
410
  if (portfolioData) {
272
- return normalizeOrchestratorPortfolio(portfolioData);
411
+ const normalized = normalizeOrchestratorPortfolio(portfolioData);
412
+ debugLog(debug, scope, "fetchPortfolio:success", {
413
+ address,
414
+ source: "orchestrator",
415
+ tokenCount: normalized.tokens.length,
416
+ totalUsd: normalized.totalUsd
417
+ });
418
+ return normalized;
273
419
  }
420
+ debugLog(debug, scope, "fetchPortfolio:empty", { address });
274
421
  return { tokens: [], totalUsd: 0 };
275
422
  },
423
+ async fetchSolanaPortfolio(address) {
424
+ const url = apiUrl(`/portfolio/solana/${address}`);
425
+ debugLog(debug, scope, "fetchSolanaPortfolio:request", { url, address });
426
+ const response = await fetch(url, {
427
+ method: "GET",
428
+ headers: { "Content-Type": "application/json" }
429
+ });
430
+ if (!response.ok) {
431
+ const error = await response.json().catch(() => ({ error: "Unknown error" }));
432
+ debugError(
433
+ debug,
434
+ scope,
435
+ "fetchSolanaPortfolio:failed",
436
+ error,
437
+ { status: response.status, address }
438
+ );
439
+ throw new Error(
440
+ error.error || `Solana portfolio fetch failed: ${response.status}`
441
+ );
442
+ }
443
+ const data = await response.json();
444
+ const normalized = normalizeDirectPortfolio(data);
445
+ debugLog(debug, scope, "fetchSolanaPortfolio:success", {
446
+ address,
447
+ tokenCount: normalized.tokens.length,
448
+ totalUsd: normalized.totalUsd
449
+ });
450
+ return normalized;
451
+ },
452
+ async checkAccount(address) {
453
+ const url = apiUrl(`/check/${address}`);
454
+ debugLog(debug, scope, "checkAccount:request", { url, address });
455
+ const response = await fetch(url, {
456
+ method: "GET",
457
+ headers: { "Content-Type": "application/json" }
458
+ });
459
+ if (!response.ok) {
460
+ const error = await response.json().catch(() => ({ error: "Unknown error" }));
461
+ debugError(
462
+ debug,
463
+ scope,
464
+ "checkAccount:failed",
465
+ error,
466
+ { status: response.status, address }
467
+ );
468
+ throw new Error(error.error || `Account check failed: ${response.status}`);
469
+ }
470
+ const data = await response.json();
471
+ const result = {
472
+ isRegistered: _optionalChain([data, 'optionalAccess', _6 => _6.isRegistered]) === true,
473
+ targetChain: _optionalChain([data, 'optionalAccess', _7 => _7.targetChain]),
474
+ targetToken: _optionalChain([data, 'optionalAccess', _8 => _8.targetToken])
475
+ };
476
+ debugLog(debug, scope, "checkAccount:success", {
477
+ address,
478
+ isRegistered: result.isRegistered,
479
+ targetChain: result.targetChain,
480
+ targetToken: result.targetToken
481
+ });
482
+ return result;
483
+ },
276
484
  async fetchStatus(address, txHash) {
277
- const txHashParam = encodeURIComponent(txHash.toLowerCase());
485
+ const normalized = txHash.startsWith("0x") || txHash.startsWith("0X") ? txHash.toLowerCase() : txHash;
486
+ const txHashParam = encodeURIComponent(normalized);
487
+ const url = apiUrl(`/status/${address}?txHash=${txHashParam}`);
278
488
  const response = await fetch(
279
- apiUrl(`/status/${address}?txHash=${txHashParam}`),
489
+ url,
280
490
  {
281
491
  method: "GET",
282
492
  headers: { "Content-Type": "application/json" },
@@ -284,24 +494,53 @@ function createDepositService(baseUrl) {
284
494
  }
285
495
  );
286
496
  if (!response.ok) {
497
+ debugLog(debug, scope, "fetchStatus:miss", {
498
+ address,
499
+ txHash: shortRef(normalized),
500
+ status: response.status
501
+ });
287
502
  return { lastEvent: void 0 };
288
503
  }
289
- return response.json();
504
+ const result = await response.json();
505
+ debugLog(debug, scope, "fetchStatus:success", {
506
+ address,
507
+ txHash: shortRef(normalized),
508
+ eventType: _optionalChain([result, 'optionalAccess', _9 => _9.lastEvent, 'optionalAccess', _10 => _10.type])
509
+ });
510
+ return result;
290
511
  },
291
512
  async fetchLatestStatus(address) {
292
- const response = await fetch(apiUrl(`/status/${address}`), {
513
+ const url = apiUrl(`/status/${address}`);
514
+ const response = await fetch(url, {
293
515
  method: "GET",
294
516
  headers: { "Content-Type": "application/json" },
295
517
  cache: "no-store"
296
518
  });
297
519
  if (!response.ok) {
520
+ debugLog(debug, scope, "fetchLatestStatus:miss", {
521
+ address,
522
+ status: response.status
523
+ });
298
524
  return { lastEvent: void 0 };
299
525
  }
300
- return response.json();
526
+ const result = await response.json();
527
+ debugLog(debug, scope, "fetchLatestStatus:success", {
528
+ address,
529
+ eventType: _optionalChain([result, 'optionalAccess', _11 => _11.lastEvent, 'optionalAccess', _12 => _12.type])
530
+ });
531
+ return result;
301
532
  },
302
533
  async relayWithdraw(params) {
303
534
  const { smartAccount, chainId, safeAddress, safeTransaction, signature } = params;
304
- const response = await fetch(apiUrl(`/relay-withdraw`), {
535
+ const url = apiUrl(`/relay-withdraw`);
536
+ debugLog(debug, scope, "relayWithdraw:request", {
537
+ url,
538
+ smartAccount,
539
+ chainId,
540
+ safeAddress,
541
+ to: safeTransaction.to
542
+ });
543
+ const response = await fetch(url, {
305
544
  method: "POST",
306
545
  headers: { "Content-Type": "application/json" },
307
546
  body: JSON.stringify(
@@ -327,26 +566,46 @@ function createDepositService(baseUrl) {
327
566
  });
328
567
  if (!response.ok) {
329
568
  const error = await response.json().catch(() => ({ error: "Unknown error" }));
569
+ debugError(
570
+ debug,
571
+ scope,
572
+ "relayWithdraw:failed",
573
+ error,
574
+ {
575
+ status: response.status,
576
+ smartAccount,
577
+ chainId,
578
+ safeAddress,
579
+ signature
580
+ }
581
+ );
330
582
  throw new Error(
331
583
  error.error || `Relay withdraw failed: ${response.status}`
332
584
  );
333
585
  }
334
- return response.json();
586
+ const result = await response.json();
587
+ debugLog(debug, scope, "relayWithdraw:success", {
588
+ smartAccount,
589
+ chainId,
590
+ safeAddress,
591
+ txHash: _optionalChain([result, 'optionalAccess', _13 => _13.txHash]) ? shortRef(result.txHash) : void 0
592
+ });
593
+ return result;
335
594
  }
336
595
  };
337
596
  }
338
597
  function normalizeDirectPortfolio(data) {
339
598
  const rawTokens = _nullishCoalesce(_nullishCoalesce(extractArray(data, "tokens"), () => ( extractArray(
340
- _optionalChain([data, 'optionalAccess', _ => _.data]),
599
+ _optionalChain([data, 'optionalAccess', _14 => _14.data]),
341
600
  "tokens"
342
601
  ))), () => ( []));
343
- const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _2 => _2.data]), "totalUsd"))), () => ( 0));
602
+ const totalUsd = _nullishCoalesce(_nullishCoalesce(extractNumber(data, "totalUsd"), () => ( extractNumber(_optionalChain([data, 'optionalAccess', _15 => _15.data]), "totalUsd"))), () => ( 0));
344
603
  const tokens = rawTokens.map((token) => normalizeDirectToken(token)).filter((token) => Boolean(token));
345
604
  return { tokens, totalUsd };
346
605
  }
347
606
  function extractOrchestratorPortfolio(data) {
348
607
  const portfolio = _nullishCoalesce(extractArray(data, "portfolio"), () => ( extractArray(
349
- _optionalChain([data, 'optionalAccess', _3 => _3.data]),
608
+ _optionalChain([data, 'optionalAccess', _16 => _16.data]),
350
609
  "portfolio"
351
610
  )));
352
611
  if (!portfolio || !Array.isArray(portfolio)) return null;
@@ -357,17 +616,17 @@ function normalizeOrchestratorPortfolio(data) {
357
616
  for (const tokenData of data.portfolio || []) {
358
617
  const chainBalances = _nullishCoalesce(_nullishCoalesce(tokenData.tokenChainBalance, () => ( tokenData.chainBalances)), () => ( []));
359
618
  for (const chainBalance of chainBalances) {
360
- const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _4 => _4.balance, 'optionalAccess', _5 => _5.unlocked]), () => ( "0"));
619
+ const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _17 => _17.balance, 'optionalAccess', _18 => _18.unlocked]), () => ( "0"));
361
620
  const normalizedName = tokenData.tokenName.trim();
362
621
  const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
363
- const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkFLXTBFMZcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
364
- const resolvedTokenAddress = isNativeSymbol ? _chunkFLXTBFMZcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
622
+ const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkNELAYNA3cjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
623
+ const resolvedTokenAddress = isNativeSymbol ? _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
365
624
  if (!resolvedTokenAddress) {
366
625
  continue;
367
626
  }
368
- const registrySymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
627
+ const registrySymbol = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
369
628
  const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
370
- const decimals = registrySymbol !== "Token" ? _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
629
+ const decimals = registrySymbol !== "Token" ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
371
630
  tokens.push({
372
631
  chainId: chainBalance.chainId,
373
632
  address: resolvedTokenAddress,
@@ -385,26 +644,28 @@ function normalizeOrchestratorPortfolio(data) {
385
644
  };
386
645
  }
387
646
  function normalizeDirectToken(token) {
388
- const chainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
389
- if (!chainId) return null;
647
+ const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
648
+ const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
649
+ const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? isSolanaCaip2(rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : parseEvmChainId(rawChainString) : null)));
650
+ if (chainId === null) return null;
390
651
  const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
391
652
  if (!symbol) return null;
392
- const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _6 => _6(token, "balance"), 'optionalAccess', _7 => _7.toString, 'call', _8 => _8()]))), () => ( _optionalChain([extractNumber, 'call', _9 => _9(token, "amount"), 'optionalAccess', _10 => _10.toString, 'call', _11 => _11()]))), () => ( _optionalChain([extractNumber, 'call', _12 => _12(token, "value"), 'optionalAccess', _13 => _13.toString, 'call', _14 => _14()]))), () => ( _optionalChain([extractNumber, 'call', _15 => _15(token, "rawBalance"), 'optionalAccess', _16 => _16.toString, 'call', _17 => _17()])));
653
+ const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _19 => _19(token, "balance"), 'optionalAccess', _20 => _20.toString, 'call', _21 => _21()]))), () => ( _optionalChain([extractNumber, 'call', _22 => _22(token, "amount"), 'optionalAccess', _23 => _23.toString, 'call', _24 => _24()]))), () => ( _optionalChain([extractNumber, 'call', _25 => _25(token, "value"), 'optionalAccess', _26 => _26.toString, 'call', _27 => _27()]))), () => ( _optionalChain([extractNumber, 'call', _28 => _28(token, "rawBalance"), 'optionalAccess', _29 => _29.toString, 'call', _30 => _30()])));
393
654
  if (!balanceValue) return null;
394
655
  const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
395
656
  token.token,
396
657
  "address"
397
- ))), () => ( _chunkFLXTBFMZcjs.getTokenAddress.call(void 0, symbol, chainId)));
658
+ ))), () => ( (typeof chainId === "number" ? _chunkNELAYNA3cjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
398
659
  if (!address) return null;
399
- const addressAsToken = address;
400
660
  const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
401
- const registrySymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, addressAsToken, chainId);
402
- const resolvedSymbol = registrySymbol !== "Token" ? registrySymbol : symbol;
661
+ const isSolanaToken = chainId === "solana";
662
+ const registrySymbol = isSolanaToken ? "Token" : _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, address, chainId);
663
+ const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
403
664
  const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
404
- const resolvedDecimals = registrySymbol !== "Token" ? _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0, addressAsToken, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
665
+ const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
405
666
  return {
406
667
  chainId,
407
- address: addressAsToken,
668
+ address,
408
669
  symbol: resolvedSymbol,
409
670
  name: resolvedSymbol,
410
671
  decimals: resolvedDecimals,
@@ -414,7 +675,7 @@ function normalizeDirectToken(token) {
414
675
  }
415
676
  function extractTokenAddress(tokenData, chainId) {
416
677
  const token = tokenData;
417
- return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _18 => _18.addresses, 'optionalAccess', _19 => _19[chainId]]))), () => ( _optionalChain([token, 'access', _20 => _20.token, 'optionalAccess', _21 => _21.address]))), () => ( _optionalChain([token, 'access', _22 => _22.token, 'optionalAccess', _23 => _23.addresses, 'optionalAccess', _24 => _24[chainId]])));
678
+ return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(token.tokenAddress, () => ( token.address)), () => ( _optionalChain([token, 'access', _31 => _31.addresses, 'optionalAccess', _32 => _32[chainId]]))), () => ( _optionalChain([token, 'access', _33 => _33.token, 'optionalAccess', _34 => _34.address]))), () => ( _optionalChain([token, 'access', _35 => _35.token, 'optionalAccess', _36 => _36.addresses, 'optionalAccess', _37 => _37[chainId]])));
418
679
  }
419
680
  function extractArray(data, key) {
420
681
  if (!data || typeof data !== "object") return null;
@@ -443,7 +704,12 @@ function extractNumericString(data, key) {
443
704
  function getAssetId(asset) {
444
705
  return `${asset.chainId}:${asset.token.toLowerCase()}`;
445
706
  }
707
+ function isEvmAddress(value) {
708
+ return /^0x[a-fA-F0-9]{40}$/.test(value);
709
+ }
446
710
  function portfolioTokenToAsset(token) {
711
+ if (typeof token.chainId !== "number") return null;
712
+ if (!isEvmAddress(token.address)) return null;
447
713
  return {
448
714
  id: getAssetId({ chainId: token.chainId, token: token.address }),
449
715
  chainId: token.chainId,
@@ -456,7 +722,7 @@ function portfolioTokenToAsset(token) {
456
722
  };
457
723
  }
458
724
  function portfolioToAssets(tokens) {
459
- return tokens.map(portfolioTokenToAsset).sort((a, b) => {
725
+ return tokens.map(portfolioTokenToAsset).filter((token) => token !== null).sort((a, b) => {
460
726
  const balanceA = safeBigInt(a.balance);
461
727
  const balanceB = safeBigInt(b.balance);
462
728
  if (balanceB > balanceA) return 1;
@@ -499,6 +765,9 @@ function formatUserError(raw) {
499
765
  if (lower.includes("execution reverted")) {
500
766
  return "Transaction would fail on-chain";
501
767
  }
768
+ if (lower.includes("recent blockhash") || lower.includes("latest blockhash")) {
769
+ return "Solana RPC unavailable \u2014 please retry";
770
+ }
502
771
  if (lower.includes("network") || lower.includes("disconnected")) {
503
772
  return "Network error \u2014 check your connection";
504
773
  }
@@ -523,35 +792,35 @@ var RADIUS_VALUES = {
523
792
  };
524
793
  function applyTheme(element, theme) {
525
794
  if (!element) return;
526
- if (_optionalChain([theme, 'optionalAccess', _25 => _25.mode])) {
795
+ if (_optionalChain([theme, 'optionalAccess', _38 => _38.mode])) {
527
796
  element.setAttribute("data-theme", theme.mode);
528
797
  } else {
529
798
  element.removeAttribute("data-theme");
530
799
  }
531
- if (_optionalChain([theme, 'optionalAccess', _26 => _26.fontColor])) {
800
+ if (_optionalChain([theme, 'optionalAccess', _39 => _39.fontColor])) {
532
801
  element.style.setProperty("--rs-foreground", theme.fontColor);
533
802
  }
534
- if (_optionalChain([theme, 'optionalAccess', _27 => _27.iconColor])) {
803
+ if (_optionalChain([theme, 'optionalAccess', _40 => _40.iconColor])) {
535
804
  element.style.setProperty("--rs-icon", theme.iconColor);
536
805
  }
537
- if (_optionalChain([theme, 'optionalAccess', _28 => _28.ctaColor])) {
806
+ if (_optionalChain([theme, 'optionalAccess', _41 => _41.ctaColor])) {
538
807
  element.style.setProperty("--rs-primary", theme.ctaColor);
539
808
  element.style.setProperty("--rs-border-accent", theme.ctaColor);
540
809
  element.style.setProperty(
541
810
  "--rs-primary-hover",
542
811
  _nullishCoalesce(theme.ctaHoverColor, () => ( theme.ctaColor))
543
812
  );
544
- } else if (_optionalChain([theme, 'optionalAccess', _29 => _29.ctaHoverColor])) {
813
+ } else if (_optionalChain([theme, 'optionalAccess', _42 => _42.ctaHoverColor])) {
545
814
  element.style.setProperty("--rs-primary-hover", theme.ctaHoverColor);
546
815
  }
547
- if (_optionalChain([theme, 'optionalAccess', _30 => _30.borderColor])) {
816
+ if (_optionalChain([theme, 'optionalAccess', _43 => _43.borderColor])) {
548
817
  element.style.setProperty("--rs-border", theme.borderColor);
549
818
  element.style.setProperty("--rs-border-surface", theme.borderColor);
550
819
  }
551
- if (_optionalChain([theme, 'optionalAccess', _31 => _31.backgroundColor])) {
820
+ if (_optionalChain([theme, 'optionalAccess', _44 => _44.backgroundColor])) {
552
821
  element.style.setProperty("--rs-background", theme.backgroundColor);
553
822
  }
554
- if (_optionalChain([theme, 'optionalAccess', _32 => _32.radius])) {
823
+ if (_optionalChain([theme, 'optionalAccess', _45 => _45.radius])) {
555
824
  element.style.setProperty("--rs-radius", RADIUS_VALUES[theme.radius]);
556
825
  }
557
826
  }
@@ -698,12 +967,13 @@ function ChevronRightIcon() {
698
967
 
699
968
  function rowIcon(kind) {
700
969
  if (kind === "connected") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {});
970
+ if (kind === "solana") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {});
701
971
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {});
702
972
  }
703
973
  function ConnectStep({
704
974
  walletOptions,
705
- selectedAddress,
706
- onSelectAddress,
975
+ selectedWalletId,
976
+ onSelectWallet,
707
977
  onSelectTransferCrypto,
708
978
  onRequestConnect,
709
979
  onConnect,
@@ -712,22 +982,25 @@ function ConnectStep({
712
982
  continueButtonLabel = "Continue",
713
983
  connectButtonLabel = "Connect external wallet"
714
984
  }) {
715
- const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _33 => _33.length]), () => ( 0))) > 0;
985
+ const hasWalletOptions = (_nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _46 => _46.length]), () => ( 0))) > 0;
716
986
  if (hasWalletOptions) {
717
- const hasExternalWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _34 => _34.some, 'call', _35 => _35((option) => option.kind === "external")]), () => ( false));
718
- const showConnectDifferentWalletOption = Boolean(onConnect) && !hasExternalWallet;
987
+ const hasReownWallet = _nullishCoalesce(_optionalChain([walletOptions, 'optionalAccess', _47 => _47.some, 'call', _48 => _48(
988
+ (option) => option.kind === "external" || option.kind === "solana"
989
+ )]), () => ( false));
990
+ const showConnectDifferentWalletOption = Boolean(onConnect) && !hasReownWallet;
719
991
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
720
992
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-centered rs-connect-centered--wallets", children: [
721
993
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-connect-wallet-list", children: [
722
- _optionalChain([walletOptions, 'optionalAccess', _36 => _36.map, 'call', _37 => _37((option) => {
723
- const isSelected = option.address.toLowerCase() === (_nullishCoalesce(selectedAddress, () => ( ""))).toLowerCase();
724
- const shortAddress = `${option.address.slice(0, 6)}...${option.address.slice(-4)}`;
994
+ _optionalChain([walletOptions, 'optionalAccess', _49 => _49.map, 'call', _50 => _50((option) => {
995
+ const isSelected = option.id === selectedWalletId;
996
+ const rawAddress = _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id));
997
+ const shortAddress = rawAddress.length > 12 ? `${rawAddress.slice(0, 6)}...${rawAddress.slice(-4)}` : rawAddress;
725
998
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
726
999
  "button",
727
1000
  {
728
1001
  type: "button",
729
1002
  className: `rs-connect-wallet-row ${isSelected ? "rs-connect-wallet-row--selected" : ""}`,
730
- onClick: () => _optionalChain([onSelectAddress, 'optionalCall', _38 => _38(option.address)]),
1003
+ onClick: () => _optionalChain([onSelectWallet, 'optionalCall', _51 => _51(option.id)]),
731
1004
  children: [
732
1005
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
733
1006
  "div",
@@ -750,7 +1023,7 @@ function ConnectStep({
750
1023
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-connect-wallet-indicator", children: isSelected ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronRightIcon, {}) })
751
1024
  ]
752
1025
  },
753
- `${option.label}-${option.address}`
1026
+ option.id
754
1027
  );
755
1028
  })]),
756
1029
  showConnectDifferentWalletOption && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -786,7 +1059,9 @@ function ConnectStep({
786
1059
  }
787
1060
  )
788
1061
  ] }),
789
- (onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _39 => _39.some, 'call', _40 => _40((option) => option.kind === "external")]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1062
+ (onDisconnect || onConnect) && _optionalChain([walletOptions, 'optionalAccess', _52 => _52.some, 'call', _53 => _53(
1063
+ (option) => option.kind === "external" || option.kind === "solana"
1064
+ )]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
790
1065
  "button",
791
1066
  {
792
1067
  type: "button",
@@ -802,7 +1077,7 @@ function ConnectStep({
802
1077
  onClick: onContinue,
803
1078
  variant: "accent",
804
1079
  fullWidth: true,
805
- disabled: !selectedAddress || !onContinue,
1080
+ disabled: !selectedWalletId || !onContinue,
806
1081
  children: continueButtonLabel
807
1082
  }
808
1083
  ) })
@@ -1001,7 +1276,7 @@ function asNumber(value) {
1001
1276
  const trimmed = value.trim();
1002
1277
  if (!trimmed) return void 0;
1003
1278
  const caipMatch = trimmed.match(/^eip155:(\d+)$/);
1004
- if (_optionalChain([caipMatch, 'optionalAccess', _41 => _41[1]])) {
1279
+ if (_optionalChain([caipMatch, 'optionalAccess', _54 => _54[1]])) {
1005
1280
  const parsed2 = Number(caipMatch[1]);
1006
1281
  return Number.isFinite(parsed2) ? parsed2 : void 0;
1007
1282
  }
@@ -1020,24 +1295,24 @@ function asAddress(value) {
1020
1295
  return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
1021
1296
  }
1022
1297
  function getEventTxHash(event) {
1023
- if (!_optionalChain([event, 'optionalAccess', _42 => _42.type])) return void 0;
1298
+ if (!_optionalChain([event, 'optionalAccess', _55 => _55.type])) return void 0;
1024
1299
  if (event.type === "deposit-received") {
1025
- return asString(_optionalChain([event, 'access', _43 => _43.data, 'optionalAccess', _44 => _44.transactionHash]));
1300
+ return asString(_optionalChain([event, 'access', _56 => _56.data, 'optionalAccess', _57 => _57.transactionHash]));
1026
1301
  }
1027
1302
  if (event.type === "bridge-started" || event.type === "bridge-complete") {
1028
- const deposit = isRecord(_optionalChain([event, 'access', _45 => _45.data, 'optionalAccess', _46 => _46.deposit])) ? event.data.deposit : void 0;
1029
- const source = isRecord(_optionalChain([event, 'access', _47 => _47.data, 'optionalAccess', _48 => _48.source])) ? event.data.source : void 0;
1030
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _49 => _49.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _50 => _50.transactionHash]))));
1303
+ const deposit = isRecord(_optionalChain([event, 'access', _58 => _58.data, 'optionalAccess', _59 => _59.deposit])) ? event.data.deposit : void 0;
1304
+ const source = isRecord(_optionalChain([event, 'access', _60 => _60.data, 'optionalAccess', _61 => _61.source])) ? event.data.source : void 0;
1305
+ return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _62 => _62.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _63 => _63.transactionHash]))));
1031
1306
  }
1032
1307
  if (event.type === "bridge-failed" || event.type === "error") {
1033
- const deposit = isRecord(_optionalChain([event, 'access', _51 => _51.data, 'optionalAccess', _52 => _52.deposit])) ? event.data.deposit : void 0;
1034
- const source = isRecord(_optionalChain([event, 'access', _53 => _53.data, 'optionalAccess', _54 => _54.source])) ? event.data.source : void 0;
1035
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _55 => _55.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _56 => _56.transactionHash]))));
1308
+ const deposit = isRecord(_optionalChain([event, 'access', _64 => _64.data, 'optionalAccess', _65 => _65.deposit])) ? event.data.deposit : void 0;
1309
+ const source = isRecord(_optionalChain([event, 'access', _66 => _66.data, 'optionalAccess', _67 => _67.source])) ? event.data.source : void 0;
1310
+ return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _68 => _68.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _69 => _69.transactionHash]))));
1036
1311
  }
1037
1312
  return void 0;
1038
1313
  }
1039
1314
  function getEventSourceDetails(event) {
1040
- if (!_optionalChain([event, 'optionalAccess', _57 => _57.type]) || !isRecord(event.data)) return {};
1315
+ if (!_optionalChain([event, 'optionalAccess', _70 => _70.type]) || !isRecord(event.data)) return {};
1041
1316
  if (event.type === "deposit-received") {
1042
1317
  return {
1043
1318
  chainId: asNumber(event.data.chain),
@@ -1049,15 +1324,24 @@ function getEventSourceDetails(event) {
1049
1324
  const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1050
1325
  if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
1051
1326
  return {
1052
- chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _58 => _58.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _59 => _59.chain])))),
1053
- amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _60 => _60.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _61 => _61.amount])))),
1054
- token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _62 => _62.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _63 => _63.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _64 => _64.token]))))
1327
+ chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _71 => _71.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _72 => _72.chain])))),
1328
+ amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _73 => _73.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _74 => _74.amount])))),
1329
+ token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _75 => _75.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _76 => _76.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _77 => _77.token]))))
1055
1330
  };
1056
1331
  }
1057
1332
  return {};
1058
1333
  }
1059
1334
  function isDepositEvent(event) {
1060
- return _optionalChain([event, 'optionalAccess', _65 => _65.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _66 => _66.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _67 => _67.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _68 => _68.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _69 => _69.type]) === "error";
1335
+ return _optionalChain([event, 'optionalAccess', _78 => _78.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _79 => _79.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _80 => _80.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _81 => _81.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _82 => _82.type]) === "error";
1336
+ }
1337
+ function isHexString(value) {
1338
+ return value.startsWith("0x") || value.startsWith("0X");
1339
+ }
1340
+ function txRefsMatch(a, b) {
1341
+ if (isHexString(a) && isHexString(b)) {
1342
+ return a.toLowerCase() === b.toLowerCase();
1343
+ }
1344
+ return a === b;
1061
1345
  }
1062
1346
 
1063
1347
  // src/components/steps/ProcessingStep.tsx
@@ -1069,15 +1353,32 @@ var PROCESS_TIMEOUT_MS = 10 * 60 * 1e3;
1069
1353
  function isEventForTx(event, txHash) {
1070
1354
  const eventTxHash = getEventTxHash(event);
1071
1355
  if (!eventTxHash) return false;
1072
- return eventTxHash.toLowerCase() === txHash.toLowerCase();
1356
+ return txRefsMatch(eventTxHash, txHash);
1073
1357
  }
1074
1358
  function formatBridgeFailedMessage(event) {
1075
- const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _70 => _70.data]), () => ( {}));
1359
+ const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _83 => _83.data]), () => ( {}));
1076
1360
  const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
1077
1361
  const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
1362
+ function toUserFacingFailure(raw) {
1363
+ const lower = raw.toLowerCase();
1364
+ if (lower.includes("insufficient funds")) {
1365
+ return "Deposit was received, but processing could not continue due to insufficient funds. Please retry.";
1366
+ }
1367
+ if (lower.includes("no valid quote available")) {
1368
+ return "No bridge route is currently available for this transfer. Please try again shortly.";
1369
+ }
1370
+ if (lower.includes("simulation failed")) {
1371
+ return "Transfer processing failed during simulation. Please retry.";
1372
+ }
1373
+ if (raw.length > 220) {
1374
+ return "Transfer processing failed. Please retry.";
1375
+ }
1376
+ return raw;
1377
+ }
1078
1378
  if (backendMessage.length > 0) {
1379
+ const userMessage = toUserFacingFailure(backendMessage);
1079
1380
  return {
1080
- message: backendMessage,
1381
+ message: userMessage,
1081
1382
  code
1082
1383
  };
1083
1384
  }
@@ -1093,6 +1394,8 @@ function ProcessingStep({
1093
1394
  sourceToken,
1094
1395
  targetChain,
1095
1396
  amount,
1397
+ sourceSymbol: providedSourceSymbol,
1398
+ sourceDecimals: providedSourceDecimals,
1096
1399
  waitForFinalTx,
1097
1400
  service,
1098
1401
  directTransfer,
@@ -1112,10 +1415,14 @@ function ProcessingStep({
1112
1415
  const intervalRef = _react.useRef.call(void 0, null);
1113
1416
  _react.useEffect.call(void 0, () => {
1114
1417
  if (directTransfer) {
1115
- _optionalChain([onDepositComplete, 'optionalCall', _71 => _71(txHash)]);
1418
+ debugLog(debug, "processing", "direct-transfer:complete", {
1419
+ txHash,
1420
+ flowLabel
1421
+ });
1422
+ _optionalChain([onDepositComplete, 'optionalCall', _84 => _84(txHash)]);
1116
1423
  return;
1117
1424
  }
1118
- }, [directTransfer, txHash, onDepositComplete]);
1425
+ }, [debug, directTransfer, flowLabel, txHash, onDepositComplete]);
1119
1426
  _react.useEffect.call(void 0, () => {
1120
1427
  if (directTransfer) return;
1121
1428
  startTimeRef.current = Date.now();
@@ -1146,54 +1453,81 @@ function ProcessingStep({
1146
1453
  let isMounted = true;
1147
1454
  async function pollStatus() {
1148
1455
  try {
1456
+ debugLog(debug, "processing", "poll:request", {
1457
+ smartAccount,
1458
+ txHash,
1459
+ intervalMs: pollIntervalRef.current
1460
+ });
1149
1461
  const data = await service.fetchStatus(smartAccount, txHash);
1150
1462
  const lastEvent2 = data.lastEvent;
1151
1463
  const eventMatchesTx = isEventForTx(lastEvent2, txHash);
1152
1464
  const eventForCurrentTx = eventMatchesTx ? lastEvent2 : void 0;
1153
- if (debug && lastEvent2) {
1465
+ if (lastEvent2) {
1154
1466
  const eventData = lastEvent2.data;
1155
- console.log("[deposit-modal] status poll", {
1467
+ debugLog(debug, "processing", "poll:event", {
1156
1468
  type: lastEvent2.type,
1157
1469
  matchesTx: eventMatchesTx,
1158
- intentId: _optionalChain([eventData, 'optionalAccess', _72 => _72.intentId]),
1159
- data: eventData
1470
+ intentId: _optionalChain([eventData, 'optionalAccess', _85 => _85.intentId])
1160
1471
  });
1161
1472
  }
1162
1473
  if (!isMounted) return;
1163
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _73 => _73.type]) === "bridge-complete") {
1474
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _86 => _86.type]) === "bridge-complete") {
1164
1475
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1165
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _74 => _74.data, 'optionalAccess', _75 => _75.destination, 'optionalAccess', _76 => _76.transactionHash]);
1166
- _optionalChain([onDepositComplete, 'optionalCall', _77 => _77(txHash, destinationTxHash2)]);
1476
+ const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _87 => _87.data, 'optionalAccess', _88 => _88.destination, 'optionalAccess', _89 => _89.transactionHash]);
1477
+ debugLog(debug, "processing", "state:complete", {
1478
+ txHash,
1479
+ destinationTxHash: destinationTxHash2,
1480
+ event: eventForCurrentTx.type
1481
+ });
1482
+ _optionalChain([onDepositComplete, 'optionalCall', _90 => _90(txHash, destinationTxHash2)]);
1167
1483
  return;
1168
1484
  }
1169
- if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _78 => _78.type]) === "bridge-started") {
1485
+ if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _91 => _91.type]) === "bridge-started") {
1170
1486
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1171
- _optionalChain([onDepositComplete, 'optionalCall', _79 => _79(txHash)]);
1487
+ debugLog(debug, "processing", "state:early-complete", {
1488
+ txHash,
1489
+ event: eventForCurrentTx.type
1490
+ });
1491
+ _optionalChain([onDepositComplete, 'optionalCall', _92 => _92(txHash)]);
1172
1492
  return;
1173
1493
  }
1174
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _80 => _80.type]) === "bridge-failed") {
1494
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _93 => _93.type]) === "bridge-failed") {
1175
1495
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1176
1496
  setState({
1177
1497
  type: "failed",
1178
1498
  message: formatted.message,
1179
1499
  lastEvent: eventForCurrentTx
1180
1500
  });
1181
- _optionalChain([onDepositFailed, 'optionalCall', _81 => _81(txHash, formatted.message)]);
1501
+ debugLog(debug, "processing", "state:failed", {
1502
+ txHash,
1503
+ message: formatted.message,
1504
+ code: formatted.code
1505
+ });
1506
+ _optionalChain([onDepositFailed, 'optionalCall', _94 => _94(txHash, formatted.message)]);
1182
1507
  return;
1183
1508
  }
1184
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _82 => _82.type]) === "error") {
1185
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _83 => _83.data, 'optionalAccess', _84 => _84.message]), () => ( "Unknown error"));
1509
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _95 => _95.type]) === "error") {
1510
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _96 => _96.data, 'optionalAccess', _97 => _97.message]), () => ( "Unknown error"));
1186
1511
  setState({
1187
1512
  type: "failed",
1188
1513
  message: errorMessage,
1189
1514
  lastEvent: eventForCurrentTx
1190
1515
  });
1191
- _optionalChain([onDepositFailed, 'optionalCall', _85 => _85(txHash, errorMessage)]);
1516
+ debugLog(debug, "processing", "state:error-event", {
1517
+ txHash,
1518
+ message: errorMessage
1519
+ });
1520
+ _optionalChain([onDepositFailed, 'optionalCall', _98 => _98(txHash, errorMessage)]);
1192
1521
  return;
1193
1522
  }
1194
1523
  setState({ type: "processing", lastEvent: eventForCurrentTx });
1195
1524
  scheduleNextPoll();
1196
- } catch (e3) {
1525
+ } catch (error) {
1526
+ debugError(debug, "processing", "poll:failure", error, {
1527
+ smartAccount,
1528
+ txHash,
1529
+ intervalMs: pollIntervalRef.current
1530
+ });
1197
1531
  scheduleNextPoll();
1198
1532
  }
1199
1533
  }
@@ -1204,6 +1538,9 @@ function ProcessingStep({
1204
1538
  pollIntervalRef.current * BACKOFF_MULTIPLIER,
1205
1539
  MAX_POLL_INTERVAL
1206
1540
  );
1541
+ debugLog(debug, "processing", "poll:scheduled", {
1542
+ nextIntervalMs: pollIntervalRef.current
1543
+ });
1207
1544
  pollStatus();
1208
1545
  }, pollIntervalRef.current);
1209
1546
  }
@@ -1215,6 +1552,7 @@ function ProcessingStep({
1215
1552
  }
1216
1553
  };
1217
1554
  }, [
1555
+ debug,
1218
1556
  directTransfer,
1219
1557
  state.type,
1220
1558
  smartAccount,
@@ -1235,8 +1573,12 @@ function ProcessingStep({
1235
1573
  }
1236
1574
  processTimeoutRef.current = setTimeout(() => {
1237
1575
  const message = "We couldn't confirm your transfer. Please contact support if funds do not arrive.";
1576
+ debugLog(debug, "processing", "state:timeout", {
1577
+ txHash,
1578
+ timeoutMs: PROCESS_TIMEOUT_MS
1579
+ });
1238
1580
  setState({ type: "error", message });
1239
- _optionalChain([onError, 'optionalCall', _86 => _86(message, "PROCESS_TIMEOUT")]);
1581
+ _optionalChain([onError, 'optionalCall', _99 => _99(message, "PROCESS_TIMEOUT")]);
1240
1582
  }, PROCESS_TIMEOUT_MS);
1241
1583
  return () => {
1242
1584
  if (processTimeoutRef.current) {
@@ -1244,21 +1586,21 @@ function ProcessingStep({
1244
1586
  processTimeoutRef.current = null;
1245
1587
  }
1246
1588
  };
1247
- }, [directTransfer, state.type, onError]);
1589
+ }, [debug, directTransfer, state.type, txHash, onError]);
1248
1590
  const isError = state.type === "error" || state.type === "failed";
1249
1591
  const isComplete = state.type === "complete";
1250
1592
  const isProcessing = state.type === "processing";
1251
1593
  const lastEvent = state.type === "processing" || state.type === "complete" || state.type === "failed" ? state.lastEvent : void 0;
1252
- const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _87 => _87.type]) === "bridge-started";
1594
+ const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _100 => _100.type]) === "bridge-started";
1253
1595
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
1254
1596
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
1255
- const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _88 => _88.data, 'optionalAccess', _89 => _89.destination, 'optionalAccess', _90 => _90.transactionHash]) || null;
1597
+ const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _101 => _101.data, 'optionalAccess', _102 => _102.destination, 'optionalAccess', _103 => _103.transactionHash]) || null;
1256
1598
  const sourceDetails = getEventSourceDetails(lastEvent);
1257
1599
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
1258
1600
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
1259
1601
  const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
1260
- const sourceExplorerUrl = _chunkFLXTBFMZcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1261
- const destExplorerUrl = destinationTxHash ? _chunkFLXTBFMZcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1602
+ const sourceExplorerUrl = _chunkNELAYNA3cjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
1603
+ const destExplorerUrl = destinationTxHash ? _chunkNELAYNA3cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1262
1604
  const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
1263
1605
  const formatElapsedTime = (seconds) => {
1264
1606
  if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
@@ -1266,18 +1608,16 @@ function ProcessingStep({
1266
1608
  const secs = seconds % 60;
1267
1609
  return `${mins}m ${secs}s`;
1268
1610
  };
1269
- const sourceSymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain);
1270
- const sourceDecimals = _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0,
1271
- displaySourceToken,
1272
- displaySourceChain
1273
- );
1611
+ const isEvmSourceToken = /^0x[a-fA-F0-9]{40}$/.test(displaySourceToken);
1612
+ const sourceSymbol = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceSymbol, () => ( "SOL")) : isEvmSourceToken ? _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceSymbol, () => ( "Token"));
1613
+ const sourceDecimals = displaySourceChain === "solana" ? _nullishCoalesce(providedSourceDecimals, () => ( 9)) : isEvmSourceToken ? _chunkNELAYNA3cjs.getTokenDecimalsByAddress.call(void 0, displaySourceToken, displaySourceChain) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
1274
1614
  const formattedReceivedAmount = (() => {
1275
1615
  try {
1276
1616
  const raw = _viem.formatUnits.call(void 0, BigInt(displayAmount), sourceDecimals);
1277
1617
  const numeric = Number(raw);
1278
1618
  if (!Number.isFinite(numeric)) return raw;
1279
1619
  return numeric.toLocaleString("en-US", { maximumFractionDigits: 6 });
1280
- } catch (e4) {
1620
+ } catch (e3) {
1281
1621
  return Number(displayAmount).toLocaleString("en-US", {
1282
1622
  maximumFractionDigits: 6
1283
1623
  });
@@ -1341,15 +1681,15 @@ function ProcessingStep({
1341
1681
  className: "rs-card-value",
1342
1682
  style: { display: "flex", alignItems: "center", gap: 6 },
1343
1683
  children: [
1344
- _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1684
+ _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1345
1685
  "img",
1346
1686
  {
1347
- src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain),
1687
+ src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain),
1348
1688
  alt: "",
1349
1689
  style: { width: 14, height: 14, borderRadius: "50%" }
1350
1690
  }
1351
1691
  ),
1352
- _chunkFLXTBFMZcjs.getChainName.call(void 0, displaySourceChain)
1692
+ _chunkNELAYNA3cjs.getChainName.call(void 0, displaySourceChain)
1353
1693
  ]
1354
1694
  }
1355
1695
  )
@@ -1362,15 +1702,15 @@ function ProcessingStep({
1362
1702
  className: "rs-card-value",
1363
1703
  style: { display: "flex", alignItems: "center", gap: 6 },
1364
1704
  children: [
1365
- _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1705
+ _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1366
1706
  "img",
1367
1707
  {
1368
- src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain),
1708
+ src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain),
1369
1709
  alt: "",
1370
1710
  style: { width: 14, height: 14, borderRadius: "50%" }
1371
1711
  }
1372
1712
  ),
1373
- _chunkFLXTBFMZcjs.getChainName.call(void 0, targetChain)
1713
+ _chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)
1374
1714
  ]
1375
1715
  }
1376
1716
  )
@@ -1492,7 +1832,7 @@ function ProcessingStep({
1492
1832
  {
1493
1833
  className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
1494
1834
  children: [
1495
- state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _91 => _91.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _92 => _92.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${_chunkFLXTBFMZcjs.getChainName.call(void 0, targetChain)}.`),
1835
+ state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _104 => _104.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _105 => _105.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${_chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)}.`),
1496
1836
  state.type === "failed" && state.message,
1497
1837
  state.type === "error" && state.message
1498
1838
  ]
@@ -1548,15 +1888,15 @@ function ProcessingStep({
1548
1888
  className: "rs-card-value",
1549
1889
  style: { display: "flex", alignItems: "center", gap: 8 },
1550
1890
  children: [
1551
- _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1891
+ _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1552
1892
  "img",
1553
1893
  {
1554
- src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain),
1894
+ src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, displaySourceChain),
1555
1895
  alt: "",
1556
1896
  style: { width: 16, height: 16, borderRadius: "50%" }
1557
1897
  }
1558
1898
  ),
1559
- _chunkFLXTBFMZcjs.getChainName.call(void 0, displaySourceChain)
1899
+ _chunkNELAYNA3cjs.getChainName.call(void 0, displaySourceChain)
1560
1900
  ]
1561
1901
  }
1562
1902
  )
@@ -1569,15 +1909,15 @@ function ProcessingStep({
1569
1909
  className: "rs-card-value",
1570
1910
  style: { display: "flex", alignItems: "center", gap: 8 },
1571
1911
  children: [
1572
- _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1912
+ _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1573
1913
  "img",
1574
1914
  {
1575
- src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain),
1915
+ src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain),
1576
1916
  alt: "",
1577
1917
  style: { width: 16, height: 16, borderRadius: "50%" }
1578
1918
  }
1579
1919
  ),
1580
- _chunkFLXTBFMZcjs.getChainName.call(void 0, targetChain)
1920
+ _chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)
1581
1921
  ]
1582
1922
  }
1583
1923
  )
@@ -1630,7 +1970,7 @@ var clientCache = /* @__PURE__ */ new Map();
1630
1970
  function getPublicClient(chainId) {
1631
1971
  let client = clientCache.get(chainId);
1632
1972
  if (!client) {
1633
- const chain = _chunkFLXTBFMZcjs.CHAIN_BY_ID[chainId];
1973
+ const chain = _chunkNELAYNA3cjs.CHAIN_BY_ID[chainId];
1634
1974
  client = _viem.createPublicClient.call(void 0, {
1635
1975
  chain,
1636
1976
  transport: _viem.http.call(void 0, )
@@ -1664,4 +2004,7 @@ function getPublicClient(chainId) {
1664
2004
 
1665
2005
 
1666
2006
 
1667
- exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.PoweredBy = PoweredBy; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;
2007
+
2008
+
2009
+
2010
+ exports.Modal = Modal; exports.Spinner = Spinner; exports.Button = Button; exports.ConnectStep = ConnectStep; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.PoweredBy = PoweredBy; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.formatUserError = formatUserError; exports.getEventTxHash = getEventTxHash; exports.isDepositEvent = isDepositEvent; exports.txRefsMatch = txRefsMatch; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;