@rhinestone/deposit-modal 0.1.28 → 0.1.30
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.
- package/dist/{DepositModalReown-FF4YU5VV.mjs → DepositModalReown-OHTRNISJ.mjs} +3 -3
- package/dist/{DepositModalReown-6IXFIXR6.cjs → DepositModalReown-ZD3ROLZG.cjs} +4 -4
- package/dist/{WithdrawModalReown-LIYQG2BW.mjs → WithdrawModalReown-IJAMIPSY.mjs} +3 -3
- package/dist/{WithdrawModalReown-GMIE6AWA.cjs → WithdrawModalReown-SVZQKH2X.cjs} +4 -4
- package/dist/{chunk-YXTWMYHK.mjs → chunk-BOKLFGNS.mjs} +94 -55
- package/dist/{chunk-RQSAANC3.mjs → chunk-CIAKCO7G.mjs} +17 -20
- package/dist/{chunk-LP6DQCKV.cjs → chunk-K4YSUWIT.cjs} +54 -54
- package/dist/{chunk-VW3QQWEL.cjs → chunk-KIRDZLOS.cjs} +55 -58
- package/dist/{chunk-XF7M4TTT.mjs → chunk-S76PY7GZ.mjs} +3 -3
- package/dist/{chunk-A6QLADED.mjs → chunk-VL47TLTE.mjs} +128 -3
- package/dist/{chunk-CEIWN53N.cjs → chunk-WB3ZJJBH.cjs} +135 -10
- package/dist/{chunk-XJ4G6RO6.cjs → chunk-WDDONQLV.cjs} +190 -151
- package/dist/constants.cjs +4 -2
- package/dist/constants.d.cts +12 -2
- package/dist/constants.d.ts +12 -2
- package/dist/constants.mjs +3 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.mjs +6 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.mjs +4 -4
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +56 -9
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
var _chunkCEIWN53Ncjs = require('./chunk-CEIWN53N.cjs');
|
|
10
|
+
var _chunkWB3ZJJBHcjs = require('./chunk-WB3ZJJBH.cjs');
|
|
12
11
|
|
|
13
12
|
// src/components/ui/Modal.tsx
|
|
14
13
|
|
|
@@ -361,27 +360,20 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
361
360
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _4 => _4.balance, 'optionalAccess', _5 => _5.unlocked]), () => ( "0"));
|
|
362
361
|
const normalizedName = tokenData.tokenName.trim();
|
|
363
362
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
364
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
365
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
363
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkWB3ZJJBHcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
364
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkWB3ZJJBHcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
366
365
|
if (!resolvedTokenAddress) {
|
|
367
366
|
continue;
|
|
368
367
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
)) {
|
|
373
|
-
continue;
|
|
374
|
-
}
|
|
375
|
-
const symbol = _chunkCEIWN53Ncjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
368
|
+
const registrySymbol = _chunkWB3ZJJBHcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
369
|
+
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
370
|
+
const decimals = registrySymbol !== "Token" ? _chunkWB3ZJJBHcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
376
371
|
tokens.push({
|
|
377
372
|
chainId: chainBalance.chainId,
|
|
378
373
|
address: resolvedTokenAddress,
|
|
379
374
|
symbol,
|
|
380
375
|
name: symbol,
|
|
381
|
-
decimals
|
|
382
|
-
resolvedTokenAddress,
|
|
383
|
-
chainBalance.chainId
|
|
384
|
-
),
|
|
376
|
+
decimals,
|
|
385
377
|
balance: unlocked,
|
|
386
378
|
balanceUsd: 0
|
|
387
379
|
});
|
|
@@ -402,17 +394,20 @@ function normalizeDirectToken(token) {
|
|
|
402
394
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
403
395
|
token.token,
|
|
404
396
|
"address"
|
|
405
|
-
))), () => (
|
|
397
|
+
))), () => ( _chunkWB3ZJJBHcjs.getTokenAddress.call(void 0, symbol, chainId)));
|
|
406
398
|
if (!address) return null;
|
|
407
399
|
const addressAsToken = address;
|
|
408
|
-
if (!_chunkCEIWN53Ncjs.isSupportedTokenAddressForChain.call(void 0, addressAsToken, chainId)) return null;
|
|
409
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 = _chunkWB3ZJJBHcjs.getTokenSymbol.call(void 0, addressAsToken, chainId);
|
|
402
|
+
const resolvedSymbol = registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
403
|
+
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
404
|
+
const resolvedDecimals = registrySymbol !== "Token" ? _chunkWB3ZJJBHcjs.getTokenDecimalsByAddress.call(void 0, addressAsToken, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
410
405
|
return {
|
|
411
406
|
chainId,
|
|
412
407
|
address: addressAsToken,
|
|
413
|
-
symbol:
|
|
414
|
-
name:
|
|
415
|
-
decimals:
|
|
408
|
+
symbol: resolvedSymbol,
|
|
409
|
+
name: resolvedSymbol,
|
|
410
|
+
decimals: resolvedDecimals,
|
|
416
411
|
balance: balanceValue,
|
|
417
412
|
balanceUsd
|
|
418
413
|
};
|
|
@@ -973,16 +968,18 @@ function getEventTxHash(event) {
|
|
|
973
968
|
}
|
|
974
969
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
975
970
|
const deposit = isRecord(_optionalChain([event, 'access', _44 => _44.data, 'optionalAccess', _45 => _45.deposit])) ? event.data.deposit : void 0;
|
|
976
|
-
|
|
971
|
+
const source = isRecord(_optionalChain([event, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.source])) ? event.data.source : void 0;
|
|
972
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _48 => _48.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _49 => _49.transactionHash]))));
|
|
977
973
|
}
|
|
978
974
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
979
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
980
|
-
|
|
975
|
+
const deposit = isRecord(_optionalChain([event, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.deposit])) ? event.data.deposit : void 0;
|
|
976
|
+
const source = isRecord(_optionalChain([event, 'access', _52 => _52.data, 'optionalAccess', _53 => _53.source])) ? event.data.source : void 0;
|
|
977
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _54 => _54.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _55 => _55.transactionHash]))));
|
|
981
978
|
}
|
|
982
979
|
return void 0;
|
|
983
980
|
}
|
|
984
981
|
function isDepositEvent(event) {
|
|
985
|
-
return _optionalChain([event, 'optionalAccess',
|
|
982
|
+
return _optionalChain([event, 'optionalAccess', _56 => _56.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _57 => _57.type]) === "bridge-started";
|
|
986
983
|
}
|
|
987
984
|
|
|
988
985
|
// src/components/steps/ProcessingStep.tsx
|
|
@@ -997,7 +994,7 @@ function isEventForTx(event, txHash) {
|
|
|
997
994
|
return eventTxHash.toLowerCase() === txHash.toLowerCase();
|
|
998
995
|
}
|
|
999
996
|
function formatBridgeFailedMessage(event) {
|
|
1000
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
997
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _58 => _58.data]), () => ( {}));
|
|
1001
998
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
1002
999
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1003
1000
|
if (backendMessage.length > 0) {
|
|
@@ -1038,7 +1035,7 @@ function ProcessingStep({
|
|
|
1038
1035
|
const intervalRef = _react.useRef.call(void 0, null);
|
|
1039
1036
|
_react.useEffect.call(void 0, () => {
|
|
1040
1037
|
if (directTransfer) {
|
|
1041
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1038
|
+
_optionalChain([onDepositComplete, 'optionalCall', _59 => _59(txHash)]);
|
|
1042
1039
|
return;
|
|
1043
1040
|
}
|
|
1044
1041
|
}, [directTransfer, txHash, onDepositComplete]);
|
|
@@ -1081,40 +1078,40 @@ function ProcessingStep({
|
|
|
1081
1078
|
console.log("[deposit-modal] status poll", {
|
|
1082
1079
|
type: lastEvent2.type,
|
|
1083
1080
|
matchesTx: eventMatchesTx,
|
|
1084
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
1081
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _60 => _60.intentId]),
|
|
1085
1082
|
data: eventData
|
|
1086
1083
|
});
|
|
1087
1084
|
}
|
|
1088
1085
|
if (!isMounted) return;
|
|
1089
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1086
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _61 => _61.type]) === "bridge-complete") {
|
|
1090
1087
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1091
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
1092
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1088
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _62 => _62.data, 'optionalAccess', _63 => _63.destination, 'optionalAccess', _64 => _64.transactionHash]);
|
|
1089
|
+
_optionalChain([onDepositComplete, 'optionalCall', _65 => _65(txHash, destinationTxHash2)]);
|
|
1093
1090
|
return;
|
|
1094
1091
|
}
|
|
1095
|
-
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1092
|
+
if (!waitForFinalTx && _optionalChain([eventForCurrentTx, 'optionalAccess', _66 => _66.type]) === "bridge-started") {
|
|
1096
1093
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
1097
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1094
|
+
_optionalChain([onDepositComplete, 'optionalCall', _67 => _67(txHash)]);
|
|
1098
1095
|
return;
|
|
1099
1096
|
}
|
|
1100
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1097
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _68 => _68.type]) === "bridge-failed") {
|
|
1101
1098
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
1102
1099
|
setState({
|
|
1103
1100
|
type: "failed",
|
|
1104
1101
|
message: formatted.message,
|
|
1105
1102
|
lastEvent: eventForCurrentTx
|
|
1106
1103
|
});
|
|
1107
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1104
|
+
_optionalChain([onDepositFailed, 'optionalCall', _69 => _69(txHash, formatted.message)]);
|
|
1108
1105
|
return;
|
|
1109
1106
|
}
|
|
1110
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
1111
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
1107
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _70 => _70.type]) === "error") {
|
|
1108
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _71 => _71.data, 'optionalAccess', _72 => _72.message]), () => ( "Unknown error"));
|
|
1112
1109
|
setState({
|
|
1113
1110
|
type: "failed",
|
|
1114
1111
|
message: errorMessage,
|
|
1115
1112
|
lastEvent: eventForCurrentTx
|
|
1116
1113
|
});
|
|
1117
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1114
|
+
_optionalChain([onDepositFailed, 'optionalCall', _73 => _73(txHash, errorMessage)]);
|
|
1118
1115
|
return;
|
|
1119
1116
|
}
|
|
1120
1117
|
setState({ type: "processing", lastEvent: eventForCurrentTx });
|
|
@@ -1162,7 +1159,7 @@ function ProcessingStep({
|
|
|
1162
1159
|
processTimeoutRef.current = setTimeout(() => {
|
|
1163
1160
|
const message = "We couldn't confirm your transfer. Please contact support if funds do not arrive.";
|
|
1164
1161
|
setState({ type: "error", message });
|
|
1165
|
-
_optionalChain([onError, 'optionalCall',
|
|
1162
|
+
_optionalChain([onError, 'optionalCall', _74 => _74(message, "PROCESS_TIMEOUT")]);
|
|
1166
1163
|
}, PROCESS_TIMEOUT_MS);
|
|
1167
1164
|
return () => {
|
|
1168
1165
|
if (processTimeoutRef.current) {
|
|
@@ -1175,12 +1172,12 @@ function ProcessingStep({
|
|
|
1175
1172
|
const isComplete = state.type === "complete";
|
|
1176
1173
|
const isProcessing = state.type === "processing";
|
|
1177
1174
|
const lastEvent = state.type === "processing" || state.type === "complete" || state.type === "failed" ? state.lastEvent : void 0;
|
|
1178
|
-
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess',
|
|
1175
|
+
const isEarlyComplete = !waitForFinalTx && _optionalChain([lastEvent, 'optionalAccess', _75 => _75.type]) === "bridge-started";
|
|
1179
1176
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
1180
1177
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
1181
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
1182
|
-
const sourceExplorerUrl =
|
|
1183
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1178
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _76 => _76.data, 'optionalAccess', _77 => _77.destination, 'optionalAccess', _78 => _78.transactionHash]) || null;
|
|
1179
|
+
const sourceExplorerUrl = _chunkWB3ZJJBHcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1180
|
+
const destExplorerUrl = destinationTxHash ? _chunkWB3ZJJBHcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1184
1181
|
const truncateHash = (hash) => `${hash.slice(0, 10)}...${hash.slice(-8)}`;
|
|
1185
1182
|
const formatElapsedTime = (seconds) => {
|
|
1186
1183
|
if (seconds < 60) return `${seconds} second${seconds !== 1 ? "s" : ""}`;
|
|
@@ -1188,8 +1185,8 @@ function ProcessingStep({
|
|
|
1188
1185
|
const secs = seconds % 60;
|
|
1189
1186
|
return `${mins}m ${secs}s`;
|
|
1190
1187
|
};
|
|
1191
|
-
const targetSymbol =
|
|
1192
|
-
const sourceDecimals =
|
|
1188
|
+
const targetSymbol = _chunkWB3ZJJBHcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1189
|
+
const sourceDecimals = _chunkWB3ZJJBHcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
|
|
1193
1190
|
const formattedReceivedAmount = (() => {
|
|
1194
1191
|
try {
|
|
1195
1192
|
const raw = _viem.formatUnits.call(void 0, BigInt(amount), sourceDecimals);
|
|
@@ -1260,15 +1257,15 @@ function ProcessingStep({
|
|
|
1260
1257
|
className: "rs-card-value",
|
|
1261
1258
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1262
1259
|
children: [
|
|
1263
|
-
|
|
1260
|
+
_chunkWB3ZJJBHcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
1261
|
"img",
|
|
1265
1262
|
{
|
|
1266
|
-
src:
|
|
1263
|
+
src: _chunkWB3ZJJBHcjs.getChainIcon.call(void 0, sourceChain),
|
|
1267
1264
|
alt: "",
|
|
1268
1265
|
style: { width: 14, height: 14, borderRadius: "50%" }
|
|
1269
1266
|
}
|
|
1270
1267
|
),
|
|
1271
|
-
|
|
1268
|
+
_chunkWB3ZJJBHcjs.getChainName.call(void 0, sourceChain)
|
|
1272
1269
|
]
|
|
1273
1270
|
}
|
|
1274
1271
|
)
|
|
@@ -1281,15 +1278,15 @@ function ProcessingStep({
|
|
|
1281
1278
|
className: "rs-card-value",
|
|
1282
1279
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1283
1280
|
children: [
|
|
1284
|
-
|
|
1281
|
+
_chunkWB3ZJJBHcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1285
1282
|
"img",
|
|
1286
1283
|
{
|
|
1287
|
-
src:
|
|
1284
|
+
src: _chunkWB3ZJJBHcjs.getChainIcon.call(void 0, targetChain),
|
|
1288
1285
|
alt: "",
|
|
1289
1286
|
style: { width: 14, height: 14, borderRadius: "50%" }
|
|
1290
1287
|
}
|
|
1291
1288
|
),
|
|
1292
|
-
|
|
1289
|
+
_chunkWB3ZJJBHcjs.getChainName.call(void 0, targetChain)
|
|
1293
1290
|
]
|
|
1294
1291
|
}
|
|
1295
1292
|
)
|
|
@@ -1411,7 +1408,7 @@ function ProcessingStep({
|
|
|
1411
1408
|
{
|
|
1412
1409
|
className: `rs-step-description ${isError ? "rs-text-error" : "rs-text-secondary"}`,
|
|
1413
1410
|
children: [
|
|
1414
|
-
state.type === "processing" && (_optionalChain([lastEvent, 'optionalAccess',
|
|
1411
|
+
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 ${_chunkWB3ZJJBHcjs.getChainName.call(void 0, targetChain)}.`),
|
|
1415
1412
|
state.type === "failed" && state.message,
|
|
1416
1413
|
state.type === "error" && state.message
|
|
1417
1414
|
]
|
|
@@ -1467,15 +1464,15 @@ function ProcessingStep({
|
|
|
1467
1464
|
className: "rs-card-value",
|
|
1468
1465
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1469
1466
|
children: [
|
|
1470
|
-
|
|
1467
|
+
_chunkWB3ZJJBHcjs.getChainIcon.call(void 0, sourceChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1471
1468
|
"img",
|
|
1472
1469
|
{
|
|
1473
|
-
src:
|
|
1470
|
+
src: _chunkWB3ZJJBHcjs.getChainIcon.call(void 0, sourceChain),
|
|
1474
1471
|
alt: "",
|
|
1475
1472
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1476
1473
|
}
|
|
1477
1474
|
),
|
|
1478
|
-
|
|
1475
|
+
_chunkWB3ZJJBHcjs.getChainName.call(void 0, sourceChain)
|
|
1479
1476
|
]
|
|
1480
1477
|
}
|
|
1481
1478
|
)
|
|
@@ -1488,15 +1485,15 @@ function ProcessingStep({
|
|
|
1488
1485
|
className: "rs-card-value",
|
|
1489
1486
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1490
1487
|
children: [
|
|
1491
|
-
|
|
1488
|
+
_chunkWB3ZJJBHcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1492
1489
|
"img",
|
|
1493
1490
|
{
|
|
1494
|
-
src:
|
|
1491
|
+
src: _chunkWB3ZJJBHcjs.getChainIcon.call(void 0, targetChain),
|
|
1495
1492
|
alt: "",
|
|
1496
1493
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1497
1494
|
}
|
|
1498
1495
|
),
|
|
1499
|
-
|
|
1496
|
+
_chunkWB3ZJJBHcjs.getChainName.call(void 0, targetChain)
|
|
1500
1497
|
]
|
|
1501
1498
|
}
|
|
1502
1499
|
)
|
|
@@ -1549,7 +1546,7 @@ var clientCache = /* @__PURE__ */ new Map();
|
|
|
1549
1546
|
function getPublicClient(chainId) {
|
|
1550
1547
|
let client = clientCache.get(chainId);
|
|
1551
1548
|
if (!client) {
|
|
1552
|
-
const chain =
|
|
1549
|
+
const chain = _chunkWB3ZJJBHcjs.CHAIN_BY_ID[chainId];
|
|
1553
1550
|
client = _viem.createPublicClient.call(void 0, {
|
|
1554
1551
|
chain,
|
|
1555
1552
|
transport: _viem.http.call(void 0, )
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isNativeAsset,
|
|
17
17
|
loadSessionOwnerFromStorage,
|
|
18
18
|
saveSessionOwnerToStorage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CIAKCO7G.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_BACKEND_URL,
|
|
22
22
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getTokenDecimalsByAddress,
|
|
30
30
|
getTokenIcon,
|
|
31
31
|
getTokenSymbol
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VL47TLTE.mjs";
|
|
33
33
|
|
|
34
34
|
// src/WithdrawModal.tsx
|
|
35
35
|
import {
|
|
@@ -1300,7 +1300,7 @@ function WithdrawFlow({
|
|
|
1300
1300
|
// src/WithdrawModal.tsx
|
|
1301
1301
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1302
1302
|
var ReownWithdrawInner = lazy(
|
|
1303
|
-
() => import("./WithdrawModalReown-
|
|
1303
|
+
() => import("./WithdrawModalReown-IJAMIPSY.mjs").then((m) => ({
|
|
1304
1304
|
default: m.WithdrawModalReown
|
|
1305
1305
|
}))
|
|
1306
1306
|
);
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
optimism,
|
|
8
8
|
polygon
|
|
9
9
|
} from "viem/chains";
|
|
10
|
-
import { chainRegistry } from "@rhinestone/shared-configs";
|
|
11
10
|
var DEFAULT_BACKEND_URL = "https://v1.orchestrator.rhinestone.dev/deposit-widget";
|
|
12
11
|
var DEFAULT_SIGNER_ADDRESS = "0x177bfcdd15bc01e99013dcc5d2b09cd87a18ce9c";
|
|
13
12
|
var NATIVE_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
@@ -61,6 +60,128 @@ var SYMBOL_ALIASES = {
|
|
|
61
60
|
var CANONICAL_SYMBOL_BY_REGISTRY_SYMBOL = {
|
|
62
61
|
USDT0: "USDT"
|
|
63
62
|
};
|
|
63
|
+
var chainRegistry = {
|
|
64
|
+
[mainnet.id]: {
|
|
65
|
+
name: mainnet.name,
|
|
66
|
+
tokens: [
|
|
67
|
+
{ symbol: "ETH", address: NATIVE_TOKEN_ADDRESS, decimals: 18 },
|
|
68
|
+
{
|
|
69
|
+
symbol: "USDC",
|
|
70
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
71
|
+
decimals: 6
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
symbol: "WETH",
|
|
75
|
+
address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
|
|
76
|
+
decimals: 18
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
symbol: "USDT0",
|
|
80
|
+
address: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
81
|
+
decimals: 6
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
[base.id]: {
|
|
86
|
+
name: base.name,
|
|
87
|
+
tokens: [
|
|
88
|
+
{ symbol: "ETH", address: NATIVE_TOKEN_ADDRESS, decimals: 18 },
|
|
89
|
+
{
|
|
90
|
+
symbol: "USDC",
|
|
91
|
+
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
92
|
+
decimals: 6
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
symbol: "WETH",
|
|
96
|
+
address: "0x4200000000000000000000000000000000000006",
|
|
97
|
+
decimals: 18
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
[arbitrum.id]: {
|
|
102
|
+
name: arbitrum.name,
|
|
103
|
+
tokens: [
|
|
104
|
+
{ symbol: "ETH", address: NATIVE_TOKEN_ADDRESS, decimals: 18 },
|
|
105
|
+
{
|
|
106
|
+
symbol: "USDC",
|
|
107
|
+
address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
108
|
+
decimals: 6
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
symbol: "WETH",
|
|
112
|
+
address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
|
|
113
|
+
decimals: 18
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
symbol: "USDT0",
|
|
117
|
+
address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
|
|
118
|
+
decimals: 6
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
[optimism.id]: {
|
|
123
|
+
name: optimism.name,
|
|
124
|
+
tokens: [
|
|
125
|
+
{ symbol: "ETH", address: NATIVE_TOKEN_ADDRESS, decimals: 18 },
|
|
126
|
+
{
|
|
127
|
+
symbol: "USDC",
|
|
128
|
+
address: "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
|
|
129
|
+
decimals: 6
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
symbol: "WETH",
|
|
133
|
+
address: "0x4200000000000000000000000000000000000006",
|
|
134
|
+
decimals: 18
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
symbol: "USDT0",
|
|
138
|
+
address: "0x01bFF41798a0BcF287b996046Ca68b395DbC1071",
|
|
139
|
+
decimals: 6
|
|
140
|
+
}
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
[polygon.id]: {
|
|
144
|
+
name: polygon.name,
|
|
145
|
+
tokens: [
|
|
146
|
+
{ symbol: "ETH", address: NATIVE_TOKEN_ADDRESS, decimals: 18 },
|
|
147
|
+
{
|
|
148
|
+
symbol: "USDC",
|
|
149
|
+
address: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
|
|
150
|
+
decimals: 6
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
symbol: "WETH",
|
|
154
|
+
address: "0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",
|
|
155
|
+
decimals: 18
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
symbol: "USDT0",
|
|
159
|
+
address: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
|
|
160
|
+
decimals: 6
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
[bsc.id]: {
|
|
165
|
+
name: bsc.name,
|
|
166
|
+
tokens: [
|
|
167
|
+
{
|
|
168
|
+
symbol: "USDC",
|
|
169
|
+
address: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
|
|
170
|
+
decimals: 18
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
symbol: "WETH",
|
|
174
|
+
address: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8",
|
|
175
|
+
decimals: 18
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
symbol: "USDT",
|
|
179
|
+
address: "0x55d398326f99059fF775485246999027B3197955",
|
|
180
|
+
decimals: 18
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
};
|
|
64
185
|
function getChainId(chain) {
|
|
65
186
|
return typeof chain === "number" ? chain : chain.id;
|
|
66
187
|
}
|
|
@@ -127,10 +248,13 @@ function getTokenDecimals(symbol, chainId) {
|
|
|
127
248
|
const token = getTokenFromRegistry(chainId, symbol);
|
|
128
249
|
return token?.decimals ?? 18;
|
|
129
250
|
}
|
|
130
|
-
function
|
|
251
|
+
function getTargetTokenSymbolsForChain(chainId) {
|
|
131
252
|
const symbols = SUPPORTED_TOKENS_BY_CHAIN[chainId] ?? [];
|
|
132
253
|
return [...symbols];
|
|
133
254
|
}
|
|
255
|
+
function getSupportedTokenSymbolsForChain(chainId) {
|
|
256
|
+
return getTargetTokenSymbolsForChain(chainId);
|
|
257
|
+
}
|
|
134
258
|
function getSupportedChainIds() {
|
|
135
259
|
return [...SUPPORTED_CHAIN_IDS];
|
|
136
260
|
}
|
|
@@ -274,19 +398,20 @@ function getTokenIcon(symbol) {
|
|
|
274
398
|
}
|
|
275
399
|
|
|
276
400
|
export {
|
|
277
|
-
chainRegistry,
|
|
278
401
|
DEFAULT_BACKEND_URL,
|
|
279
402
|
DEFAULT_SIGNER_ADDRESS,
|
|
280
403
|
NATIVE_TOKEN_ADDRESS,
|
|
281
404
|
CHAIN_BY_ID,
|
|
282
405
|
SOURCE_CHAINS,
|
|
283
406
|
SUPPORTED_CHAINS,
|
|
407
|
+
chainRegistry,
|
|
284
408
|
getChainId,
|
|
285
409
|
getChainObject,
|
|
286
410
|
getUsdcAddress,
|
|
287
411
|
getUsdcDecimals,
|
|
288
412
|
getTokenAddress,
|
|
289
413
|
getTokenDecimals,
|
|
414
|
+
getTargetTokenSymbolsForChain,
|
|
290
415
|
getSupportedTokenSymbolsForChain,
|
|
291
416
|
getSupportedChainIds,
|
|
292
417
|
isSupportedTokenAddressForChain,
|