@rhinestone/deposit-modal 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-ICBGUVAA.cjs → DepositModalReown-CHVDFNEX.cjs} +9 -9
- package/dist/{DepositModalReown-IVRDXQAA.mjs → DepositModalReown-T4RRW5FM.mjs} +6 -6
- package/dist/{WithdrawModalReown-O7PR343Z.mjs → WithdrawModalReown-Q6MUMZTX.mjs} +5 -5
- package/dist/{WithdrawModalReown-6XWURPFZ.cjs → WithdrawModalReown-YZMZTN6E.cjs} +8 -8
- package/dist/{chunk-FJWLC4AM.mjs → chunk-4JLYWRQA.mjs} +1 -1
- package/dist/{chunk-VVKJRGX3.cjs → chunk-6P3WNDED.cjs} +10 -8
- package/dist/{chunk-N73D3WN4.mjs → chunk-CLUR2J72.mjs} +4 -4
- package/dist/{chunk-WJX3TJFK.mjs → chunk-CPMHRMPH.mjs} +36 -7
- package/dist/{chunk-ABVRVW3P.cjs → chunk-HH46H6ZI.cjs} +37 -8
- package/dist/{chunk-7Q26RR6J.mjs → chunk-J52W34Y7.mjs} +6 -4
- package/dist/{chunk-F7P4MV72.mjs → chunk-K6J3RDDK.mjs} +1 -1
- package/dist/{chunk-SITLCMTI.cjs → chunk-KUURQOTT.cjs} +100 -100
- package/dist/{chunk-GBOCV2LQ.mjs → chunk-OYPFPEIT.mjs} +221 -45
- package/dist/{chunk-IZPUHIIN.cjs → chunk-QSMPJQTX.cjs} +687 -528
- package/dist/{chunk-UEKPBRBY.cjs → chunk-RLMXWLF4.cjs} +3 -3
- package/dist/{chunk-VPWWFWZT.cjs → chunk-UN6MEOOA.cjs} +283 -107
- package/dist/{chunk-TCLBFO3S.mjs → chunk-UZENNYHS.mjs} +230 -71
- package/dist/{chunk-NRNJAQUA.cjs → chunk-XOBLFIGV.cjs} +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +86 -12
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkHH46H6ZIcjs = require('./chunk-HH46H6ZI.cjs');
|
|
17
17
|
|
|
18
18
|
// src/components/ui/Modal.tsx
|
|
19
19
|
|
|
@@ -538,6 +538,7 @@ function createDepositService(baseUrl, options) {
|
|
|
538
538
|
}
|
|
539
539
|
const PORTFOLIO_CACHE_TTL_MS = 3e4;
|
|
540
540
|
const portfolioCache = /* @__PURE__ */ new Map();
|
|
541
|
+
let topTokensPromise = null;
|
|
541
542
|
function cachedPortfolio(key, fetcher, forceRefresh = false) {
|
|
542
543
|
const now = Date.now();
|
|
543
544
|
const entry = portfolioCache.get(key);
|
|
@@ -642,7 +643,7 @@ function createDepositService(baseUrl, options) {
|
|
|
642
643
|
},
|
|
643
644
|
async fetchPortfolio(address, options2) {
|
|
644
645
|
return cachedPortfolio(`evm:${address.toLowerCase()}`, async () => {
|
|
645
|
-
const url = apiUrl(`/portfolio/${address}`);
|
|
646
|
+
const url = apiUrl(`/portfolio/${address}?includeUnsupported=true`);
|
|
646
647
|
debugLog(debug, scope, "fetchPortfolio:request", { url, address });
|
|
647
648
|
const response = await fetch(url, {
|
|
648
649
|
method: "GET",
|
|
@@ -948,7 +949,7 @@ function createDepositService(baseUrl, options) {
|
|
|
948
949
|
},
|
|
949
950
|
async checkLiquidity(params) {
|
|
950
951
|
if (params.destinationChainId === "solana") {
|
|
951
|
-
const token =
|
|
952
|
+
const token = _chunkHH46H6ZIcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
952
953
|
return {
|
|
953
954
|
hasLiquidity: true,
|
|
954
955
|
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _25 => _25.symbol]), () => ( "Token")),
|
|
@@ -1178,6 +1179,60 @@ function createDepositService(baseUrl, options) {
|
|
|
1178
1179
|
stale: body.stale === true ? true : void 0
|
|
1179
1180
|
};
|
|
1180
1181
|
},
|
|
1182
|
+
getTopTokens() {
|
|
1183
|
+
if (!topTokensPromise) {
|
|
1184
|
+
topTokensPromise = (async () => {
|
|
1185
|
+
try {
|
|
1186
|
+
const response = await fetch(apiUrl("/tokens"), {
|
|
1187
|
+
method: "GET",
|
|
1188
|
+
headers: { "Content-Type": "application/json" }
|
|
1189
|
+
});
|
|
1190
|
+
if (!response.ok) {
|
|
1191
|
+
debugLog(debug, scope, "getTopTokens:unavailable", {
|
|
1192
|
+
status: response.status
|
|
1193
|
+
});
|
|
1194
|
+
return null;
|
|
1195
|
+
}
|
|
1196
|
+
const data = await response.json();
|
|
1197
|
+
const tokens = _nullishCoalesce(data.tokens, () => ( null));
|
|
1198
|
+
debugLog(debug, scope, "getTopTokens:success", {
|
|
1199
|
+
chains: tokens ? Object.keys(tokens).length : 0
|
|
1200
|
+
});
|
|
1201
|
+
return tokens;
|
|
1202
|
+
} catch (error) {
|
|
1203
|
+
debugError(debug, scope, "getTopTokens:error", error);
|
|
1204
|
+
return null;
|
|
1205
|
+
}
|
|
1206
|
+
})();
|
|
1207
|
+
}
|
|
1208
|
+
return topTokensPromise;
|
|
1209
|
+
},
|
|
1210
|
+
async getSetup() {
|
|
1211
|
+
const url = apiUrl("/setup");
|
|
1212
|
+
try {
|
|
1213
|
+
const response = await fetch(url, {
|
|
1214
|
+
method: "GET",
|
|
1215
|
+
headers: { "Content-Type": "application/json" },
|
|
1216
|
+
cache: "no-store"
|
|
1217
|
+
});
|
|
1218
|
+
if (!response.ok) {
|
|
1219
|
+
debugLog(debug, scope, "getSetup:unavailable", {
|
|
1220
|
+
status: response.status
|
|
1221
|
+
});
|
|
1222
|
+
return null;
|
|
1223
|
+
}
|
|
1224
|
+
const data = await response.json();
|
|
1225
|
+
debugLog(debug, scope, "getSetup:success", {
|
|
1226
|
+
hasWhitelist: Boolean(data.depositWhitelist),
|
|
1227
|
+
whitelistChains: data.depositWhitelist ? Object.keys(data.depositWhitelist).length : 0,
|
|
1228
|
+
minDepositUsd: data.minDepositUsd
|
|
1229
|
+
});
|
|
1230
|
+
return data;
|
|
1231
|
+
} catch (error) {
|
|
1232
|
+
debugError(debug, scope, "getSetup:error", error);
|
|
1233
|
+
return null;
|
|
1234
|
+
}
|
|
1235
|
+
},
|
|
1181
1236
|
async fetchSwappedOrderStatus(smartAccount) {
|
|
1182
1237
|
const url = apiUrl(
|
|
1183
1238
|
`/onramp/swapped/status/${encodeURIComponent(smartAccount)}`
|
|
@@ -1198,7 +1253,16 @@ function createDepositService(baseUrl, options) {
|
|
|
1198
1253
|
const status = typeof body.status === "string" ? body.status : null;
|
|
1199
1254
|
const orderId = typeof body.orderId === "string" ? body.orderId : null;
|
|
1200
1255
|
if (!status || !orderId) return null;
|
|
1201
|
-
const numericOrNull = (v) =>
|
|
1256
|
+
const numericOrNull = (v) => {
|
|
1257
|
+
if (typeof v === "number") {
|
|
1258
|
+
return Number.isFinite(v) ? v : null;
|
|
1259
|
+
}
|
|
1260
|
+
if (typeof v === "string" && v.trim().length > 0) {
|
|
1261
|
+
const parsed = Number(v);
|
|
1262
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
1263
|
+
}
|
|
1264
|
+
return null;
|
|
1265
|
+
};
|
|
1202
1266
|
return {
|
|
1203
1267
|
orderId,
|
|
1204
1268
|
status,
|
|
@@ -1239,14 +1303,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1239
1303
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _32 => _32.balance, 'optionalAccess', _33 => _33.unlocked]), () => ( "0"));
|
|
1240
1304
|
const normalizedName = tokenData.tokenName.trim();
|
|
1241
1305
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1242
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1243
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1306
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkHH46H6ZIcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1307
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkHH46H6ZIcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1244
1308
|
if (!resolvedTokenAddress) {
|
|
1245
1309
|
continue;
|
|
1246
1310
|
}
|
|
1247
|
-
const registrySymbol =
|
|
1311
|
+
const registrySymbol = _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1248
1312
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1249
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1313
|
+
const decimals = registrySymbol !== "Token" ? _chunkHH46H6ZIcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1250
1314
|
tokens.push({
|
|
1251
1315
|
chainId: chainBalance.chainId,
|
|
1252
1316
|
address: resolvedTokenAddress,
|
|
@@ -1266,7 +1330,7 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1266
1330
|
function normalizeDirectToken(token) {
|
|
1267
1331
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1268
1332
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1269
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ?
|
|
1333
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkHH46H6ZIcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : _chunkHH46H6ZIcjs.parseEvmChainId.call(void 0, rawChainString) : null)));
|
|
1270
1334
|
if (chainId === null) return null;
|
|
1271
1335
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1272
1336
|
if (!symbol) return null;
|
|
@@ -1275,14 +1339,14 @@ function normalizeDirectToken(token) {
|
|
|
1275
1339
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1276
1340
|
token.token,
|
|
1277
1341
|
"address"
|
|
1278
|
-
))), () => ( (typeof chainId === "number" ?
|
|
1342
|
+
))), () => ( (typeof chainId === "number" ? _chunkHH46H6ZIcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
|
|
1279
1343
|
if (!address) return null;
|
|
1280
1344
|
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));
|
|
1281
1345
|
const isSolanaToken = chainId === "solana";
|
|
1282
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1346
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, address, chainId);
|
|
1283
1347
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1284
1348
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1285
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1349
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkHH46H6ZIcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1286
1350
|
return {
|
|
1287
1351
|
chainId,
|
|
1288
1352
|
address,
|
|
@@ -1423,7 +1487,7 @@ function getPublicClient(chainId, rpcUrls) {
|
|
|
1423
1487
|
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1424
1488
|
let client = clientCache.get(cacheKey);
|
|
1425
1489
|
if (!client) {
|
|
1426
|
-
const chain =
|
|
1490
|
+
const chain = _chunkHH46H6ZIcjs.CHAIN_BY_ID[chainId];
|
|
1427
1491
|
client = _viem.createPublicClient.call(void 0, {
|
|
1428
1492
|
chain,
|
|
1429
1493
|
transport: _viem.http.call(void 0, url)
|
|
@@ -2231,7 +2295,7 @@ function VisaMark() {
|
|
|
2231
2295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2232
2296
|
"aria-hidden": "true",
|
|
2233
2297
|
children: [
|
|
2234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "
|
|
2298
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
|
|
2235
2299
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2236
2300
|
"path",
|
|
2237
2301
|
{
|
|
@@ -2254,7 +2318,7 @@ function MastercardMark() {
|
|
|
2254
2318
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2255
2319
|
"aria-hidden": "true",
|
|
2256
2320
|
children: [
|
|
2257
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "
|
|
2321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
|
|
2258
2322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2259
2323
|
"path",
|
|
2260
2324
|
{
|
|
@@ -2298,7 +2362,7 @@ function AmexMark() {
|
|
|
2298
2362
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2299
2363
|
"aria-hidden": "true",
|
|
2300
2364
|
children: [
|
|
2301
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "
|
|
2365
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "#006FCF" }),
|
|
2302
2366
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2303
2367
|
"path",
|
|
2304
2368
|
{
|
|
@@ -2394,7 +2458,7 @@ var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fr
|
|
|
2394
2458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
2395
2459
|
"+6"
|
|
2396
2460
|
] });
|
|
2397
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
2461
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkHH46H6ZIcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
2398
2462
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2399
2463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
2400
2464
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -2826,21 +2890,25 @@ Tooltip.displayName = "Tooltip";
|
|
|
2826
2890
|
// src/components/ui/FeesAccordion.tsx
|
|
2827
2891
|
|
|
2828
2892
|
|
|
2829
|
-
function FeesAccordion({ total, rows }) {
|
|
2893
|
+
function FeesAccordion({ total, rows, tooltip }) {
|
|
2830
2894
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
2831
2895
|
const expandable = rows.length > 0;
|
|
2832
2896
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion", children: [
|
|
2833
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2834
|
-
"
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2897
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-summary", children: [
|
|
2898
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-fees-accordion-label", children: [
|
|
2899
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
2900
|
+
tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {}) }) })
|
|
2901
|
+
] }),
|
|
2902
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2903
|
+
"button",
|
|
2904
|
+
{
|
|
2905
|
+
type: "button",
|
|
2906
|
+
className: "rs-fees-accordion-toggle",
|
|
2907
|
+
"aria-label": "Fees",
|
|
2908
|
+
"aria-expanded": expandable ? open : void 0,
|
|
2909
|
+
disabled: !expandable,
|
|
2910
|
+
onClick: () => expandable && setOpen((o) => !o),
|
|
2911
|
+
children: [
|
|
2844
2912
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: total }),
|
|
2845
2913
|
expandable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2846
2914
|
"span",
|
|
@@ -2850,13 +2918,29 @@ function FeesAccordion({ total, rows }) {
|
|
|
2850
2918
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronDownIcon, {})
|
|
2851
2919
|
}
|
|
2852
2920
|
)
|
|
2853
|
-
]
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
),
|
|
2921
|
+
]
|
|
2922
|
+
}
|
|
2923
|
+
)
|
|
2924
|
+
] }),
|
|
2857
2925
|
expandable && open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fees-accordion-rows", children: rows.map((row, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-row", children: [
|
|
2858
2926
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: row.label }),
|
|
2859
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2927
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2928
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2929
|
+
"span",
|
|
2930
|
+
{
|
|
2931
|
+
className: row.strike ? "rs-review-detail-value--strike" : void 0,
|
|
2932
|
+
children: row.value
|
|
2933
|
+
}
|
|
2934
|
+
),
|
|
2935
|
+
row.tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: row.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2936
|
+
"span",
|
|
2937
|
+
{
|
|
2938
|
+
className: "rs-review-detail-info",
|
|
2939
|
+
"aria-label": `${row.label} info`,
|
|
2940
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {})
|
|
2941
|
+
}
|
|
2942
|
+
) })
|
|
2943
|
+
] })
|
|
2860
2944
|
] }, `${row.label}-${i}`)) })
|
|
2861
2945
|
] });
|
|
2862
2946
|
}
|
|
@@ -2872,6 +2956,7 @@ function SwappedReceipt({
|
|
|
2872
2956
|
depositedIcon,
|
|
2873
2957
|
feesTotal,
|
|
2874
2958
|
feeRows,
|
|
2959
|
+
feesTooltip,
|
|
2875
2960
|
newLabel,
|
|
2876
2961
|
onNewDeposit,
|
|
2877
2962
|
onClose
|
|
@@ -2892,13 +2977,20 @@ function SwappedReceipt({
|
|
|
2892
2977
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: amountPaid })
|
|
2893
2978
|
] }),
|
|
2894
2979
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2895
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "
|
|
2980
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Deposited amount" }),
|
|
2896
2981
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2897
2982
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: depositedAmount }),
|
|
2898
2983
|
depositedIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: depositedIcon, alt: "" }) })
|
|
2899
2984
|
] })
|
|
2900
2985
|
] }),
|
|
2901
|
-
feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2986
|
+
feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2987
|
+
FeesAccordion,
|
|
2988
|
+
{
|
|
2989
|
+
total: feesTotal,
|
|
2990
|
+
rows: _nullishCoalesce(feeRows, () => ( [])),
|
|
2991
|
+
tooltip: _nullishCoalesce(feesTooltip, () => ( void 0))
|
|
2992
|
+
}
|
|
2993
|
+
)
|
|
2902
2994
|
] }),
|
|
2903
2995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
|
|
2904
2996
|
onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
@@ -3070,13 +3162,13 @@ var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
|
3070
3162
|
function resolveTokenDisplay(token, chain, fallback) {
|
|
3071
3163
|
if (token !== void 0) {
|
|
3072
3164
|
if (chain === "solana") {
|
|
3073
|
-
const solanaToken =
|
|
3165
|
+
const solanaToken = _chunkHH46H6ZIcjs.getSolanaTokenByMint.call(void 0, token);
|
|
3074
3166
|
if (solanaToken) {
|
|
3075
3167
|
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
3076
3168
|
}
|
|
3077
3169
|
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
3078
|
-
const symbol =
|
|
3079
|
-
const decimals =
|
|
3170
|
+
const symbol = _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, token, chain);
|
|
3171
|
+
const decimals = _chunkHH46H6ZIcjs.findTokenDecimals.call(void 0, token, chain);
|
|
3080
3172
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
3081
3173
|
return {
|
|
3082
3174
|
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _117 => _117.symbol]), () => ( symbol)),
|
|
@@ -3252,6 +3344,8 @@ function FailedBadge() {
|
|
|
3252
3344
|
var INITIAL_POLL_INTERVAL = 3e3;
|
|
3253
3345
|
var MAX_POLL_INTERVAL = 3e4;
|
|
3254
3346
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
3347
|
+
var SWAPPED_RECEIPT_STATUS_RETRY_INTERVAL_MS = 1e3;
|
|
3348
|
+
var SWAPPED_FIAT_STATUS_MAX_ATTEMPTS = 12;
|
|
3255
3349
|
var ESCALATED_DELAY_MS = 10 * 60 * 1e3;
|
|
3256
3350
|
var SOFT_DELAY_MS = {
|
|
3257
3351
|
confirming: 90 * 1e3,
|
|
@@ -3282,6 +3376,36 @@ function formatPaymentMethod(method) {
|
|
|
3282
3376
|
if (PAYMENT_METHOD_LABELS[key]) return PAYMENT_METHOD_LABELS[key];
|
|
3283
3377
|
return key.replace(/[-_]+/g, " ").split(" ").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
3284
3378
|
}
|
|
3379
|
+
function normalizeFeeUsd(value) {
|
|
3380
|
+
return Number.isFinite(value) ? Math.max(0, value) : null;
|
|
3381
|
+
}
|
|
3382
|
+
function formatUsdFee(value) {
|
|
3383
|
+
return `$${_nullishCoalesce(_optionalChain([normalizeFeeUsd, 'call', _121 => _121(value), 'optionalAccess', _122 => _122.toFixed, 'call', _123 => _123(2)]), () => ( "0.00"))}`;
|
|
3384
|
+
}
|
|
3385
|
+
function getMarketNetworkFees(breakdown) {
|
|
3386
|
+
if (!breakdown) return null;
|
|
3387
|
+
const gasUsd = normalizeFeeUsd(breakdown.gasUsd);
|
|
3388
|
+
const bridgeUsd = normalizeFeeUsd(breakdown.bridgeUsd);
|
|
3389
|
+
const swapUsd = normalizeFeeUsd(breakdown.swapUsd);
|
|
3390
|
+
if (gasUsd === null || bridgeUsd === null || swapUsd === null) return null;
|
|
3391
|
+
return {
|
|
3392
|
+
marketUsd: bridgeUsd + swapUsd,
|
|
3393
|
+
networkUsd: gasUsd
|
|
3394
|
+
};
|
|
3395
|
+
}
|
|
3396
|
+
function toSwappedFiatContext(status) {
|
|
3397
|
+
return {
|
|
3398
|
+
orderCrypto: status.orderCrypto,
|
|
3399
|
+
orderCryptoAmount: status.orderCryptoAmount,
|
|
3400
|
+
paidAmountUsd: status.paidAmountUsd,
|
|
3401
|
+
paidAmountEur: status.paidAmountEur,
|
|
3402
|
+
onrampFeeUsd: status.onrampFeeUsd,
|
|
3403
|
+
paymentMethod: status.paymentMethod
|
|
3404
|
+
};
|
|
3405
|
+
}
|
|
3406
|
+
function hasFiatReceiptPricing(status) {
|
|
3407
|
+
return status.paidAmountUsd != null && status.onrampFeeUsd != null;
|
|
3408
|
+
}
|
|
3285
3409
|
function loadPhaseTimings(txHash) {
|
|
3286
3410
|
if (typeof window === "undefined") return null;
|
|
3287
3411
|
try {
|
|
@@ -3310,12 +3434,12 @@ function isEventForTx(event, txHash) {
|
|
|
3310
3434
|
return txRefsMatch(eventTxHash, txHash);
|
|
3311
3435
|
}
|
|
3312
3436
|
function parseWebhookTimestamp(event) {
|
|
3313
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
3437
|
+
if (typeof _optionalChain([event, 'optionalAccess', _124 => _124.time]) !== "string") return void 0;
|
|
3314
3438
|
const timestamp = Date.parse(event.time);
|
|
3315
3439
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
3316
3440
|
}
|
|
3317
3441
|
function syncPhaseTimings(previous, event) {
|
|
3318
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3442
|
+
if (!_optionalChain([event, 'optionalAccess', _125 => _125.type])) return previous;
|
|
3319
3443
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
3320
3444
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
3321
3445
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -3377,46 +3501,46 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
3377
3501
|
if (state.type === "complete") {
|
|
3378
3502
|
return void 0;
|
|
3379
3503
|
}
|
|
3380
|
-
if (_optionalChain([state, 'access',
|
|
3504
|
+
if (_optionalChain([state, 'access', _126 => _126.lastEvent, 'optionalAccess', _127 => _127.type]) === "bridge-started" || _optionalChain([state, 'access', _128 => _128.lastEvent, 'optionalAccess', _129 => _129.type]) === "bridge-complete")
|
|
3381
3505
|
return "bridging";
|
|
3382
|
-
if (_optionalChain([state, 'access',
|
|
3506
|
+
if (_optionalChain([state, 'access', _130 => _130.lastEvent, 'optionalAccess', _131 => _131.type]) === "deposit-received") return "received";
|
|
3383
3507
|
return "confirming";
|
|
3384
3508
|
}
|
|
3385
3509
|
function getCompletionDestinationTxHash(event) {
|
|
3386
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
3387
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
3388
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
3510
|
+
const eventData = _optionalChain([event, 'optionalAccess', _132 => _132.data]);
|
|
3511
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _133 => _133.swap, 'optionalAccess', _134 => _134.transactionHash]);
|
|
3512
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _135 => _135.destination, 'optionalAccess', _136 => _136.transactionHash]);
|
|
3389
3513
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
3390
3514
|
}
|
|
3391
3515
|
function getTerminalProcessingOutcome(event) {
|
|
3392
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3516
|
+
if (_optionalChain([event, 'optionalAccess', _137 => _137.type]) === "post-bridge-swap-complete") {
|
|
3393
3517
|
return {
|
|
3394
3518
|
type: "complete",
|
|
3395
3519
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
3396
3520
|
};
|
|
3397
3521
|
}
|
|
3398
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3522
|
+
if (_optionalChain([event, 'optionalAccess', _138 => _138.type]) === "post-bridge-swap-failed") {
|
|
3399
3523
|
return {
|
|
3400
3524
|
type: "failed",
|
|
3401
3525
|
message: formatBridgeFailedMessage(event).message
|
|
3402
3526
|
};
|
|
3403
3527
|
}
|
|
3404
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3528
|
+
if (_optionalChain([event, 'optionalAccess', _139 => _139.type]) === "bridge-complete") {
|
|
3405
3529
|
return {
|
|
3406
3530
|
type: "complete",
|
|
3407
3531
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
3408
3532
|
};
|
|
3409
3533
|
}
|
|
3410
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3534
|
+
if (_optionalChain([event, 'optionalAccess', _140 => _140.type]) === "bridge-failed") {
|
|
3411
3535
|
return {
|
|
3412
3536
|
type: "failed",
|
|
3413
3537
|
message: formatBridgeFailedMessage(event).message
|
|
3414
3538
|
};
|
|
3415
3539
|
}
|
|
3416
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3540
|
+
if (_optionalChain([event, 'optionalAccess', _141 => _141.type]) === "error") {
|
|
3417
3541
|
return {
|
|
3418
3542
|
type: "failed",
|
|
3419
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
3543
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _142 => _142.data, 'optionalAccess', _143 => _143.message]), () => ( "Unknown error"))
|
|
3420
3544
|
};
|
|
3421
3545
|
}
|
|
3422
3546
|
return null;
|
|
@@ -3424,10 +3548,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
3424
3548
|
function getInitialProcessingState(event, txHash) {
|
|
3425
3549
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
3426
3550
|
const terminal = getTerminalProcessingOutcome(event);
|
|
3427
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
3551
|
+
if (_optionalChain([terminal, 'optionalAccess', _144 => _144.type]) === "complete") {
|
|
3428
3552
|
return { type: "complete", lastEvent: event };
|
|
3429
3553
|
}
|
|
3430
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
3554
|
+
if (_optionalChain([terminal, 'optionalAccess', _145 => _145.type]) === "failed") {
|
|
3431
3555
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
3432
3556
|
}
|
|
3433
3557
|
if (isDepositEvent(event)) {
|
|
@@ -3455,6 +3579,7 @@ function ProcessingStep({
|
|
|
3455
3579
|
uiConfig,
|
|
3456
3580
|
quotedFeeAmount,
|
|
3457
3581
|
quotedFeeSymbol,
|
|
3582
|
+
quoteFeeBreakdown,
|
|
3458
3583
|
balanceAfterUsd,
|
|
3459
3584
|
isSwappedOrder,
|
|
3460
3585
|
swappedContext,
|
|
@@ -3529,7 +3654,7 @@ function ProcessingStep({
|
|
|
3529
3654
|
flowLabel
|
|
3530
3655
|
});
|
|
3531
3656
|
const context = processingContextRef.current;
|
|
3532
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3657
|
+
_optionalChain([onDepositCompleteRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147(txHash, void 0, {
|
|
3533
3658
|
amount: context.amount,
|
|
3534
3659
|
sourceChain: context.sourceChain,
|
|
3535
3660
|
sourceToken: context.sourceToken,
|
|
@@ -3560,7 +3685,7 @@ function ProcessingStep({
|
|
|
3560
3685
|
destinationTxHash: outcome.destinationTxHash,
|
|
3561
3686
|
event: event.type
|
|
3562
3687
|
});
|
|
3563
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3688
|
+
_optionalChain([onDepositCompleteRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(txHash, outcome.destinationTxHash, {
|
|
3564
3689
|
amount: context.amount,
|
|
3565
3690
|
sourceChain: context.sourceChain,
|
|
3566
3691
|
sourceToken: context.sourceToken,
|
|
@@ -3576,7 +3701,7 @@ function ProcessingStep({
|
|
|
3576
3701
|
message: outcome.message,
|
|
3577
3702
|
event: event.type
|
|
3578
3703
|
});
|
|
3579
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3704
|
+
_optionalChain([onDepositFailedRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(txHash, outcome.message)]);
|
|
3580
3705
|
}, [
|
|
3581
3706
|
debug,
|
|
3582
3707
|
onDepositCompleteRef,
|
|
@@ -3608,31 +3733,65 @@ function ProcessingStep({
|
|
|
3608
3733
|
updatePhaseTimings(
|
|
3609
3734
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
3610
3735
|
);
|
|
3611
|
-
}, [_optionalChain([state, 'access',
|
|
3736
|
+
}, [_optionalChain([state, 'access', _152 => _152.lastEvent, 'optionalAccess', _153 => _153.time]), _optionalChain([state, 'access', _154 => _154.lastEvent, 'optionalAccess', _155 => _155.type]), updatePhaseTimings]);
|
|
3612
3737
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
3613
3738
|
_react.useEffect.call(void 0, () => {
|
|
3614
3739
|
let cancelled = false;
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3740
|
+
let timeoutId;
|
|
3741
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _156 => _156.variant]) === "fiat";
|
|
3742
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _157 => _157.expectedOrderUuid]), () => ( null));
|
|
3743
|
+
setSwappedFiatContext(null);
|
|
3744
|
+
if (isFiatSwappedOrder && !expectedOrderUuid) {
|
|
3745
|
+
return () => {
|
|
3746
|
+
cancelled = true;
|
|
3747
|
+
};
|
|
3748
|
+
}
|
|
3749
|
+
let attempts = 0;
|
|
3750
|
+
const matchesCurrentDeposit = (res) => {
|
|
3751
|
+
if (isFiatSwappedOrder) {
|
|
3752
|
+
return res.orderId === expectedOrderUuid;
|
|
3753
|
+
}
|
|
3754
|
+
return res.transactionId != null && res.transactionId.toLowerCase() === txHash.toLowerCase();
|
|
3755
|
+
};
|
|
3756
|
+
const scheduleRetry = () => {
|
|
3757
|
+
if (cancelled || !isFiatSwappedOrder || attempts >= SWAPPED_FIAT_STATUS_MAX_ATTEMPTS) {
|
|
3620
3758
|
return;
|
|
3621
3759
|
}
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3760
|
+
timeoutId = setTimeout(
|
|
3761
|
+
fetchContext,
|
|
3762
|
+
SWAPPED_RECEIPT_STATUS_RETRY_INTERVAL_MS
|
|
3763
|
+
);
|
|
3764
|
+
};
|
|
3765
|
+
async function fetchContext() {
|
|
3766
|
+
attempts += 1;
|
|
3767
|
+
try {
|
|
3768
|
+
const res = await service.fetchSwappedOrderStatus(smartAccount);
|
|
3769
|
+
if (cancelled) return;
|
|
3770
|
+
if (!res || !matchesCurrentDeposit(res)) {
|
|
3771
|
+
scheduleRetry();
|
|
3772
|
+
return;
|
|
3773
|
+
}
|
|
3774
|
+
setSwappedFiatContext(toSwappedFiatContext(res));
|
|
3775
|
+
if (isFiatSwappedOrder && !hasFiatReceiptPricing(res)) {
|
|
3776
|
+
scheduleRetry();
|
|
3777
|
+
}
|
|
3778
|
+
} catch (e8) {
|
|
3779
|
+
scheduleRetry();
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
fetchContext();
|
|
3632
3783
|
return () => {
|
|
3633
3784
|
cancelled = true;
|
|
3785
|
+
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
3634
3786
|
};
|
|
3635
|
-
}, [
|
|
3787
|
+
}, [
|
|
3788
|
+
service,
|
|
3789
|
+
smartAccount,
|
|
3790
|
+
txHash,
|
|
3791
|
+
isSwappedOrder,
|
|
3792
|
+
_optionalChain([swappedContext, 'optionalAccess', _158 => _158.variant]),
|
|
3793
|
+
_optionalChain([swappedContext, 'optionalAccess', _159 => _159.expectedOrderUuid])
|
|
3794
|
+
]);
|
|
3636
3795
|
_react.useEffect.call(void 0, () => {
|
|
3637
3796
|
if (directTransfer) return;
|
|
3638
3797
|
if (state.type !== "processing") {
|
|
@@ -3657,20 +3816,20 @@ function ProcessingStep({
|
|
|
3657
3816
|
debugLog(debug, "processing", "poll:event", {
|
|
3658
3817
|
type: lastEvent2.type,
|
|
3659
3818
|
matchesTx: eventMatchesTx,
|
|
3660
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
3819
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _160 => _160.intentId])
|
|
3661
3820
|
});
|
|
3662
3821
|
}
|
|
3663
3822
|
if (!isMounted) return;
|
|
3664
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3823
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _161 => _161.type]) === "bridge-complete") {
|
|
3665
3824
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3666
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
3825
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _162 => _162.data, 'optionalAccess', _163 => _163.destination, 'optionalAccess', _164 => _164.transactionHash]);
|
|
3667
3826
|
debugLog(debug, "processing", "state:complete", {
|
|
3668
3827
|
txHash,
|
|
3669
3828
|
destinationTxHash: destinationTxHash2,
|
|
3670
3829
|
event: eventForCurrentTx.type
|
|
3671
3830
|
});
|
|
3672
3831
|
const context = processingContextRef.current;
|
|
3673
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3832
|
+
_optionalChain([onDepositCompleteRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(txHash, destinationTxHash2, {
|
|
3674
3833
|
amount: context.amount,
|
|
3675
3834
|
sourceChain: context.sourceChain,
|
|
3676
3835
|
sourceToken: context.sourceToken,
|
|
@@ -3681,7 +3840,7 @@ function ProcessingStep({
|
|
|
3681
3840
|
})]);
|
|
3682
3841
|
return;
|
|
3683
3842
|
}
|
|
3684
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3843
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _167 => _167.type]) === "bridge-failed") {
|
|
3685
3844
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3686
3845
|
setState({
|
|
3687
3846
|
type: "failed",
|
|
@@ -3693,11 +3852,11 @@ function ProcessingStep({
|
|
|
3693
3852
|
message: formatted.message,
|
|
3694
3853
|
code: formatted.code
|
|
3695
3854
|
});
|
|
3696
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3855
|
+
_optionalChain([onDepositFailedRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169(txHash, formatted.message)]);
|
|
3697
3856
|
return;
|
|
3698
3857
|
}
|
|
3699
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3700
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
3858
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _170 => _170.type]) === "error") {
|
|
3859
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _171 => _171.data, 'optionalAccess', _172 => _172.message]), () => ( "Unknown error"));
|
|
3701
3860
|
setState({
|
|
3702
3861
|
type: "failed",
|
|
3703
3862
|
message: errorMessage,
|
|
@@ -3707,7 +3866,7 @@ function ProcessingStep({
|
|
|
3707
3866
|
txHash,
|
|
3708
3867
|
message: errorMessage
|
|
3709
3868
|
});
|
|
3710
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3869
|
+
_optionalChain([onDepositFailedRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(txHash, errorMessage)]);
|
|
3711
3870
|
return;
|
|
3712
3871
|
}
|
|
3713
3872
|
setState((previous) => ({
|
|
@@ -3768,7 +3927,7 @@ function ProcessingStep({
|
|
|
3768
3927
|
txHash,
|
|
3769
3928
|
timeoutMs: ESCALATED_DELAY_MS
|
|
3770
3929
|
});
|
|
3771
|
-
_optionalChain([onErrorRef, 'access',
|
|
3930
|
+
_optionalChain([onErrorRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176(message, "PROCESS_TIMEOUT")]);
|
|
3772
3931
|
}, ESCALATED_DELAY_MS);
|
|
3773
3932
|
return () => clearTimeout(timeoutId);
|
|
3774
3933
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -3780,13 +3939,13 @@ function ProcessingStep({
|
|
|
3780
3939
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
3781
3940
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
3782
3941
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
3783
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
3942
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _177 => _177.data, 'optionalAccess', _178 => _178.destination, 'optionalAccess', _179 => _179.transactionHash]) || null;
|
|
3784
3943
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
3785
3944
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
3786
3945
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
3787
3946
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
3788
|
-
const sourceExplorerUrl =
|
|
3789
|
-
const destExplorerUrl = destinationTxHash ?
|
|
3947
|
+
const sourceExplorerUrl = _chunkHH46H6ZIcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
|
|
3948
|
+
const destExplorerUrl = destinationTxHash ? _chunkHH46H6ZIcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
3790
3949
|
const sourceDisplay = (() => {
|
|
3791
3950
|
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
3792
3951
|
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
@@ -3851,15 +4010,15 @@ function ProcessingStep({
|
|
|
3851
4010
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
3852
4011
|
void delayPhaseId;
|
|
3853
4012
|
void hasEscalatedDelay;
|
|
3854
|
-
const targetTokenIcon =
|
|
3855
|
-
const sourceChainIcon =
|
|
3856
|
-
const targetChainIcon =
|
|
3857
|
-
const sourceTokenIcon =
|
|
3858
|
-
const sourceChainName =
|
|
3859
|
-
const targetChainName =
|
|
4013
|
+
const targetTokenIcon = _chunkHH46H6ZIcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
4014
|
+
const sourceChainIcon = _chunkHH46H6ZIcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
4015
|
+
const targetChainIcon = _chunkHH46H6ZIcjs.getChainIcon.call(void 0, targetChain);
|
|
4016
|
+
const sourceTokenIcon = _chunkHH46H6ZIcjs.getTokenIcon.call(void 0, sourceSymbol);
|
|
4017
|
+
const sourceChainName = _chunkHH46H6ZIcjs.getChainName.call(void 0, displaySourceChain);
|
|
4018
|
+
const targetChainName = _chunkHH46H6ZIcjs.getChainName.call(void 0, targetChain);
|
|
3860
4019
|
const timerText = formatTimer(elapsedSeconds);
|
|
3861
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3862
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4020
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _180 => _180.feeSponsored]), () => ( false));
|
|
4021
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _181 => _181.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3863
4022
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
3864
4023
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
3865
4024
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -3870,31 +4029,47 @@ function ProcessingStep({
|
|
|
3870
4029
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
3871
4030
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
3872
4031
|
if (isComplete && isSwappedOrder) {
|
|
3873
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
4032
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _182 => _182.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _183 => _183.paymentMethod]))), () => ( null));
|
|
3874
4033
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
3875
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
4034
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _184 => _184.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
3876
4035
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
3877
4036
|
effectivePaymentMethod
|
|
3878
4037
|
) : null;
|
|
3879
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
3880
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4038
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _185 => _185.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
4039
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _186 => _186.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
3881
4040
|
const depositedAmount = receiveDisplay;
|
|
3882
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3883
|
-
const
|
|
4041
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _187 => _187.onrampFeeUsd]), () => ( null));
|
|
4042
|
+
const quoteFees = getMarketNetworkFees(quoteFeeBreakdown);
|
|
4043
|
+
const fallbackNetworkFeeUsd = quoteFees === null && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
4044
|
+
const marketFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _188 => _188.marketUsd]), () => ( null));
|
|
4045
|
+
const networkFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _189 => _189.networkUsd]), () => ( fallbackNetworkFeeUsd));
|
|
4046
|
+
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
4047
|
+
const feesTooltip = feeSponsored ? "On-ramp fees are charged by the payment provider. Market and network fees are sponsored for this deposit." : "Fees include on-ramp, market, and network costs for this deposit.";
|
|
3884
4048
|
const feeRows = [];
|
|
3885
4049
|
if (onrampFeeUsd != null) {
|
|
3886
4050
|
feeRows.push({
|
|
3887
4051
|
label: "On-ramp fee",
|
|
3888
|
-
value:
|
|
4052
|
+
value: formatUsdFee(onrampFeeUsd)
|
|
4053
|
+
});
|
|
4054
|
+
}
|
|
4055
|
+
if (marketFeeUsd != null) {
|
|
4056
|
+
feeRows.push({
|
|
4057
|
+
label: "Market fee",
|
|
4058
|
+
value: formatUsdFee(marketFeeUsd),
|
|
4059
|
+
strike: feeSponsored,
|
|
4060
|
+
tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
|
|
3889
4061
|
});
|
|
3890
4062
|
}
|
|
3891
4063
|
if (networkFeeUsd != null) {
|
|
3892
4064
|
feeRows.push({
|
|
3893
4065
|
label: "Network fee",
|
|
3894
|
-
value:
|
|
4066
|
+
value: formatUsdFee(networkFeeUsd),
|
|
4067
|
+
strike: feeSponsored,
|
|
4068
|
+
tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
|
|
3895
4069
|
});
|
|
3896
4070
|
}
|
|
3897
|
-
const
|
|
4071
|
+
const chargeableQuoteFeeUsd = feeSponsored ? 0 : (_nullishCoalesce(marketFeeUsd, () => ( 0))) + (_nullishCoalesce(networkFeeUsd, () => ( 0)));
|
|
4072
|
+
const feesTotal = feeRows.length > 0 ? formatUsdFee((_nullishCoalesce(onrampFeeUsd, () => ( 0))) + chargeableQuoteFeeUsd) : null;
|
|
3898
4073
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3899
4074
|
SwappedReceipt,
|
|
3900
4075
|
{
|
|
@@ -3905,6 +4080,7 @@ function ProcessingStep({
|
|
|
3905
4080
|
depositedIcon: targetTokenIcon,
|
|
3906
4081
|
feesTotal,
|
|
3907
4082
|
feeRows,
|
|
4083
|
+
feesTooltip,
|
|
3908
4084
|
newLabel: `New ${flowNoun}`,
|
|
3909
4085
|
onNewDeposit,
|
|
3910
4086
|
onClose
|
|
@@ -3956,7 +4132,7 @@ function ProcessingStep({
|
|
|
3956
4132
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
3957
4133
|
] }),
|
|
3958
4134
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3959
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4135
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _190 => _190.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3960
4136
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
3961
4137
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3962
4138
|
"$",
|
|
@@ -3968,7 +4144,7 @@ function ProcessingStep({
|
|
|
3968
4144
|
] })
|
|
3969
4145
|
] })
|
|
3970
4146
|
] }),
|
|
3971
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4147
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _191 => _191.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3972
4148
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
3973
4149
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3974
4150
|
"$",
|
|
@@ -4112,7 +4288,7 @@ function loadSessionOwnerFromStorage(eoaAddress) {
|
|
|
4112
4288
|
privateKey: parsed.privateKey,
|
|
4113
4289
|
address: account.address
|
|
4114
4290
|
};
|
|
4115
|
-
} catch (
|
|
4291
|
+
} catch (e9) {
|
|
4116
4292
|
return null;
|
|
4117
4293
|
}
|
|
4118
4294
|
}
|