@rhinestone/deposit-modal 0.3.0 → 0.4.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-DNW4GH6L.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -7
- package/dist/{DepositModalReown-6SUEC5IU.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -4
- package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -4
- package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -7
- package/dist/{caip-CrQ2KKU-.d.cts → caip-CsslyHGL.d.cts} +1 -1
- package/dist/{caip-CrQ2KKU-.d.ts → caip-CsslyHGL.d.ts} +1 -1
- package/dist/{chunk-33H6O5UU.cjs → chunk-3MXWIYAT.cjs} +16 -6
- package/dist/{chunk-KJ2RR2D4.mjs → chunk-3PVDRSJ7.mjs} +930 -682
- package/dist/{chunk-VVJAIMKB.cjs → chunk-7MP2UWIQ.cjs} +1091 -843
- package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
- package/dist/{chunk-2SMS542Q.cjs → chunk-AE5LHTPM.cjs} +122 -100
- package/dist/chunk-F7P4MV72.mjs +295 -0
- package/dist/chunk-FJWLC4AM.mjs +212 -0
- package/dist/{chunk-KAWJABTW.mjs → chunk-GKC22JC4.mjs} +901 -717
- package/dist/chunk-NRNJAQUA.cjs +212 -0
- package/dist/{chunk-RABZINV3.cjs → chunk-OQVLEVNR.cjs} +758 -574
- package/dist/chunk-UEKPBRBY.cjs +295 -0
- package/dist/{chunk-GPSBM66J.mjs → chunk-UFKFSGT3.mjs} +14 -4
- package/dist/{chunk-TKQYTBU6.mjs → chunk-WCIGOV34.mjs} +36 -14
- package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -4
- package/dist/deposit.d.cts +4 -4
- package/dist/deposit.d.ts +4 -4
- package/dist/deposit.mjs +5 -3
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +6 -4
- package/dist/polymarket.cjs +64 -0
- package/dist/polymarket.d.cts +57 -0
- package/dist/polymarket.d.ts +57 -0
- package/dist/polymarket.mjs +64 -0
- package/dist/styles.css +252 -9
- package/dist/{types-BMcGO5k_.d.cts → types-CFRuisqK.d.cts} +10 -1
- package/dist/{types-BMcGO5k_.d.ts → types-CFRuisqK.d.ts} +10 -1
- package/dist/withdraw.cjs +5 -4
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +4 -3
- package/package.json +15 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAIN_BY_ID,
|
|
3
3
|
NATIVE_TOKEN_ADDRESS,
|
|
4
|
+
findTokenDecimals,
|
|
4
5
|
getChainIcon,
|
|
5
6
|
getChainName,
|
|
6
7
|
getExplorerTxUrl,
|
|
7
8
|
getSolanaTokenByMint,
|
|
8
9
|
getSupportedChainIds,
|
|
9
|
-
getTargetTokenSymbol,
|
|
10
10
|
getTokenAddress,
|
|
11
11
|
getTokenDecimalsByAddress,
|
|
12
12
|
getTokenIcon,
|
|
13
13
|
getTokenSymbol,
|
|
14
14
|
isSolanaCaip2,
|
|
15
15
|
parseEvmChainId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WJX3TJFK.mjs";
|
|
17
17
|
|
|
18
18
|
// src/components/ui/Modal.tsx
|
|
19
19
|
import {
|
|
@@ -169,9 +169,9 @@ import {
|
|
|
169
169
|
CircleArrowOutUpLeft,
|
|
170
170
|
CreditCard,
|
|
171
171
|
Landmark,
|
|
172
|
-
|
|
172
|
+
Unplug
|
|
173
173
|
} from "lucide-react";
|
|
174
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
174
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
175
175
|
var WalletIcon = Wallet;
|
|
176
176
|
var ExternalLinkIcon = ExternalLink;
|
|
177
177
|
var CheckIcon = Check;
|
|
@@ -214,10 +214,43 @@ var PlusCircleIcon = CirclePlus;
|
|
|
214
214
|
var CircleArrowOutUpLeftIcon = CircleArrowOutUpLeft;
|
|
215
215
|
var CardIcon = CreditCard;
|
|
216
216
|
var BankIcon = Landmark;
|
|
217
|
-
var
|
|
217
|
+
var UnplugIcon = Unplug;
|
|
218
|
+
function AppleIcon() {
|
|
219
|
+
return /* @__PURE__ */ jsxs(
|
|
220
|
+
"svg",
|
|
221
|
+
{
|
|
222
|
+
width: "24",
|
|
223
|
+
height: "24",
|
|
224
|
+
viewBox: "0 0 24 24",
|
|
225
|
+
fill: "none",
|
|
226
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
227
|
+
"aria-hidden": "true",
|
|
228
|
+
children: [
|
|
229
|
+
/* @__PURE__ */ jsx2(
|
|
230
|
+
"path",
|
|
231
|
+
{
|
|
232
|
+
d: "M16.36 1.43c0 1.14-.49 2.27-1.18 3.08-.74.9-1.99 1.57-2.98 1.57-.12 0-.23-.02-.3-.03-.01-.06-.04-.22-.04-.39 0-1.15.57-2.27 1.2-2.98.8-.94 2.15-1.64 3.25-1.68.03.13.05.28.05.43z",
|
|
233
|
+
stroke: "currentColor",
|
|
234
|
+
strokeWidth: "1.6",
|
|
235
|
+
strokeLinejoin: "round"
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ jsx2(
|
|
239
|
+
"path",
|
|
240
|
+
{
|
|
241
|
+
d: "M20.93 17.14c-.03.07-.46 1.58-1.52 3.12-.94 1.34-1.94 2.71-3.43 2.71-1.51 0-1.9-.88-3.63-.88-1.7 0-2.3.91-3.67.91-1.38 0-2.33-1.26-3.43-2.8-1.29-1.82-2.32-4.63-2.32-7.28 0-4.28 2.8-6.55 5.55-6.55 1.45 0 2.68.95 3.6.95.86 0 2.22-1.01 3.9-1.01.61 0 2.89.06 4.37 2.19-.13.09-2.38 1.37-2.38 4.19 0 3.26 2.85 4.42 2.96 4.45z",
|
|
242
|
+
stroke: "currentColor",
|
|
243
|
+
strokeWidth: "1.6",
|
|
244
|
+
strokeLinejoin: "round"
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
218
251
|
|
|
219
252
|
// src/components/ui/Callout.tsx
|
|
220
|
-
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
253
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
221
254
|
function CircleAlertIcon() {
|
|
222
255
|
return /* @__PURE__ */ jsx3(
|
|
223
256
|
"svg",
|
|
@@ -242,7 +275,7 @@ function CircleAlertIcon() {
|
|
|
242
275
|
);
|
|
243
276
|
}
|
|
244
277
|
function Callout({ variant = "error", children, role }) {
|
|
245
|
-
return /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ jsxs2(
|
|
246
279
|
"div",
|
|
247
280
|
{
|
|
248
281
|
className: `rs-callout rs-callout--${variant}`,
|
|
@@ -1549,31 +1582,35 @@ function applyTheme(element, theme) {
|
|
|
1549
1582
|
}
|
|
1550
1583
|
|
|
1551
1584
|
// src/components/ui/BodyHeader.tsx
|
|
1552
|
-
import { jsx as jsx4, jsxs as
|
|
1585
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1553
1586
|
function BodyHeader({
|
|
1554
1587
|
icon,
|
|
1555
1588
|
title,
|
|
1556
1589
|
subtitle,
|
|
1557
|
-
variant = "default"
|
|
1590
|
+
variant = "default",
|
|
1591
|
+
aside
|
|
1558
1592
|
}) {
|
|
1559
1593
|
const iconClasses = [
|
|
1560
1594
|
"rs-body-header-icon",
|
|
1561
1595
|
variant === "success" ? "rs-body-header-icon--success" : "",
|
|
1562
1596
|
variant === "error" ? "rs-body-header-icon--error" : ""
|
|
1563
1597
|
].filter(Boolean).join(" ");
|
|
1564
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ jsxs3("div", { className: "rs-body-header", children: [
|
|
1565
1599
|
/* @__PURE__ */ jsx4("div", { className: iconClasses, children: icon }),
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
|
|
1600
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-body-header-main", children: [
|
|
1601
|
+
/* @__PURE__ */ jsxs3("div", { className: "rs-body-header-text", children: [
|
|
1602
|
+
/* @__PURE__ */ jsx4("h2", { className: "rs-body-header-title", children: title }),
|
|
1603
|
+
subtitle && /* @__PURE__ */ jsx4("p", { className: "rs-body-header-subtitle", children: subtitle })
|
|
1604
|
+
] }),
|
|
1605
|
+
aside && /* @__PURE__ */ jsx4("div", { className: "rs-body-header-aside", children: aside })
|
|
1569
1606
|
] })
|
|
1570
1607
|
] });
|
|
1571
1608
|
}
|
|
1572
1609
|
BodyHeader.displayName = "BodyHeader";
|
|
1573
1610
|
|
|
1574
1611
|
// src/components/ui/PoweredBy.tsx
|
|
1575
|
-
import { jsx as jsx5, jsxs as
|
|
1576
|
-
var rhinestoneLogo = /* @__PURE__ */
|
|
1612
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1613
|
+
var rhinestoneLogo = /* @__PURE__ */ jsxs4(
|
|
1577
1614
|
"svg",
|
|
1578
1615
|
{
|
|
1579
1616
|
className: "rs-powered-by-logo",
|
|
@@ -1582,7 +1619,7 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs3(
|
|
|
1582
1619
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1583
1620
|
"aria-hidden": "true",
|
|
1584
1621
|
children: [
|
|
1585
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ jsxs4("g", { fill: "currentColor", clipPath: "url(#rs-pb-clip)", children: [
|
|
1586
1623
|
/* @__PURE__ */ jsx5(
|
|
1587
1624
|
"path",
|
|
1588
1625
|
{
|
|
@@ -1626,7 +1663,7 @@ var rhinestoneLogo = /* @__PURE__ */ jsxs3(
|
|
|
1626
1663
|
}
|
|
1627
1664
|
);
|
|
1628
1665
|
function PoweredBy() {
|
|
1629
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ jsxs4("div", { className: "rs-powered-by", "aria-label": "Powered by Rhinestone", children: [
|
|
1630
1667
|
/* @__PURE__ */ jsx5("span", { children: "Powered by" }),
|
|
1631
1668
|
/* @__PURE__ */ jsx5(
|
|
1632
1669
|
"a",
|
|
@@ -1643,9 +1680,9 @@ function PoweredBy() {
|
|
|
1643
1680
|
PoweredBy.displayName = "PoweredBy";
|
|
1644
1681
|
|
|
1645
1682
|
// src/components/ui/Spinner.tsx
|
|
1646
|
-
import { jsx as jsx6, jsxs as
|
|
1683
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1647
1684
|
function Spinner({ className }) {
|
|
1648
|
-
return /* @__PURE__ */
|
|
1685
|
+
return /* @__PURE__ */ jsxs5(
|
|
1649
1686
|
"svg",
|
|
1650
1687
|
{
|
|
1651
1688
|
className: `rs-spinner ${className || ""}`,
|
|
@@ -1672,8 +1709,11 @@ function Spinner({ className }) {
|
|
|
1672
1709
|
);
|
|
1673
1710
|
}
|
|
1674
1711
|
|
|
1712
|
+
// src/components/steps/ConnectStep.tsx
|
|
1713
|
+
import { useState } from "react";
|
|
1714
|
+
|
|
1675
1715
|
// src/components/ui/ListRow.tsx
|
|
1676
|
-
import { Fragment, jsx as jsx7, jsxs as
|
|
1716
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1677
1717
|
function ListRow({
|
|
1678
1718
|
leading,
|
|
1679
1719
|
leadingMedia,
|
|
@@ -1687,10 +1727,10 @@ function ListRow({
|
|
|
1687
1727
|
disabled,
|
|
1688
1728
|
...props
|
|
1689
1729
|
}) {
|
|
1690
|
-
const inner = /* @__PURE__ */
|
|
1730
|
+
const inner = /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
1691
1731
|
leadingMedia ? /* @__PURE__ */ jsx7("span", { className: "rs-list-row-leading rs-list-row-leading--media", children: /* @__PURE__ */ jsx7("img", { src: leadingMedia, alt: "" }) }) : leading ? /* @__PURE__ */ jsx7("span", { className: "rs-list-row-leading", children: leading }) : null,
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-list-row-body", children: [
|
|
1733
|
+
/* @__PURE__ */ jsxs6("div", { className: "rs-list-row-text", children: [
|
|
1694
1734
|
/* @__PURE__ */ jsx7("span", { className: "rs-list-row-title", children: title }),
|
|
1695
1735
|
subtitle && /* @__PURE__ */ jsx7("span", { className: "rs-list-row-subtitle", children: subtitle })
|
|
1696
1736
|
] }),
|
|
@@ -1745,10 +1785,36 @@ function ListRow({
|
|
|
1745
1785
|
}
|
|
1746
1786
|
ListRow.displayName = "ListRow";
|
|
1747
1787
|
|
|
1788
|
+
// src/components/ui/SegmentedToggle.tsx
|
|
1789
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1790
|
+
function SegmentedToggle({
|
|
1791
|
+
options,
|
|
1792
|
+
value,
|
|
1793
|
+
onChange,
|
|
1794
|
+
ariaLabel
|
|
1795
|
+
}) {
|
|
1796
|
+
return /* @__PURE__ */ jsx8("div", { className: "rs-segmented", role: "tablist", "aria-label": ariaLabel, children: options.map((opt) => {
|
|
1797
|
+
const active = opt.value === value;
|
|
1798
|
+
return /* @__PURE__ */ jsx8(
|
|
1799
|
+
"button",
|
|
1800
|
+
{
|
|
1801
|
+
type: "button",
|
|
1802
|
+
role: "tab",
|
|
1803
|
+
"aria-selected": active,
|
|
1804
|
+
className: `rs-segmented-option${active ? " rs-segmented-option--active" : ""}`,
|
|
1805
|
+
onClick: () => onChange(opt.value),
|
|
1806
|
+
children: opt.label
|
|
1807
|
+
},
|
|
1808
|
+
opt.value
|
|
1809
|
+
);
|
|
1810
|
+
}) });
|
|
1811
|
+
}
|
|
1812
|
+
SegmentedToggle.displayName = "SegmentedToggle";
|
|
1813
|
+
|
|
1748
1814
|
// src/components/ui/WalletBadgeIcons/RabbyIcon.tsx
|
|
1749
|
-
import { jsx as
|
|
1815
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1750
1816
|
function RabbyIcon() {
|
|
1751
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ jsxs7(
|
|
1752
1818
|
"svg",
|
|
1753
1819
|
{
|
|
1754
1820
|
width: "20",
|
|
@@ -1757,8 +1823,8 @@ function RabbyIcon() {
|
|
|
1757
1823
|
fill: "none",
|
|
1758
1824
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1759
1825
|
children: [
|
|
1760
|
-
/* @__PURE__ */
|
|
1761
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ jsxs7("g", { clipPath: "url(#rs-rabby-clip)", children: [
|
|
1827
|
+
/* @__PURE__ */ jsx9(
|
|
1762
1828
|
"mask",
|
|
1763
1829
|
{
|
|
1764
1830
|
id: "rs-rabby-mask",
|
|
@@ -1768,7 +1834,7 @@ function RabbyIcon() {
|
|
|
1768
1834
|
y: "0",
|
|
1769
1835
|
width: "20",
|
|
1770
1836
|
height: "20",
|
|
1771
|
-
children: /* @__PURE__ */
|
|
1837
|
+
children: /* @__PURE__ */ jsx9(
|
|
1772
1838
|
"path",
|
|
1773
1839
|
{
|
|
1774
1840
|
d: "M20 10C20 4.47 15.52 0 10 0C4.47 0 0 4.47 0 10C0 15.52 4.47 20 10 20C15.52 20 20 15.52 20 10Z",
|
|
@@ -1777,22 +1843,22 @@ function RabbyIcon() {
|
|
|
1777
1843
|
)
|
|
1778
1844
|
}
|
|
1779
1845
|
),
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsxs7("g", { mask: "url(#rs-rabby-mask)", children: [
|
|
1847
|
+
/* @__PURE__ */ jsx9(
|
|
1782
1848
|
"path",
|
|
1783
1849
|
{
|
|
1784
1850
|
d: "M20 10C20 4.47 15.52 0 10 0C4.47 0 0 4.47 0 10C0 15.52 4.47 20 10 20C15.52 20 20 15.52 20 10Z",
|
|
1785
1851
|
fill: "#7084FF"
|
|
1786
1852
|
}
|
|
1787
1853
|
),
|
|
1788
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx9(
|
|
1789
1855
|
"path",
|
|
1790
1856
|
{
|
|
1791
1857
|
d: "M17.25 10.86C17.82 9.57 14.98 5.97 12.26 4.47C10.55 3.31 8.77 3.47 8.41 3.98C7.62 5.10 11.03 6.05 13.32 7.16C12.83 7.37 12.36 7.76 12.09 8.25C11.24 7.31 9.37 6.51 7.18 7.16C5.70 7.59 4.47 8.62 3.99 10.18C3.85 10.11 3.70 10.09 3.54 10.10C3.39 10.11 3.24 10.16 3.11 10.25C2.98 10.33 2.87 10.45 2.80 10.58C2.72 10.72 2.69 10.87 2.69 11.03C2.69 11.55 3.10 11.96 3.62 11.96C3.71 11.96 4.01 11.90 4.01 11.90L8.77 11.93C6.87 14.96 5.36 15.41 5.36 15.93C5.36 16.46 6.80 16.32 7.34 16.12C9.93 15.18 12.71 12.26 13.19 11.42C15.19 11.67 16.87 11.70 17.25 10.86Z",
|
|
1792
1858
|
fill: "url(#rs-rabby-grad0)"
|
|
1793
1859
|
}
|
|
1794
1860
|
),
|
|
1795
|
-
/* @__PURE__ */
|
|
1861
|
+
/* @__PURE__ */ jsx9(
|
|
1796
1862
|
"path",
|
|
1797
1863
|
{
|
|
1798
1864
|
fillRule: "evenodd",
|
|
@@ -1801,7 +1867,7 @@ function RabbyIcon() {
|
|
|
1801
1867
|
fill: "url(#rs-rabby-grad1)"
|
|
1802
1868
|
}
|
|
1803
1869
|
),
|
|
1804
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ jsx9(
|
|
1805
1871
|
"path",
|
|
1806
1872
|
{
|
|
1807
1873
|
fillRule: "evenodd",
|
|
@@ -1810,7 +1876,7 @@ function RabbyIcon() {
|
|
|
1810
1876
|
fill: "url(#rs-rabby-grad2)"
|
|
1811
1877
|
}
|
|
1812
1878
|
),
|
|
1813
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx9(
|
|
1814
1880
|
"path",
|
|
1815
1881
|
{
|
|
1816
1882
|
d: "M3.94 11.70C4.11 13.19 4.96 13.77 6.68 13.94C8.40 14.12 9.39 14.00 10.71 14.12C11.81 14.22 12.79 14.78 13.15 14.59C13.48 14.42 13.30 13.78 12.86 13.38C12.29 12.85 11.50 12.49 10.12 12.36C10.39 11.60 10.32 10.54 9.89 9.96C9.27 9.12 8.13 8.75 6.68 8.91C5.17 9.08 3.72 9.83 3.94 11.70Z",
|
|
@@ -1819,8 +1885,8 @@ function RabbyIcon() {
|
|
|
1819
1885
|
)
|
|
1820
1886
|
] })
|
|
1821
1887
|
] }),
|
|
1822
|
-
/* @__PURE__ */
|
|
1823
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ jsxs7("defs", { children: [
|
|
1889
|
+
/* @__PURE__ */ jsxs7(
|
|
1824
1890
|
"linearGradient",
|
|
1825
1891
|
{
|
|
1826
1892
|
id: "rs-rabby-grad0",
|
|
@@ -1830,12 +1896,12 @@ function RabbyIcon() {
|
|
|
1830
1896
|
y2: "12.58",
|
|
1831
1897
|
gradientUnits: "userSpaceOnUse",
|
|
1832
1898
|
children: [
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
1899
|
+
/* @__PURE__ */ jsx9("stop", { stopColor: "white" }),
|
|
1900
|
+
/* @__PURE__ */ jsx9("stop", { offset: "1", stopColor: "white" })
|
|
1835
1901
|
]
|
|
1836
1902
|
}
|
|
1837
1903
|
),
|
|
1838
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ jsxs7(
|
|
1839
1905
|
"linearGradient",
|
|
1840
1906
|
{
|
|
1841
1907
|
id: "rs-rabby-grad1",
|
|
@@ -1845,12 +1911,12 @@ function RabbyIcon() {
|
|
|
1845
1911
|
y2: "2.21",
|
|
1846
1912
|
gradientUnits: "userSpaceOnUse",
|
|
1847
1913
|
children: [
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1914
|
+
/* @__PURE__ */ jsx9("stop", { stopColor: "#8697FF" }),
|
|
1915
|
+
/* @__PURE__ */ jsx9("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1850
1916
|
]
|
|
1851
1917
|
}
|
|
1852
1918
|
),
|
|
1853
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ jsxs7(
|
|
1854
1920
|
"linearGradient",
|
|
1855
1921
|
{
|
|
1856
1922
|
id: "rs-rabby-grad2",
|
|
@@ -1860,12 +1926,12 @@ function RabbyIcon() {
|
|
|
1860
1926
|
y2: "9.61",
|
|
1861
1927
|
gradientUnits: "userSpaceOnUse",
|
|
1862
1928
|
children: [
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
/* @__PURE__ */
|
|
1929
|
+
/* @__PURE__ */ jsx9("stop", { stopColor: "#8697FF" }),
|
|
1930
|
+
/* @__PURE__ */ jsx9("stop", { offset: "1", stopColor: "#8697FF", stopOpacity: "0" })
|
|
1865
1931
|
]
|
|
1866
1932
|
}
|
|
1867
1933
|
),
|
|
1868
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsxs7(
|
|
1869
1935
|
"linearGradient",
|
|
1870
1936
|
{
|
|
1871
1937
|
id: "rs-rabby-grad3",
|
|
@@ -1875,12 +1941,12 @@ function RabbyIcon() {
|
|
|
1875
1941
|
y2: "15.67",
|
|
1876
1942
|
gradientUnits: "userSpaceOnUse",
|
|
1877
1943
|
children: [
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
1944
|
+
/* @__PURE__ */ jsx9("stop", { stopColor: "white" }),
|
|
1945
|
+
/* @__PURE__ */ jsx9("stop", { offset: "0.98", stopColor: "#D1D8FF" })
|
|
1880
1946
|
]
|
|
1881
1947
|
}
|
|
1882
1948
|
),
|
|
1883
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ jsx9("clipPath", { id: "rs-rabby-clip", children: /* @__PURE__ */ jsx9("rect", { width: "20", height: "20", fill: "white" }) })
|
|
1884
1950
|
] })
|
|
1885
1951
|
]
|
|
1886
1952
|
}
|
|
@@ -1888,9 +1954,9 @@ function RabbyIcon() {
|
|
|
1888
1954
|
}
|
|
1889
1955
|
|
|
1890
1956
|
// src/components/ui/WalletBadgeIcons/PhantomIcon.tsx
|
|
1891
|
-
import { jsx as
|
|
1957
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1892
1958
|
function PhantomIcon() {
|
|
1893
|
-
return /* @__PURE__ */
|
|
1959
|
+
return /* @__PURE__ */ jsxs8(
|
|
1894
1960
|
"svg",
|
|
1895
1961
|
{
|
|
1896
1962
|
width: "20",
|
|
@@ -1899,14 +1965,14 @@ function PhantomIcon() {
|
|
|
1899
1965
|
fill: "none",
|
|
1900
1966
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1901
1967
|
children: [
|
|
1902
|
-
/* @__PURE__ */
|
|
1968
|
+
/* @__PURE__ */ jsx10(
|
|
1903
1969
|
"path",
|
|
1904
1970
|
{
|
|
1905
1971
|
d: "M15.18 0H4.81C2.15 0 0 2.15 0 4.81V15.18C0 17.84 2.15 20 4.81 20H15.18C17.84 20 20 17.84 20 15.18V4.81C20 2.15 17.84 0 15.18 0Z",
|
|
1906
1972
|
fill: "#AB9FF2"
|
|
1907
1973
|
}
|
|
1908
1974
|
),
|
|
1909
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ jsx10(
|
|
1910
1976
|
"path",
|
|
1911
1977
|
{
|
|
1912
1978
|
fillRule: "evenodd",
|
|
@@ -1921,9 +1987,9 @@ function PhantomIcon() {
|
|
|
1921
1987
|
}
|
|
1922
1988
|
|
|
1923
1989
|
// src/components/ui/WalletBadgeIcons/WalletConnectIcon.tsx
|
|
1924
|
-
import { jsx as
|
|
1990
|
+
import { jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1925
1991
|
function WalletConnectIcon() {
|
|
1926
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsxs9(
|
|
1927
1993
|
"svg",
|
|
1928
1994
|
{
|
|
1929
1995
|
width: "20",
|
|
@@ -1932,8 +1998,8 @@ function WalletConnectIcon() {
|
|
|
1932
1998
|
fill: "none",
|
|
1933
1999
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1934
2000
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
1936
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ jsx11("rect", { width: "20", height: "20", rx: "2.5", fill: "#3B99FC" }),
|
|
2002
|
+
/* @__PURE__ */ jsx11(
|
|
1937
2003
|
"path",
|
|
1938
2004
|
{
|
|
1939
2005
|
d: "M6.18 7.96a5.36 5.36 0 0 1 7.64 0l.25.26a.26.26 0 0 1 0 .37l-.87.87a.13.13 0 0 1-.19 0l-.35-.35a3.74 3.74 0 0 0-5.32 0l-.38.37a.13.13 0 0 1-.19 0l-.86-.86a.26.26 0 0 1 0-.37l.27-.29Zm9.43 1.79.78.78a.26.26 0 0 1 0 .37l-3.54 3.54a.26.26 0 0 1-.37 0l-2.51-2.5a.07.07 0 0 0-.09 0l-2.51 2.5a.26.26 0 0 1-.37 0L3.46 10.9a.26.26 0 0 1 0-.37l.78-.78a.26.26 0 0 1 .37 0l2.5 2.5a.07.07 0 0 0 .1 0L9.72 9.75a.26.26 0 0 1 .37 0l2.5 2.5a.07.07 0 0 0 .1 0l2.5-2.5a.26.26 0 0 1 .37 0Z",
|
|
@@ -1946,9 +2012,9 @@ function WalletConnectIcon() {
|
|
|
1946
2012
|
}
|
|
1947
2013
|
|
|
1948
2014
|
// src/components/ui/WalletBadgeIcons/EthBadgeIcon.tsx
|
|
1949
|
-
import { jsx as
|
|
2015
|
+
import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1950
2016
|
function EthBadgeIcon() {
|
|
1951
|
-
return /* @__PURE__ */
|
|
2017
|
+
return /* @__PURE__ */ jsxs10(
|
|
1952
2018
|
"svg",
|
|
1953
2019
|
{
|
|
1954
2020
|
width: "20",
|
|
@@ -1957,28 +2023,28 @@ function EthBadgeIcon() {
|
|
|
1957
2023
|
fill: "none",
|
|
1958
2024
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1959
2025
|
children: [
|
|
1960
|
-
/* @__PURE__ */
|
|
2026
|
+
/* @__PURE__ */ jsx12(
|
|
1961
2027
|
"path",
|
|
1962
2028
|
{
|
|
1963
2029
|
d: "M9.99 19.93C15.48 19.93 19.93 15.48 19.93 9.99C19.93 4.51 15.48 0.06 9.99 0.06C4.51 0.06 0.06 4.51 0.06 9.99C0.06 15.48 4.51 19.93 9.99 19.93Z",
|
|
1964
2030
|
fill: "#E3E3E3"
|
|
1965
2031
|
}
|
|
1966
2032
|
),
|
|
1967
|
-
/* @__PURE__ */
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
1971
|
-
/* @__PURE__ */
|
|
1972
|
-
/* @__PURE__ */
|
|
2033
|
+
/* @__PURE__ */ jsx12("path", { d: "M10.00 2.18L14.69 9.99L10.02 7.98L10.00 2.18Z", fill: "#2F3030" }),
|
|
2034
|
+
/* @__PURE__ */ jsx12("path", { d: "M5.31 9.99L9.98 2.18L10.00 7.98L5.31 9.99Z", fill: "#828384" }),
|
|
2035
|
+
/* @__PURE__ */ jsx12("path", { d: "M9.98 12.80L5.31 10.04L10.00 8.11L9.98 12.80Z", fill: "#343535" }),
|
|
2036
|
+
/* @__PURE__ */ jsx12("path", { d: "M14.69 10.04L10.02 8.11L10.00 12.80L14.69 10.04Z", fill: "#131313" }),
|
|
2037
|
+
/* @__PURE__ */ jsx12("path", { d: "M10.00 14.00L14.69 11.24L10.00 17.80V14.00Z", fill: "#2F3030" }),
|
|
2038
|
+
/* @__PURE__ */ jsx12("path", { d: "M10.00 14.00L5.31 11.24L10.00 17.80V14.00Z", fill: "#828384" })
|
|
1973
2039
|
]
|
|
1974
2040
|
}
|
|
1975
2041
|
);
|
|
1976
2042
|
}
|
|
1977
2043
|
|
|
1978
2044
|
// src/components/ui/WalletBadgeIcons/SolBadgeIcon.tsx
|
|
1979
|
-
import { jsx as
|
|
2045
|
+
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1980
2046
|
function SolBadgeIcon() {
|
|
1981
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ jsxs11(
|
|
1982
2048
|
"svg",
|
|
1983
2049
|
{
|
|
1984
2050
|
width: "20",
|
|
@@ -1987,8 +2053,8 @@ function SolBadgeIcon() {
|
|
|
1987
2053
|
fill: "none",
|
|
1988
2054
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1989
2055
|
children: [
|
|
1990
|
-
/* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ jsx13("rect", { width: "20", height: "20", rx: "10", fill: "#0C0C0C" }),
|
|
2057
|
+
/* @__PURE__ */ jsx13(
|
|
1992
2058
|
"path",
|
|
1993
2059
|
{
|
|
1994
2060
|
fillRule: "evenodd",
|
|
@@ -1997,7 +2063,7 @@ function SolBadgeIcon() {
|
|
|
1997
2063
|
fill: "url(#rs-sol-badge-grad)"
|
|
1998
2064
|
}
|
|
1999
2065
|
),
|
|
2000
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ jsx13("defs", { children: /* @__PURE__ */ jsxs11(
|
|
2001
2067
|
"linearGradient",
|
|
2002
2068
|
{
|
|
2003
2069
|
id: "rs-sol-badge-grad",
|
|
@@ -2007,8 +2073,8 @@ function SolBadgeIcon() {
|
|
|
2007
2073
|
y2: "5.08",
|
|
2008
2074
|
gradientUnits: "userSpaceOnUse",
|
|
2009
2075
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2076
|
+
/* @__PURE__ */ jsx13("stop", { stopColor: "#CB4EE8" }),
|
|
2077
|
+
/* @__PURE__ */ jsx13("stop", { offset: "1", stopColor: "#10F4B1" })
|
|
2012
2078
|
]
|
|
2013
2079
|
}
|
|
2014
2080
|
) })
|
|
@@ -2018,9 +2084,9 @@ function SolBadgeIcon() {
|
|
|
2018
2084
|
}
|
|
2019
2085
|
|
|
2020
2086
|
// src/components/ui/WalletBadgeIcons/BaseBadgeIcon.tsx
|
|
2021
|
-
import { jsx as
|
|
2087
|
+
import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2022
2088
|
function BaseBadgeIcon() {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2089
|
+
return /* @__PURE__ */ jsxs12(
|
|
2024
2090
|
"svg",
|
|
2025
2091
|
{
|
|
2026
2092
|
width: "20",
|
|
@@ -2029,8 +2095,8 @@ function BaseBadgeIcon() {
|
|
|
2029
2095
|
fill: "none",
|
|
2030
2096
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2031
2097
|
children: [
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsx14("circle", { cx: "55.5", cy: "55.5", r: "55.5", fill: "#0052FF" }),
|
|
2099
|
+
/* @__PURE__ */ jsx14(
|
|
2034
2100
|
"path",
|
|
2035
2101
|
{
|
|
2036
2102
|
d: "M54.92 93.4c20.94 0 37.92-16.97 37.92-37.92S75.86 17.55 54.92 17.55c-19.49 0-35.57 14.72-37.65 33.64h49.82v5.54h-49.82C19.35 75.67 35.42 93.4 54.92 93.4z",
|
|
@@ -2043,41 +2109,143 @@ function BaseBadgeIcon() {
|
|
|
2043
2109
|
}
|
|
2044
2110
|
|
|
2045
2111
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
2046
|
-
import { jsx as
|
|
2112
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2047
2113
|
function WalletBadgeIcons() {
|
|
2048
|
-
return /* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2114
|
+
return /* @__PURE__ */ jsxs13("span", { className: "rs-list-row-meta-icons", children: [
|
|
2115
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(RabbyIcon, {}) }),
|
|
2116
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(PhantomIcon, {}) }),
|
|
2117
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(WalletConnectIcon, {}) })
|
|
2052
2118
|
] });
|
|
2053
2119
|
}
|
|
2054
2120
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
2055
2121
|
function ChainBadgeIcons() {
|
|
2056
|
-
return /* @__PURE__ */
|
|
2057
|
-
/* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
/* @__PURE__ */
|
|
2122
|
+
return /* @__PURE__ */ jsxs13("span", { className: "rs-list-row-meta-icons", children: [
|
|
2123
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(EthBadgeIcon, {}) }),
|
|
2124
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(SolBadgeIcon, {}) }),
|
|
2125
|
+
/* @__PURE__ */ jsx15("span", { children: /* @__PURE__ */ jsx15(BaseBadgeIcon, {}) })
|
|
2060
2126
|
] });
|
|
2061
2127
|
}
|
|
2062
2128
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
2063
2129
|
|
|
2130
|
+
// src/components/ui/BrandIcons.tsx
|
|
2131
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2132
|
+
function VisaMark() {
|
|
2133
|
+
return /* @__PURE__ */ jsx16("svg", { viewBox: "0 7.4 24 9", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx16(
|
|
2134
|
+
"path",
|
|
2135
|
+
{
|
|
2136
|
+
fill: "#1A1F71",
|
|
2137
|
+
d: "M9.112 8.262 5.97 15.758H3.92L2.374 9.775c-.094-.368-.175-.503-.461-.658C1.447 8.864.677 8.627 0 8.479l.046-.217h3.3a.904.904 0 0 1 .894.764l.817 4.338 2.018-5.102zm8.033 5.049c.008-1.979-2.736-2.088-2.717-2.972.006-.269.262-.555.822-.628a3.66 3.66 0 0 1 1.913.336l.34-1.59a5.207 5.207 0 0 0-1.814-.333c-1.917 0-3.266 1.02-3.278 2.479-.012 1.079.963 1.68 1.698 2.04.756.367 1.01.603 1.006.931-.005.504-.602.725-1.16.734-.975.015-1.54-.263-1.992-.473l-.351 1.642c.453.208 1.289.39 2.156.398 2.037 0 3.37-1.006 3.377-2.564m5.061 2.447H24l-1.565-7.496h-1.656a.883.883 0 0 0-.826.55l-2.909 6.946h2.036l.405-1.12h2.488zm-2.163-2.656 1.02-2.815.588 2.815zm-8.16-4.84-1.603 7.496H8.34l1.605-7.496z"
|
|
2138
|
+
}
|
|
2139
|
+
) });
|
|
2140
|
+
}
|
|
2141
|
+
function MastercardMark() {
|
|
2142
|
+
return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 3.5 24 17", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2143
|
+
/* @__PURE__ */ jsx16(
|
|
2144
|
+
"path",
|
|
2145
|
+
{
|
|
2146
|
+
fill: "#EB001B",
|
|
2147
|
+
d: "M11.343 18.031c.058.049.12.098.181.146-1.177.783-2.59 1.238-4.107 1.238C3.32 19.416 0 16.096 0 12c0-4.095 3.32-7.416 7.416-7.416 1.518 0 2.931.456 4.105 1.238-.06.051-.12.098-.165.15C9.6 7.489 8.595 9.688 8.595 12c0 2.311 1.001 4.51 2.748 6.031z"
|
|
2148
|
+
}
|
|
2149
|
+
),
|
|
2150
|
+
/* @__PURE__ */ jsx16(
|
|
2151
|
+
"path",
|
|
2152
|
+
{
|
|
2153
|
+
fill: "#F79E1B",
|
|
2154
|
+
d: "M16.584 4.584c-1.52 0-2.931.456-4.105 1.238.06.051.12.098.165.15C14.4 7.489 15.405 9.688 15.405 12c0 2.31-1.001 4.507-2.748 6.031-.058.049-.12.098-.181.146 1.177.783 2.588 1.238 4.107 1.238C20.68 19.416 24 16.096 24 12c0-4.094-3.32-7.416-7.416-7.416z"
|
|
2155
|
+
}
|
|
2156
|
+
),
|
|
2157
|
+
/* @__PURE__ */ jsx16(
|
|
2158
|
+
"path",
|
|
2159
|
+
{
|
|
2160
|
+
fill: "#FF5F00",
|
|
2161
|
+
d: "M12 6.174c-.096.075-.189.15-.28.231C10.156 7.764 9.169 9.765 9.169 12c0 2.236.987 4.236 2.551 5.595.09.08.185.158.28.232.096-.074.189-.152.28-.232 1.563-1.359 2.551-3.359 2.551-5.595 0-2.235-.987-4.236-2.551-5.595-.09-.08-.184-.156-.28-.231z"
|
|
2162
|
+
}
|
|
2163
|
+
)
|
|
2164
|
+
] });
|
|
2165
|
+
}
|
|
2166
|
+
function AmexMark() {
|
|
2167
|
+
return /* @__PURE__ */ jsx16("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsx16(
|
|
2168
|
+
"path",
|
|
2169
|
+
{
|
|
2170
|
+
fill: "#2E77BC",
|
|
2171
|
+
d: "M16.015 14.378c0-.32-.135-.496-.344-.622-.21-.12-.464-.135-.81-.135h-1.543v2.82h.675v-1.027h.72c.24 0 .39.024.478.125.12.13.104.38.104.55v.35h.66v-.555c-.002-.25-.017-.376-.108-.516-.06-.08-.18-.18-.33-.234l.02-.008c.18-.072.48-.297.48-.747zm-.87.407-.028-.002c-.09.053-.195.058-.33.058h-.81v-.63h.824c.12 0 .24 0 .33.05.098.048.156.147.15.255 0 .12-.045.215-.134.27zM20.297 15.837H19v.6h1.304c.676 0 1.05-.278 1.05-.884 0-.28-.066-.448-.187-.582-.153-.133-.392-.193-.73-.207l-.376-.015c-.104 0-.18 0-.255-.03-.09-.03-.15-.105-.15-.21 0-.09.017-.166.09-.21.083-.046.177-.066.272-.06h1.23v-.602h-1.35c-.704 0-.958.437-.958.84 0 .9.776.855 1.407.87.104 0 .18.015.225.06.046.03.082.106.082.18 0 .077-.035.15-.08.18-.06.053-.15.07-.277.07zM0 0v10.096L.81 8.22h1.75l.225.464V8.22h2.043l.45 1.02.437-1.013h6.502c.295 0 .56.057.756.236v-.23h1.787v.23c.307-.17.686-.23 1.12-.23h2.606l.24.466v-.466h1.918l.254.465v-.466h1.858v3.948H20.87l-.36-.6v.585h-2.353l-.256-.63h-.583l-.27.614h-1.213c-.48 0-.84-.104-1.08-.24v.24h-2.89v-.884c0-.12-.03-.12-.105-.135h-.105v1.036H6.067v-.48l-.21.48H4.69l-.202-.48v.465H2.235l-.256-.624H1.4l-.256.624H0V24h23.786v-7.108c-.27.135-.613.18-.973.18H21.09v-.255c-.21.165-.57.255-.914.255H14.71v-.9c0-.12-.018-.12-.12-.12h-.075v1.022h-1.8v-1.066c-.298.136-.643.15-.928.136h-.214v.915h-2.18l-.54-.617-.57.6H4.742v-3.93h3.61l.518.602.554-.6h2.412c.28 0 .74.03.942.225v-.24h2.177c.202 0 .644.045.903.225v-.24h3.265v.24c.163-.164.508-.24.803-.24h1.89v.24c.194-.15.464-.24.84-.24h1.176V0H0zM18.597 14.208v-.583h-2.235v2.833h2.235v-.585h-1.57v-.57h1.533v-.584h-1.532v-.51M13.51 8.787h.685V11.6h-.684zM13.126 9.543l-.007.006c0-.314-.13-.5-.34-.624-.217-.125-.47-.135-.81-.135H10.43v2.82h.674v-1.034h.72c.24 0 .39.03.487.12.122.136.107.378.107.548v.354h.677v-.553c0-.25-.016-.375-.11-.516-.09-.107-.202-.19-.33-.237.172-.07.472-.3.472-.75zm-.855.396h-.015c-.09.054-.195.056-.33.056H11.1v-.623h.825c.12 0 .24.004.33.05.09.04.15.128.15.25s-.047.22-.134.266zM15.92 9.373h.632v-.6h-.644c-.464 0-.804.105-1.02.33-.286.3-.362.69-.362 1.11 0 .512.123.833.36 1.074.232.238.645.31.97.31h.78l.255-.627h1.39l.262.627h1.36v-2.11l1.272 2.11h.95l.002.002V8.786h-.684v1.963l-1.18-1.96h-1.02V11.4L18.11 8.744h-1.004l-.943 2.22h-.3c-.177 0-.362-.03-.468-.134-.125-.15-.186-.36-.186-.662 0-.285.08-.51.194-.63.133-.135.272-.165.516-.165zm1.668-.108.464 1.118v.002h-.93l.466-1.12zM2.38 10.97l.254.628H4V9.393l.972 2.205h.584l.973-2.202.015 2.202h.69v-2.81H6.118l-.807 1.904-.876-1.905H3.343v2.663L2.205 8.787h-.997L.01 11.597h.72l.26-.626h1.39zm-.688-1.705.46 1.118-.003.002h-.915l.457-1.12zM11.856 13.62H9.714l-.85.923-.825-.922H5.346v2.82H8l.855-.932.824.93h1.302v-.94h.838c.6 0 1.17-.164 1.17-.945l-.006-.003c0-.78-.598-.93-1.128-.93zM7.67 15.853l-.014-.002H6.02v-.557h1.47v-.574H6.02v-.51H7.7l.733.82-.764.824zm2.642.33-1.03-1.147 1.03-1.108v2.253zm1.553-1.258h-.885v-.717h.885c.24 0 .42.098.42.344 0 .243-.15.372-.42.372zM9.967 9.373v-.586H7.73V11.6h2.237v-.58H8.4v-.564h1.527V9.88H8.4v-.507"
|
|
2172
|
+
}
|
|
2173
|
+
) });
|
|
2174
|
+
}
|
|
2175
|
+
function CoinbaseMark() {
|
|
2176
|
+
return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2177
|
+
/* @__PURE__ */ jsx16("rect", { width: "20", height: "20", rx: "5", fill: "#0052FF" }),
|
|
2178
|
+
/* @__PURE__ */ jsx16(
|
|
2179
|
+
"path",
|
|
2180
|
+
{
|
|
2181
|
+
d: "M10.029 13.247a3.188 3.188 0 1 1 3.137-3.747h3.207A6.375 6.375 0 1 0 16.373 10.5h-3.211a3.19 3.19 0 0 1-3.133 2.747Z",
|
|
2182
|
+
fill: "#fff"
|
|
2183
|
+
}
|
|
2184
|
+
)
|
|
2185
|
+
] });
|
|
2186
|
+
}
|
|
2187
|
+
function BinanceMark() {
|
|
2188
|
+
return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2189
|
+
/* @__PURE__ */ jsx16("circle", { cx: "10", cy: "10", r: "10", fill: "#181A20" }),
|
|
2190
|
+
/* @__PURE__ */ jsx16("svg", { x: "3", y: "3", width: "14", height: "14", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx16(
|
|
2191
|
+
"path",
|
|
2192
|
+
{
|
|
2193
|
+
fill: "#F0B90B",
|
|
2194
|
+
d: "m16.624 13.920 2.718 2.716-7.353 7.353-7.353-7.353 2.717-2.716 4.636 4.66zm4.637-4.636L24 12l-2.715 2.716L18.568 12zm-9.272.001 2.716 2.691-2.716 2.717L9.272 12zm-9.273-.001L5.409 12l-2.692 2.692L0 12zM11.989.012l7.353 7.329-2.718 2.715-4.635-4.636-4.636 4.66-2.717-2.716z"
|
|
2195
|
+
}
|
|
2196
|
+
) })
|
|
2197
|
+
] });
|
|
2198
|
+
}
|
|
2199
|
+
function KrakenMark() {
|
|
2200
|
+
return /* @__PURE__ */ jsxs14("svg", { viewBox: "0 0 20 20", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2201
|
+
/* @__PURE__ */ jsx16("circle", { cx: "10", cy: "10", r: "10", fill: "#7133F5" }),
|
|
2202
|
+
/* @__PURE__ */ jsx16("svg", { x: "3", y: "3", width: "14", height: "14", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx16(
|
|
2203
|
+
"path",
|
|
2204
|
+
{
|
|
2205
|
+
fill: "#fff",
|
|
2206
|
+
d: "M11.998 4.5C7.028 4.5 3 8.774 3 14.047v4.09c0 .753.575 1.363 1.285 1.363s1.288-.61 1.288-1.362v-4.091c0-.755.573-1.365 1.285-1.365.71 0 1.284.61 1.284 1.365v4.09c0 .753.575 1.363 1.285 1.363.712 0 1.286-.61 1.286-1.362v-4.091c0-.755.575-1.365 1.285-1.365.712 0 1.289.61 1.289 1.365v4.09c0 .753.574 1.363 1.284 1.363s1.285-.61 1.285-1.362v-4.091c0-.755.574-1.365 1.288-1.365.71 0 1.285.61 1.285 1.365v4.09c0 .753.575 1.363 1.287 1.363.71 0 1.284-.61 1.284-1.362v-4.091C21 8.774 16.97 4.5 11.998 4.5"
|
|
2207
|
+
}
|
|
2208
|
+
) })
|
|
2209
|
+
] });
|
|
2210
|
+
}
|
|
2211
|
+
function CardNetworkIcons() {
|
|
2212
|
+
return /* @__PURE__ */ jsxs14("span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--cards", children: [
|
|
2213
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(AmexMark, {}) }),
|
|
2214
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(VisaMark, {}) }),
|
|
2215
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(MastercardMark, {}) })
|
|
2216
|
+
] });
|
|
2217
|
+
}
|
|
2218
|
+
CardNetworkIcons.displayName = "CardNetworkIcons";
|
|
2219
|
+
function ExchangeBadgeIcons() {
|
|
2220
|
+
return /* @__PURE__ */ jsxs14("span", { className: "rs-list-row-meta-icons", children: [
|
|
2221
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(CoinbaseMark, {}) }),
|
|
2222
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(BinanceMark, {}) }),
|
|
2223
|
+
/* @__PURE__ */ jsx16("span", { children: /* @__PURE__ */ jsx16(KrakenMark, {}) })
|
|
2224
|
+
] });
|
|
2225
|
+
}
|
|
2226
|
+
ExchangeBadgeIcons.displayName = "ExchangeBadgeIcons";
|
|
2227
|
+
|
|
2064
2228
|
// src/components/steps/ConnectStep.tsx
|
|
2065
|
-
import { Fragment as Fragment2, jsx as
|
|
2229
|
+
import { Fragment as Fragment2, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2066
2230
|
function formatBalanceUsd(value) {
|
|
2067
2231
|
if (!Number.isFinite(value) || value <= 0) return "$0.00";
|
|
2068
2232
|
return `$${value.toFixed(2)}`;
|
|
2069
2233
|
}
|
|
2070
2234
|
function fiatIcon(name) {
|
|
2071
|
-
if (name === "apple") return /* @__PURE__ */
|
|
2072
|
-
if (name === "bank") return /* @__PURE__ */
|
|
2073
|
-
return /* @__PURE__ */
|
|
2235
|
+
if (name === "apple") return /* @__PURE__ */ jsx17(AppleIcon, {});
|
|
2236
|
+
if (name === "bank") return /* @__PURE__ */ jsx17(BankIcon, {});
|
|
2237
|
+
return /* @__PURE__ */ jsx17(CardIcon, {});
|
|
2238
|
+
}
|
|
2239
|
+
function fiatMeta(name) {
|
|
2240
|
+
if (name === "apple" || name === "bank") return void 0;
|
|
2241
|
+
return /* @__PURE__ */ jsx17(CardNetworkIcons, {});
|
|
2074
2242
|
}
|
|
2075
2243
|
function shorten(addr) {
|
|
2076
2244
|
return addr.length > 12 ? `${addr.slice(0, 6)}...${addr.slice(-4)}` : addr;
|
|
2077
2245
|
}
|
|
2078
2246
|
function renderWalletLeading(row) {
|
|
2079
2247
|
if (row.icon) {
|
|
2080
|
-
return /* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ jsx17(
|
|
2081
2249
|
"img",
|
|
2082
2250
|
{
|
|
2083
2251
|
src: row.icon,
|
|
@@ -2086,19 +2254,24 @@ function renderWalletLeading(row) {
|
|
|
2086
2254
|
}
|
|
2087
2255
|
);
|
|
2088
2256
|
}
|
|
2089
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ jsx17(WalletIcon, {});
|
|
2090
2258
|
}
|
|
2091
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */
|
|
2092
|
-
var WALLET_LEADING = /* @__PURE__ */
|
|
2093
|
-
var
|
|
2094
|
-
var
|
|
2095
|
-
|
|
2096
|
-
|
|
2259
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ jsx17(TransferCryptoIcon, {});
|
|
2260
|
+
var WALLET_LEADING = /* @__PURE__ */ jsx17(WalletIcon, {});
|
|
2261
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ jsx17(UnplugIcon, {});
|
|
2262
|
+
var SMALL_SPINNER = /* @__PURE__ */ jsx17(Spinner, { className: "rs-spinner--sm" });
|
|
2263
|
+
var CONNECT_META = /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2264
|
+
/* @__PURE__ */ jsx17(WalletBadgeIcons, {}),
|
|
2265
|
+
"+100"
|
|
2266
|
+
] });
|
|
2267
|
+
var EXCHANGE_META = /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2268
|
+
/* @__PURE__ */ jsx17(ExchangeBadgeIcons, {}),
|
|
2269
|
+
"+6"
|
|
2097
2270
|
] });
|
|
2098
2271
|
var EXTRA_CHAIN_COUNT = Math.max(0, getSupportedChainIds().length - 3);
|
|
2099
|
-
var CHAIN_BADGE_META = /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2101
|
-
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}
|
|
2272
|
+
var CHAIN_BADGE_META = /* @__PURE__ */ jsxs15(Fragment2, { children: [
|
|
2273
|
+
/* @__PURE__ */ jsx17(ChainBadgeIcons, {}),
|
|
2274
|
+
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
2102
2275
|
] });
|
|
2103
2276
|
function renderRowTrailing(state) {
|
|
2104
2277
|
if (state === "loading") {
|
|
@@ -2122,7 +2295,8 @@ function ConnectStep({
|
|
|
2122
2295
|
dappImports,
|
|
2123
2296
|
onSelectDappImport,
|
|
2124
2297
|
title = "Deposit",
|
|
2125
|
-
subtitle
|
|
2298
|
+
subtitle,
|
|
2299
|
+
defaultMethodTab = "crypto"
|
|
2126
2300
|
}) {
|
|
2127
2301
|
const rows = walletRows ?? [];
|
|
2128
2302
|
const handleConnect = onConnect ?? onRequestConnect;
|
|
@@ -2131,145 +2305,211 @@ function ConnectStep({
|
|
|
2131
2305
|
);
|
|
2132
2306
|
const showDappImports = (dappImports?.length ?? 0) > 0;
|
|
2133
2307
|
const defaultSubtitle = onSelectTransferCrypto ? "Add money to your balance" : "Choose a wallet to continue";
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2308
|
+
const cryptoRows = [];
|
|
2309
|
+
if (onSelectTransferCrypto) {
|
|
2310
|
+
cryptoRows.push(
|
|
2311
|
+
/* @__PURE__ */ jsx17(
|
|
2312
|
+
ListRow,
|
|
2138
2313
|
{
|
|
2139
|
-
|
|
2140
|
-
title,
|
|
2141
|
-
subtitle:
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2314
|
+
leading: TRANSFER_CRYPTO_LEADING,
|
|
2315
|
+
title: "Transfer crypto",
|
|
2316
|
+
subtitle: transferCryptoState === "error" ? transferCryptoErrorReason ?? "Couldn't prepare account \u2014 tap to retry" : "Instant - No limit",
|
|
2317
|
+
meta: CHAIN_BADGE_META,
|
|
2318
|
+
onClick: onSelectTransferCrypto
|
|
2319
|
+
},
|
|
2320
|
+
"transfer-crypto"
|
|
2321
|
+
)
|
|
2322
|
+
);
|
|
2323
|
+
}
|
|
2324
|
+
for (const row of rows) {
|
|
2325
|
+
const collapseToExternal = Boolean(onSelectTransferCrypto) && row.kind !== "solana";
|
|
2326
|
+
const subtitleText = row.state === "loading" ? "Preparing\u2026" : row.state === "error" ? row.errorReason ?? "Couldn't prepare wallet \u2014 tap to retry" : shorten(row.address);
|
|
2327
|
+
cryptoRows.push(
|
|
2328
|
+
/* @__PURE__ */ jsx17(
|
|
2329
|
+
ListRow,
|
|
2330
|
+
{
|
|
2331
|
+
leading: renderWalletLeading(row),
|
|
2332
|
+
title: collapseToExternal ? "External wallet" : row.label,
|
|
2333
|
+
subtitle: subtitleText,
|
|
2334
|
+
onClick: () => onConfirmWallet?.(row.id),
|
|
2335
|
+
disabled: row.state === "loading",
|
|
2336
|
+
trailing: renderRowTrailing(row.state)
|
|
2337
|
+
},
|
|
2338
|
+
row.id
|
|
2339
|
+
)
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
if (!hasReownWallet && handleConnect) {
|
|
2343
|
+
cryptoRows.push(
|
|
2344
|
+
/* @__PURE__ */ jsx17(
|
|
2345
|
+
ListRow,
|
|
2346
|
+
{
|
|
2347
|
+
leading: WALLET_LEADING,
|
|
2348
|
+
title: "Connect wallet",
|
|
2349
|
+
subtitle: "Instant - No limit",
|
|
2350
|
+
meta: CONNECT_META,
|
|
2351
|
+
onClick: handleConnect
|
|
2352
|
+
},
|
|
2353
|
+
"connect-wallet"
|
|
2354
|
+
)
|
|
2355
|
+
);
|
|
2356
|
+
}
|
|
2357
|
+
if (onSelectFundFromExchange) {
|
|
2358
|
+
cryptoRows.push(
|
|
2359
|
+
/* @__PURE__ */ jsx17(
|
|
2360
|
+
ListRow,
|
|
2361
|
+
{
|
|
2362
|
+
leading: EXCHANGE_LEADING,
|
|
2363
|
+
title: "Connect exchange",
|
|
2364
|
+
subtitle: "Instant - No limit",
|
|
2365
|
+
meta: EXCHANGE_META,
|
|
2366
|
+
onClick: onSelectFundFromExchange
|
|
2367
|
+
},
|
|
2368
|
+
"connect-exchange"
|
|
2369
|
+
)
|
|
2370
|
+
);
|
|
2371
|
+
}
|
|
2372
|
+
if (showDappImports) {
|
|
2373
|
+
for (const row of dappImports ?? []) {
|
|
2374
|
+
if (!hasReownWallet) {
|
|
2375
|
+
cryptoRows.push(
|
|
2376
|
+
/* @__PURE__ */ jsx17(
|
|
2186
2377
|
ListRow,
|
|
2187
2378
|
{
|
|
2188
|
-
leading:
|
|
2189
|
-
title:
|
|
2190
|
-
subtitle:
|
|
2191
|
-
onClick:
|
|
2192
|
-
disabled:
|
|
2193
|
-
trailing: renderRowTrailing(row.state)
|
|
2379
|
+
leading: row.icon,
|
|
2380
|
+
title: row.label,
|
|
2381
|
+
subtitle: "Connect wallet to view balance",
|
|
2382
|
+
onClick: handleConnect,
|
|
2383
|
+
disabled: !handleConnect
|
|
2194
2384
|
},
|
|
2195
2385
|
row.id
|
|
2196
|
-
)
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
}
|
|
2235
|
-
if (row.status.enabled) {
|
|
2236
|
-
return /* @__PURE__ */ jsx15(
|
|
2237
|
-
ListRow,
|
|
2238
|
-
{
|
|
2239
|
-
leading: row.icon,
|
|
2240
|
-
title: row.label,
|
|
2241
|
-
subtitle: formatBalanceUsd(row.status.balanceUsd),
|
|
2242
|
-
onClick: () => onSelectDappImport?.(row.id)
|
|
2243
|
-
},
|
|
2244
|
-
row.id
|
|
2245
|
-
);
|
|
2246
|
-
}
|
|
2247
|
-
if (row.status.retryable) {
|
|
2248
|
-
return /* @__PURE__ */ jsx15(
|
|
2249
|
-
ListRow,
|
|
2250
|
-
{
|
|
2251
|
-
leading: row.icon,
|
|
2252
|
-
title: row.label,
|
|
2253
|
-
subtitle: row.status.reason,
|
|
2254
|
-
onClick: () => onSelectDappImport?.(row.id)
|
|
2255
|
-
},
|
|
2256
|
-
row.id
|
|
2257
|
-
);
|
|
2258
|
-
}
|
|
2259
|
-
return /* @__PURE__ */ jsx15(
|
|
2386
|
+
)
|
|
2387
|
+
);
|
|
2388
|
+
continue;
|
|
2389
|
+
}
|
|
2390
|
+
if (row.status === "loading" || row.status === "needs-connect") {
|
|
2391
|
+
cryptoRows.push(
|
|
2392
|
+
/* @__PURE__ */ jsx17(
|
|
2393
|
+
ListRow,
|
|
2394
|
+
{
|
|
2395
|
+
leading: row.icon,
|
|
2396
|
+
title: row.label,
|
|
2397
|
+
subtitle: "Checking balance\u2026",
|
|
2398
|
+
disabled: true,
|
|
2399
|
+
trailing: SMALL_SPINNER
|
|
2400
|
+
},
|
|
2401
|
+
row.id
|
|
2402
|
+
)
|
|
2403
|
+
);
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
if (row.status.enabled) {
|
|
2407
|
+
cryptoRows.push(
|
|
2408
|
+
/* @__PURE__ */ jsx17(
|
|
2409
|
+
ListRow,
|
|
2410
|
+
{
|
|
2411
|
+
leading: row.icon,
|
|
2412
|
+
title: row.label,
|
|
2413
|
+
subtitle: formatBalanceUsd(row.status.balanceUsd),
|
|
2414
|
+
onClick: () => onSelectDappImport?.(row.id)
|
|
2415
|
+
},
|
|
2416
|
+
row.id
|
|
2417
|
+
)
|
|
2418
|
+
);
|
|
2419
|
+
continue;
|
|
2420
|
+
}
|
|
2421
|
+
if (row.status.retryable) {
|
|
2422
|
+
cryptoRows.push(
|
|
2423
|
+
/* @__PURE__ */ jsx17(
|
|
2260
2424
|
ListRow,
|
|
2261
2425
|
{
|
|
2262
2426
|
leading: row.icon,
|
|
2263
2427
|
title: row.label,
|
|
2264
2428
|
subtitle: row.status.reason,
|
|
2265
|
-
|
|
2429
|
+
onClick: () => onSelectDappImport?.(row.id)
|
|
2266
2430
|
},
|
|
2267
2431
|
row.id
|
|
2268
|
-
)
|
|
2269
|
-
|
|
2270
|
-
|
|
2432
|
+
)
|
|
2433
|
+
);
|
|
2434
|
+
continue;
|
|
2435
|
+
}
|
|
2436
|
+
cryptoRows.push(
|
|
2437
|
+
/* @__PURE__ */ jsx17(
|
|
2438
|
+
ListRow,
|
|
2439
|
+
{
|
|
2440
|
+
leading: row.icon,
|
|
2441
|
+
title: row.label,
|
|
2442
|
+
subtitle: row.status.reason,
|
|
2443
|
+
disabled: true
|
|
2444
|
+
},
|
|
2445
|
+
row.id
|
|
2446
|
+
)
|
|
2447
|
+
);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
const cashRows = [];
|
|
2451
|
+
if (fiatPaymentMethods && fiatPaymentMethods.length > 0 && onSelectFiatMethod) {
|
|
2452
|
+
for (const opt of fiatPaymentMethods) {
|
|
2453
|
+
cashRows.push(
|
|
2454
|
+
/* @__PURE__ */ jsx17(
|
|
2455
|
+
ListRow,
|
|
2456
|
+
{
|
|
2457
|
+
leading: fiatIcon(opt.icon),
|
|
2458
|
+
title: opt.label,
|
|
2459
|
+
subtitle: opt.sublabel,
|
|
2460
|
+
meta: fiatMeta(opt.icon),
|
|
2461
|
+
onClick: () => onSelectFiatMethod(opt.method)
|
|
2462
|
+
},
|
|
2463
|
+
opt.method
|
|
2464
|
+
)
|
|
2465
|
+
);
|
|
2466
|
+
}
|
|
2467
|
+
} else if (onSelectPayWithCard) {
|
|
2468
|
+
cashRows.push(
|
|
2469
|
+
/* @__PURE__ */ jsx17(
|
|
2470
|
+
ListRow,
|
|
2471
|
+
{
|
|
2472
|
+
leading: /* @__PURE__ */ jsx17(CardIcon, {}),
|
|
2473
|
+
title: "Debit/Credit card",
|
|
2474
|
+
subtitle: "Instant - $10,000 limit",
|
|
2475
|
+
meta: /* @__PURE__ */ jsx17(CardNetworkIcons, {}),
|
|
2476
|
+
onClick: onSelectPayWithCard
|
|
2477
|
+
},
|
|
2478
|
+
"pay-with-card"
|
|
2479
|
+
)
|
|
2480
|
+
);
|
|
2481
|
+
}
|
|
2482
|
+
const hasCrypto = cryptoRows.length > 0;
|
|
2483
|
+
const hasCash = cashRows.length > 0;
|
|
2484
|
+
const showToggle = hasCrypto && hasCash;
|
|
2485
|
+
const [tab, setTab] = useState(defaultMethodTab);
|
|
2486
|
+
const activeTab = showToggle ? tab : hasCash && !hasCrypto ? "cash" : "crypto";
|
|
2487
|
+
const activeRows = activeTab === "cash" ? cashRows : cryptoRows;
|
|
2488
|
+
return /* @__PURE__ */ jsxs15("div", { className: "rs-screen", children: [
|
|
2489
|
+
/* @__PURE__ */ jsxs15("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2490
|
+
/* @__PURE__ */ jsx17(
|
|
2491
|
+
BodyHeader,
|
|
2492
|
+
{
|
|
2493
|
+
icon: /* @__PURE__ */ jsx17(HandCoinsIcon, {}),
|
|
2494
|
+
title,
|
|
2495
|
+
subtitle: subtitle ?? defaultSubtitle,
|
|
2496
|
+
aside: showToggle ? /* @__PURE__ */ jsx17(
|
|
2497
|
+
SegmentedToggle,
|
|
2498
|
+
{
|
|
2499
|
+
ariaLabel: "Deposit method type",
|
|
2500
|
+
value: activeTab,
|
|
2501
|
+
onChange: setTab,
|
|
2502
|
+
options: [
|
|
2503
|
+
{ value: "crypto", label: "Crypto" },
|
|
2504
|
+
{ value: "cash", label: "Cash" }
|
|
2505
|
+
]
|
|
2506
|
+
}
|
|
2507
|
+
) : void 0
|
|
2508
|
+
}
|
|
2509
|
+
),
|
|
2510
|
+
/* @__PURE__ */ jsx17("div", { className: "rs-list", children: activeRows })
|
|
2271
2511
|
] }),
|
|
2272
|
-
onDisconnect && hasReownWallet && /* @__PURE__ */
|
|
2512
|
+
onDisconnect && hasReownWallet && /* @__PURE__ */ jsx17("div", { className: "rs-screen-tight-row", children: /* @__PURE__ */ jsx17(
|
|
2273
2513
|
"button",
|
|
2274
2514
|
{
|
|
2275
2515
|
type: "button",
|
|
@@ -2278,17 +2518,16 @@ function ConnectStep({
|
|
|
2278
2518
|
children: "Disconnect wallet"
|
|
2279
2519
|
}
|
|
2280
2520
|
) }),
|
|
2281
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx17(PoweredBy, {})
|
|
2282
2522
|
] });
|
|
2283
2523
|
}
|
|
2284
2524
|
ConnectStep.displayName = "ConnectStep";
|
|
2285
2525
|
|
|
2286
2526
|
// src/components/steps/ProcessingStep.tsx
|
|
2287
|
-
import { useCallback as useCallback3, useEffect as
|
|
2288
|
-
import { formatUnits } from "viem";
|
|
2527
|
+
import { useCallback as useCallback3, useEffect as useEffect5, useRef as useRef4, useState as useState5 } from "react";
|
|
2289
2528
|
|
|
2290
2529
|
// src/components/ui/Button.tsx
|
|
2291
|
-
import { Fragment as Fragment3, jsx as
|
|
2530
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2292
2531
|
function Button({
|
|
2293
2532
|
children,
|
|
2294
2533
|
variant = "accent",
|
|
@@ -2308,19 +2547,19 @@ function Button({
|
|
|
2308
2547
|
className
|
|
2309
2548
|
].filter(Boolean).join(" ");
|
|
2310
2549
|
const showInlineLoadingText = loading && loadingText !== void 0;
|
|
2311
|
-
return /* @__PURE__ */
|
|
2550
|
+
return /* @__PURE__ */ jsx18(
|
|
2312
2551
|
"button",
|
|
2313
2552
|
{
|
|
2314
2553
|
className: classes,
|
|
2315
2554
|
disabled: disabled || loading,
|
|
2316
2555
|
"aria-busy": loading || void 0,
|
|
2317
2556
|
...props,
|
|
2318
|
-
children: showInlineLoadingText ? /* @__PURE__ */
|
|
2319
|
-
/* @__PURE__ */
|
|
2320
|
-
/* @__PURE__ */
|
|
2321
|
-
] }) : /* @__PURE__ */
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
loading && /* @__PURE__ */
|
|
2557
|
+
children: showInlineLoadingText ? /* @__PURE__ */ jsxs16("span", { className: "rs-button__loading-row", children: [
|
|
2558
|
+
/* @__PURE__ */ jsx18(Spinner, { className: "rs-spinner--sm" }),
|
|
2559
|
+
/* @__PURE__ */ jsx18("span", { children: loadingText })
|
|
2560
|
+
] }) : /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2561
|
+
/* @__PURE__ */ jsx18("span", { className: loading ? "rs-button__content--hidden" : "", children }),
|
|
2562
|
+
loading && /* @__PURE__ */ jsx18("span", { className: "rs-button__spinner", children: /* @__PURE__ */ jsx18(Spinner, { className: "rs-spinner--sm" }) })
|
|
2324
2563
|
] })
|
|
2325
2564
|
}
|
|
2326
2565
|
);
|
|
@@ -2329,16 +2568,16 @@ Button.displayName = "Button";
|
|
|
2329
2568
|
|
|
2330
2569
|
// src/components/ui/Tooltip.tsx
|
|
2331
2570
|
import {
|
|
2332
|
-
useState,
|
|
2571
|
+
useState as useState2,
|
|
2333
2572
|
useRef as useRef3,
|
|
2334
2573
|
useEffect as useEffect3,
|
|
2335
2574
|
useCallback as useCallback2
|
|
2336
2575
|
} from "react";
|
|
2337
2576
|
import { createPortal as createPortal2 } from "react-dom";
|
|
2338
|
-
import { jsx as
|
|
2577
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2339
2578
|
function Tooltip({ content, children, className }) {
|
|
2340
|
-
const [open, setOpen] =
|
|
2341
|
-
const [position, setPosition] =
|
|
2579
|
+
const [open, setOpen] = useState2(false);
|
|
2580
|
+
const [position, setPosition] = useState2(null);
|
|
2342
2581
|
const triggerRef = useRef3(null);
|
|
2343
2582
|
const bubbleRef = useRef3(null);
|
|
2344
2583
|
const updatePosition = useCallback2(() => {
|
|
@@ -2376,7 +2615,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2376
2615
|
window.removeEventListener("resize", updatePosition);
|
|
2377
2616
|
};
|
|
2378
2617
|
}, [open, updatePosition]);
|
|
2379
|
-
return /* @__PURE__ */
|
|
2618
|
+
return /* @__PURE__ */ jsxs17(
|
|
2380
2619
|
"span",
|
|
2381
2620
|
{
|
|
2382
2621
|
ref: triggerRef,
|
|
@@ -2384,7 +2623,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2384
2623
|
onMouseEnter: () => setOpen(true),
|
|
2385
2624
|
onMouseLeave: () => setOpen(false),
|
|
2386
2625
|
children: [
|
|
2387
|
-
/* @__PURE__ */
|
|
2626
|
+
/* @__PURE__ */ jsx19(
|
|
2388
2627
|
"span",
|
|
2389
2628
|
{
|
|
2390
2629
|
className: "rs-tooltip-trigger",
|
|
@@ -2406,7 +2645,7 @@ function Tooltip({ content, children, className }) {
|
|
|
2406
2645
|
}
|
|
2407
2646
|
),
|
|
2408
2647
|
open && position && typeof document !== "undefined" && createPortal2(
|
|
2409
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ jsx19(
|
|
2410
2649
|
"span",
|
|
2411
2650
|
{
|
|
2412
2651
|
ref: bubbleRef,
|
|
@@ -2424,6 +2663,89 @@ function Tooltip({ content, children, className }) {
|
|
|
2424
2663
|
}
|
|
2425
2664
|
Tooltip.displayName = "Tooltip";
|
|
2426
2665
|
|
|
2666
|
+
// src/components/ui/FeesAccordion.tsx
|
|
2667
|
+
import { useState as useState3 } from "react";
|
|
2668
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2669
|
+
function FeesAccordion({ total, rows }) {
|
|
2670
|
+
const [open, setOpen] = useState3(false);
|
|
2671
|
+
const expandable = rows.length > 0;
|
|
2672
|
+
return /* @__PURE__ */ jsxs18("div", { className: "rs-fees-accordion", children: [
|
|
2673
|
+
/* @__PURE__ */ jsxs18(
|
|
2674
|
+
"button",
|
|
2675
|
+
{
|
|
2676
|
+
type: "button",
|
|
2677
|
+
className: "rs-fees-accordion-summary",
|
|
2678
|
+
"aria-expanded": expandable ? open : void 0,
|
|
2679
|
+
disabled: !expandable,
|
|
2680
|
+
onClick: () => expandable && setOpen((o) => !o),
|
|
2681
|
+
children: [
|
|
2682
|
+
/* @__PURE__ */ jsx20("span", { children: "Fees" }),
|
|
2683
|
+
/* @__PURE__ */ jsxs18("span", { className: "rs-review-detail-value", children: [
|
|
2684
|
+
/* @__PURE__ */ jsx20("span", { children: total }),
|
|
2685
|
+
expandable && /* @__PURE__ */ jsx20(
|
|
2686
|
+
"span",
|
|
2687
|
+
{
|
|
2688
|
+
className: `rs-fees-accordion-chevron${open ? " rs-fees-accordion-chevron--open" : ""}`,
|
|
2689
|
+
"aria-hidden": "true",
|
|
2690
|
+
children: /* @__PURE__ */ jsx20(ChevronDownIcon, {})
|
|
2691
|
+
}
|
|
2692
|
+
)
|
|
2693
|
+
] })
|
|
2694
|
+
]
|
|
2695
|
+
}
|
|
2696
|
+
),
|
|
2697
|
+
expandable && open && /* @__PURE__ */ jsx20("div", { className: "rs-fees-accordion-rows", children: rows.map((row, i) => /* @__PURE__ */ jsxs18("div", { className: "rs-fees-accordion-row", children: [
|
|
2698
|
+
/* @__PURE__ */ jsx20("span", { children: row.label }),
|
|
2699
|
+
/* @__PURE__ */ jsx20("span", { className: "rs-review-detail-value", children: row.value })
|
|
2700
|
+
] }, `${row.label}-${i}`)) })
|
|
2701
|
+
] });
|
|
2702
|
+
}
|
|
2703
|
+
FeesAccordion.displayName = "FeesAccordion";
|
|
2704
|
+
|
|
2705
|
+
// src/components/steps/SwappedReceipt.tsx
|
|
2706
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2707
|
+
function SwappedReceipt({
|
|
2708
|
+
onrampMethod,
|
|
2709
|
+
amountPaid,
|
|
2710
|
+
depositedAmount,
|
|
2711
|
+
depositedIcon,
|
|
2712
|
+
feesTotal,
|
|
2713
|
+
feeRows,
|
|
2714
|
+
newLabel,
|
|
2715
|
+
onNewDeposit,
|
|
2716
|
+
onClose
|
|
2717
|
+
}) {
|
|
2718
|
+
return /* @__PURE__ */ jsxs19("div", { className: "rs-screen", children: [
|
|
2719
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2720
|
+
/* @__PURE__ */ jsx21(BodyHeader, { icon: /* @__PURE__ */ jsx21(CheckIcon, {}), title: "Deposit successful" }),
|
|
2721
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-review-details", children: [
|
|
2722
|
+
onrampMethod && /* @__PURE__ */ jsxs19("div", { className: "rs-review-detail-row", children: [
|
|
2723
|
+
/* @__PURE__ */ jsx21("span", { children: "Onramp method" }),
|
|
2724
|
+
/* @__PURE__ */ jsx21("span", { className: "rs-review-detail-value", children: onrampMethod })
|
|
2725
|
+
] }),
|
|
2726
|
+
amountPaid && /* @__PURE__ */ jsxs19("div", { className: "rs-review-detail-row", children: [
|
|
2727
|
+
/* @__PURE__ */ jsx21("span", { children: "Amount paid" }),
|
|
2728
|
+
/* @__PURE__ */ jsx21("span", { className: "rs-review-detail-value", children: amountPaid })
|
|
2729
|
+
] }),
|
|
2730
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-review-detail-row", children: [
|
|
2731
|
+
/* @__PURE__ */ jsx21("span", { children: "Deposited amount" }),
|
|
2732
|
+
/* @__PURE__ */ jsxs19("span", { className: "rs-review-detail-value", children: [
|
|
2733
|
+
/* @__PURE__ */ jsx21("span", { children: depositedAmount }),
|
|
2734
|
+
depositedIcon && /* @__PURE__ */ jsx21("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx21("img", { src: depositedIcon, alt: "" }) })
|
|
2735
|
+
] })
|
|
2736
|
+
] }),
|
|
2737
|
+
feesTotal != null && /* @__PURE__ */ jsx21(FeesAccordion, { total: feesTotal, rows: feeRows ?? [] })
|
|
2738
|
+
] }),
|
|
2739
|
+
/* @__PURE__ */ jsxs19("div", { className: "rs-screen-button-row", children: [
|
|
2740
|
+
onNewDeposit && /* @__PURE__ */ jsx21(Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
|
|
2741
|
+
onClose && /* @__PURE__ */ jsx21(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
2742
|
+
] })
|
|
2743
|
+
] }),
|
|
2744
|
+
/* @__PURE__ */ jsx21(PoweredBy, {})
|
|
2745
|
+
] });
|
|
2746
|
+
}
|
|
2747
|
+
SwappedReceipt.displayName = "SwappedReceipt";
|
|
2748
|
+
|
|
2427
2749
|
// src/core/webhook.ts
|
|
2428
2750
|
function isRecord(value) {
|
|
2429
2751
|
return typeof value === "object" && value !== null;
|
|
@@ -2496,6 +2818,26 @@ function getEventSourceDetails(event) {
|
|
|
2496
2818
|
}
|
|
2497
2819
|
return {};
|
|
2498
2820
|
}
|
|
2821
|
+
function asChain(value) {
|
|
2822
|
+
if (typeof value === "string" && value.trim().startsWith("solana")) {
|
|
2823
|
+
return "solana";
|
|
2824
|
+
}
|
|
2825
|
+
return asNumber(value);
|
|
2826
|
+
}
|
|
2827
|
+
function getEventDestinationDetails(event) {
|
|
2828
|
+
if (!event?.type || !isRecord(event.data)) return {};
|
|
2829
|
+
if (event.type !== "bridge-started" && event.type !== "bridge-complete" && event.type !== "post-bridge-swap-complete") {
|
|
2830
|
+
return {};
|
|
2831
|
+
}
|
|
2832
|
+
const destination = isRecord(event.data.destination) ? event.data.destination : void 0;
|
|
2833
|
+
if (!destination) return {};
|
|
2834
|
+
const token = asString(destination.asset);
|
|
2835
|
+
return {
|
|
2836
|
+
chainId: asChain(destination.chain),
|
|
2837
|
+
amount: asAmount(destination.amount),
|
|
2838
|
+
token: token?.trim() || void 0
|
|
2839
|
+
};
|
|
2840
|
+
}
|
|
2499
2841
|
function isDepositEvent(event) {
|
|
2500
2842
|
return 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";
|
|
2501
2843
|
}
|
|
@@ -2547,10 +2889,131 @@ function failureMessageForEvent(event) {
|
|
|
2547
2889
|
return formatBridgeFailedMessage(event).message;
|
|
2548
2890
|
}
|
|
2549
2891
|
|
|
2892
|
+
// src/core/token-amount.ts
|
|
2893
|
+
import { formatUnits } from "viem";
|
|
2894
|
+
var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
2895
|
+
"USDC",
|
|
2896
|
+
"USDT",
|
|
2897
|
+
"USDT0",
|
|
2898
|
+
"DAI",
|
|
2899
|
+
"FRAX",
|
|
2900
|
+
"PYUSD",
|
|
2901
|
+
"USDP",
|
|
2902
|
+
"TUSD",
|
|
2903
|
+
"GUSD",
|
|
2904
|
+
"USDS",
|
|
2905
|
+
"LUSD",
|
|
2906
|
+
"BUSD",
|
|
2907
|
+
"USDE"
|
|
2908
|
+
]);
|
|
2909
|
+
var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
2910
|
+
function resolveTokenDisplay(token, chain, fallback) {
|
|
2911
|
+
if (token !== void 0) {
|
|
2912
|
+
if (chain === "solana") {
|
|
2913
|
+
const solanaToken = getSolanaTokenByMint(token);
|
|
2914
|
+
if (solanaToken) {
|
|
2915
|
+
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
2916
|
+
}
|
|
2917
|
+
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
2918
|
+
const symbol = getTokenSymbol(token, chain);
|
|
2919
|
+
const decimals = findTokenDecimals(token, chain);
|
|
2920
|
+
if (symbol !== "Token" || decimals !== void 0) {
|
|
2921
|
+
return {
|
|
2922
|
+
symbol: symbol !== "Token" ? symbol : fallback?.symbol ?? symbol,
|
|
2923
|
+
decimals: decimals ?? fallback?.decimals
|
|
2924
|
+
};
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
return {
|
|
2929
|
+
symbol: fallback?.symbol ?? "Token",
|
|
2930
|
+
decimals: fallback?.decimals
|
|
2931
|
+
};
|
|
2932
|
+
}
|
|
2933
|
+
function maxFractionDigitsFor(symbol) {
|
|
2934
|
+
if (!symbol) return 6;
|
|
2935
|
+
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2936
|
+
}
|
|
2937
|
+
function formatTokenAmount(amount, symbol) {
|
|
2938
|
+
if (!Number.isFinite(amount)) return void 0;
|
|
2939
|
+
return amount.toLocaleString("en-US", {
|
|
2940
|
+
minimumFractionDigits: 2,
|
|
2941
|
+
maximumFractionDigits: maxFractionDigitsFor(symbol)
|
|
2942
|
+
});
|
|
2943
|
+
}
|
|
2944
|
+
function tokenAmountToNumber(rawAmount, decimals) {
|
|
2945
|
+
if (decimals === void 0) return void 0;
|
|
2946
|
+
try {
|
|
2947
|
+
const value = Number(formatUnits(BigInt(rawAmount), decimals));
|
|
2948
|
+
return Number.isFinite(value) ? value : void 0;
|
|
2949
|
+
} catch {
|
|
2950
|
+
return void 0;
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
function formatRawTokenAmount(rawAmount, token) {
|
|
2954
|
+
const value = tokenAmountToNumber(rawAmount, token.decimals);
|
|
2955
|
+
if (value === void 0) return void 0;
|
|
2956
|
+
return formatTokenAmount(value, token.symbol);
|
|
2957
|
+
}
|
|
2958
|
+
function priceUsdFor(symbol, prices) {
|
|
2959
|
+
if (!symbol) return void 0;
|
|
2960
|
+
const upper = symbol.toUpperCase();
|
|
2961
|
+
const quoted = prices[upper];
|
|
2962
|
+
if (typeof quoted === "number" && quoted > 0) return quoted;
|
|
2963
|
+
return STABLECOIN_SYMBOLS.has(upper) ? 1 : void 0;
|
|
2964
|
+
}
|
|
2965
|
+
function estimateReceiveAmount(params) {
|
|
2966
|
+
const { sourceAmount, sourceSymbol, targetSymbol, sourceAmountUsd, prices } = params;
|
|
2967
|
+
if (sourceSymbol !== void 0 && sourceSymbol.toUpperCase() === targetSymbol.toUpperCase()) {
|
|
2968
|
+
return sourceAmount;
|
|
2969
|
+
}
|
|
2970
|
+
const usdValue = sourceAmountUsd !== void 0 && Number.isFinite(sourceAmountUsd) ? sourceAmountUsd : sourceAmount !== void 0 ? (() => {
|
|
2971
|
+
const sourcePrice = priceUsdFor(sourceSymbol, prices);
|
|
2972
|
+
return sourcePrice !== void 0 ? sourceAmount * sourcePrice : void 0;
|
|
2973
|
+
})() : void 0;
|
|
2974
|
+
if (usdValue === void 0) return void 0;
|
|
2975
|
+
const targetPrice = priceUsdFor(targetSymbol, prices);
|
|
2976
|
+
if (targetPrice === void 0) return void 0;
|
|
2977
|
+
return usdValue / targetPrice;
|
|
2978
|
+
}
|
|
2979
|
+
function formatReceiveEstimate(params) {
|
|
2980
|
+
const estimate = estimateReceiveAmount(params);
|
|
2981
|
+
if (estimate === void 0) return void 0;
|
|
2982
|
+
const formatted = formatTokenAmount(estimate, params.targetSymbol);
|
|
2983
|
+
if (formatted === void 0) return void 0;
|
|
2984
|
+
const sameSymbol = params.sourceSymbol.toUpperCase() === params.targetSymbol.toUpperCase();
|
|
2985
|
+
return sameSymbol ? `${formatted} ${params.targetSymbol}` : `~${formatted} ${params.targetSymbol}`;
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
// src/core/useTokenPrices.ts
|
|
2989
|
+
import { useEffect as useEffect4, useState as useState4 } from "react";
|
|
2990
|
+
function useTokenPrices(service, symbols) {
|
|
2991
|
+
const [prices, setPrices] = useState4({});
|
|
2992
|
+
const symbolsKey = [
|
|
2993
|
+
...new Set(
|
|
2994
|
+
symbols.filter((symbol) => Boolean(symbol)).map((symbol) => symbol.toUpperCase())
|
|
2995
|
+
)
|
|
2996
|
+
].sort().join(",");
|
|
2997
|
+
useEffect4(() => {
|
|
2998
|
+
if (!symbolsKey) return;
|
|
2999
|
+
let cancelled = false;
|
|
3000
|
+
service.fetchPrices(symbolsKey.split(",")).then((result) => {
|
|
3001
|
+
if (!cancelled && result && Object.keys(result).length > 0) {
|
|
3002
|
+
setPrices(result);
|
|
3003
|
+
}
|
|
3004
|
+
}).catch(() => {
|
|
3005
|
+
});
|
|
3006
|
+
return () => {
|
|
3007
|
+
cancelled = true;
|
|
3008
|
+
};
|
|
3009
|
+
}, [service, symbolsKey]);
|
|
3010
|
+
return prices;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
2550
3013
|
// src/components/steps/ProcessingStep.tsx
|
|
2551
|
-
import { Fragment as Fragment4, jsx as
|
|
3014
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2552
3015
|
function SuccessBadge() {
|
|
2553
|
-
return /* @__PURE__ */
|
|
3016
|
+
return /* @__PURE__ */ jsxs20(
|
|
2554
3017
|
"svg",
|
|
2555
3018
|
{
|
|
2556
3019
|
width: "40",
|
|
@@ -2560,7 +3023,7 @@ function SuccessBadge() {
|
|
|
2560
3023
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2561
3024
|
"aria-hidden": "true",
|
|
2562
3025
|
children: [
|
|
2563
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsx22(
|
|
2564
3027
|
"rect",
|
|
2565
3028
|
{
|
|
2566
3029
|
width: "40",
|
|
@@ -2569,7 +3032,7 @@ function SuccessBadge() {
|
|
|
2569
3032
|
fill: "var(--rs-icon-wrapper-bg)"
|
|
2570
3033
|
}
|
|
2571
3034
|
),
|
|
2572
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ jsx22(
|
|
2573
3036
|
"path",
|
|
2574
3037
|
{
|
|
2575
3038
|
d: "M28 14L17 25L12 20",
|
|
@@ -2584,7 +3047,7 @@ function SuccessBadge() {
|
|
|
2584
3047
|
);
|
|
2585
3048
|
}
|
|
2586
3049
|
function FailedBadge() {
|
|
2587
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsxs20(
|
|
2588
3051
|
"svg",
|
|
2589
3052
|
{
|
|
2590
3053
|
width: "40",
|
|
@@ -2594,8 +3057,8 @@ function FailedBadge() {
|
|
|
2594
3057
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2595
3058
|
"aria-hidden": "true",
|
|
2596
3059
|
children: [
|
|
2597
|
-
/* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
3060
|
+
/* @__PURE__ */ jsx22("rect", { width: "40", height: "40", rx: "8", fill: "#FB2C36" }),
|
|
3061
|
+
/* @__PURE__ */ jsx22(
|
|
2599
3062
|
"path",
|
|
2600
3063
|
{
|
|
2601
3064
|
d: "M26 14L14 26M14 14L26 26",
|
|
@@ -2619,24 +3082,6 @@ var SOFT_DELAY_MS = {
|
|
|
2619
3082
|
bridging: 4 * 60 * 1e3
|
|
2620
3083
|
};
|
|
2621
3084
|
var PHASE_TIMINGS_PREFIX = "rhinestone:phase-timings";
|
|
2622
|
-
var STABLECOIN_SYMBOLS = /* @__PURE__ */ new Set([
|
|
2623
|
-
"USDC",
|
|
2624
|
-
"USDT",
|
|
2625
|
-
"DAI",
|
|
2626
|
-
"FRAX",
|
|
2627
|
-
"PYUSD",
|
|
2628
|
-
"USDP",
|
|
2629
|
-
"TUSD",
|
|
2630
|
-
"GUSD",
|
|
2631
|
-
"USDS",
|
|
2632
|
-
"LUSD",
|
|
2633
|
-
"BUSD",
|
|
2634
|
-
"USDE"
|
|
2635
|
-
]);
|
|
2636
|
-
function maxFractionDigitsFor(symbol) {
|
|
2637
|
-
if (!symbol) return 6;
|
|
2638
|
-
return STABLECOIN_SYMBOLS.has(symbol.toUpperCase()) ? 3 : 6;
|
|
2639
|
-
}
|
|
2640
3085
|
var PAYMENT_METHOD_LABELS = {
|
|
2641
3086
|
creditcard: "Card",
|
|
2642
3087
|
debitcard: "Card",
|
|
@@ -2713,10 +3158,10 @@ function formatTimer(seconds) {
|
|
|
2713
3158
|
return `${mins}:${String(secs).padStart(2, "0")}`;
|
|
2714
3159
|
}
|
|
2715
3160
|
function TickerChar({ value }) {
|
|
2716
|
-
const [current, setCurrent] =
|
|
2717
|
-
const [previous, setPrevious] =
|
|
2718
|
-
const [animKey, setAnimKey] =
|
|
2719
|
-
|
|
3161
|
+
const [current, setCurrent] = useState5(value);
|
|
3162
|
+
const [previous, setPrevious] = useState5(null);
|
|
3163
|
+
const [animKey, setAnimKey] = useState5(0);
|
|
3164
|
+
useEffect5(() => {
|
|
2720
3165
|
if (value === current) return;
|
|
2721
3166
|
setPrevious(current);
|
|
2722
3167
|
setCurrent(value);
|
|
@@ -2724,16 +3169,16 @@ function TickerChar({ value }) {
|
|
|
2724
3169
|
const timeout = setTimeout(() => setPrevious(null), 360);
|
|
2725
3170
|
return () => clearTimeout(timeout);
|
|
2726
3171
|
}, [value, current]);
|
|
2727
|
-
return /* @__PURE__ */
|
|
2728
|
-
previous !== null && /* @__PURE__ */
|
|
2729
|
-
/* @__PURE__ */
|
|
3172
|
+
return /* @__PURE__ */ jsxs20("span", { className: "rs-ticker-slot", children: [
|
|
3173
|
+
previous !== null && /* @__PURE__ */ jsx22("span", { className: "rs-ticker-out", children: previous }, `out-${animKey}`),
|
|
3174
|
+
/* @__PURE__ */ jsx22("span", { className: "rs-ticker-in", children: current }, `in-${animKey}`)
|
|
2730
3175
|
] });
|
|
2731
3176
|
}
|
|
2732
3177
|
function Ticker({ value }) {
|
|
2733
|
-
return /* @__PURE__ */
|
|
3178
|
+
return /* @__PURE__ */ jsx22("span", { className: "rs-ticker", "aria-label": value, children: value.split("").map((char, index) => (
|
|
2734
3179
|
// Position-stable key so each slot keeps its own animation state.
|
|
2735
3180
|
// eslint-disable-next-line react/no-array-index-key
|
|
2736
|
-
/* @__PURE__ */
|
|
3181
|
+
/* @__PURE__ */ jsx22(TickerChar, { value: char }, index)
|
|
2737
3182
|
)) });
|
|
2738
3183
|
}
|
|
2739
3184
|
function getPhaseStartTime(phaseId, phaseTimings) {
|
|
@@ -2806,11 +3251,11 @@ function ProcessingStep({
|
|
|
2806
3251
|
const onDepositCompleteRef = useLatestRef(onDepositComplete);
|
|
2807
3252
|
const onDepositFailedRef = useLatestRef(onDepositFailed);
|
|
2808
3253
|
const onErrorRef = useLatestRef(onError);
|
|
2809
|
-
const [state, setState] =
|
|
3254
|
+
const [state, setState] = useState5(
|
|
2810
3255
|
directTransfer ? { type: "complete" } : { type: "processing" }
|
|
2811
3256
|
);
|
|
2812
|
-
const [elapsedSeconds, setElapsedSeconds] =
|
|
2813
|
-
const [phaseTimings, setPhaseTimings] =
|
|
3257
|
+
const [elapsedSeconds, setElapsedSeconds] = useState5(0);
|
|
3258
|
+
const [phaseTimings, setPhaseTimings] = useState5(() => {
|
|
2814
3259
|
const saved = loadPhaseTimings(txHash);
|
|
2815
3260
|
if (saved) {
|
|
2816
3261
|
startTimeRef.current = saved.startedAt;
|
|
@@ -2818,7 +3263,7 @@ function ProcessingStep({
|
|
|
2818
3263
|
}
|
|
2819
3264
|
return { startedAt: startTimeRef.current };
|
|
2820
3265
|
});
|
|
2821
|
-
const [hasEscalatedDelay, setHasEscalatedDelay] =
|
|
3266
|
+
const [hasEscalatedDelay, setHasEscalatedDelay] = useState5(false);
|
|
2822
3267
|
const updatePhaseTimings = useCallback3(
|
|
2823
3268
|
(updater) => {
|
|
2824
3269
|
setPhaseTimings((previous) => {
|
|
@@ -2829,7 +3274,7 @@ function ProcessingStep({
|
|
|
2829
3274
|
},
|
|
2830
3275
|
[txHash]
|
|
2831
3276
|
);
|
|
2832
|
-
|
|
3277
|
+
useEffect5(() => {
|
|
2833
3278
|
if (!directTransfer) return;
|
|
2834
3279
|
const completedAt = Date.now();
|
|
2835
3280
|
updatePhaseTimings(() => ({
|
|
@@ -2860,7 +3305,7 @@ function ProcessingStep({
|
|
|
2860
3305
|
txHash,
|
|
2861
3306
|
updatePhaseTimings
|
|
2862
3307
|
]);
|
|
2863
|
-
|
|
3308
|
+
useEffect5(() => {
|
|
2864
3309
|
if (directTransfer || state.type !== "processing") return;
|
|
2865
3310
|
const updateElapsed = () => {
|
|
2866
3311
|
setElapsedSeconds(
|
|
@@ -2871,7 +3316,7 @@ function ProcessingStep({
|
|
|
2871
3316
|
const intervalId = setInterval(updateElapsed, 1e3);
|
|
2872
3317
|
return () => clearInterval(intervalId);
|
|
2873
3318
|
}, [directTransfer, state.type]);
|
|
2874
|
-
|
|
3319
|
+
useEffect5(() => {
|
|
2875
3320
|
if (state.type === "processing") return;
|
|
2876
3321
|
const endedAt = state.type === "complete" ? phaseTimings.completedAt ?? Date.now() : Date.now();
|
|
2877
3322
|
setElapsedSeconds(Math.floor((endedAt - startTimeRef.current) / 1e3));
|
|
@@ -2879,14 +3324,14 @@ function ProcessingStep({
|
|
|
2879
3324
|
(previous) => previous.endedAt !== void 0 ? previous : { ...previous, endedAt }
|
|
2880
3325
|
);
|
|
2881
3326
|
}, [phaseTimings.completedAt, state.type, updatePhaseTimings]);
|
|
2882
|
-
|
|
3327
|
+
useEffect5(() => {
|
|
2883
3328
|
if (!state.lastEvent) return;
|
|
2884
3329
|
updatePhaseTimings(
|
|
2885
3330
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
2886
3331
|
);
|
|
2887
3332
|
}, [state.lastEvent?.time, state.lastEvent?.type, updatePhaseTimings]);
|
|
2888
|
-
const [swappedFiatContext, setSwappedFiatContext] =
|
|
2889
|
-
|
|
3333
|
+
const [swappedFiatContext, setSwappedFiatContext] = useState5(null);
|
|
3334
|
+
useEffect5(() => {
|
|
2890
3335
|
let cancelled = false;
|
|
2891
3336
|
service.fetchSwappedOrderStatus(smartAccount).then((res) => {
|
|
2892
3337
|
if (cancelled || !res) return;
|
|
@@ -2907,7 +3352,7 @@ function ProcessingStep({
|
|
|
2907
3352
|
cancelled = true;
|
|
2908
3353
|
};
|
|
2909
3354
|
}, [service, smartAccount, txHash, isSwappedOrder]);
|
|
2910
|
-
|
|
3355
|
+
useEffect5(() => {
|
|
2911
3356
|
if (directTransfer) return;
|
|
2912
3357
|
if (state.type !== "processing") {
|
|
2913
3358
|
pollIntervalRef.current = INITIAL_POLL_INTERVAL;
|
|
@@ -3067,7 +3512,7 @@ function ProcessingStep({
|
|
|
3067
3512
|
state.type,
|
|
3068
3513
|
txHash
|
|
3069
3514
|
]);
|
|
3070
|
-
|
|
3515
|
+
useEffect5(() => {
|
|
3071
3516
|
if (directTransfer || state.type !== "processing") return;
|
|
3072
3517
|
const timeoutId = setTimeout(() => {
|
|
3073
3518
|
if (escalatedDelayRef.current) return;
|
|
@@ -3098,82 +3543,71 @@ function ProcessingStep({
|
|
|
3098
3543
|
const displayAmount = sourceDetails.amount ?? amount;
|
|
3099
3544
|
const sourceExplorerUrl = getExplorerTxUrl(displaySourceChain, txHash);
|
|
3100
3545
|
const destExplorerUrl = destinationTxHash ? getExplorerTxUrl(targetChain, destinationTxHash) : null;
|
|
3101
|
-
const
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
const raw = formatUnits(BigInt(displayAmount), sourceDecimals);
|
|
3111
|
-
const numeric = Number(raw);
|
|
3112
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3113
|
-
return numeric.toLocaleString("en-US", {
|
|
3114
|
-
minimumFractionDigits: 2,
|
|
3115
|
-
maximumFractionDigits: amountMaxDigits
|
|
3116
|
-
});
|
|
3117
|
-
} catch {
|
|
3118
|
-
return Number(displayAmount).toLocaleString("en-US", {
|
|
3119
|
-
minimumFractionDigits: 2,
|
|
3120
|
-
maximumFractionDigits: amountMaxDigits
|
|
3121
|
-
});
|
|
3122
|
-
}
|
|
3546
|
+
const sourceDisplay = (() => {
|
|
3547
|
+
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
3548
|
+
symbol: providedSourceSymbol ?? (displaySourceChain === "solana" ? "SOL" : "Token"),
|
|
3549
|
+
decimals: providedSourceDecimals
|
|
3550
|
+
});
|
|
3551
|
+
return {
|
|
3552
|
+
symbol: resolved.symbol,
|
|
3553
|
+
decimals: resolved.decimals ?? (displaySourceChain === "solana" ? 9 : 18)
|
|
3554
|
+
};
|
|
3123
3555
|
})();
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3556
|
+
const sourceSymbol = sourceDisplay.symbol;
|
|
3557
|
+
const formattedSentAmount = formatRawTokenAmount(displayAmount, sourceDisplay) ?? // Not raw base units (e.g. a decimal string) — render the number as-is.
|
|
3558
|
+
formatTokenAmount(Number(displayAmount), sourceDisplay.symbol) ?? displayAmount;
|
|
3559
|
+
const isBridgeHopDestination = hasPostBridgeActions && (lastEvent?.type === "bridge-started" || lastEvent?.type === "bridge-complete");
|
|
3560
|
+
const eventDestination = isBridgeHopDestination ? {} : getEventDestinationDetails(lastEvent);
|
|
3561
|
+
const targetDisplay = resolveTokenDisplay(
|
|
3562
|
+
eventDestination.token ?? targetToken,
|
|
3563
|
+
eventDestination.chainId ?? targetChain,
|
|
3564
|
+
// Dapp deposits default to USDC targets; mirror the source symbol last so
|
|
3565
|
+
// unresolvable same-token routes still label sensibly.
|
|
3566
|
+
{ symbol: providedSourceSymbol ?? "USDC" }
|
|
3567
|
+
);
|
|
3568
|
+
const targetSymbol = targetDisplay.symbol;
|
|
3569
|
+
const formattedDestinationAmount = eventDestination.amount !== void 0 ? formatRawTokenAmount(eventDestination.amount, targetDisplay) : void 0;
|
|
3570
|
+
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
3571
|
+
const prices = useTokenPrices(service, [
|
|
3572
|
+
sourceDisplay.symbol,
|
|
3573
|
+
targetDisplay.symbol
|
|
3574
|
+
]);
|
|
3575
|
+
const estimatedReceiveAmount = (() => {
|
|
3576
|
+
const estimate = estimateReceiveAmount({
|
|
3577
|
+
sourceAmount: tokenAmountToNumber(displayAmount, sourceDisplay.decimals),
|
|
3578
|
+
sourceSymbol: sourceDisplay.symbol,
|
|
3579
|
+
targetSymbol: targetDisplay.symbol,
|
|
3580
|
+
sourceAmountUsd: amountUsdNumber,
|
|
3581
|
+
prices
|
|
3582
|
+
});
|
|
3583
|
+
return estimate !== void 0 ? formatTokenAmount(estimate, targetDisplay.symbol) : void 0;
|
|
3132
3584
|
})();
|
|
3133
|
-
const
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3585
|
+
const receiveDisplay = formattedDestinationAmount ? `${formattedDestinationAmount} ${targetSymbol}` : estimatedReceiveAmount !== void 0 ? `~${estimatedReceiveAmount} ${targetSymbol}` : amountUsdNumber !== void 0 ? `~$${amountUsdNumber.toFixed(2)}` : (
|
|
3586
|
+
// Cross-token with no price and no USD context (rare QR case):
|
|
3587
|
+
// an honest dash beats a wrong number.
|
|
3588
|
+
"\u2014"
|
|
3589
|
+
);
|
|
3590
|
+
const formattedBridgingCost = (() => {
|
|
3591
|
+
if (sourceSymbol.toUpperCase() !== targetSymbol.toUpperCase()) {
|
|
3137
3592
|
return void 0;
|
|
3138
3593
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
try {
|
|
3143
|
-
const raw = formatUnits(destinationAmountRaw, sourceDecimals);
|
|
3144
|
-
const numeric = Number(raw);
|
|
3145
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3146
|
-
return numeric.toLocaleString("en-US", {
|
|
3147
|
-
minimumFractionDigits: 2,
|
|
3148
|
-
maximumFractionDigits: amountMaxDigits
|
|
3149
|
-
});
|
|
3150
|
-
} catch {
|
|
3594
|
+
const sentValue = tokenAmountToNumber(displayAmount, sourceDisplay.decimals);
|
|
3595
|
+
const receivedValue = eventDestination.amount !== void 0 ? tokenAmountToNumber(eventDestination.amount, targetDisplay.decimals) : void 0;
|
|
3596
|
+
if (sentValue === void 0 || receivedValue === void 0 || sentValue <= receivedValue) {
|
|
3151
3597
|
return void 0;
|
|
3152
3598
|
}
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
try {
|
|
3156
|
-
const raw = formatUnits(bridgingCostRaw, sourceDecimals);
|
|
3157
|
-
const numeric = Number(raw);
|
|
3158
|
-
if (!Number.isFinite(numeric)) return raw;
|
|
3159
|
-
return numeric.toLocaleString("en-US", {
|
|
3160
|
-
minimumFractionDigits: 2,
|
|
3161
|
-
maximumFractionDigits: amountMaxDigits
|
|
3162
|
-
});
|
|
3163
|
-
} catch {
|
|
3599
|
+
const formatted = formatTokenAmount(sentValue - receivedValue, sourceSymbol);
|
|
3600
|
+
if (formatted === void 0 || Number(formatted.replace(/,/g, "")) === 0) {
|
|
3164
3601
|
return void 0;
|
|
3165
3602
|
}
|
|
3166
|
-
|
|
3603
|
+
return formatted;
|
|
3604
|
+
})();
|
|
3167
3605
|
const currentPhaseId = getCurrentPhaseId(state, phaseTimings);
|
|
3168
3606
|
const activePhaseStartedAt = currentPhaseId ? getPhaseStartTime(currentPhaseId, phaseTimings) : void 0;
|
|
3169
3607
|
const activePhaseElapsedMs = isProcessing && activePhaseStartedAt !== void 0 ? timelineNowMs - activePhaseStartedAt : 0;
|
|
3170
3608
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
3171
3609
|
void delayPhaseId;
|
|
3172
3610
|
void hasEscalatedDelay;
|
|
3173
|
-
const targetSymbol = (() => {
|
|
3174
|
-
const resolved = getTargetTokenSymbol(targetToken, targetChain);
|
|
3175
|
-
return resolved !== "Token" ? resolved : providedSourceSymbol ?? "USDC";
|
|
3176
|
-
})();
|
|
3177
3611
|
const targetTokenIcon = getTokenIcon(targetSymbol);
|
|
3178
3612
|
const sourceChainIcon = getChainIcon(displaySourceChain);
|
|
3179
3613
|
const targetChainIcon = getChainIcon(targetChain);
|
|
@@ -3185,23 +3619,58 @@ function ProcessingStep({
|
|
|
3185
3619
|
const feeTooltip = uiConfig?.feeTooltip ?? (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.");
|
|
3186
3620
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
3187
3621
|
const handleRetry = onRetry ?? onNewDeposit;
|
|
3188
|
-
const headerContent = isComplete ? /* @__PURE__ */
|
|
3189
|
-
/* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
] }) : isFailed ? /* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3193
|
-
/* @__PURE__ */
|
|
3194
|
-
] }) : /* @__PURE__ */
|
|
3195
|
-
|
|
3196
|
-
|
|
3622
|
+
const headerContent = isComplete ? /* @__PURE__ */ jsxs20("div", { className: "rs-body-header", children: [
|
|
3623
|
+
/* @__PURE__ */ jsx22(SuccessBadge, {}),
|
|
3624
|
+
/* @__PURE__ */ jsx22("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx22("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
3625
|
+
] }) : isFailed ? /* @__PURE__ */ jsxs20("div", { className: "rs-body-header", children: [
|
|
3626
|
+
/* @__PURE__ */ jsx22(FailedBadge, {}),
|
|
3627
|
+
/* @__PURE__ */ jsx22("div", { className: "rs-body-header-text", children: /* @__PURE__ */ jsx22("h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
3628
|
+
] }) : /* @__PURE__ */ jsx22(BodyHeader, { icon: /* @__PURE__ */ jsx22(WalletIcon, {}), title: stateTitle });
|
|
3629
|
+
if (isComplete && isSwappedOrder) {
|
|
3630
|
+
const onrampMethod = swappedFiatContext?.paymentMethod ? formatPaymentMethod(swappedFiatContext.paymentMethod) : null;
|
|
3631
|
+
const amountPaid = swappedFiatContext?.paidAmountUsd != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null;
|
|
3632
|
+
const depositedAmount = receiveDisplay;
|
|
3633
|
+
const onrampFeeUsd = swappedFiatContext?.onrampFeeUsd ?? null;
|
|
3634
|
+
const networkFeeUsd = quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
3635
|
+
const feeRows = [];
|
|
3636
|
+
if (onrampFeeUsd != null) {
|
|
3637
|
+
feeRows.push({
|
|
3638
|
+
label: "On-ramp fee",
|
|
3639
|
+
value: `$${onrampFeeUsd.toFixed(2)}`
|
|
3640
|
+
});
|
|
3641
|
+
}
|
|
3642
|
+
if (networkFeeUsd != null) {
|
|
3643
|
+
feeRows.push({
|
|
3644
|
+
label: "Network fee",
|
|
3645
|
+
value: `$${networkFeeUsd.toFixed(2)}`
|
|
3646
|
+
});
|
|
3647
|
+
}
|
|
3648
|
+
const feesTotal = feeRows.length > 0 ? `$${((onrampFeeUsd ?? 0) + (networkFeeUsd ?? 0)).toFixed(2)}` : null;
|
|
3649
|
+
return /* @__PURE__ */ jsx22(
|
|
3650
|
+
SwappedReceipt,
|
|
3651
|
+
{
|
|
3652
|
+
onrampMethod,
|
|
3653
|
+
amountPaid,
|
|
3654
|
+
depositedAmount,
|
|
3655
|
+
depositedIcon: targetTokenIcon,
|
|
3656
|
+
feesTotal,
|
|
3657
|
+
feeRows,
|
|
3658
|
+
newLabel: `New ${flowNoun}`,
|
|
3659
|
+
onNewDeposit,
|
|
3660
|
+
onClose
|
|
3661
|
+
}
|
|
3662
|
+
);
|
|
3663
|
+
}
|
|
3664
|
+
return /* @__PURE__ */ jsxs20("div", { className: "rs-screen", children: [
|
|
3665
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3197
3666
|
headerContent,
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
sourceChainIcon && /* @__PURE__ */
|
|
3204
|
-
|
|
3667
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-review-details", children: [
|
|
3668
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3669
|
+
/* @__PURE__ */ jsx22("span", { children: "Source chain" }),
|
|
3670
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3671
|
+
/* @__PURE__ */ jsx22("span", { children: sourceChainName }),
|
|
3672
|
+
sourceChainIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: sourceChainIcon, alt: "" }) }),
|
|
3673
|
+
sourceExplorerUrl && /* @__PURE__ */ jsx22(
|
|
3205
3674
|
"a",
|
|
3206
3675
|
{
|
|
3207
3676
|
href: sourceExplorerUrl,
|
|
@@ -3209,17 +3678,17 @@ function ProcessingStep({
|
|
|
3209
3678
|
rel: "noopener noreferrer",
|
|
3210
3679
|
className: "rs-review-detail-link",
|
|
3211
3680
|
"aria-label": "View source transaction",
|
|
3212
|
-
children: /* @__PURE__ */
|
|
3681
|
+
children: /* @__PURE__ */ jsx22(ExternalLinkIcon, {})
|
|
3213
3682
|
}
|
|
3214
3683
|
)
|
|
3215
3684
|
] })
|
|
3216
3685
|
] }),
|
|
3217
|
-
/* @__PURE__ */
|
|
3218
|
-
/* @__PURE__ */
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
/* @__PURE__ */
|
|
3221
|
-
targetChainIcon && /* @__PURE__ */
|
|
3222
|
-
|
|
3686
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3687
|
+
/* @__PURE__ */ jsx22("span", { children: "Destination chain" }),
|
|
3688
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3689
|
+
/* @__PURE__ */ jsx22("span", { children: targetChainName }),
|
|
3690
|
+
targetChainIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: targetChainIcon, alt: "" }) }),
|
|
3691
|
+
destExplorerUrl && /* @__PURE__ */ jsx22(
|
|
3223
3692
|
"a",
|
|
3224
3693
|
{
|
|
3225
3694
|
href: destExplorerUrl,
|
|
@@ -3227,75 +3696,75 @@ function ProcessingStep({
|
|
|
3227
3696
|
rel: "noopener noreferrer",
|
|
3228
3697
|
className: "rs-review-detail-link",
|
|
3229
3698
|
"aria-label": "View destination transaction",
|
|
3230
|
-
children: /* @__PURE__ */
|
|
3699
|
+
children: /* @__PURE__ */ jsx22(ExternalLinkIcon, {})
|
|
3231
3700
|
}
|
|
3232
3701
|
)
|
|
3233
3702
|
] })
|
|
3234
3703
|
] }),
|
|
3235
|
-
/* @__PURE__ */
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3704
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3705
|
+
/* @__PURE__ */ jsx22("span", { children: isProcessing ? "Time elapsed" : "Total time" }),
|
|
3706
|
+
/* @__PURE__ */ jsx22("span", { className: "rs-review-detail-value", children: /* @__PURE__ */ jsx22(Ticker, { value: timerText }) })
|
|
3238
3707
|
] }),
|
|
3239
|
-
isSwappedOrder ? /* @__PURE__ */
|
|
3240
|
-
swappedFiatContext?.paidAmountUsd != null && /* @__PURE__ */
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
/* @__PURE__ */
|
|
3708
|
+
isSwappedOrder ? /* @__PURE__ */ jsxs20(Fragment4, { children: [
|
|
3709
|
+
swappedFiatContext?.paidAmountUsd != null && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3710
|
+
/* @__PURE__ */ jsx22("span", { children: "You pay" }),
|
|
3711
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3243
3712
|
"$",
|
|
3244
3713
|
swappedFiatContext.paidAmountUsd.toFixed(2),
|
|
3245
|
-
swappedFiatContext.paymentMethod && /* @__PURE__ */
|
|
3714
|
+
swappedFiatContext.paymentMethod && /* @__PURE__ */ jsxs20("span", { style: { color: "#71717b", marginLeft: 6 }, children: [
|
|
3246
3715
|
"via",
|
|
3247
3716
|
" ",
|
|
3248
3717
|
formatPaymentMethod(swappedFiatContext.paymentMethod)
|
|
3249
3718
|
] })
|
|
3250
3719
|
] })
|
|
3251
3720
|
] }),
|
|
3252
|
-
swappedFiatContext?.onrampFeeUsd != null && /* @__PURE__ */
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3721
|
+
swappedFiatContext?.onrampFeeUsd != null && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3722
|
+
/* @__PURE__ */ jsx22("span", { children: "On-ramp fee" }),
|
|
3723
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3255
3724
|
"$",
|
|
3256
3725
|
swappedFiatContext.onrampFeeUsd.toFixed(2)
|
|
3257
3726
|
] })
|
|
3258
3727
|
] }),
|
|
3259
|
-
formattedBridgingCost && /* @__PURE__ */
|
|
3260
|
-
/* @__PURE__ */
|
|
3261
|
-
/* @__PURE__ */
|
|
3262
|
-
/* @__PURE__ */
|
|
3728
|
+
formattedBridgingCost && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3729
|
+
/* @__PURE__ */ jsx22("span", { children: "Bridging cost" }),
|
|
3730
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3731
|
+
/* @__PURE__ */ jsxs20("span", { children: [
|
|
3263
3732
|
formattedBridgingCost,
|
|
3264
3733
|
" ",
|
|
3265
3734
|
sourceSymbol
|
|
3266
3735
|
] }),
|
|
3267
|
-
sourceTokenIcon && /* @__PURE__ */
|
|
3736
|
+
sourceTokenIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: sourceTokenIcon, alt: "" }) })
|
|
3268
3737
|
] })
|
|
3269
3738
|
] })
|
|
3270
|
-
] }) : /* @__PURE__ */
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3274
|
-
|
|
3739
|
+
] }) : /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3740
|
+
/* @__PURE__ */ jsx22("span", { children: isProcessing ? "You send" : "You sent" }),
|
|
3741
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3742
|
+
/* @__PURE__ */ jsxs20("span", { children: [
|
|
3743
|
+
formattedSentAmount,
|
|
3275
3744
|
" ",
|
|
3276
3745
|
sourceSymbol
|
|
3277
3746
|
] }),
|
|
3278
|
-
sourceTokenIcon && /* @__PURE__ */
|
|
3747
|
+
sourceTokenIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: sourceTokenIcon, alt: "" }) })
|
|
3279
3748
|
] })
|
|
3280
3749
|
] }),
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
/* @__PURE__ */
|
|
3285
|
-
targetTokenIcon && /* @__PURE__ */
|
|
3750
|
+
/* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3751
|
+
/* @__PURE__ */ jsx22("span", { children: isProcessing ? "Receive" : "Received" }),
|
|
3752
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3753
|
+
/* @__PURE__ */ jsx22("span", { children: receiveDisplay }),
|
|
3754
|
+
targetTokenIcon && /* @__PURE__ */ jsx22("span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ jsx22("img", { src: targetTokenIcon, alt: "" }) })
|
|
3286
3755
|
] })
|
|
3287
3756
|
] }),
|
|
3288
|
-
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */
|
|
3289
|
-
/* @__PURE__ */
|
|
3290
|
-
/* @__PURE__ */
|
|
3757
|
+
isFailed && balanceAfterUsd !== void 0 && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3758
|
+
/* @__PURE__ */ jsx22("span", { children: "Balance" }),
|
|
3759
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3291
3760
|
"$",
|
|
3292
3761
|
balanceAfterUsd.toFixed(2)
|
|
3293
3762
|
] })
|
|
3294
3763
|
] }),
|
|
3295
|
-
isSwappedOrder ? quotedFeeAmount !== void 0 && /* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
/* @__PURE__ */
|
|
3298
|
-
/* @__PURE__ */
|
|
3764
|
+
isSwappedOrder ? quotedFeeAmount !== void 0 && /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3765
|
+
/* @__PURE__ */ jsx22("span", { children: "Fees" }),
|
|
3766
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3767
|
+
/* @__PURE__ */ jsxs20(
|
|
3299
3768
|
"span",
|
|
3300
3769
|
{
|
|
3301
3770
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
@@ -3306,22 +3775,22 @@ function ProcessingStep({
|
|
|
3306
3775
|
]
|
|
3307
3776
|
}
|
|
3308
3777
|
),
|
|
3309
|
-
/* @__PURE__ */
|
|
3778
|
+
/* @__PURE__ */ jsx22(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx22(
|
|
3310
3779
|
"span",
|
|
3311
3780
|
{
|
|
3312
3781
|
className: "rs-review-detail-info",
|
|
3313
3782
|
"aria-label": "Fee info",
|
|
3314
|
-
children: /* @__PURE__ */
|
|
3783
|
+
children: /* @__PURE__ */ jsx22(InfoIcon, {})
|
|
3315
3784
|
}
|
|
3316
3785
|
) })
|
|
3317
3786
|
] })
|
|
3318
3787
|
] }) : (() => {
|
|
3319
3788
|
const feeValue = quotedFeeAmount ?? formattedBridgingCost;
|
|
3320
3789
|
if (feeValue === void 0) return null;
|
|
3321
|
-
return /* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ jsxs20("div", { className: "rs-review-detail-row", children: [
|
|
3791
|
+
/* @__PURE__ */ jsx22("span", { children: "Fees" }),
|
|
3792
|
+
/* @__PURE__ */ jsxs20("span", { className: "rs-review-detail-value", children: [
|
|
3793
|
+
/* @__PURE__ */ jsxs20(
|
|
3325
3794
|
"span",
|
|
3326
3795
|
{
|
|
3327
3796
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
@@ -3332,20 +3801,20 @@ function ProcessingStep({
|
|
|
3332
3801
|
]
|
|
3333
3802
|
}
|
|
3334
3803
|
),
|
|
3335
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsx22(Tooltip, { content: feeTooltip, children: /* @__PURE__ */ jsx22(
|
|
3336
3805
|
"span",
|
|
3337
3806
|
{
|
|
3338
3807
|
className: "rs-review-detail-info",
|
|
3339
3808
|
"aria-label": "Fee info",
|
|
3340
|
-
children: /* @__PURE__ */
|
|
3809
|
+
children: /* @__PURE__ */ jsx22(InfoIcon, {})
|
|
3341
3810
|
}
|
|
3342
3811
|
) })
|
|
3343
3812
|
] })
|
|
3344
3813
|
] });
|
|
3345
3814
|
})()
|
|
3346
3815
|
] }),
|
|
3347
|
-
isFailed && failureMessage && /* @__PURE__ */
|
|
3348
|
-
isProcessing && /* @__PURE__ */
|
|
3816
|
+
isFailed && failureMessage && /* @__PURE__ */ jsx22(Callout, { variant: "error", children: failureMessage }),
|
|
3817
|
+
isProcessing && /* @__PURE__ */ jsx22(
|
|
3349
3818
|
Button,
|
|
3350
3819
|
{
|
|
3351
3820
|
fullWidth: true,
|
|
@@ -3355,307 +3824,22 @@ function ProcessingStep({
|
|
|
3355
3824
|
children: "Submitting transaction\u2026"
|
|
3356
3825
|
}
|
|
3357
3826
|
),
|
|
3358
|
-
isComplete && /* @__PURE__ */
|
|
3359
|
-
onNewDeposit && /* @__PURE__ */
|
|
3827
|
+
isComplete && /* @__PURE__ */ jsxs20("div", { className: "rs-screen-button-row", children: [
|
|
3828
|
+
onNewDeposit && /* @__PURE__ */ jsxs20(Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: [
|
|
3360
3829
|
"New ",
|
|
3361
3830
|
flowNoun
|
|
3362
3831
|
] }),
|
|
3363
|
-
onClose && /* @__PURE__ */
|
|
3832
|
+
onClose && /* @__PURE__ */ jsx22(Button, { onClick: onClose, fullWidth: true, children: "Done" })
|
|
3364
3833
|
] }),
|
|
3365
|
-
isFailed && /* @__PURE__ */
|
|
3366
|
-
onClose && /* @__PURE__ */
|
|
3367
|
-
handleRetry && /* @__PURE__ */
|
|
3834
|
+
isFailed && /* @__PURE__ */ jsxs20("div", { className: "rs-screen-button-row", children: [
|
|
3835
|
+
onClose && /* @__PURE__ */ jsx22(Button, { variant: "outline", onClick: onClose, fullWidth: true, children: "Cancel" }),
|
|
3836
|
+
handleRetry && /* @__PURE__ */ jsx22(Button, { onClick: handleRetry, fullWidth: true, children: "Try again" })
|
|
3368
3837
|
] })
|
|
3369
3838
|
] }),
|
|
3370
|
-
/* @__PURE__ */
|
|
3839
|
+
/* @__PURE__ */ jsx22(PoweredBy, {})
|
|
3371
3840
|
] });
|
|
3372
3841
|
}
|
|
3373
3842
|
|
|
3374
|
-
// src/core/safe.ts
|
|
3375
|
-
import {
|
|
3376
|
-
concat,
|
|
3377
|
-
encodeFunctionData,
|
|
3378
|
-
erc20Abi,
|
|
3379
|
-
hashTypedData,
|
|
3380
|
-
pad,
|
|
3381
|
-
parseEventLogs,
|
|
3382
|
-
toHex,
|
|
3383
|
-
zeroAddress
|
|
3384
|
-
} from "viem";
|
|
3385
|
-
var SAFE_ABI = [
|
|
3386
|
-
{
|
|
3387
|
-
type: "function",
|
|
3388
|
-
name: "isOwner",
|
|
3389
|
-
stateMutability: "view",
|
|
3390
|
-
inputs: [{ name: "owner", type: "address" }],
|
|
3391
|
-
outputs: [{ name: "", type: "bool" }]
|
|
3392
|
-
},
|
|
3393
|
-
{
|
|
3394
|
-
type: "function",
|
|
3395
|
-
name: "nonce",
|
|
3396
|
-
stateMutability: "view",
|
|
3397
|
-
inputs: [],
|
|
3398
|
-
outputs: [{ type: "uint256" }]
|
|
3399
|
-
},
|
|
3400
|
-
{
|
|
3401
|
-
type: "function",
|
|
3402
|
-
name: "execTransaction",
|
|
3403
|
-
stateMutability: "payable",
|
|
3404
|
-
inputs: [
|
|
3405
|
-
{ name: "to", type: "address" },
|
|
3406
|
-
{ name: "value", type: "uint256" },
|
|
3407
|
-
{ name: "data", type: "bytes" },
|
|
3408
|
-
{ name: "operation", type: "uint8" },
|
|
3409
|
-
{ name: "safeTxGas", type: "uint256" },
|
|
3410
|
-
{ name: "baseGas", type: "uint256" },
|
|
3411
|
-
{ name: "gasPrice", type: "uint256" },
|
|
3412
|
-
{ name: "gasToken", type: "address" },
|
|
3413
|
-
{ name: "refundReceiver", type: "address" },
|
|
3414
|
-
{ name: "signatures", type: "bytes" }
|
|
3415
|
-
],
|
|
3416
|
-
outputs: [{ name: "success", type: "bool" }]
|
|
3417
|
-
},
|
|
3418
|
-
{
|
|
3419
|
-
type: "event",
|
|
3420
|
-
name: "ExecutionSuccess",
|
|
3421
|
-
inputs: [
|
|
3422
|
-
{ name: "txHash", type: "bytes32", indexed: true },
|
|
3423
|
-
{ name: "payment", type: "uint256", indexed: false }
|
|
3424
|
-
],
|
|
3425
|
-
anonymous: false
|
|
3426
|
-
},
|
|
3427
|
-
{
|
|
3428
|
-
type: "event",
|
|
3429
|
-
name: "ExecutionFailure",
|
|
3430
|
-
inputs: [
|
|
3431
|
-
{ name: "txHash", type: "bytes32", indexed: true },
|
|
3432
|
-
{ name: "payment", type: "uint256", indexed: false }
|
|
3433
|
-
],
|
|
3434
|
-
anonymous: false
|
|
3435
|
-
}
|
|
3436
|
-
];
|
|
3437
|
-
async function executeSafeEthTransfer(params) {
|
|
3438
|
-
const {
|
|
3439
|
-
walletClient,
|
|
3440
|
-
publicClient,
|
|
3441
|
-
safeAddress,
|
|
3442
|
-
recipient,
|
|
3443
|
-
amount,
|
|
3444
|
-
chainId
|
|
3445
|
-
} = params;
|
|
3446
|
-
const account = walletClient.account;
|
|
3447
|
-
const chain = walletClient.chain;
|
|
3448
|
-
if (!account || !chain) {
|
|
3449
|
-
throw new Error("Wallet not connected");
|
|
3450
|
-
}
|
|
3451
|
-
if (chain.id !== chainId) {
|
|
3452
|
-
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
3453
|
-
}
|
|
3454
|
-
const isOwner = await publicClient.readContract({
|
|
3455
|
-
address: safeAddress,
|
|
3456
|
-
abi: SAFE_ABI,
|
|
3457
|
-
functionName: "isOwner",
|
|
3458
|
-
args: [account.address]
|
|
3459
|
-
});
|
|
3460
|
-
if (!isOwner) {
|
|
3461
|
-
throw new Error("Connected wallet is not a Safe owner");
|
|
3462
|
-
}
|
|
3463
|
-
const safeTx = {
|
|
3464
|
-
to: recipient,
|
|
3465
|
-
value: amount,
|
|
3466
|
-
data: "0x",
|
|
3467
|
-
operation: 0,
|
|
3468
|
-
safeTxGas: 0n,
|
|
3469
|
-
baseGas: 0n,
|
|
3470
|
-
gasPrice: 0n,
|
|
3471
|
-
gasToken: zeroAddress,
|
|
3472
|
-
refundReceiver: zeroAddress
|
|
3473
|
-
};
|
|
3474
|
-
const signature = concat([
|
|
3475
|
-
pad(account.address, { size: 32 }),
|
|
3476
|
-
pad(toHex(0), { size: 32 }),
|
|
3477
|
-
toHex(1, { size: 1 })
|
|
3478
|
-
]);
|
|
3479
|
-
const txHash = await walletClient.writeContract({
|
|
3480
|
-
account,
|
|
3481
|
-
chain,
|
|
3482
|
-
address: safeAddress,
|
|
3483
|
-
abi: SAFE_ABI,
|
|
3484
|
-
functionName: "execTransaction",
|
|
3485
|
-
args: [
|
|
3486
|
-
safeTx.to,
|
|
3487
|
-
safeTx.value,
|
|
3488
|
-
safeTx.data,
|
|
3489
|
-
safeTx.operation,
|
|
3490
|
-
safeTx.safeTxGas,
|
|
3491
|
-
safeTx.baseGas,
|
|
3492
|
-
safeTx.gasPrice,
|
|
3493
|
-
safeTx.gasToken,
|
|
3494
|
-
safeTx.refundReceiver,
|
|
3495
|
-
signature
|
|
3496
|
-
]
|
|
3497
|
-
});
|
|
3498
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
3499
|
-
hash: txHash
|
|
3500
|
-
});
|
|
3501
|
-
const safeLogs = receipt.logs.filter(
|
|
3502
|
-
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3503
|
-
);
|
|
3504
|
-
const parsed = parseEventLogs({
|
|
3505
|
-
abi: SAFE_ABI,
|
|
3506
|
-
logs: safeLogs,
|
|
3507
|
-
strict: false
|
|
3508
|
-
});
|
|
3509
|
-
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
3510
|
-
if (failed) {
|
|
3511
|
-
throw new Error("Safe transaction failed");
|
|
3512
|
-
}
|
|
3513
|
-
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
3514
|
-
if (!succeeded) {
|
|
3515
|
-
throw new Error("Safe transaction status unavailable");
|
|
3516
|
-
}
|
|
3517
|
-
return { txHash };
|
|
3518
|
-
}
|
|
3519
|
-
async function executeSafeErc20Transfer(params) {
|
|
3520
|
-
const {
|
|
3521
|
-
walletClient,
|
|
3522
|
-
publicClient,
|
|
3523
|
-
safeAddress,
|
|
3524
|
-
tokenAddress,
|
|
3525
|
-
recipient,
|
|
3526
|
-
amount,
|
|
3527
|
-
chainId
|
|
3528
|
-
} = params;
|
|
3529
|
-
const account = walletClient.account;
|
|
3530
|
-
const chain = walletClient.chain;
|
|
3531
|
-
if (!account || !chain) {
|
|
3532
|
-
throw new Error("Wallet not connected");
|
|
3533
|
-
}
|
|
3534
|
-
if (chain.id !== chainId) {
|
|
3535
|
-
throw new Error(`Switch to ${getChainName(chainId)} to sign`);
|
|
3536
|
-
}
|
|
3537
|
-
const isOwner = await publicClient.readContract({
|
|
3538
|
-
address: safeAddress,
|
|
3539
|
-
abi: SAFE_ABI,
|
|
3540
|
-
functionName: "isOwner",
|
|
3541
|
-
args: [account.address]
|
|
3542
|
-
});
|
|
3543
|
-
if (!isOwner) {
|
|
3544
|
-
throw new Error("Connected wallet is not a Safe owner");
|
|
3545
|
-
}
|
|
3546
|
-
const data = encodeFunctionData({
|
|
3547
|
-
abi: erc20Abi,
|
|
3548
|
-
functionName: "transfer",
|
|
3549
|
-
args: [recipient, amount]
|
|
3550
|
-
});
|
|
3551
|
-
const safeTx = {
|
|
3552
|
-
to: tokenAddress,
|
|
3553
|
-
value: 0n,
|
|
3554
|
-
data,
|
|
3555
|
-
operation: 0,
|
|
3556
|
-
safeTxGas: 0n,
|
|
3557
|
-
baseGas: 0n,
|
|
3558
|
-
gasPrice: 0n,
|
|
3559
|
-
gasToken: zeroAddress,
|
|
3560
|
-
refundReceiver: zeroAddress
|
|
3561
|
-
};
|
|
3562
|
-
const signature = concat([
|
|
3563
|
-
pad(account.address, { size: 32 }),
|
|
3564
|
-
pad(toHex(0), { size: 32 }),
|
|
3565
|
-
toHex(1, { size: 1 })
|
|
3566
|
-
]);
|
|
3567
|
-
const txHash = await walletClient.writeContract({
|
|
3568
|
-
account,
|
|
3569
|
-
chain,
|
|
3570
|
-
address: safeAddress,
|
|
3571
|
-
abi: SAFE_ABI,
|
|
3572
|
-
functionName: "execTransaction",
|
|
3573
|
-
args: [
|
|
3574
|
-
safeTx.to,
|
|
3575
|
-
safeTx.value,
|
|
3576
|
-
safeTx.data,
|
|
3577
|
-
safeTx.operation,
|
|
3578
|
-
safeTx.safeTxGas,
|
|
3579
|
-
safeTx.baseGas,
|
|
3580
|
-
safeTx.gasPrice,
|
|
3581
|
-
safeTx.gasToken,
|
|
3582
|
-
safeTx.refundReceiver,
|
|
3583
|
-
signature
|
|
3584
|
-
]
|
|
3585
|
-
});
|
|
3586
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
3587
|
-
hash: txHash
|
|
3588
|
-
});
|
|
3589
|
-
const safeLogs = receipt.logs.filter(
|
|
3590
|
-
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3591
|
-
);
|
|
3592
|
-
const parsed = parseEventLogs({
|
|
3593
|
-
abi: SAFE_ABI,
|
|
3594
|
-
logs: safeLogs,
|
|
3595
|
-
strict: false
|
|
3596
|
-
});
|
|
3597
|
-
const failed = parsed.find((log) => log.eventName === "ExecutionFailure");
|
|
3598
|
-
if (failed) {
|
|
3599
|
-
throw new Error("Safe transaction failed");
|
|
3600
|
-
}
|
|
3601
|
-
const succeeded = parsed.find((log) => log.eventName === "ExecutionSuccess");
|
|
3602
|
-
if (!succeeded) {
|
|
3603
|
-
throw new Error("Safe transaction status unavailable");
|
|
3604
|
-
}
|
|
3605
|
-
return { txHash };
|
|
3606
|
-
}
|
|
3607
|
-
var SAFE_TX_TYPES = {
|
|
3608
|
-
SafeTx: [
|
|
3609
|
-
{ name: "to", type: "address" },
|
|
3610
|
-
{ name: "value", type: "uint256" },
|
|
3611
|
-
{ name: "data", type: "bytes" },
|
|
3612
|
-
{ name: "operation", type: "uint8" },
|
|
3613
|
-
{ name: "safeTxGas", type: "uint256" },
|
|
3614
|
-
{ name: "baseGas", type: "uint256" },
|
|
3615
|
-
{ name: "gasPrice", type: "uint256" },
|
|
3616
|
-
{ name: "gasToken", type: "address" },
|
|
3617
|
-
{ name: "refundReceiver", type: "address" },
|
|
3618
|
-
{ name: "nonce", type: "uint256" }
|
|
3619
|
-
]
|
|
3620
|
-
};
|
|
3621
|
-
async function buildSafeTransaction(params) {
|
|
3622
|
-
const { publicClient, safeAddress, to, value, data, chainId } = params;
|
|
3623
|
-
const nonce = await publicClient.readContract({
|
|
3624
|
-
address: safeAddress,
|
|
3625
|
-
abi: SAFE_ABI,
|
|
3626
|
-
functionName: "nonce"
|
|
3627
|
-
});
|
|
3628
|
-
const message = {
|
|
3629
|
-
to,
|
|
3630
|
-
value,
|
|
3631
|
-
data,
|
|
3632
|
-
operation: 0,
|
|
3633
|
-
safeTxGas: 0n,
|
|
3634
|
-
baseGas: 0n,
|
|
3635
|
-
gasPrice: 0n,
|
|
3636
|
-
gasToken: zeroAddress,
|
|
3637
|
-
refundReceiver: zeroAddress,
|
|
3638
|
-
nonce
|
|
3639
|
-
};
|
|
3640
|
-
const safeTxHash = hashTypedData({
|
|
3641
|
-
domain: { chainId, verifyingContract: safeAddress },
|
|
3642
|
-
types: SAFE_TX_TYPES,
|
|
3643
|
-
primaryType: "SafeTx",
|
|
3644
|
-
message
|
|
3645
|
-
});
|
|
3646
|
-
return {
|
|
3647
|
-
chainId,
|
|
3648
|
-
safeAddress,
|
|
3649
|
-
safeTxHash,
|
|
3650
|
-
typedData: {
|
|
3651
|
-
domain: { chainId, verifyingContract: safeAddress },
|
|
3652
|
-
types: SAFE_TX_TYPES,
|
|
3653
|
-
primaryType: "SafeTx",
|
|
3654
|
-
message
|
|
3655
|
-
}
|
|
3656
|
-
};
|
|
3657
|
-
}
|
|
3658
|
-
|
|
3659
3843
|
// src/core/session-owner.ts
|
|
3660
3844
|
import { isAddress } from "viem";
|
|
3661
3845
|
import {
|
|
@@ -3725,6 +3909,7 @@ export {
|
|
|
3725
3909
|
PlusCircleIcon,
|
|
3726
3910
|
CircleArrowOutUpLeftIcon,
|
|
3727
3911
|
BankIcon,
|
|
3912
|
+
UnplugIcon,
|
|
3728
3913
|
Callout,
|
|
3729
3914
|
BodyHeader,
|
|
3730
3915
|
PoweredBy,
|
|
@@ -3744,17 +3929,16 @@ export {
|
|
|
3744
3929
|
isUnsupportedChainSwitchError,
|
|
3745
3930
|
formatUserError,
|
|
3746
3931
|
Tooltip,
|
|
3932
|
+
formatTokenAmount,
|
|
3933
|
+
formatReceiveEstimate,
|
|
3747
3934
|
getEventTxHash,
|
|
3748
3935
|
getEventSourceDetails,
|
|
3749
3936
|
isDepositEvent,
|
|
3750
3937
|
isFailedEvent,
|
|
3751
3938
|
txRefsMatch,
|
|
3752
3939
|
failureMessageForEvent,
|
|
3940
|
+
useTokenPrices,
|
|
3753
3941
|
ProcessingStep,
|
|
3754
|
-
SAFE_ABI,
|
|
3755
|
-
executeSafeEthTransfer,
|
|
3756
|
-
executeSafeErc20Transfer,
|
|
3757
|
-
buildSafeTransaction,
|
|
3758
3942
|
getPublicClient,
|
|
3759
3943
|
getHyperEvmReadClient,
|
|
3760
3944
|
loadSessionOwnerFromStorage,
|