@rhinestone/deposit-modal 0.4.2 → 0.5.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-ORSBSEMO.mjs → DepositModalReown-6AO4QURQ.mjs} +4 -3
- package/dist/{DepositModalReown-MCDIOJLT.cjs → DepositModalReown-GHEUERDG.cjs} +7 -6
- package/dist/{WithdrawModalReown-L4SWLONE.mjs → WithdrawModalReown-FRMD2ACH.mjs} +12 -4
- package/dist/{WithdrawModalReown-AZ27OBAV.cjs → WithdrawModalReown-LIP6FHCB.cjs} +14 -6
- package/dist/{chunk-PQDHZZ2B.cjs → chunk-H7727ABX.cjs} +28 -6
- package/dist/{chunk-V72YVCR6.mjs → chunk-LCKO6C76.mjs} +28 -6
- package/dist/{chunk-36R7XKXP.cjs → chunk-MXFZ6Q7F.cjs} +365 -336
- package/dist/{chunk-EDUWRMQI.cjs → chunk-PPFG3VBD.cjs} +123 -88
- package/dist/{chunk-7EQQD7B4.mjs → chunk-PS7HJ62M.mjs} +51 -16
- package/dist/{chunk-7JVBUMFE.mjs → chunk-V6KJKRE7.mjs} +42 -12
- package/dist/{chunk-PNN2YBPF.cjs → chunk-XQH2APMO.cjs} +126 -96
- package/dist/{chunk-ANPDY6NJ.mjs → chunk-ZYYLKWU2.mjs} +70 -41
- 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 +59 -31
- package/dist/{types-CUOqIIvZ.d.cts → types-_m8w8BYq.d.cts} +29 -2
- package/dist/{types-CUOqIIvZ.d.ts → types-_m8w8BYq.d.ts} +29 -2
- 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 +9 -8
|
@@ -1395,31 +1395,49 @@ function formatUserError(raw) {
|
|
|
1395
1395
|
return cleaned;
|
|
1396
1396
|
}
|
|
1397
1397
|
|
|
1398
|
+
// src/core/rpc.ts
|
|
1399
|
+
|
|
1400
|
+
function rpcUrlFor(rpcUrls, chain) {
|
|
1401
|
+
const url = _optionalChain([rpcUrls, 'optionalAccess', _50 => _50[chain], 'optionalAccess', _51 => _51.trim, 'call', _52 => _52()]);
|
|
1402
|
+
return url ? url : void 0;
|
|
1403
|
+
}
|
|
1404
|
+
var RpcUrlsContext = _react.createContext.call(void 0, void 0);
|
|
1405
|
+
var RpcUrlsProvider = RpcUrlsContext.Provider;
|
|
1406
|
+
function useRpcUrls() {
|
|
1407
|
+
return _react.useContext.call(void 0, RpcUrlsContext);
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1398
1410
|
// src/core/public-client.ts
|
|
1399
1411
|
var _viem = require('viem');
|
|
1400
1412
|
var _chains = require('viem/chains');
|
|
1401
1413
|
var clientCache = /* @__PURE__ */ new Map();
|
|
1402
|
-
function getPublicClient(chainId) {
|
|
1403
|
-
|
|
1414
|
+
function getPublicClient(chainId, rpcUrls) {
|
|
1415
|
+
const url = rpcUrlFor(rpcUrls, chainId);
|
|
1416
|
+
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1417
|
+
let client = clientCache.get(cacheKey);
|
|
1404
1418
|
if (!client) {
|
|
1405
1419
|
const chain = _chunkABVRVW3Pcjs.CHAIN_BY_ID[chainId];
|
|
1406
1420
|
client = _viem.createPublicClient.call(void 0, {
|
|
1407
1421
|
chain,
|
|
1408
|
-
transport: _viem.http.call(void 0, )
|
|
1422
|
+
transport: _viem.http.call(void 0, url)
|
|
1409
1423
|
});
|
|
1410
|
-
clientCache.set(
|
|
1424
|
+
clientCache.set(cacheKey, client);
|
|
1411
1425
|
}
|
|
1412
1426
|
return client;
|
|
1413
1427
|
}
|
|
1414
|
-
var
|
|
1415
|
-
function getHyperEvmReadClient() {
|
|
1416
|
-
|
|
1417
|
-
|
|
1428
|
+
var hyperEvmClientCache = /* @__PURE__ */ new Map();
|
|
1429
|
+
function getHyperEvmReadClient(rpcUrls) {
|
|
1430
|
+
const url = rpcUrlFor(rpcUrls, _chains.hyperliquid.id);
|
|
1431
|
+
const cacheKey = _nullishCoalesce(url, () => ( ""));
|
|
1432
|
+
let client = hyperEvmClientCache.get(cacheKey);
|
|
1433
|
+
if (!client) {
|
|
1434
|
+
client = _viem.createPublicClient.call(void 0, {
|
|
1418
1435
|
chain: _chains.hyperliquid,
|
|
1419
|
-
transport: _viem.http.call(void 0, )
|
|
1436
|
+
transport: _viem.http.call(void 0, url)
|
|
1420
1437
|
});
|
|
1438
|
+
hyperEvmClientCache.set(cacheKey, client);
|
|
1421
1439
|
}
|
|
1422
|
-
return
|
|
1440
|
+
return client;
|
|
1423
1441
|
}
|
|
1424
1442
|
|
|
1425
1443
|
// src/core/theme.ts
|
|
@@ -1524,19 +1542,19 @@ var CUSTOM_PRIMARY_VARS = [
|
|
|
1524
1542
|
function applyTheme(element, theme) {
|
|
1525
1543
|
if (!element) return;
|
|
1526
1544
|
const parent = element.parentElement;
|
|
1527
|
-
const targets = _optionalChain([parent, 'optionalAccess',
|
|
1528
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1545
|
+
const targets = _optionalChain([parent, 'optionalAccess', _53 => _53.classList, 'access', _54 => _54.contains, 'call', _55 => _55("rs-modal-content")]) ? [element, parent] : [element];
|
|
1546
|
+
if (_optionalChain([theme, 'optionalAccess', _56 => _56.mode])) {
|
|
1529
1547
|
for (const t of targets) t.setAttribute("data-theme", theme.mode);
|
|
1530
1548
|
} else {
|
|
1531
1549
|
for (const t of targets) t.removeAttribute("data-theme");
|
|
1532
1550
|
}
|
|
1533
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1551
|
+
if (_optionalChain([theme, 'optionalAccess', _57 => _57.fontColor])) {
|
|
1534
1552
|
setVar(targets, "--rs-foreground", theme.fontColor);
|
|
1535
1553
|
}
|
|
1536
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1554
|
+
if (_optionalChain([theme, 'optionalAccess', _58 => _58.iconColor])) {
|
|
1537
1555
|
setVar(targets, "--rs-icon", theme.iconColor);
|
|
1538
1556
|
}
|
|
1539
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1557
|
+
if (_optionalChain([theme, 'optionalAccess', _59 => _59.ctaColor])) {
|
|
1540
1558
|
const derived = deriveCustomPrimary(theme.ctaColor);
|
|
1541
1559
|
if (derived) {
|
|
1542
1560
|
setVar(targets, "--rs-primary", derived.base);
|
|
@@ -1561,18 +1579,18 @@ function applyTheme(element, theme) {
|
|
|
1561
1579
|
}
|
|
1562
1580
|
} else {
|
|
1563
1581
|
for (const v of CUSTOM_PRIMARY_VARS) clearVar(targets, v);
|
|
1564
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1582
|
+
if (_optionalChain([theme, 'optionalAccess', _60 => _60.ctaHoverColor])) {
|
|
1565
1583
|
setVar(targets, "--rs-primary-hover", theme.ctaHoverColor);
|
|
1566
1584
|
}
|
|
1567
1585
|
}
|
|
1568
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1586
|
+
if (_optionalChain([theme, 'optionalAccess', _61 => _61.borderColor])) {
|
|
1569
1587
|
setVar(targets, "--rs-border", theme.borderColor);
|
|
1570
1588
|
setVar(targets, "--rs-border-surface", theme.borderColor);
|
|
1571
1589
|
}
|
|
1572
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1590
|
+
if (_optionalChain([theme, 'optionalAccess', _62 => _62.backgroundColor])) {
|
|
1573
1591
|
setVar(targets, "--rs-background", theme.backgroundColor);
|
|
1574
1592
|
}
|
|
1575
|
-
if (_optionalChain([theme, 'optionalAccess',
|
|
1593
|
+
if (_optionalChain([theme, 'optionalAccess', _63 => _63.radius])) {
|
|
1576
1594
|
const scale = RADIUS_SCALE[theme.radius];
|
|
1577
1595
|
setVar(targets, "--rs-radius-sm", scale.sm);
|
|
1578
1596
|
setVar(targets, "--rs-radius-md", scale.md);
|
|
@@ -1755,7 +1773,7 @@ function ListRow({
|
|
|
1755
1773
|
if (disabled) return;
|
|
1756
1774
|
if (e.key === "Enter" || e.key === " ") {
|
|
1757
1775
|
e.preventDefault();
|
|
1758
|
-
_optionalChain([onClick, 'optionalCall',
|
|
1776
|
+
_optionalChain([onClick, 'optionalCall', _64 => _64(e)]);
|
|
1759
1777
|
}
|
|
1760
1778
|
};
|
|
1761
1779
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1765,7 +1783,7 @@ function ListRow({
|
|
|
1765
1783
|
role: "button",
|
|
1766
1784
|
tabIndex: disabled ? -1 : 0,
|
|
1767
1785
|
"aria-disabled": disabled || void 0,
|
|
1768
|
-
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall',
|
|
1786
|
+
onClick: disabled ? void 0 : (e) => _optionalChain([onClick, 'optionalCall', _65 => _65(e)]),
|
|
1769
1787
|
onKeyDown: handleKey,
|
|
1770
1788
|
children: inner
|
|
1771
1789
|
}
|
|
@@ -2386,7 +2404,7 @@ function ConnectStep({
|
|
|
2386
2404
|
const hasReownWallet = rows.some(
|
|
2387
2405
|
(row) => row.kind === "external" || row.kind === "solana"
|
|
2388
2406
|
);
|
|
2389
|
-
const showDappImports = (_nullishCoalesce(_optionalChain([dappImports, 'optionalAccess',
|
|
2407
|
+
const showDappImports = (_nullishCoalesce(_optionalChain([dappImports, 'optionalAccess', _66 => _66.length]), () => ( 0))) > 0;
|
|
2390
2408
|
const defaultSubtitle = onSelectTransferCrypto ? "Add money to your balance" : "Choose a wallet to continue";
|
|
2391
2409
|
const cryptoRows = [];
|
|
2392
2410
|
if (onSelectTransferCrypto) {
|
|
@@ -2414,7 +2432,7 @@ function ConnectStep({
|
|
|
2414
2432
|
leading: renderWalletLeading(row),
|
|
2415
2433
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
2416
2434
|
subtitle: subtitleText,
|
|
2417
|
-
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall',
|
|
2435
|
+
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall', _67 => _67(row.id)]),
|
|
2418
2436
|
disabled: row.state === "loading",
|
|
2419
2437
|
trailing: renderRowTrailing(row.state)
|
|
2420
2438
|
},
|
|
@@ -2494,7 +2512,7 @@ function ConnectStep({
|
|
|
2494
2512
|
leading: row.icon,
|
|
2495
2513
|
title: row.label,
|
|
2496
2514
|
subtitle: formatBalanceUsd(row.status.balanceUsd),
|
|
2497
|
-
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall',
|
|
2515
|
+
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall', _68 => _68(row.id)])
|
|
2498
2516
|
},
|
|
2499
2517
|
row.id
|
|
2500
2518
|
)
|
|
@@ -2509,7 +2527,7 @@ function ConnectStep({
|
|
|
2509
2527
|
leading: row.icon,
|
|
2510
2528
|
title: row.label,
|
|
2511
2529
|
subtitle: row.status.reason,
|
|
2512
|
-
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall',
|
|
2530
|
+
onClick: () => _optionalChain([onSelectDappImport, 'optionalCall', _69 => _69(row.id)])
|
|
2513
2531
|
},
|
|
2514
2532
|
row.id
|
|
2515
2533
|
)
|
|
@@ -2678,8 +2696,8 @@ function Tooltip({ content, children, className }) {
|
|
|
2678
2696
|
function handleOutside(event) {
|
|
2679
2697
|
const target = event.target;
|
|
2680
2698
|
if (!target) return;
|
|
2681
|
-
if (_optionalChain([triggerRef, 'access',
|
|
2682
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
2699
|
+
if (_optionalChain([triggerRef, 'access', _70 => _70.current, 'optionalAccess', _71 => _71.contains, 'call', _72 => _72(target)])) return;
|
|
2700
|
+
if (_optionalChain([bubbleRef, 'access', _73 => _73.current, 'optionalAccess', _74 => _74.contains, 'call', _75 => _75(target)])) return;
|
|
2683
2701
|
setOpen(false);
|
|
2684
2702
|
}
|
|
2685
2703
|
function handleKey(event) {
|
|
@@ -2789,6 +2807,7 @@ FeesAccordion.displayName = "FeesAccordion";
|
|
|
2789
2807
|
|
|
2790
2808
|
function SwappedReceipt({
|
|
2791
2809
|
onrampMethod,
|
|
2810
|
+
onrampMethodIcon,
|
|
2792
2811
|
amountPaid,
|
|
2793
2812
|
depositedAmount,
|
|
2794
2813
|
depositedIcon,
|
|
@@ -2804,14 +2823,17 @@ function SwappedReceipt({
|
|
|
2804
2823
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
2805
2824
|
onrampMethod && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2806
2825
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Onramp method" }),
|
|
2807
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2826
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2827
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: onrampMethod }),
|
|
2828
|
+
onrampMethodIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon rs-review-detail-icon--square", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: onrampMethodIcon, alt: "" }) })
|
|
2829
|
+
] })
|
|
2808
2830
|
] }),
|
|
2809
2831
|
amountPaid && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2810
2832
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Amount paid" }),
|
|
2811
2833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: amountPaid })
|
|
2812
2834
|
] }),
|
|
2813
2835
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2814
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "
|
|
2836
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
2815
2837
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
2816
2838
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: depositedAmount }),
|
|
2817
2839
|
depositedIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: depositedIcon, alt: "" }) })
|
|
@@ -2842,7 +2864,7 @@ function asNumber(value) {
|
|
|
2842
2864
|
const trimmed = value.trim();
|
|
2843
2865
|
if (!trimmed) return void 0;
|
|
2844
2866
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
2845
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
2867
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _76 => _76[1]])) {
|
|
2846
2868
|
const parsed2 = Number(caipMatch[1]);
|
|
2847
2869
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
2848
2870
|
}
|
|
@@ -2861,28 +2883,28 @@ function asAddress(value) {
|
|
|
2861
2883
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
2862
2884
|
}
|
|
2863
2885
|
function getEventTxHash(event) {
|
|
2864
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2886
|
+
if (!_optionalChain([event, 'optionalAccess', _77 => _77.type])) return void 0;
|
|
2865
2887
|
if (event.type === "deposit-received") {
|
|
2866
|
-
return asString(_optionalChain([event, 'access',
|
|
2888
|
+
return asString(_optionalChain([event, 'access', _78 => _78.data, 'optionalAccess', _79 => _79.transactionHash]));
|
|
2867
2889
|
}
|
|
2868
2890
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
2869
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2870
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
2871
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
2891
|
+
const deposit = isRecord(_optionalChain([event, 'access', _80 => _80.data, 'optionalAccess', _81 => _81.deposit])) ? event.data.deposit : void 0;
|
|
2892
|
+
const source = isRecord(_optionalChain([event, 'access', _82 => _82.data, 'optionalAccess', _83 => _83.source])) ? event.data.source : void 0;
|
|
2893
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _84 => _84.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _85 => _85.transactionHash]))));
|
|
2872
2894
|
}
|
|
2873
2895
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
2874
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2875
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
2876
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
2896
|
+
const deposit = isRecord(_optionalChain([event, 'access', _86 => _86.data, 'optionalAccess', _87 => _87.deposit])) ? event.data.deposit : void 0;
|
|
2897
|
+
const source = isRecord(_optionalChain([event, 'access', _88 => _88.data, 'optionalAccess', _89 => _89.source])) ? event.data.source : void 0;
|
|
2898
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _90 => _90.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _91 => _91.transactionHash]))));
|
|
2877
2899
|
}
|
|
2878
2900
|
if (event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
2879
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
2880
|
-
return asString(_optionalChain([deposit, 'optionalAccess',
|
|
2901
|
+
const deposit = isRecord(_optionalChain([event, 'access', _92 => _92.data, 'optionalAccess', _93 => _93.deposit])) ? event.data.deposit : void 0;
|
|
2902
|
+
return asString(_optionalChain([deposit, 'optionalAccess', _94 => _94.transactionHash]));
|
|
2881
2903
|
}
|
|
2882
2904
|
return void 0;
|
|
2883
2905
|
}
|
|
2884
2906
|
function getEventSourceDetails(event) {
|
|
2885
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2907
|
+
if (!_optionalChain([event, 'optionalAccess', _95 => _95.type]) || !isRecord(event.data)) return {};
|
|
2886
2908
|
if (event.type === "deposit-received") {
|
|
2887
2909
|
return {
|
|
2888
2910
|
chainId: asNumber(event.data.chain),
|
|
@@ -2894,9 +2916,9 @@ function getEventSourceDetails(event) {
|
|
|
2894
2916
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2895
2917
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error" || event.type === "post-bridge-swap-complete" || event.type === "post-bridge-swap-failed") {
|
|
2896
2918
|
return {
|
|
2897
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
2898
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2899
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
2919
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _96 => _96.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _97 => _97.chain])))),
|
|
2920
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _98 => _98.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _99 => _99.amount])))),
|
|
2921
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _100 => _100.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _101 => _101.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _102 => _102.token]))))
|
|
2900
2922
|
};
|
|
2901
2923
|
}
|
|
2902
2924
|
return {};
|
|
@@ -2908,7 +2930,7 @@ function asChain(value) {
|
|
|
2908
2930
|
return asNumber(value);
|
|
2909
2931
|
}
|
|
2910
2932
|
function getEventDestinationDetails(event) {
|
|
2911
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2933
|
+
if (!_optionalChain([event, 'optionalAccess', _103 => _103.type]) || !isRecord(event.data)) return {};
|
|
2912
2934
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete" && event.type !== "post-bridge-swap-complete") {
|
|
2913
2935
|
return {};
|
|
2914
2936
|
}
|
|
@@ -2918,14 +2940,14 @@ function getEventDestinationDetails(event) {
|
|
|
2918
2940
|
return {
|
|
2919
2941
|
chainId: asChain(destination.chain),
|
|
2920
2942
|
amount: asAmount(destination.amount),
|
|
2921
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
2943
|
+
token: _optionalChain([token, 'optionalAccess', _104 => _104.trim, 'call', _105 => _105()]) || void 0
|
|
2922
2944
|
};
|
|
2923
2945
|
}
|
|
2924
2946
|
function isDepositEvent(event) {
|
|
2925
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2947
|
+
return _optionalChain([event, 'optionalAccess', _106 => _106.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _107 => _107.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _108 => _108.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _109 => _109.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _110 => _110.type]) === "post-bridge-swap-complete" || _optionalChain([event, 'optionalAccess', _111 => _111.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _112 => _112.type]) === "error";
|
|
2926
2948
|
}
|
|
2927
2949
|
function isFailedEvent(event) {
|
|
2928
|
-
return _optionalChain([event, 'optionalAccess',
|
|
2950
|
+
return _optionalChain([event, 'optionalAccess', _113 => _113.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _114 => _114.type]) === "post-bridge-swap-failed" || _optionalChain([event, 'optionalAccess', _115 => _115.type]) === "error";
|
|
2929
2951
|
}
|
|
2930
2952
|
function isHexString(value) {
|
|
2931
2953
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -2937,7 +2959,7 @@ function txRefsMatch(a, b) {
|
|
|
2937
2959
|
return a === b;
|
|
2938
2960
|
}
|
|
2939
2961
|
function formatBridgeFailedMessage(event) {
|
|
2940
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2962
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _116 => _116.data]), () => ( {}));
|
|
2941
2963
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
2942
2964
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2943
2965
|
function toUserFacingFailure(raw) {
|
|
@@ -2965,7 +2987,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2965
2987
|
return { message: "Bridge failed" };
|
|
2966
2988
|
}
|
|
2967
2989
|
function failureMessageForEvent(event) {
|
|
2968
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
2990
|
+
if (_optionalChain([event, 'optionalAccess', _117 => _117.type]) === "error") {
|
|
2969
2991
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
2970
2992
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
2971
2993
|
}
|
|
@@ -3002,15 +3024,15 @@ function resolveTokenDisplay(token, chain, fallback) {
|
|
|
3002
3024
|
const decimals = _chunkABVRVW3Pcjs.findTokenDecimals.call(void 0, token, chain);
|
|
3003
3025
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
3004
3026
|
return {
|
|
3005
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3006
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
3027
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _118 => _118.symbol]), () => ( symbol)),
|
|
3028
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _119 => _119.decimals])))
|
|
3007
3029
|
};
|
|
3008
3030
|
}
|
|
3009
3031
|
}
|
|
3010
3032
|
}
|
|
3011
3033
|
return {
|
|
3012
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3013
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
3034
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _120 => _120.symbol]), () => ( "Token")),
|
|
3035
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _121 => _121.decimals])
|
|
3014
3036
|
};
|
|
3015
3037
|
}
|
|
3016
3038
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -3233,12 +3255,12 @@ function isEventForTx(event, txHash) {
|
|
|
3233
3255
|
return txRefsMatch(eventTxHash, txHash);
|
|
3234
3256
|
}
|
|
3235
3257
|
function parseWebhookTimestamp(event) {
|
|
3236
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
3258
|
+
if (typeof _optionalChain([event, 'optionalAccess', _122 => _122.time]) !== "string") return void 0;
|
|
3237
3259
|
const timestamp = Date.parse(event.time);
|
|
3238
3260
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
3239
3261
|
}
|
|
3240
3262
|
function syncPhaseTimings(previous, event) {
|
|
3241
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3263
|
+
if (!_optionalChain([event, 'optionalAccess', _123 => _123.type])) return previous;
|
|
3242
3264
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
3243
3265
|
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;
|
|
3244
3266
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "post-bridge-swap-complete") && previous.bridgingAt === void 0;
|
|
@@ -3300,9 +3322,9 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
3300
3322
|
if (state.type === "complete") {
|
|
3301
3323
|
return void 0;
|
|
3302
3324
|
}
|
|
3303
|
-
if (_optionalChain([state, 'access',
|
|
3325
|
+
if (_optionalChain([state, 'access', _124 => _124.lastEvent, 'optionalAccess', _125 => _125.type]) === "bridge-started" || _optionalChain([state, 'access', _126 => _126.lastEvent, 'optionalAccess', _127 => _127.type]) === "bridge-complete")
|
|
3304
3326
|
return "bridging";
|
|
3305
|
-
if (_optionalChain([state, 'access',
|
|
3327
|
+
if (_optionalChain([state, 'access', _128 => _128.lastEvent, 'optionalAccess', _129 => _129.type]) === "deposit-received") return "received";
|
|
3306
3328
|
return "confirming";
|
|
3307
3329
|
}
|
|
3308
3330
|
function ProcessingStep({
|
|
@@ -3327,6 +3349,7 @@ function ProcessingStep({
|
|
|
3327
3349
|
quotedFeeSymbol,
|
|
3328
3350
|
balanceAfterUsd,
|
|
3329
3351
|
isSwappedOrder,
|
|
3352
|
+
swappedContext,
|
|
3330
3353
|
onClose,
|
|
3331
3354
|
onNewDeposit,
|
|
3332
3355
|
onRetry,
|
|
@@ -3387,7 +3410,7 @@ function ProcessingStep({
|
|
|
3387
3410
|
flowLabel
|
|
3388
3411
|
});
|
|
3389
3412
|
const context = processingContextRef.current;
|
|
3390
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3413
|
+
_optionalChain([onDepositCompleteRef, 'access', _130 => _130.current, 'optionalCall', _131 => _131(txHash, void 0, {
|
|
3391
3414
|
amount: context.amount,
|
|
3392
3415
|
sourceChain: context.sourceChain,
|
|
3393
3416
|
sourceToken: context.sourceToken,
|
|
@@ -3429,7 +3452,7 @@ function ProcessingStep({
|
|
|
3429
3452
|
updatePhaseTimings(
|
|
3430
3453
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
3431
3454
|
);
|
|
3432
|
-
}, [_optionalChain([state, 'access',
|
|
3455
|
+
}, [_optionalChain([state, 'access', _132 => _132.lastEvent, 'optionalAccess', _133 => _133.time]), _optionalChain([state, 'access', _134 => _134.lastEvent, 'optionalAccess', _135 => _135.type]), updatePhaseTimings]);
|
|
3433
3456
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
3434
3457
|
_react.useEffect.call(void 0, () => {
|
|
3435
3458
|
let cancelled = false;
|
|
@@ -3437,10 +3460,12 @@ function ProcessingStep({
|
|
|
3437
3460
|
if (cancelled || !res) return;
|
|
3438
3461
|
if (res.transactionId != null) {
|
|
3439
3462
|
if (res.transactionId.toLowerCase() !== txHash.toLowerCase()) return;
|
|
3440
|
-
} else if (!isSwappedOrder) {
|
|
3463
|
+
} else if (!isSwappedOrder || _optionalChain([swappedContext, 'optionalAccess', _136 => _136.variant]) === "connect") {
|
|
3441
3464
|
return;
|
|
3442
3465
|
}
|
|
3443
3466
|
setSwappedFiatContext({
|
|
3467
|
+
orderCrypto: res.orderCrypto,
|
|
3468
|
+
orderCryptoAmount: res.orderCryptoAmount,
|
|
3444
3469
|
paidAmountUsd: res.paidAmountUsd,
|
|
3445
3470
|
paidAmountEur: res.paidAmountEur,
|
|
3446
3471
|
onrampFeeUsd: res.onrampFeeUsd,
|
|
@@ -3451,7 +3476,7 @@ function ProcessingStep({
|
|
|
3451
3476
|
return () => {
|
|
3452
3477
|
cancelled = true;
|
|
3453
3478
|
};
|
|
3454
|
-
}, [service, smartAccount, txHash, isSwappedOrder]);
|
|
3479
|
+
}, [service, smartAccount, txHash, isSwappedOrder, _optionalChain([swappedContext, 'optionalAccess', _137 => _137.variant])]);
|
|
3455
3480
|
_react.useEffect.call(void 0, () => {
|
|
3456
3481
|
if (directTransfer) return;
|
|
3457
3482
|
if (state.type !== "processing") {
|
|
@@ -3476,21 +3501,21 @@ function ProcessingStep({
|
|
|
3476
3501
|
debugLog(debug, "processing", "poll:event", {
|
|
3477
3502
|
type: lastEvent2.type,
|
|
3478
3503
|
matchesTx: eventMatchesTx,
|
|
3479
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
3504
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _138 => _138.intentId])
|
|
3480
3505
|
});
|
|
3481
3506
|
}
|
|
3482
3507
|
if (!isMounted) return;
|
|
3483
3508
|
const awaitingPostBridgeSwap = processingContextRef.current.hasPostBridgeActions;
|
|
3484
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3509
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _139 => _139.type]) === "post-bridge-swap-complete") {
|
|
3485
3510
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3486
|
-
const swapTxHash = _optionalChain([eventForCurrentTx, 'access',
|
|
3511
|
+
const swapTxHash = _optionalChain([eventForCurrentTx, 'access', _140 => _140.data, 'optionalAccess', _141 => _141.swap, 'optionalAccess', _142 => _142.transactionHash]);
|
|
3487
3512
|
debugLog(debug, "processing", "state:complete", {
|
|
3488
3513
|
txHash,
|
|
3489
3514
|
destinationTxHash: swapTxHash,
|
|
3490
3515
|
event: eventForCurrentTx.type
|
|
3491
3516
|
});
|
|
3492
3517
|
const context = processingContextRef.current;
|
|
3493
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3518
|
+
_optionalChain([onDepositCompleteRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144(txHash, swapTxHash, {
|
|
3494
3519
|
amount: context.amount,
|
|
3495
3520
|
sourceChain: context.sourceChain,
|
|
3496
3521
|
sourceToken: context.sourceToken,
|
|
@@ -3501,7 +3526,7 @@ function ProcessingStep({
|
|
|
3501
3526
|
})]);
|
|
3502
3527
|
return;
|
|
3503
3528
|
}
|
|
3504
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3529
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _145 => _145.type]) === "post-bridge-swap-failed") {
|
|
3505
3530
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3506
3531
|
setState({
|
|
3507
3532
|
type: "failed",
|
|
@@ -3513,19 +3538,19 @@ function ProcessingStep({
|
|
|
3513
3538
|
message: formatted.message,
|
|
3514
3539
|
code: formatted.code
|
|
3515
3540
|
});
|
|
3516
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3541
|
+
_optionalChain([onDepositFailedRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147(txHash, formatted.message)]);
|
|
3517
3542
|
return;
|
|
3518
3543
|
}
|
|
3519
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3544
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _148 => _148.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
3520
3545
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3521
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
3546
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _149 => _149.data, 'optionalAccess', _150 => _150.destination, 'optionalAccess', _151 => _151.transactionHash]);
|
|
3522
3547
|
debugLog(debug, "processing", "state:complete", {
|
|
3523
3548
|
txHash,
|
|
3524
3549
|
destinationTxHash: destinationTxHash2,
|
|
3525
3550
|
event: eventForCurrentTx.type
|
|
3526
3551
|
});
|
|
3527
3552
|
const context = processingContextRef.current;
|
|
3528
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3553
|
+
_optionalChain([onDepositCompleteRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153(txHash, destinationTxHash2, {
|
|
3529
3554
|
amount: context.amount,
|
|
3530
3555
|
sourceChain: context.sourceChain,
|
|
3531
3556
|
sourceToken: context.sourceToken,
|
|
@@ -3536,7 +3561,7 @@ function ProcessingStep({
|
|
|
3536
3561
|
})]);
|
|
3537
3562
|
return;
|
|
3538
3563
|
}
|
|
3539
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3564
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _154 => _154.type]) === "bridge-failed") {
|
|
3540
3565
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3541
3566
|
setState({
|
|
3542
3567
|
type: "failed",
|
|
@@ -3548,11 +3573,11 @@ function ProcessingStep({
|
|
|
3548
3573
|
message: formatted.message,
|
|
3549
3574
|
code: formatted.code
|
|
3550
3575
|
});
|
|
3551
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3576
|
+
_optionalChain([onDepositFailedRef, 'access', _155 => _155.current, 'optionalCall', _156 => _156(txHash, formatted.message)]);
|
|
3552
3577
|
return;
|
|
3553
3578
|
}
|
|
3554
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3555
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
3579
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _157 => _157.type]) === "error") {
|
|
3580
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _158 => _158.data, 'optionalAccess', _159 => _159.message]), () => ( "Unknown error"));
|
|
3556
3581
|
setState({
|
|
3557
3582
|
type: "failed",
|
|
3558
3583
|
message: errorMessage,
|
|
@@ -3562,7 +3587,7 @@ function ProcessingStep({
|
|
|
3562
3587
|
txHash,
|
|
3563
3588
|
message: errorMessage
|
|
3564
3589
|
});
|
|
3565
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3590
|
+
_optionalChain([onDepositFailedRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161(txHash, errorMessage)]);
|
|
3566
3591
|
return;
|
|
3567
3592
|
}
|
|
3568
3593
|
setState((previous) => ({
|
|
@@ -3623,7 +3648,7 @@ function ProcessingStep({
|
|
|
3623
3648
|
txHash,
|
|
3624
3649
|
timeoutMs: ESCALATED_DELAY_MS
|
|
3625
3650
|
});
|
|
3626
|
-
_optionalChain([onErrorRef, 'access',
|
|
3651
|
+
_optionalChain([onErrorRef, 'access', _162 => _162.current, 'optionalCall', _163 => _163(message, "PROCESS_TIMEOUT")]);
|
|
3627
3652
|
}, ESCALATED_DELAY_MS);
|
|
3628
3653
|
return () => clearTimeout(timeoutId);
|
|
3629
3654
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -3635,8 +3660,8 @@ function ProcessingStep({
|
|
|
3635
3660
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
3636
3661
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
3637
3662
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
3638
|
-
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess',
|
|
3639
|
-
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess',
|
|
3663
|
+
const isPostBridgeSwapEvent = _optionalChain([lastEvent, 'optionalAccess', _164 => _164.type]) === "post-bridge-swap-complete" || _optionalChain([lastEvent, 'optionalAccess', _165 => _165.type]) === "post-bridge-swap-failed";
|
|
3664
|
+
const destinationTxHash = isPostBridgeSwapEvent ? _optionalChain([lastEvent, 'optionalAccess', _166 => _166.data, 'optionalAccess', _167 => _167.swap, 'optionalAccess', _168 => _168.transactionHash]) || null : _optionalChain([lastEvent, 'optionalAccess', _169 => _169.data, 'optionalAccess', _170 => _170.destination, 'optionalAccess', _171 => _171.transactionHash]) || null;
|
|
3640
3665
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
3641
3666
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
3642
3667
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
@@ -3656,7 +3681,7 @@ function ProcessingStep({
|
|
|
3656
3681
|
const sourceSymbol = sourceDisplay.symbol;
|
|
3657
3682
|
const formattedSentAmount = _nullishCoalesce(_nullishCoalesce(formatRawTokenAmount(displayAmount, sourceDisplay), () => ( // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
3658
3683
|
formatTokenAmount(Number(displayAmount), sourceDisplay.symbol))), () => ( displayAmount));
|
|
3659
|
-
const isBridgeHopDestination = hasPostBridgeActions && (_optionalChain([lastEvent, 'optionalAccess',
|
|
3684
|
+
const isBridgeHopDestination = hasPostBridgeActions && (_optionalChain([lastEvent, 'optionalAccess', _172 => _172.type]) === "bridge-started" || _optionalChain([lastEvent, 'optionalAccess', _173 => _173.type]) === "bridge-complete");
|
|
3660
3685
|
const eventDestination = isBridgeHopDestination ? {} : getEventDestinationDetails(lastEvent);
|
|
3661
3686
|
const targetDisplay = resolveTokenDisplay(
|
|
3662
3687
|
_nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
@@ -3715,8 +3740,8 @@ function ProcessingStep({
|
|
|
3715
3740
|
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, displaySourceChain);
|
|
3716
3741
|
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
3717
3742
|
const timerText = formatTimer(elapsedSeconds);
|
|
3718
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3719
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3743
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _174 => _174.feeSponsored]), () => ( false));
|
|
3744
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _175 => _175.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3720
3745
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
3721
3746
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
3722
3747
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -3727,10 +3752,16 @@ function ProcessingStep({
|
|
|
3727
3752
|
/* @__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 }) })
|
|
3728
3753
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
3729
3754
|
if (isComplete && isSwappedOrder) {
|
|
3730
|
-
const
|
|
3731
|
-
const
|
|
3755
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _176 => _176.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _177 => _177.paymentMethod]))), () => ( null));
|
|
3756
|
+
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
3757
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _178 => _178.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
3758
|
+
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
3759
|
+
effectivePaymentMethod
|
|
3760
|
+
) : null;
|
|
3761
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _179 => _179.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
3762
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _180 => _180.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
3732
3763
|
const depositedAmount = receiveDisplay;
|
|
3733
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3764
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _181 => _181.onrampFeeUsd]), () => ( null));
|
|
3734
3765
|
const networkFeeUsd = quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
3735
3766
|
const feeRows = [];
|
|
3736
3767
|
if (onrampFeeUsd != null) {
|
|
@@ -3750,6 +3781,7 @@ function ProcessingStep({
|
|
|
3750
3781
|
SwappedReceipt,
|
|
3751
3782
|
{
|
|
3752
3783
|
onrampMethod,
|
|
3784
|
+
onrampMethodIcon,
|
|
3753
3785
|
amountPaid,
|
|
3754
3786
|
depositedAmount,
|
|
3755
3787
|
depositedIcon: targetTokenIcon,
|
|
@@ -3806,7 +3838,7 @@ function ProcessingStep({
|
|
|
3806
3838
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
3807
3839
|
] }),
|
|
3808
3840
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3809
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3841
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _182 => _182.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3810
3842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
3811
3843
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3812
3844
|
"$",
|
|
@@ -3818,7 +3850,7 @@ function ProcessingStep({
|
|
|
3818
3850
|
] })
|
|
3819
3851
|
] })
|
|
3820
3852
|
] }),
|
|
3821
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
3853
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _183 => _183.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3822
3854
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
3823
3855
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3824
3856
|
"$",
|
|
@@ -4048,4 +4080,7 @@ function accountFromPrivateKey(privateKey) {
|
|
|
4048
4080
|
|
|
4049
4081
|
|
|
4050
4082
|
|
|
4051
|
-
|
|
4083
|
+
|
|
4084
|
+
|
|
4085
|
+
|
|
4086
|
+
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.UnplugIcon = UnplugIcon; exports.Callout = Callout; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.getExchangeLogo = getExchangeLogo; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.debugLog = debugLog; exports.debugError = debugError; 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.formatTokenAmount = formatTokenAmount; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|