@rhinestone/deposit-modal 0.1.37 → 0.1.39

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.
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkFQIIKMDJcjs = require('./chunk-FQIIKMDJ.cjs');
3
+ var _chunkVTTEVMB6cjs = require('./chunk-VTTEVMB6.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkV7I5T4SWcjs = require('./chunk-V7I5T4SW.cjs');
8
- require('./chunk-YIHOACM3.cjs');
9
- require('./chunk-S4UBVD3H.cjs');
8
+ require('./chunk-AHOFT42H.cjs');
9
+ require('./chunk-FLXTBFMZ.cjs');
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  var _react = require('react');
@@ -20,7 +20,7 @@ function DepositModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkFQIIKMDJcjs.DepositModalInner,
23
+ _chunkVTTEVMB6cjs.DepositModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  DepositModalInner
3
- } from "./chunk-MMVDUFJD.mjs";
3
+ } from "./chunk-TK7BVWX6.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-SJEIKMVO.mjs";
8
- import "./chunk-DLFUXLAM.mjs";
9
- import "./chunk-C6I5TFSL.mjs";
8
+ import "./chunk-IC2M2DZ7.mjs";
9
+ import "./chunk-I7RYTI4G.mjs";
10
10
 
11
11
  // src/DepositModalReown.tsx
12
12
  import { useCallback } from "react";
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkSFYMDLKJcjs = require('./chunk-SFYMDLKJ.cjs');
3
+ var _chunkK7BHCDJQcjs = require('./chunk-K7BHCDJQ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  var _chunkV7I5T4SWcjs = require('./chunk-V7I5T4SW.cjs');
8
- require('./chunk-YIHOACM3.cjs');
9
- require('./chunk-S4UBVD3H.cjs');
8
+ require('./chunk-AHOFT42H.cjs');
9
+ require('./chunk-FLXTBFMZ.cjs');
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  var _react = require('react');
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
20
20
  reown.disconnect();
21
21
  }, [reown.disconnect]);
22
22
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
23
- _chunkSFYMDLKJcjs.WithdrawModalInner,
23
+ _chunkK7BHCDJQcjs.WithdrawModalInner,
24
24
  {
25
25
  ...props,
26
26
  reownWallet: reown,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  WithdrawModalInner
3
- } from "./chunk-MKOZFFFJ.mjs";
3
+ } from "./chunk-CFLZYWX7.mjs";
4
4
  import {
5
5
  ReownWalletProvider,
6
6
  useReownWallet
7
7
  } from "./chunk-SJEIKMVO.mjs";
8
- import "./chunk-DLFUXLAM.mjs";
9
- import "./chunk-C6I5TFSL.mjs";
8
+ import "./chunk-IC2M2DZ7.mjs";
9
+ import "./chunk-I7RYTI4G.mjs";
10
10
 
11
11
  // src/WithdrawModalReown.tsx
12
12
  import { useCallback } from "react";
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunkS4UBVD3Hcjs = require('./chunk-S4UBVD3H.cjs');
10
+ var _chunkFLXTBFMZcjs = require('./chunk-FLXTBFMZ.cjs');
11
11
 
12
12
  // src/components/ui/Modal.tsx
13
13
 
@@ -360,14 +360,14 @@ function normalizeOrchestratorPortfolio(data) {
360
360
  const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _4 => _4.balance, 'optionalAccess', _5 => _5.unlocked]), () => ( "0"));
361
361
  const normalizedName = tokenData.tokenName.trim();
362
362
  const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
363
- const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkS4UBVD3Hcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
364
- const resolvedTokenAddress = isNativeSymbol ? _chunkS4UBVD3Hcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
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;
365
365
  if (!resolvedTokenAddress) {
366
366
  continue;
367
367
  }
368
- const registrySymbol = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
368
+ const registrySymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
369
369
  const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
370
- const decimals = registrySymbol !== "Token" ? _chunkS4UBVD3Hcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
370
+ const decimals = registrySymbol !== "Token" ? _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
371
371
  tokens.push({
372
372
  chainId: chainBalance.chainId,
373
373
  address: resolvedTokenAddress,
@@ -394,14 +394,14 @@ function normalizeDirectToken(token) {
394
394
  const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
395
395
  token.token,
396
396
  "address"
397
- ))), () => ( _chunkS4UBVD3Hcjs.getTokenAddress.call(void 0, symbol, chainId)));
397
+ ))), () => ( _chunkFLXTBFMZcjs.getTokenAddress.call(void 0, symbol, chainId)));
398
398
  if (!address) return null;
399
399
  const addressAsToken = address;
400
400
  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 = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, addressAsToken, chainId);
401
+ const registrySymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, addressAsToken, chainId);
402
402
  const resolvedSymbol = registrySymbol !== "Token" ? registrySymbol : symbol;
403
403
  const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
404
- const resolvedDecimals = registrySymbol !== "Token" ? _chunkS4UBVD3Hcjs.getTokenDecimalsByAddress.call(void 0, addressAsToken, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
404
+ const resolvedDecimals = registrySymbol !== "Token" ? _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0, addressAsToken, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
405
405
  return {
406
406
  chainId,
407
407
  address: addressAsToken,
@@ -995,25 +995,69 @@ function isRecord(value) {
995
995
  function asString(value) {
996
996
  return typeof value === "string" ? value : void 0;
997
997
  }
998
+ function asNumber(value) {
999
+ if (typeof value === "number" && Number.isFinite(value)) return value;
1000
+ if (typeof value !== "string") return void 0;
1001
+ const trimmed = value.trim();
1002
+ if (!trimmed) return void 0;
1003
+ const caipMatch = trimmed.match(/^eip155:(\d+)$/);
1004
+ if (_optionalChain([caipMatch, 'optionalAccess', _41 => _41[1]])) {
1005
+ const parsed2 = Number(caipMatch[1]);
1006
+ return Number.isFinite(parsed2) ? parsed2 : void 0;
1007
+ }
1008
+ const parsed = Number(trimmed);
1009
+ return Number.isFinite(parsed) ? parsed : void 0;
1010
+ }
1011
+ function asAmount(value) {
1012
+ if (typeof value === "string") return value;
1013
+ if (typeof value === "number" && Number.isFinite(value)) {
1014
+ return value.toString();
1015
+ }
1016
+ return void 0;
1017
+ }
1018
+ function asAddress(value) {
1019
+ if (typeof value !== "string") return void 0;
1020
+ return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
1021
+ }
998
1022
  function getEventTxHash(event) {
999
- if (!_optionalChain([event, 'optionalAccess', _41 => _41.type])) return void 0;
1023
+ if (!_optionalChain([event, 'optionalAccess', _42 => _42.type])) return void 0;
1000
1024
  if (event.type === "deposit-received") {
1001
- return asString(_optionalChain([event, 'access', _42 => _42.data, 'optionalAccess', _43 => _43.transactionHash]));
1025
+ return asString(_optionalChain([event, 'access', _43 => _43.data, 'optionalAccess', _44 => _44.transactionHash]));
1002
1026
  }
1003
1027
  if (event.type === "bridge-started" || event.type === "bridge-complete") {
1004
- const deposit = isRecord(_optionalChain([event, 'access', _44 => _44.data, 'optionalAccess', _45 => _45.deposit])) ? event.data.deposit : void 0;
1005
- const source = isRecord(_optionalChain([event, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.source])) ? event.data.source : void 0;
1006
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _48 => _48.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _49 => _49.transactionHash]))));
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]))));
1007
1031
  }
1008
1032
  if (event.type === "bridge-failed" || event.type === "error") {
1009
- const deposit = isRecord(_optionalChain([event, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.deposit])) ? event.data.deposit : void 0;
1010
- const source = isRecord(_optionalChain([event, 'access', _52 => _52.data, 'optionalAccess', _53 => _53.source])) ? event.data.source : void 0;
1011
- return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _54 => _54.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _55 => _55.transactionHash]))));
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]))));
1012
1036
  }
1013
1037
  return void 0;
1014
1038
  }
1039
+ function getEventSourceDetails(event) {
1040
+ if (!_optionalChain([event, 'optionalAccess', _57 => _57.type]) || !isRecord(event.data)) return {};
1041
+ if (event.type === "deposit-received") {
1042
+ return {
1043
+ chainId: asNumber(event.data.chain),
1044
+ amount: asAmount(event.data.amount),
1045
+ token: asAddress(event.data.token)
1046
+ };
1047
+ }
1048
+ const source = isRecord(event.data.source) ? event.data.source : void 0;
1049
+ const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
1050
+ if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
1051
+ 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]))))
1055
+ };
1056
+ }
1057
+ return {};
1058
+ }
1015
1059
  function isDepositEvent(event) {
1016
- return _optionalChain([event, 'optionalAccess', _56 => _56.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _57 => _57.type]) === "bridge-started";
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";
1017
1061
  }
1018
1062
 
1019
1063
  // src/components/steps/ProcessingStep.tsx
@@ -1028,7 +1072,7 @@ function isEventForTx(event, txHash) {
1028
1072
  return eventTxHash.toLowerCase() === txHash.toLowerCase();
1029
1073
  }
1030
1074
  function formatBridgeFailedMessage(event) {
1031
- const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _58 => _58.data]), () => ( {}));
1075
+ const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _70 => _70.data]), () => ( {}));
1032
1076
  const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
1033
1077
  const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
1034
1078
  if (backendMessage.length > 0) {
@@ -1068,7 +1112,7 @@ function ProcessingStep({
1068
1112
  const intervalRef = _react.useRef.call(void 0, null);
1069
1113
  _react.useEffect.call(void 0, () => {
1070
1114
  if (directTransfer) {
1071
- _optionalChain([onDepositComplete, 'optionalCall', _59 => _59(txHash)]);
1115
+ _optionalChain([onDepositComplete, 'optionalCall', _71 => _71(txHash)]);
1072
1116
  return;
1073
1117
  }
1074
1118
  }, [directTransfer, txHash, onDepositComplete]);
@@ -1111,40 +1155,40 @@ function ProcessingStep({
1111
1155
  console.log("[deposit-modal] status poll", {
1112
1156
  type: lastEvent2.type,
1113
1157
  matchesTx: eventMatchesTx,
1114
- intentId: _optionalChain([eventData, 'optionalAccess', _60 => _60.intentId]),
1158
+ intentId: _optionalChain([eventData, 'optionalAccess', _72 => _72.intentId]),
1115
1159
  data: eventData
1116
1160
  });
1117
1161
  }
1118
1162
  if (!isMounted) return;
1119
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _61 => _61.type]) === "bridge-complete") {
1163
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _73 => _73.type]) === "bridge-complete") {
1120
1164
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1121
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _62 => _62.data, 'optionalAccess', _63 => _63.destination, 'optionalAccess', _64 => _64.transactionHash]);
1122
- _optionalChain([onDepositComplete, 'optionalCall', _65 => _65(txHash, destinationTxHash2)]);
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)]);
1123
1167
  return;
1124
1168
  }
1125
- if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _66 => _66.type]) === "bridge-started") {
1169
+ if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _78 => _78.type]) === "bridge-started") {
1126
1170
  setState({ type: "complete", lastEvent: eventForCurrentTx });
1127
- _optionalChain([onDepositComplete, 'optionalCall', _67 => _67(txHash)]);
1171
+ _optionalChain([onDepositComplete, 'optionalCall', _79 => _79(txHash)]);
1128
1172
  return;
1129
1173
  }
1130
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _68 => _68.type]) === "bridge-failed") {
1174
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _80 => _80.type]) === "bridge-failed") {
1131
1175
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
1132
1176
  setState({
1133
1177
  type: "failed",
1134
1178
  message: formatted.message,
1135
1179
  lastEvent: eventForCurrentTx
1136
1180
  });
1137
- _optionalChain([onDepositFailed, 'optionalCall', _69 => _69(txHash, formatted.message)]);
1181
+ _optionalChain([onDepositFailed, 'optionalCall', _81 => _81(txHash, formatted.message)]);
1138
1182
  return;
1139
1183
  }
1140
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _70 => _70.type]) === "error") {
1141
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _71 => _71.data, 'optionalAccess', _72 => _72.message]), () => ( "Unknown error"));
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"));
1142
1186
  setState({
1143
1187
  type: "failed",
1144
1188
  message: errorMessage,
1145
1189
  lastEvent: eventForCurrentTx
1146
1190
  });
1147
- _optionalChain([onDepositFailed, 'optionalCall', _73 => _73(txHash, errorMessage)]);
1191
+ _optionalChain([onDepositFailed, 'optionalCall', _85 => _85(txHash, errorMessage)]);
1148
1192
  return;
1149
1193
  }
1150
1194
  setState({ type: "processing", lastEvent: eventForCurrentTx });
@@ -1192,7 +1236,7 @@ function ProcessingStep({
1192
1236
  processTimeoutRef.current = setTimeout(() => {
1193
1237
  const message = "We couldn't confirm your transfer. Please contact support if funds do not arrive.";
1194
1238
  setState({ type: "error", message });
1195
- _optionalChain([onError, 'optionalCall', _74 => _74(message, "PROCESS_TIMEOUT")]);
1239
+ _optionalChain([onError, 'optionalCall', _86 => _86(message, "PROCESS_TIMEOUT")]);
1196
1240
  }, PROCESS_TIMEOUT_MS);
1197
1241
  return () => {
1198
1242
  if (processTimeoutRef.current) {
@@ -1205,12 +1249,16 @@ function ProcessingStep({
1205
1249
  const isComplete = state.type === "complete";
1206
1250
  const isProcessing = state.type === "processing";
1207
1251
  const lastEvent = state.type === "processing" || state.type === "complete" || state.type === "failed" ? state.lastEvent : void 0;
1208
- const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _75 => _75.type]) === "bridge-started";
1252
+ const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _87 => _87.type]) === "bridge-started";
1209
1253
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
1210
1254
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
1211
- const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _76 => _76.data, 'optionalAccess', _77 => _77.destination, 'optionalAccess', _78 => _78.transactionHash]) || null;
1212
- const sourceExplorerUrl = _chunkS4UBVD3Hcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
1213
- const destExplorerUrl = destinationTxHash ? _chunkS4UBVD3Hcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
1255
+ const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _88 => _88.data, 'optionalAccess', _89 => _89.destination, 'optionalAccess', _90 => _90.transactionHash]) || null;
1256
+ const sourceDetails = getEventSourceDetails(lastEvent);
1257
+ const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
1258
+ const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
1259
+ 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;
1214
1262
  const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
1215
1263
  const formatElapsedTime = (seconds) => {
1216
1264
  if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
@@ -1218,16 +1266,19 @@ function ProcessingStep({
1218
1266
  const secs = seconds % 60;
1219
1267
  return `${mins}m ${secs}s`;
1220
1268
  };
1221
- const sourceSymbol = _chunkS4UBVD3Hcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1222
- const sourceDecimals = _chunkS4UBVD3Hcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1269
+ const sourceSymbol = _chunkFLXTBFMZcjs.getTokenSymbol.call(void 0, displaySourceToken, displaySourceChain);
1270
+ const sourceDecimals = _chunkFLXTBFMZcjs.getTokenDecimalsByAddress.call(void 0,
1271
+ displaySourceToken,
1272
+ displaySourceChain
1273
+ );
1223
1274
  const formattedReceivedAmount = (() => {
1224
1275
  try {
1225
- const raw = _viem.formatUnits.call(void 0, BigInt(amount), sourceDecimals);
1276
+ const raw = _viem.formatUnits.call(void 0, BigInt(displayAmount), sourceDecimals);
1226
1277
  const numeric = Number(raw);
1227
1278
  if (!Number.isFinite(numeric)) return raw;
1228
1279
  return numeric.toLocaleString("en-US", { maximumFractionDigits: 6 });
1229
1280
  } catch (e4) {
1230
- return Number(amount).toLocaleString("en-US", {
1281
+ return Number(displayAmount).toLocaleString("en-US", {
1231
1282
  maximumFractionDigits: 6
1232
1283
  });
1233
1284
  }
@@ -1290,15 +1341,15 @@ function ProcessingStep({
1290
1341
  className: "rs-card-value",
1291
1342
  style: { display: "flex", alignItems: "center", gap: 6 },
1292
1343
  children: [
1293
- _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1344
+ _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1294
1345
  "img",
1295
1346
  {
1296
- src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, sourceChain),
1347
+ src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain),
1297
1348
  alt: "",
1298
1349
  style: { width: 14, height: 14, borderRadius: "50%" }
1299
1350
  }
1300
1351
  ),
1301
- _chunkS4UBVD3Hcjs.getChainName.call(void 0, sourceChain)
1352
+ _chunkFLXTBFMZcjs.getChainName.call(void 0, displaySourceChain)
1302
1353
  ]
1303
1354
  }
1304
1355
  )
@@ -1311,15 +1362,15 @@ function ProcessingStep({
1311
1362
  className: "rs-card-value",
1312
1363
  style: { display: "flex", alignItems: "center", gap: 6 },
1313
1364
  children: [
1314
- _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1365
+ _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1315
1366
  "img",
1316
1367
  {
1317
- src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain),
1368
+ src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain),
1318
1369
  alt: "",
1319
1370
  style: { width: 14, height: 14, borderRadius: "50%" }
1320
1371
  }
1321
1372
  ),
1322
- _chunkS4UBVD3Hcjs.getChainName.call(void 0, targetChain)
1373
+ _chunkFLXTBFMZcjs.getChainName.call(void 0, targetChain)
1323
1374
  ]
1324
1375
  }
1325
1376
  )
@@ -1441,7 +1492,7 @@ function ProcessingStep({
1441
1492
  {
1442
1493
  className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
1443
1494
  children: [
1444
- state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess', _79 => _79.type]) === "deposit-received" ? "Transfer received. Preparing bridge..." : _optionalChain([lastEvent, 'optionalAccess', _80 => _80.type]) === "bridge-started" ? "Transfer confirmed. Funds arriving shortly..." : `Bridging your ${flowNoun} to ${_chunkS4UBVD3Hcjs.getChainName.call(void 0, targetChain)}.`),
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)}.`),
1445
1496
  state.type === "failed" && state.message,
1446
1497
  state.type === "error" && state.message
1447
1498
  ]
@@ -1497,15 +1548,15 @@ function ProcessingStep({
1497
1548
  className: "rs-card-value",
1498
1549
  style: { display: "flex", alignItems: "center", gap: 8 },
1499
1550
  children: [
1500
- _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1551
+ _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1501
1552
  "img",
1502
1553
  {
1503
- src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, sourceChain),
1554
+ src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, displaySourceChain),
1504
1555
  alt: "",
1505
1556
  style: { width: 16, height: 16, borderRadius: "50%" }
1506
1557
  }
1507
1558
  ),
1508
- _chunkS4UBVD3Hcjs.getChainName.call(void 0, sourceChain)
1559
+ _chunkFLXTBFMZcjs.getChainName.call(void 0, displaySourceChain)
1509
1560
  ]
1510
1561
  }
1511
1562
  )
@@ -1518,15 +1569,15 @@ function ProcessingStep({
1518
1569
  className: "rs-card-value",
1519
1570
  style: { display: "flex", alignItems: "center", gap: 8 },
1520
1571
  children: [
1521
- _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1572
+ _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1522
1573
  "img",
1523
1574
  {
1524
- src: _chunkS4UBVD3Hcjs.getChainIcon.call(void 0, targetChain),
1575
+ src: _chunkFLXTBFMZcjs.getChainIcon.call(void 0, targetChain),
1525
1576
  alt: "",
1526
1577
  style: { width: 16, height: 16, borderRadius: "50%" }
1527
1578
  }
1528
1579
  ),
1529
- _chunkS4UBVD3Hcjs.getChainName.call(void 0, targetChain)
1580
+ _chunkFLXTBFMZcjs.getChainName.call(void 0, targetChain)
1530
1581
  ]
1531
1582
  }
1532
1583
  )
@@ -1579,7 +1630,7 @@ var clientCache = /* @__PURE__ */ new Map();
1579
1630
  function getPublicClient(chainId) {
1580
1631
  let client = clientCache.get(chainId);
1581
1632
  if (!client) {
1582
- const chain = _chunkS4UBVD3Hcjs.CHAIN_BY_ID[chainId];
1633
+ const chain = _chunkFLXTBFMZcjs.CHAIN_BY_ID[chainId];
1583
1634
  client = _viem.createPublicClient.call(void 0, {
1584
1635
  chain,
1585
1636
  transport: _viem.http.call(void 0, )
@@ -1612,4 +1663,5 @@ function getPublicClient(chainId) {
1612
1663
 
1613
1664
 
1614
1665
 
1615
- 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.isDepositEvent = isDepositEvent; exports.ProcessingStep = ProcessingStep; exports.getPublicClient = getPublicClient; exports.applyTheme = applyTheme;
1666
+
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;
@@ -17,7 +17,7 @@ import {
17
17
  isNativeAsset,
18
18
  loadSessionOwnerFromStorage,
19
19
  saveSessionOwnerToStorage
20
- } from "./chunk-DLFUXLAM.mjs";
20
+ } from "./chunk-IC2M2DZ7.mjs";
21
21
  import {
22
22
  DEFAULT_BACKEND_URL,
23
23
  DEFAULT_SIGNER_ADDRESS,
@@ -30,7 +30,7 @@ import {
30
30
  getTokenDecimalsByAddress,
31
31
  getTokenIcon,
32
32
  getTokenSymbol
33
- } from "./chunk-C6I5TFSL.mjs";
33
+ } from "./chunk-I7RYTI4G.mjs";
34
34
 
35
35
  // src/WithdrawModal.tsx
36
36
  import {
@@ -1340,7 +1340,7 @@ function WithdrawFlow({
1340
1340
  // src/WithdrawModal.tsx
1341
1341
  import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1342
1342
  var ReownWithdrawInner = lazy(
1343
- () => import("./WithdrawModalReown-UWTDJXSE.mjs").then((m) => ({
1343
+ () => import("./WithdrawModalReown-XXCOZYVU.mjs").then((m) => ({
1344
1344
  default: m.WithdrawModalReown
1345
1345
  }))
1346
1346
  );