@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 @@ import {
|
|
|
13
13
|
getTokenSymbol,
|
|
14
14
|
isSolanaCaip2,
|
|
15
15
|
parseEvmChainId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CPMHRMPH.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/ui/Modal.tsx
|
|
19
19
|
import {
|
|
@@ -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",
|
|
@@ -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 = 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,
|
|
@@ -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__ */ jsx17("rect", { width: "
|
|
2298
|
+
/* @__PURE__ */ jsx17("rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
|
|
2235
2299
|
/* @__PURE__ */ jsx17(
|
|
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__ */ jsx17("rect", { width: "
|
|
2321
|
+
/* @__PURE__ */ jsx17("rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
|
|
2258
2322
|
/* @__PURE__ */ jsx17(
|
|
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__ */ jsx17("rect", { width: "
|
|
2365
|
+
/* @__PURE__ */ jsx17("rect", { width: "38", height: "24", rx: "4.2985", fill: "#006FCF" }),
|
|
2302
2366
|
/* @__PURE__ */ jsx17(
|
|
2303
2367
|
"path",
|
|
2304
2368
|
{
|
|
@@ -2826,21 +2890,25 @@ Tooltip.displayName = "Tooltip";
|
|
|
2826
2890
|
// src/components/ui/FeesAccordion.tsx
|
|
2827
2891
|
import { useState as useState3 } from "react";
|
|
2828
2892
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2829
|
-
function FeesAccordion({ total, rows }) {
|
|
2893
|
+
function FeesAccordion({ total, rows, tooltip }) {
|
|
2830
2894
|
const [open, setOpen] = useState3(false);
|
|
2831
2895
|
const expandable = rows.length > 0;
|
|
2832
2896
|
return /* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion", children: [
|
|
2833
|
-
/* @__PURE__ */ jsxs19(
|
|
2834
|
-
"
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2897
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion-summary", children: [
|
|
2898
|
+
/* @__PURE__ */ jsxs19("span", { className: "rs-fees-accordion-label", children: [
|
|
2899
|
+
/* @__PURE__ */ jsx21("span", { children: "Fees" }),
|
|
2900
|
+
tooltip && /* @__PURE__ */ jsx21(Tooltip, { content: tooltip, children: /* @__PURE__ */ jsx21("span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ jsx21(InfoIcon, {}) }) })
|
|
2901
|
+
] }),
|
|
2902
|
+
/* @__PURE__ */ jsxs19(
|
|
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__ */ jsx21("span", { children: total }),
|
|
2845
2913
|
expandable && /* @__PURE__ */ jsx21(
|
|
2846
2914
|
"span",
|
|
@@ -2850,13 +2918,29 @@ function FeesAccordion({ total, rows }) {
|
|
|
2850
2918
|
children: /* @__PURE__ */ jsx21(ChevronDownIcon, {})
|
|
2851
2919
|
}
|
|
2852
2920
|
)
|
|
2853
|
-
]
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
),
|
|
2921
|
+
]
|
|
2922
|
+
}
|
|
2923
|
+
)
|
|
2924
|
+
] }),
|
|
2857
2925
|
expandable && open && /* @__PURE__ */ jsx21("div", { className: "rs-fees-accordion-rows", children: rows.map((row, i) => /* @__PURE__ */ jsxs19("div", { className: "rs-fees-accordion-row", children: [
|
|
2858
2926
|
/* @__PURE__ */ jsx21("span", { children: row.label }),
|
|
2859
|
-
/* @__PURE__ */
|
|
2927
|
+
/* @__PURE__ */ jsxs19("span", { className: "rs-review-detail-value", children: [
|
|
2928
|
+
/* @__PURE__ */ jsx21(
|
|
2929
|
+
"span",
|
|
2930
|
+
{
|
|
2931
|
+
className: row.strike ? "rs-review-detail-value--strike" : void 0,
|
|
2932
|
+
children: row.value
|
|
2933
|
+
}
|
|
2934
|
+
),
|
|
2935
|
+
row.tooltip && /* @__PURE__ */ jsx21(Tooltip, { content: row.tooltip, children: /* @__PURE__ */ jsx21(
|
|
2936
|
+
"span",
|
|
2937
|
+
{
|
|
2938
|
+
className: "rs-review-detail-info",
|
|
2939
|
+
"aria-label": `${row.label} info`,
|
|
2940
|
+
children: /* @__PURE__ */ jsx21(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__ */ jsx22("span", { className: "rs-review-detail-value", children: amountPaid })
|
|
2893
2978
|
] }),
|
|
2894
2979
|
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
2895
|
-
/* @__PURE__ */ jsx22("span", { children: "
|
|
2980
|
+
/* @__PURE__ */ jsx22("span", { children: "Deposited amount" }),
|
|
2896
2981
|
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
2897
2982
|
/* @__PURE__ */ jsx22("span", { children: depositedAmount }),
|
|
2898
2983
|
depositedIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: depositedIcon, alt: "" }) })
|
|
2899
2984
|
] })
|
|
2900
2985
|
] }),
|
|
2901
|
-
feesTotal != null && /* @__PURE__ */ jsx22(
|
|
2986
|
+
feesTotal != null && /* @__PURE__ */ jsx22(
|
|
2987
|
+
FeesAccordion,
|
|
2988
|
+
{
|
|
2989
|
+
total: feesTotal,
|
|
2990
|
+
rows: feeRows ?? [],
|
|
2991
|
+
tooltip: feesTooltip ?? void 0
|
|
2992
|
+
}
|
|
2993
|
+
)
|
|
2902
2994
|
] }),
|
|
2903
2995
|
/* @__PURE__ */ jsxs20("div", { className: "rs-screen-button-row", children: [
|
|
2904
2996
|
onNewDeposit && /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
@@ -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 `$${normalizeFeeUsd(value)?.toFixed(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 {
|
|
@@ -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,
|
|
@@ -3612,27 +3737,61 @@ function ProcessingStep({
|
|
|
3612
3737
|
const [swappedFiatContext, setSwappedFiatContext] = useState5(null);
|
|
3613
3738
|
useEffect6(() => {
|
|
3614
3739
|
let cancelled = false;
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3740
|
+
let timeoutId;
|
|
3741
|
+
const isFiatSwappedOrder = isSwappedOrder && swappedContext?.variant === "fiat";
|
|
3742
|
+
const expectedOrderUuid = swappedContext?.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 {
|
|
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
|
+
swappedContext?.variant,
|
|
3793
|
+
swappedContext?.expectedOrderUuid
|
|
3794
|
+
]);
|
|
3636
3795
|
useEffect6(() => {
|
|
3637
3796
|
if (directTransfer) return;
|
|
3638
3797
|
if (state.type !== "processing") {
|
|
@@ -3880,21 +4039,37 @@ function ProcessingStep({
|
|
|
3880
4039
|
const amountPaid = connectPaidAmount ?? (swappedFiatContext?.paidAmountUsd != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null);
|
|
3881
4040
|
const depositedAmount = receiveDisplay;
|
|
3882
4041
|
const onrampFeeUsd = swappedFiatContext?.onrampFeeUsd ?? null;
|
|
3883
|
-
const
|
|
4042
|
+
const quoteFees = getMarketNetworkFees(quoteFeeBreakdown);
|
|
4043
|
+
const fallbackNetworkFeeUsd = quoteFees === null && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
4044
|
+
const marketFeeUsd = quoteFees?.marketUsd ?? null;
|
|
4045
|
+
const networkFeeUsd = quoteFees?.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 : (marketFeeUsd ?? 0) + (networkFeeUsd ?? 0);
|
|
4072
|
+
const feesTotal = feeRows.length > 0 ? formatUsdFee((onrampFeeUsd ?? 0) + chargeableQuoteFeeUsd) : null;
|
|
3898
4073
|
return /* @__PURE__ */ jsx23(
|
|
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
|