@rhinestone/deposit-modal 0.3.0-alpha.11 → 0.3.0-alpha.13
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/README.md +59 -0
- package/dist/{DepositModalReown-KXFF6ZXY.cjs → DepositModalReown-CXPRZRXL.cjs} +6 -6
- package/dist/{DepositModalReown-UNFGBOIJ.mjs → DepositModalReown-HBAWSK6K.mjs} +3 -3
- package/dist/{WithdrawModalReown-QEQPCSWT.mjs → WithdrawModalReown-EEWQRENY.mjs} +3 -3
- package/dist/{WithdrawModalReown-Z5JVENP6.cjs → WithdrawModalReown-T3TPJIME.cjs} +6 -6
- package/dist/{chunk-WVE3JN3C.mjs → chunk-6K4JHM2D.mjs} +343 -50
- package/dist/{chunk-YI63OMXN.cjs → chunk-6RCOF3XU.cjs} +57 -57
- package/dist/{chunk-2TWQGPPB.cjs → chunk-DZNXG5JK.cjs} +372 -79
- package/dist/{chunk-7MZNQ4C2.mjs → chunk-EC63ZHY4.mjs} +2 -2
- package/dist/{chunk-V63GWJHB.mjs → chunk-HZBO2SIZ.mjs} +1503 -366
- package/dist/{chunk-FGVSNARE.cjs → chunk-PWV2UJP3.cjs} +2 -2
- package/dist/{chunk-Y4CESMTH.cjs → chunk-SEOQ66FW.cjs} +1420 -283
- package/dist/{chunk-QXIJLRKC.mjs → chunk-YB3JPWJW.mjs} +1 -1
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/styles.css +547 -12
- package/dist/{types-D6wrO4Ow.d.cts → types-C8i2ebY1.d.cts} +25 -0
- package/dist/{types-D6wrO4Ow.d.ts → types-C8i2ebY1.d.ts} +25 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +3 -3
|
@@ -62,14 +62,14 @@ function Modal({
|
|
|
62
62
|
}
|
|
63
63
|
}, [isOpen]);
|
|
64
64
|
_react.useEffect.call(void 0, () => {
|
|
65
|
-
if (isOpen) {
|
|
65
|
+
if (isOpen && !inline) {
|
|
66
66
|
const originalOverflow = document.body.style.overflow;
|
|
67
67
|
document.body.style.overflow = "hidden";
|
|
68
68
|
return () => {
|
|
69
69
|
document.body.style.overflow = originalOverflow;
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
}, [isOpen]);
|
|
72
|
+
}, [isOpen, inline]);
|
|
73
73
|
const handleKeyDown = _react.useCallback.call(void 0,
|
|
74
74
|
(event) => {
|
|
75
75
|
if (event.key === "Escape") {
|
|
@@ -162,6 +162,9 @@ Modal.displayName = "Modal";
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
165
168
|
|
|
166
169
|
|
|
167
170
|
|
|
@@ -207,6 +210,9 @@ var PercentIcon = _lucidereact.Percent;
|
|
|
207
210
|
var ClockIcon = _lucidereact.Clock;
|
|
208
211
|
var PlusCircleIcon = _lucidereact.CirclePlus;
|
|
209
212
|
var CircleArrowOutUpLeftIcon = _lucidereact.CircleArrowOutUpLeft;
|
|
213
|
+
var CardIcon = _lucidereact.CreditCard;
|
|
214
|
+
var BankIcon = _lucidereact.Landmark;
|
|
215
|
+
var AppleIcon = _lucidereact.Apple;
|
|
210
216
|
|
|
211
217
|
// src/core/useLatestRef.ts
|
|
212
218
|
|
|
@@ -972,6 +978,150 @@ function createDepositService(baseUrl, options) {
|
|
|
972
978
|
debugError(debug, scope, "fetchPrices:error", err);
|
|
973
979
|
return {};
|
|
974
980
|
}
|
|
981
|
+
},
|
|
982
|
+
async getSwappedWidgetUrl(params) {
|
|
983
|
+
const url = apiUrl("/onramp/swapped/widget-url");
|
|
984
|
+
debugLog(debug, scope, "getSwappedWidgetUrl:request", {
|
|
985
|
+
smartAccount: shortRef(params.smartAccount),
|
|
986
|
+
method: params.method
|
|
987
|
+
});
|
|
988
|
+
const response = await fetch(url, {
|
|
989
|
+
method: "POST",
|
|
990
|
+
headers: { "Content-Type": "application/json" },
|
|
991
|
+
body: JSON.stringify(params)
|
|
992
|
+
});
|
|
993
|
+
if (!response.ok) {
|
|
994
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
995
|
+
debugError(debug, scope, "getSwappedWidgetUrl:failed", error, {
|
|
996
|
+
status: response.status
|
|
997
|
+
});
|
|
998
|
+
throw new Error(
|
|
999
|
+
error.error || `Swapped widget URL failed: ${response.status}`
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
const body = await response.json();
|
|
1003
|
+
if (typeof body.url !== "string" || typeof body.currencyCode !== "string" || typeof body.externalCustomerId !== "string") {
|
|
1004
|
+
throw new Error("Swapped widget URL: malformed response");
|
|
1005
|
+
}
|
|
1006
|
+
return {
|
|
1007
|
+
url: body.url,
|
|
1008
|
+
currencyCode: body.currencyCode,
|
|
1009
|
+
sandbox: body.sandbox === true,
|
|
1010
|
+
externalCustomerId: body.externalCustomerId,
|
|
1011
|
+
expiresAt: body.expiresAt
|
|
1012
|
+
};
|
|
1013
|
+
},
|
|
1014
|
+
async getSwappedConnectUrl(params) {
|
|
1015
|
+
const url = apiUrl("/onramp/swapped/connect-url");
|
|
1016
|
+
debugLog(debug, scope, "getSwappedConnectUrl:request", {
|
|
1017
|
+
smartAccount: shortRef(params.smartAccount),
|
|
1018
|
+
connection: params.connection
|
|
1019
|
+
});
|
|
1020
|
+
const response = await fetch(url, {
|
|
1021
|
+
method: "POST",
|
|
1022
|
+
headers: { "Content-Type": "application/json" },
|
|
1023
|
+
body: JSON.stringify(params)
|
|
1024
|
+
});
|
|
1025
|
+
if (!response.ok) {
|
|
1026
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1027
|
+
debugError(debug, scope, "getSwappedConnectUrl:failed", error, {
|
|
1028
|
+
status: response.status
|
|
1029
|
+
});
|
|
1030
|
+
throw new Error(
|
|
1031
|
+
error.error || `Swapped Connect URL failed: ${response.status}`
|
|
1032
|
+
);
|
|
1033
|
+
}
|
|
1034
|
+
const body = await response.json();
|
|
1035
|
+
if (typeof body.url !== "string" || typeof body.currencyCode !== "string" || typeof body.externalCustomerId !== "string") {
|
|
1036
|
+
throw new Error("Swapped Connect URL: malformed response");
|
|
1037
|
+
}
|
|
1038
|
+
return {
|
|
1039
|
+
url: body.url,
|
|
1040
|
+
currencyCode: body.currencyCode,
|
|
1041
|
+
sandbox: body.sandbox === true,
|
|
1042
|
+
externalCustomerId: body.externalCustomerId,
|
|
1043
|
+
expiresAt: body.expiresAt
|
|
1044
|
+
};
|
|
1045
|
+
},
|
|
1046
|
+
async getSwappedConnectExchanges() {
|
|
1047
|
+
const url = apiUrl("/onramp/swapped/connect-exchanges");
|
|
1048
|
+
debugLog(debug, scope, "getSwappedConnectExchanges:request");
|
|
1049
|
+
const response = await fetch(url, {
|
|
1050
|
+
method: "GET",
|
|
1051
|
+
headers: { "Content-Type": "application/json" },
|
|
1052
|
+
cache: "no-store"
|
|
1053
|
+
});
|
|
1054
|
+
if (!response.ok) {
|
|
1055
|
+
const error = await response.json().catch(() => ({ error: "Unknown error" }));
|
|
1056
|
+
debugError(debug, scope, "getSwappedConnectExchanges:failed", error, {
|
|
1057
|
+
status: response.status
|
|
1058
|
+
});
|
|
1059
|
+
throw new Error(
|
|
1060
|
+
error.error || `Swapped Connect exchanges failed: ${response.status}`
|
|
1061
|
+
);
|
|
1062
|
+
}
|
|
1063
|
+
const body = await response.json();
|
|
1064
|
+
const rawExchanges = Array.isArray(body.exchanges) ? body.exchanges : null;
|
|
1065
|
+
const exchanges = [];
|
|
1066
|
+
let hasMalformedExchange = rawExchanges === null;
|
|
1067
|
+
for (const exchange of _nullishCoalesce(rawExchanges, () => ( []))) {
|
|
1068
|
+
if (!exchange || typeof exchange !== "object") {
|
|
1069
|
+
hasMalformedExchange = true;
|
|
1070
|
+
continue;
|
|
1071
|
+
}
|
|
1072
|
+
const raw = exchange;
|
|
1073
|
+
const connection = typeof raw.connection === "string" ? raw.connection : "";
|
|
1074
|
+
const name = typeof raw.name === "string" ? raw.name : "";
|
|
1075
|
+
const logoUrl = typeof raw.logoUrl === "string" || raw.logoUrl === null ? raw.logoUrl : null;
|
|
1076
|
+
if (!connection || !name) {
|
|
1077
|
+
hasMalformedExchange = true;
|
|
1078
|
+
continue;
|
|
1079
|
+
}
|
|
1080
|
+
exchanges.push({ connection, name, logoUrl });
|
|
1081
|
+
}
|
|
1082
|
+
if (hasMalformedExchange || typeof body.fetchedAt !== "string" || typeof body.expiresAt !== "string") {
|
|
1083
|
+
throw new Error("Swapped Connect exchanges: malformed response");
|
|
1084
|
+
}
|
|
1085
|
+
return {
|
|
1086
|
+
exchanges,
|
|
1087
|
+
fetchedAt: body.fetchedAt,
|
|
1088
|
+
expiresAt: body.expiresAt,
|
|
1089
|
+
stale: body.stale === true ? true : void 0
|
|
1090
|
+
};
|
|
1091
|
+
},
|
|
1092
|
+
async fetchSwappedOrderStatus(smartAccount) {
|
|
1093
|
+
const url = apiUrl(
|
|
1094
|
+
`/onramp/swapped/status/${encodeURIComponent(smartAccount)}`
|
|
1095
|
+
);
|
|
1096
|
+
const response = await fetch(url, {
|
|
1097
|
+
method: "GET",
|
|
1098
|
+
headers: { "Content-Type": "application/json" },
|
|
1099
|
+
cache: "no-store"
|
|
1100
|
+
});
|
|
1101
|
+
if (!response.ok) return null;
|
|
1102
|
+
let body = null;
|
|
1103
|
+
try {
|
|
1104
|
+
body = await response.json();
|
|
1105
|
+
} catch (e3) {
|
|
1106
|
+
return null;
|
|
1107
|
+
}
|
|
1108
|
+
if (!body || body.ok !== true) return null;
|
|
1109
|
+
const status = typeof body.status === "string" ? body.status : null;
|
|
1110
|
+
const orderId = typeof body.orderId === "string" ? body.orderId : null;
|
|
1111
|
+
if (!status || !orderId) return null;
|
|
1112
|
+
const numericOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
|
|
1113
|
+
return {
|
|
1114
|
+
orderId,
|
|
1115
|
+
status,
|
|
1116
|
+
orderCrypto: typeof body.orderCrypto === "string" ? body.orderCrypto : null,
|
|
1117
|
+
orderCryptoAmount: typeof body.orderCryptoAmount === "string" ? body.orderCryptoAmount : null,
|
|
1118
|
+
transactionId: typeof body.transactionId === "string" ? body.transactionId : null,
|
|
1119
|
+
receivedAt: typeof body.receivedAt === "string" ? body.receivedAt : null,
|
|
1120
|
+
paidAmountUsd: numericOrNull(body.paidAmountUsd),
|
|
1121
|
+
paidAmountEur: numericOrNull(body.paidAmountEur),
|
|
1122
|
+
onrampFeeUsd: numericOrNull(body.onrampFeeUsd),
|
|
1123
|
+
paymentMethod: typeof body.paymentMethod === "string" ? body.paymentMethod : null
|
|
1124
|
+
};
|
|
975
1125
|
}
|
|
976
1126
|
};
|
|
977
1127
|
}
|
|
@@ -1833,6 +1983,11 @@ function formatBalanceUsd(value) {
|
|
|
1833
1983
|
if (!Number.isFinite(value) || value <= 0) return "$0.00";
|
|
1834
1984
|
return `$${value.toFixed(2)}`;
|
|
1835
1985
|
}
|
|
1986
|
+
function fiatIcon(name) {
|
|
1987
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AppleIcon, {});
|
|
1988
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BankIcon, {});
|
|
1989
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardIcon, {});
|
|
1990
|
+
}
|
|
1836
1991
|
function shorten(addr) {
|
|
1837
1992
|
return addr.length > 12 ? `${addr.slice(0, 6)}...${addr.slice(-4)}` : addr;
|
|
1838
1993
|
}
|
|
@@ -1873,6 +2028,10 @@ function ConnectStep({
|
|
|
1873
2028
|
onSelectTransferCrypto,
|
|
1874
2029
|
transferCryptoState,
|
|
1875
2030
|
transferCryptoErrorReason,
|
|
2031
|
+
onSelectPayWithCard,
|
|
2032
|
+
fiatPaymentMethods,
|
|
2033
|
+
onSelectFiatMethod,
|
|
2034
|
+
onSelectFundFromExchange,
|
|
1876
2035
|
onRequestConnect,
|
|
1877
2036
|
onConnect,
|
|
1878
2037
|
onDisconnect,
|
|
@@ -1911,6 +2070,33 @@ function ConnectStep({
|
|
|
1911
2070
|
trailing: transferCryptoState === "loading" ? SMALL_SPINNER : void 0
|
|
1912
2071
|
}
|
|
1913
2072
|
),
|
|
2073
|
+
fiatPaymentMethods && fiatPaymentMethods.length > 0 && onSelectFiatMethod ? fiatPaymentMethods.map((opt) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2074
|
+
ListRow,
|
|
2075
|
+
{
|
|
2076
|
+
leading: fiatIcon(opt.icon),
|
|
2077
|
+
title: opt.label,
|
|
2078
|
+
subtitle: opt.sublabel,
|
|
2079
|
+
onClick: () => onSelectFiatMethod(opt.method)
|
|
2080
|
+
},
|
|
2081
|
+
opt.method
|
|
2082
|
+
)) : onSelectPayWithCard && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2083
|
+
ListRow,
|
|
2084
|
+
{
|
|
2085
|
+
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CardIcon, {}),
|
|
2086
|
+
title: "Pay with Card",
|
|
2087
|
+
subtitle: "Buy crypto with card or bank",
|
|
2088
|
+
onClick: onSelectPayWithCard
|
|
2089
|
+
}
|
|
2090
|
+
),
|
|
2091
|
+
onSelectFundFromExchange && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2092
|
+
ListRow,
|
|
2093
|
+
{
|
|
2094
|
+
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BankIcon, {}),
|
|
2095
|
+
title: "Fund from Exchange",
|
|
2096
|
+
subtitle: "Use Coinbase, Binance, MetaMask\u2026",
|
|
2097
|
+
onClick: onSelectFundFromExchange
|
|
2098
|
+
}
|
|
2099
|
+
),
|
|
1914
2100
|
rows.map((row) => {
|
|
1915
2101
|
const collapseToExternal = Boolean(onSelectTransferCrypto) && row.kind !== "solana";
|
|
1916
2102
|
const subtitleText = row.state === "loading" ? "Preparing\u2026" : row.state === "error" ? _nullishCoalesce(row.errorReason, () => ( "Couldn't prepare wallet \u2014 tap to retry")) : shorten(row.address);
|
|
@@ -2271,6 +2457,9 @@ function getEventSourceDetails(event) {
|
|
|
2271
2457
|
function isDepositEvent(event) {
|
|
2272
2458
|
return _optionalChain([event, 'optionalAccess', _101 => _101.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _102 => _102.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _103 => _103.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _104 => _104.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _105 => _105.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _106 => _106.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _107 => _107.type]) === "error";
|
|
2273
2459
|
}
|
|
2460
|
+
function isFailedEvent(event) {
|
|
2461
|
+
return _optionalChain([event, 'optionalAccess', _108 => _108.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _109 => _109.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _110 => _110.type]) === "error";
|
|
2462
|
+
}
|
|
2274
2463
|
function isHexString(value) {
|
|
2275
2464
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
2276
2465
|
}
|
|
@@ -2280,6 +2469,41 @@ function txRefsMatch(a, b) {
|
|
|
2280
2469
|
}
|
|
2281
2470
|
return a === b;
|
|
2282
2471
|
}
|
|
2472
|
+
function formatBridgeFailedMessage(event) {
|
|
2473
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _111 => _111.data]), () => ( {}));
|
|
2474
|
+
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
2475
|
+
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2476
|
+
function toUserFacingFailure(raw) {
|
|
2477
|
+
const lower = raw.toLowerCase();
|
|
2478
|
+
if (lower.includes("insufficient funds")) {
|
|
2479
|
+
return "Deposit was received, but processing could not continue due to insufficient funds. Please retry.";
|
|
2480
|
+
}
|
|
2481
|
+
if (lower.includes("no valid quote available")) {
|
|
2482
|
+
return "No bridge route is currently available for this transfer. Please try again shortly.";
|
|
2483
|
+
}
|
|
2484
|
+
if (lower.includes("simulation failed")) {
|
|
2485
|
+
return "Transfer processing failed during simulation. Please retry.";
|
|
2486
|
+
}
|
|
2487
|
+
if (raw.length > 220) {
|
|
2488
|
+
return "Transfer processing failed. Please retry.";
|
|
2489
|
+
}
|
|
2490
|
+
return raw;
|
|
2491
|
+
}
|
|
2492
|
+
if (backendMessage.length > 0) {
|
|
2493
|
+
return { message: toUserFacingFailure(backendMessage), code };
|
|
2494
|
+
}
|
|
2495
|
+
if (code) {
|
|
2496
|
+
return { message: `Bridge failed (${code})`, code };
|
|
2497
|
+
}
|
|
2498
|
+
return { message: "Bridge failed" };
|
|
2499
|
+
}
|
|
2500
|
+
function failureMessageForEvent(event) {
|
|
2501
|
+
if (_optionalChain([event, 'optionalAccess', _112 => _112.type]) === "error") {
|
|
2502
|
+
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
2503
|
+
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
2504
|
+
}
|
|
2505
|
+
return formatBridgeFailedMessage(event).message;
|
|
2506
|
+
}
|
|
2283
2507
|
|
|
2284
2508
|
// src/components/steps/ProcessingStep.tsx
|
|
2285
2509
|
|
|
@@ -2353,6 +2577,24 @@ var SOFT_DELAY_MS = {
|
|
|
2353
2577
|
bridging: 4 * 60 * 1e3
|
|
2354
2578
|
};
|
|
2355
2579
|
var PHASE_TIMINGS_PREFIX = "rhinestone:phase-timings";
|
|
2580
|
+
var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
2581
|
+
"USDC",
|
|
2582
|
+
"USDT",
|
|
2583
|
+
"DAI",
|
|
2584
|
+
"FRAX",
|
|
2585
|
+
"PYUSD",
|
|
2586
|
+
"USDP",
|
|
2587
|
+
"TUSD",
|
|
2588
|
+
"GUSD",
|
|
2589
|
+
"USDS",
|
|
2590
|
+
"LUSD",
|
|
2591
|
+
"BUSD",
|
|
2592
|
+
"USDE"
|
|
2593
|
+
]);
|
|
2594
|
+
function maxFractionDigitsFor(symbol) {
|
|
2595
|
+
if (!symbol) return 6;
|
|
2596
|
+
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2597
|
+
}
|
|
2356
2598
|
function loadPhaseTimings(txHash) {
|
|
2357
2599
|
if (typeof window === "undefined") return null;
|
|
2358
2600
|
try {
|
|
@@ -2361,7 +2603,7 @@ function loadPhaseTimings(txHash) {
|
|
|
2361
2603
|
const parsed = JSON.parse(raw);
|
|
2362
2604
|
if (typeof parsed.startedAt !== "number") return null;
|
|
2363
2605
|
return parsed;
|
|
2364
|
-
} catch (
|
|
2606
|
+
} catch (e4) {
|
|
2365
2607
|
return null;
|
|
2366
2608
|
}
|
|
2367
2609
|
}
|
|
@@ -2372,7 +2614,7 @@ function savePhaseTimings(txHash, timings) {
|
|
|
2372
2614
|
`${PHASE_TIMINGS_PREFIX}:${txHash}`,
|
|
2373
2615
|
JSON.stringify(timings)
|
|
2374
2616
|
);
|
|
2375
|
-
} catch (
|
|
2617
|
+
} catch (e5) {
|
|
2376
2618
|
}
|
|
2377
2619
|
}
|
|
2378
2620
|
function isEventForTx(event, txHash) {
|
|
@@ -2380,45 +2622,13 @@ function isEventForTx(event, txHash) {
|
|
|
2380
2622
|
if (!eventTxHash) return false;
|
|
2381
2623
|
return txRefsMatch(eventTxHash, txHash);
|
|
2382
2624
|
}
|
|
2383
|
-
function formatBridgeFailedMessage(event) {
|
|
2384
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _108 => _108.data]), () => ( {}));
|
|
2385
|
-
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
2386
|
-
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2387
|
-
function toUserFacingFailure(raw) {
|
|
2388
|
-
const lower = raw.toLowerCase();
|
|
2389
|
-
if (lower.includes("insufficient funds")) {
|
|
2390
|
-
return "Deposit was received, but processing could not continue due to insufficient funds. Please retry.";
|
|
2391
|
-
}
|
|
2392
|
-
if (lower.includes("no valid quote available")) {
|
|
2393
|
-
return "No bridge route is currently available for this transfer. Please try again shortly.";
|
|
2394
|
-
}
|
|
2395
|
-
if (lower.includes("simulation failed")) {
|
|
2396
|
-
return "Transfer processing failed during simulation. Please retry.";
|
|
2397
|
-
}
|
|
2398
|
-
if (raw.length > 220) {
|
|
2399
|
-
return "Transfer processing failed. Please retry.";
|
|
2400
|
-
}
|
|
2401
|
-
return raw;
|
|
2402
|
-
}
|
|
2403
|
-
if (backendMessage.length > 0) {
|
|
2404
|
-
const userMessage = toUserFacingFailure(backendMessage);
|
|
2405
|
-
return {
|
|
2406
|
-
message: userMessage,
|
|
2407
|
-
code
|
|
2408
|
-
};
|
|
2409
|
-
}
|
|
2410
|
-
if (code) {
|
|
2411
|
-
return { message: `Bridge failed (${code})`, code };
|
|
2412
|
-
}
|
|
2413
|
-
return { message: "Bridge failed" };
|
|
2414
|
-
}
|
|
2415
2625
|
function parseWebhookTimestamp(event) {
|
|
2416
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
2626
|
+
if (typeof _optionalChain([event, 'optionalAccess', _113 => _113.time]) !== "string") return void 0;
|
|
2417
2627
|
const timestamp = Date.parse(event.time);
|
|
2418
2628
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
2419
2629
|
}
|
|
2420
2630
|
function syncPhaseTimings(previous, event) {
|
|
2421
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2631
|
+
if (!_optionalChain([event, 'optionalAccess', _114 => _114.type])) return previous;
|
|
2422
2632
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
2423
2633
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
2424
2634
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
|
|
@@ -2480,9 +2690,9 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
2480
2690
|
if (state.type === "complete") {
|
|
2481
2691
|
return void 0;
|
|
2482
2692
|
}
|
|
2483
|
-
if (_optionalChain([state, 'access',
|
|
2693
|
+
if (_optionalChain([state, 'access', _115 => _115.lastEvent, 'optionalAccess', _116 => _116.type]) === "bridge-started" || _optionalChain([state, 'access', _117 => _117.lastEvent, 'optionalAccess', _118 => _118.type]) === "bridge-complete")
|
|
2484
2694
|
return "bridging";
|
|
2485
|
-
if (_optionalChain([state, 'access',
|
|
2695
|
+
if (_optionalChain([state, 'access', _119 => _119.lastEvent, 'optionalAccess', _120 => _120.type]) === "deposit-received") return "received";
|
|
2486
2696
|
return "confirming";
|
|
2487
2697
|
}
|
|
2488
2698
|
function ProcessingStep({
|
|
@@ -2502,7 +2712,7 @@ function ProcessingStep({
|
|
|
2502
2712
|
debug,
|
|
2503
2713
|
targetToken,
|
|
2504
2714
|
uiConfig,
|
|
2505
|
-
quotedFeeAmount
|
|
2715
|
+
quotedFeeAmount,
|
|
2506
2716
|
quotedFeeSymbol,
|
|
2507
2717
|
balanceAfterUsd,
|
|
2508
2718
|
onClose,
|
|
@@ -2563,7 +2773,7 @@ function ProcessingStep({
|
|
|
2563
2773
|
flowLabel
|
|
2564
2774
|
});
|
|
2565
2775
|
const context = processingContextRef.current;
|
|
2566
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2776
|
+
_optionalChain([onDepositCompleteRef, 'access', _121 => _121.current, 'optionalCall', _122 => _122(txHash, void 0, {
|
|
2567
2777
|
amount: context.amount,
|
|
2568
2778
|
sourceChain: context.sourceChain,
|
|
2569
2779
|
sourceToken: context.sourceToken,
|
|
@@ -2603,7 +2813,26 @@ function ProcessingStep({
|
|
|
2603
2813
|
updatePhaseTimings(
|
|
2604
2814
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
2605
2815
|
);
|
|
2606
|
-
}, [_optionalChain([state, 'access',
|
|
2816
|
+
}, [_optionalChain([state, 'access', _123 => _123.lastEvent, 'optionalAccess', _124 => _124.time]), _optionalChain([state, 'access', _125 => _125.lastEvent, 'optionalAccess', _126 => _126.type]), updatePhaseTimings]);
|
|
2817
|
+
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
2818
|
+
_react.useEffect.call(void 0, () => {
|
|
2819
|
+
let cancelled = false;
|
|
2820
|
+
service.fetchSwappedOrderStatus(smartAccount).then((res) => {
|
|
2821
|
+
if (cancelled || !res) return;
|
|
2822
|
+
if (!res.transactionId) return;
|
|
2823
|
+
if (res.transactionId.toLowerCase() !== txHash.toLowerCase()) return;
|
|
2824
|
+
setSwappedFiatContext({
|
|
2825
|
+
paidAmountUsd: res.paidAmountUsd,
|
|
2826
|
+
paidAmountEur: res.paidAmountEur,
|
|
2827
|
+
onrampFeeUsd: res.onrampFeeUsd,
|
|
2828
|
+
paymentMethod: res.paymentMethod
|
|
2829
|
+
});
|
|
2830
|
+
}).catch(() => {
|
|
2831
|
+
});
|
|
2832
|
+
return () => {
|
|
2833
|
+
cancelled = true;
|
|
2834
|
+
};
|
|
2835
|
+
}, [service, smartAccount, txHash]);
|
|
2607
2836
|
_react.useEffect.call(void 0, () => {
|
|
2608
2837
|
if (directTransfer) return;
|
|
2609
2838
|
if (state.type !== "processing") {
|
|
@@ -2628,21 +2857,21 @@ function ProcessingStep({
|
|
|
2628
2857
|
debugLog(debug, "processing", "poll:event", {
|
|
2629
2858
|
type: lastEvent2.type,
|
|
2630
2859
|
matchesTx: eventMatchesTx,
|
|
2631
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
2860
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _127 => _127.intentId])
|
|
2632
2861
|
});
|
|
2633
2862
|
}
|
|
2634
2863
|
if (!isMounted) return;
|
|
2635
2864
|
const awaitingPostBridgeSwap = processingContextRef.current.hasPostBridgeActions;
|
|
2636
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2865
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _128 => _128.type]) === "post-bridge-swap-complete") {
|
|
2637
2866
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2638
|
-
const swapTxHash = _optionalChain([eventForCurrentTx, 'access',
|
|
2867
|
+
const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _129 => _129.data, 'optionalAccess', _130 => _130.swap, 'optionalAccess', _131 => _131.transactionHash]);
|
|
2639
2868
|
debugLog(debug, "processing", "state:complete", {
|
|
2640
2869
|
txHash,
|
|
2641
2870
|
destinationTxHash: swapTxHash,
|
|
2642
2871
|
event: eventForCurrentTx.type
|
|
2643
2872
|
});
|
|
2644
2873
|
const context = processingContextRef.current;
|
|
2645
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2874
|
+
_optionalChain([onDepositCompleteRef, 'access', _132 => _132.current, 'optionalCall', _133 => _133(txHash, swapTxHash, {
|
|
2646
2875
|
amount: context.amount,
|
|
2647
2876
|
sourceChain: context.sourceChain,
|
|
2648
2877
|
sourceToken: context.sourceToken,
|
|
@@ -2651,7 +2880,7 @@ function ProcessingStep({
|
|
|
2651
2880
|
})]);
|
|
2652
2881
|
return;
|
|
2653
2882
|
}
|
|
2654
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2883
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _134 => _134.type]) === "post-bridge-swap-failed") {
|
|
2655
2884
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
2656
2885
|
setState({
|
|
2657
2886
|
type: "failed",
|
|
@@ -2663,19 +2892,19 @@ function ProcessingStep({
|
|
|
2663
2892
|
message: formatted.message,
|
|
2664
2893
|
code: formatted.code
|
|
2665
2894
|
});
|
|
2666
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2895
|
+
_optionalChain([onDepositFailedRef, 'access', _135 => _135.current, 'optionalCall', _136 => _136(txHash, formatted.message)]);
|
|
2667
2896
|
return;
|
|
2668
2897
|
}
|
|
2669
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2898
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _137 => _137.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
2670
2899
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
2671
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
2900
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _138 => _138.data, 'optionalAccess', _139 => _139.destination, 'optionalAccess', _140 => _140.transactionHash]);
|
|
2672
2901
|
debugLog(debug, "processing", "state:complete", {
|
|
2673
2902
|
txHash,
|
|
2674
2903
|
destinationTxHash: destinationTxHash2,
|
|
2675
2904
|
event: eventForCurrentTx.type
|
|
2676
2905
|
});
|
|
2677
2906
|
const context = processingContextRef.current;
|
|
2678
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2907
|
+
_optionalChain([onDepositCompleteRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142(txHash, destinationTxHash2, {
|
|
2679
2908
|
amount: context.amount,
|
|
2680
2909
|
sourceChain: context.sourceChain,
|
|
2681
2910
|
sourceToken: context.sourceToken,
|
|
@@ -2684,7 +2913,7 @@ function ProcessingStep({
|
|
|
2684
2913
|
})]);
|
|
2685
2914
|
return;
|
|
2686
2915
|
}
|
|
2687
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2916
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _143 => _143.type]) === "bridge-failed") {
|
|
2688
2917
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
2689
2918
|
setState({
|
|
2690
2919
|
type: "failed",
|
|
@@ -2696,11 +2925,11 @@ function ProcessingStep({
|
|
|
2696
2925
|
message: formatted.message,
|
|
2697
2926
|
code: formatted.code
|
|
2698
2927
|
});
|
|
2699
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2928
|
+
_optionalChain([onDepositFailedRef, 'access', _144 => _144.current, 'optionalCall', _145 => _145(txHash, formatted.message)]);
|
|
2700
2929
|
return;
|
|
2701
2930
|
}
|
|
2702
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
2703
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
2931
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _146 => _146.type]) === "error") {
|
|
2932
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _147 => _147.data, 'optionalAccess', _148 => _148.message]), () => ( "Unknown error"));
|
|
2704
2933
|
setState({
|
|
2705
2934
|
type: "failed",
|
|
2706
2935
|
message: errorMessage,
|
|
@@ -2710,7 +2939,7 @@ function ProcessingStep({
|
|
|
2710
2939
|
txHash,
|
|
2711
2940
|
message: errorMessage
|
|
2712
2941
|
});
|
|
2713
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2942
|
+
_optionalChain([onDepositFailedRef, 'access', _149 => _149.current, 'optionalCall', _150 => _150(txHash, errorMessage)]);
|
|
2714
2943
|
return;
|
|
2715
2944
|
}
|
|
2716
2945
|
setState((previous) => ({
|
|
@@ -2771,7 +3000,7 @@ function ProcessingStep({
|
|
|
2771
3000
|
txHash,
|
|
2772
3001
|
timeoutMs: ESCALATED_DELAY_MS
|
|
2773
3002
|
});
|
|
2774
|
-
_optionalChain([onErrorRef, 'access',
|
|
3003
|
+
_optionalChain([onErrorRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(message, "PROCESS_TIMEOUT")]);
|
|
2775
3004
|
}, ESCALATED_DELAY_MS);
|
|
2776
3005
|
return () => clearTimeout(timeoutId);
|
|
2777
3006
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -2783,8 +3012,8 @@ function ProcessingStep({
|
|
|
2783
3012
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
2784
3013
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
2785
3014
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
2786
|
-
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess',
|
|
2787
|
-
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess',
|
|
3015
|
+
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _153 => _153.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _154 => _154.type]) === "post-bridge-swap-failed";
|
|
3016
|
+
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _155 => _155.data, 'optionalAccess', _156 => _156.swap, 'optionalAccess', _157 => _157.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _158 => _158.data, 'optionalAccess', _159 => _159.destination, 'optionalAccess', _160 => _160.transactionHash]) || null;
|
|
2788
3017
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
2789
3018
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
2790
3019
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
@@ -2797,6 +3026,7 @@ function ProcessingStep({
|
|
|
2797
3026
|
displaySourceToken,
|
|
2798
3027
|
displaySourceChain
|
|
2799
3028
|
) : _nullishCoalesce(providedSourceDecimals, () => ( 18));
|
|
3029
|
+
const amountMaxDigits = maxFractionDigitsFor(sourceSymbol);
|
|
2800
3030
|
const formattedReceivedAmount = (() => {
|
|
2801
3031
|
try {
|
|
2802
3032
|
const raw = _viem.formatUnits.call(void 0, BigInt(displayAmount), sourceDecimals);
|
|
@@ -2804,15 +3034,56 @@ function ProcessingStep({
|
|
|
2804
3034
|
if (!Number.isFinite(numeric)) return raw;
|
|
2805
3035
|
return numeric.toLocaleString("en-US", {
|
|
2806
3036
|
minimumFractionDigits: 2,
|
|
2807
|
-
maximumFractionDigits:
|
|
3037
|
+
maximumFractionDigits: amountMaxDigits
|
|
2808
3038
|
});
|
|
2809
|
-
} catch (
|
|
3039
|
+
} catch (e6) {
|
|
2810
3040
|
return Number(displayAmount).toLocaleString("en-US", {
|
|
2811
3041
|
minimumFractionDigits: 2,
|
|
2812
|
-
maximumFractionDigits:
|
|
3042
|
+
maximumFractionDigits: amountMaxDigits
|
|
2813
3043
|
});
|
|
2814
3044
|
}
|
|
2815
3045
|
})();
|
|
3046
|
+
const destinationAmountRaw = (() => {
|
|
3047
|
+
const dest = _optionalChain([lastEvent, 'optionalAccess', _161 => _161.data, 'optionalAccess', _162 => _162.destination]);
|
|
3048
|
+
if (!dest || dest.amount === void 0) return void 0;
|
|
3049
|
+
try {
|
|
3050
|
+
return BigInt(dest.amount);
|
|
3051
|
+
} catch (e7) {
|
|
3052
|
+
return void 0;
|
|
3053
|
+
}
|
|
3054
|
+
})();
|
|
3055
|
+
const sourceAmountRaw = (() => {
|
|
3056
|
+
try {
|
|
3057
|
+
return BigInt(displayAmount);
|
|
3058
|
+
} catch (e8) {
|
|
3059
|
+
return void 0;
|
|
3060
|
+
}
|
|
3061
|
+
})();
|
|
3062
|
+
const bridgingCostRaw = sourceAmountRaw !== void 0 && destinationAmountRaw !== void 0 && sourceAmountRaw > destinationAmountRaw ? sourceAmountRaw - destinationAmountRaw : void 0;
|
|
3063
|
+
const formattedDestinationAmount = destinationAmountRaw !== void 0 ? (() => {
|
|
3064
|
+
try {
|
|
3065
|
+
const raw = _viem.formatUnits.call(void 0, destinationAmountRaw, sourceDecimals);
|
|
3066
|
+
const numeric = Number(raw);
|
|
3067
|
+
if (!Number.isFinite(numeric)) return raw;
|
|
3068
|
+
return numeric.toLocaleString("en-US", {
|
|
3069
|
+
maximumFractionDigits: amountMaxDigits
|
|
3070
|
+
});
|
|
3071
|
+
} catch (e9) {
|
|
3072
|
+
return void 0;
|
|
3073
|
+
}
|
|
3074
|
+
})() : void 0;
|
|
3075
|
+
const formattedBridgingCost = bridgingCostRaw !== void 0 ? (() => {
|
|
3076
|
+
try {
|
|
3077
|
+
const raw = _viem.formatUnits.call(void 0, bridgingCostRaw, sourceDecimals);
|
|
3078
|
+
const numeric = Number(raw);
|
|
3079
|
+
if (!Number.isFinite(numeric)) return raw;
|
|
3080
|
+
return numeric.toLocaleString("en-US", {
|
|
3081
|
+
maximumFractionDigits: amountMaxDigits
|
|
3082
|
+
});
|
|
3083
|
+
} catch (e10) {
|
|
3084
|
+
return void 0;
|
|
3085
|
+
}
|
|
3086
|
+
})() : void 0;
|
|
2816
3087
|
const currentPhaseId = getCurrentPhaseId(state, phaseTimings);
|
|
2817
3088
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
2818
3089
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
@@ -2830,8 +3101,8 @@ function ProcessingStep({
|
|
|
2830
3101
|
const sourceChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, displaySourceChain);
|
|
2831
3102
|
const targetChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
2832
3103
|
const timerText = formatTimer(elapsedSeconds);
|
|
2833
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2834
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3104
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _163 => _163.feeSponsored]), () => ( false));
|
|
3105
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _164 => _164.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
2835
3106
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
2836
3107
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
2837
3108
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -2885,11 +3156,29 @@ function ProcessingStep({
|
|
|
2885
3156
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: isProcessing ? "Time elapsed" : "Total time" }),
|
|
2886
3157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
2887
3158
|
] }),
|
|
2888
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2889
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "
|
|
3159
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _165 => _165.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3160
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Paid" }),
|
|
3161
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3162
|
+
"$",
|
|
3163
|
+
swappedFiatContext.paidAmountUsd.toFixed(2),
|
|
3164
|
+
swappedFiatContext.paymentMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "#71717b", marginLeft: 6 }, children: [
|
|
3165
|
+
"via ",
|
|
3166
|
+
swappedFiatContext.paymentMethod
|
|
3167
|
+
] })
|
|
3168
|
+
] })
|
|
3169
|
+
] }),
|
|
3170
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _166 => _166.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3171
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
3172
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3173
|
+
"$",
|
|
3174
|
+
swappedFiatContext.onrampFeeUsd.toFixed(2)
|
|
3175
|
+
] })
|
|
3176
|
+
] }),
|
|
3177
|
+
formattedBridgingCost && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3178
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Bridging cost" }),
|
|
2890
3179
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2891
3180
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
2892
|
-
|
|
3181
|
+
formattedBridgingCost,
|
|
2893
3182
|
" ",
|
|
2894
3183
|
sourceSymbol
|
|
2895
3184
|
] }),
|
|
@@ -2899,12 +3188,7 @@ function ProcessingStep({
|
|
|
2899
3188
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2900
3189
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
2901
3190
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2902
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2903
|
-
"~",
|
|
2904
|
-
formattedReceivedAmount,
|
|
2905
|
-
" ",
|
|
2906
|
-
targetSymbol
|
|
2907
|
-
] }),
|
|
3191
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: formattedDestinationAmount ? `${formattedDestinationAmount} ${targetSymbol}` : `~${formattedReceivedAmount} ${targetSymbol}` }),
|
|
2908
3192
|
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
2909
3193
|
] })
|
|
2910
3194
|
] }),
|
|
@@ -2915,14 +3199,18 @@ function ProcessingStep({
|
|
|
2915
3199
|
balanceAfterUsd.toFixed(2)
|
|
2916
3200
|
] })
|
|
2917
3201
|
] }),
|
|
2918
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3202
|
+
quotedFeeAmount !== void 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2919
3203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
2920
3204
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2921
|
-
/* @__PURE__ */ _jsxruntime.
|
|
3205
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2922
3206
|
"span",
|
|
2923
3207
|
{
|
|
2924
3208
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
2925
|
-
children:
|
|
3209
|
+
children: [
|
|
3210
|
+
quotedFeeAmount,
|
|
3211
|
+
" ",
|
|
3212
|
+
_nullishCoalesce(quotedFeeSymbol, () => ( sourceSymbol))
|
|
3213
|
+
]
|
|
2926
3214
|
}
|
|
2927
3215
|
),
|
|
2928
3216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {}) }) })
|
|
@@ -3279,7 +3567,7 @@ function loadSessionOwnerFromStorage(eoaAddress) {
|
|
|
3279
3567
|
privateKey: parsed.privateKey,
|
|
3280
3568
|
address: account.address
|
|
3281
3569
|
};
|
|
3282
|
-
} catch (
|
|
3570
|
+
} catch (e11) {
|
|
3283
3571
|
return null;
|
|
3284
3572
|
}
|
|
3285
3573
|
}
|
|
@@ -3361,4 +3649,9 @@ function accountFromPrivateKey(privateKey) {
|
|
|
3361
3649
|
|
|
3362
3650
|
|
|
3363
3651
|
|
|
3364
|
-
|
|
3652
|
+
|
|
3653
|
+
|
|
3654
|
+
|
|
3655
|
+
|
|
3656
|
+
|
|
3657
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BankIcon = BankIcon; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.Callout = Callout; exports.debugLog = debugLog; exports.debugError = debugError; exports.toEvmCaip2 = toEvmCaip2; exports.targetChainToCaip2 = targetChainToCaip2; exports.parseEvmChainId = parseEvmChainId; exports.isSolanaCaip2 = isSolanaCaip2; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.ProcessingStep = ProcessingStep; exports.SAFE_ABI = SAFE_ABI; exports.executeSafeEthTransfer = executeSafeEthTransfer; exports.executeSafeErc20Transfer = executeSafeErc20Transfer; exports.buildSafeTransaction = buildSafeTransaction; exports.getPublicClient = getPublicClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|