@kryptos_connect/mobile-sdk 1.0.2 → 1.0.4
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/index.js +657 -448
- package/dist/index.mjs +575 -365
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/KryptosConnectButton.tsx
|
|
2
|
-
import
|
|
2
|
+
import React37 from "react";
|
|
3
3
|
import {
|
|
4
4
|
StyleSheet as StyleSheet20,
|
|
5
5
|
Text as Text18,
|
|
@@ -54,6 +54,11 @@ import axios from "axios";
|
|
|
54
54
|
var getBaseUrl = () => {
|
|
55
55
|
return getGlobalBaseUrl() || "https://connect-api.kryptos.io/";
|
|
56
56
|
};
|
|
57
|
+
var isSvgUrl = (url) => {
|
|
58
|
+
if (!url) return false;
|
|
59
|
+
const urlWithoutParams = url.split("?")[0].split("#")[0];
|
|
60
|
+
return /\.svg$/i.test(urlWithoutParams);
|
|
61
|
+
};
|
|
57
62
|
|
|
58
63
|
// src/services/api.ts
|
|
59
64
|
var api = axios.create({
|
|
@@ -1281,25 +1286,31 @@ var styles8 = StyleSheet8.create({
|
|
|
1281
1286
|
|
|
1282
1287
|
// src/components/Footer.tsx
|
|
1283
1288
|
var Footer = () => {
|
|
1284
|
-
|
|
1289
|
+
const { clientInfo } = useKryptosConnect();
|
|
1290
|
+
const isSandbox = clientInfo?.project_stage === "sandbox";
|
|
1291
|
+
return /* @__PURE__ */ React13.createElement(
|
|
1292
|
+
View9,
|
|
1293
|
+
{
|
|
1294
|
+
style: [
|
|
1295
|
+
styles9.container,
|
|
1296
|
+
{ justifyContent: isSandbox ? "space-between" : "center" }
|
|
1297
|
+
]
|
|
1298
|
+
},
|
|
1299
|
+
/* @__PURE__ */ React13.createElement(PoweredByKryptos, null),
|
|
1300
|
+
/* @__PURE__ */ React13.createElement(Mode, null)
|
|
1301
|
+
);
|
|
1285
1302
|
};
|
|
1286
1303
|
var styles9 = StyleSheet9.create({
|
|
1287
1304
|
container: {
|
|
1288
1305
|
width: "100%",
|
|
1289
1306
|
paddingVertical: 8,
|
|
1290
1307
|
alignItems: "center",
|
|
1291
|
-
|
|
1292
|
-
},
|
|
1293
|
-
// Anchor Mode to the right side
|
|
1294
|
-
modeWrapper: {
|
|
1295
|
-
position: "absolute",
|
|
1296
|
-
right: 8,
|
|
1297
|
-
top: 4
|
|
1308
|
+
flexDirection: "row"
|
|
1298
1309
|
}
|
|
1299
1310
|
});
|
|
1300
1311
|
|
|
1301
1312
|
// src/molecules/Auth.tsx
|
|
1302
|
-
import
|
|
1313
|
+
import React20 from "react";
|
|
1303
1314
|
import { Linking as Linking2, StyleSheet as StyleSheet11, Text as Text9, View as View11 } from "react-native";
|
|
1304
1315
|
|
|
1305
1316
|
// src/assets/LinkIcon.tsx
|
|
@@ -1369,7 +1380,7 @@ var EyeIcon = ({
|
|
|
1369
1380
|
};
|
|
1370
1381
|
|
|
1371
1382
|
// src/molecules/ConnectLogo.tsx
|
|
1372
|
-
import
|
|
1383
|
+
import React19, { isValidElement } from "react";
|
|
1373
1384
|
import {
|
|
1374
1385
|
Image,
|
|
1375
1386
|
StyleSheet as StyleSheet10,
|
|
@@ -1434,15 +1445,40 @@ var UnplugIcon = ({
|
|
|
1434
1445
|
));
|
|
1435
1446
|
};
|
|
1436
1447
|
|
|
1448
|
+
// src/components/remote-svg.tsx
|
|
1449
|
+
import React18, { useEffect as useEffect2, useState } from "react";
|
|
1450
|
+
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1451
|
+
import { SvgXml } from "react-native-svg";
|
|
1452
|
+
function RemoteSvg({
|
|
1453
|
+
uri,
|
|
1454
|
+
width = 32,
|
|
1455
|
+
height = 32
|
|
1456
|
+
}) {
|
|
1457
|
+
const [svgXml, setSvgXml] = useState(null);
|
|
1458
|
+
useEffect2(() => {
|
|
1459
|
+
fetch(uri).then((res) => res.text()).then((text) => setSvgXml(text)).catch((err) => console.error("SVG load error:", err));
|
|
1460
|
+
}, [uri]);
|
|
1461
|
+
if (!svgXml) return /* @__PURE__ */ React18.createElement(ActivityIndicator2, null);
|
|
1462
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1463
|
+
SvgXml,
|
|
1464
|
+
{
|
|
1465
|
+
xml: svgXml,
|
|
1466
|
+
width,
|
|
1467
|
+
height,
|
|
1468
|
+
style: { borderRadius: 8 }
|
|
1469
|
+
}
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1437
1473
|
// src/molecules/ConnectLogo.tsx
|
|
1438
1474
|
var KryptosLogo = () => {
|
|
1439
1475
|
const theme = useTheme();
|
|
1440
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1441
1477
|
View10,
|
|
1442
1478
|
{
|
|
1443
1479
|
style: [styles10.logoContainer, { backgroundColor: theme.colors.surface }]
|
|
1444
1480
|
},
|
|
1445
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ React19.createElement(LogoIcon, { size: 36 })
|
|
1446
1482
|
);
|
|
1447
1483
|
};
|
|
1448
1484
|
var ConnectLogo = () => {
|
|
@@ -1460,7 +1496,7 @@ var ConnectLogo = () => {
|
|
|
1460
1496
|
if (isValidElement(appLogo)) {
|
|
1461
1497
|
return appLogo;
|
|
1462
1498
|
} else if (typeof appLogo === "string" && isValidUrl(appLogo)) {
|
|
1463
|
-
return /* @__PURE__ */
|
|
1499
|
+
return isSvgUrl(appLogo) ? /* @__PURE__ */ React19.createElement(RemoteSvg, { uri: appLogo }) : /* @__PURE__ */ React19.createElement(
|
|
1464
1500
|
Image,
|
|
1465
1501
|
{
|
|
1466
1502
|
source: { uri: appLogo },
|
|
@@ -1469,7 +1505,7 @@ var ConnectLogo = () => {
|
|
|
1469
1505
|
}
|
|
1470
1506
|
);
|
|
1471
1507
|
} else if (typeof appLogo === "number" || typeof appLogo === "object" && appLogo !== null) {
|
|
1472
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1473
1509
|
Image,
|
|
1474
1510
|
{
|
|
1475
1511
|
source: appLogo,
|
|
@@ -1478,11 +1514,11 @@ var ConnectLogo = () => {
|
|
|
1478
1514
|
}
|
|
1479
1515
|
);
|
|
1480
1516
|
} else if (appName) {
|
|
1481
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, appName.charAt(0).toUpperCase());
|
|
1482
1518
|
}
|
|
1483
|
-
return /* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, "?");
|
|
1484
1520
|
};
|
|
1485
|
-
return /* @__PURE__ */
|
|
1521
|
+
return /* @__PURE__ */ React19.createElement(View10, { style: styles10.container }, /* @__PURE__ */ React19.createElement(KryptosLogo, null), /* @__PURE__ */ React19.createElement(View10, { style: styles10.iconContainer }, /* @__PURE__ */ React19.createElement(UnplugIcon, { size: 24, color: theme.colors.textSecondary })), /* @__PURE__ */ React19.createElement(
|
|
1486
1522
|
View10,
|
|
1487
1523
|
{
|
|
1488
1524
|
style: [
|
|
@@ -1534,11 +1570,11 @@ var Auth = ({
|
|
|
1534
1570
|
}) => {
|
|
1535
1571
|
const { appName, linkToken, clientId, setUser, setEmail } = useKryptosConnect();
|
|
1536
1572
|
const theme = useTheme();
|
|
1537
|
-
const [isLoading, setIsLoading] =
|
|
1538
|
-
const [errorMessage, setErrorMessage] =
|
|
1539
|
-
const [emailValue, setEmailValue] =
|
|
1540
|
-
const [emailError, setEmailError] =
|
|
1541
|
-
const [loadingType, setLoadingType] =
|
|
1573
|
+
const [isLoading, setIsLoading] = React20.useState(false);
|
|
1574
|
+
const [errorMessage, setErrorMessage] = React20.useState("");
|
|
1575
|
+
const [emailValue, setEmailValue] = React20.useState("");
|
|
1576
|
+
const [emailError, setEmailError] = React20.useState("");
|
|
1577
|
+
const [loadingType, setLoadingType] = React20.useState(null);
|
|
1542
1578
|
const validateEmail = (email) => {
|
|
1543
1579
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1544
1580
|
if (!email) {
|
|
@@ -1600,28 +1636,28 @@ var Auth = ({
|
|
|
1600
1636
|
};
|
|
1601
1637
|
const infoSections = [
|
|
1602
1638
|
{
|
|
1603
|
-
icon: /* @__PURE__ */
|
|
1639
|
+
icon: /* @__PURE__ */ React20.createElement(LinkIcon, { size: 20, color: theme.colors.primary }),
|
|
1604
1640
|
title: "Simple and secure",
|
|
1605
1641
|
text: "Link your accounts in just a few clicks"
|
|
1606
1642
|
},
|
|
1607
1643
|
{
|
|
1608
|
-
icon: /* @__PURE__ */
|
|
1644
|
+
icon: /* @__PURE__ */ React20.createElement(ShieldIcon, { size: 20, color: theme.colors.primary }),
|
|
1609
1645
|
title: "Control what you share",
|
|
1610
1646
|
text: "We never share your data without your permission"
|
|
1611
1647
|
},
|
|
1612
1648
|
{
|
|
1613
|
-
icon: /* @__PURE__ */
|
|
1649
|
+
icon: /* @__PURE__ */ React20.createElement(EyeIcon, { size: 20, color: theme.colors.primary }),
|
|
1614
1650
|
title: "View Only Access",
|
|
1615
1651
|
text: "Kryptos retrieves view-only data and cannot perform any transactions on your behalf."
|
|
1616
1652
|
}
|
|
1617
1653
|
];
|
|
1618
|
-
return /* @__PURE__ */
|
|
1654
|
+
return /* @__PURE__ */ React20.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React20.createElement(ModalHeader, { onClose: handleClose }, ""), /* @__PURE__ */ React20.createElement(ModalBody, null, /* @__PURE__ */ React20.createElement(View11, { style: styles11.container }, /* @__PURE__ */ React20.createElement(View11, { style: styles11.header }, /* @__PURE__ */ React20.createElement(Text9, { style: [styles11.title, { color: theme.colors.text }] }, "Link your accounts to", " ", /* @__PURE__ */ React20.createElement(Text9, { style: { fontWeight: "700" } }, appName), " using Kryptos"), /* @__PURE__ */ React20.createElement(ConnectLogo, null), infoSections.map((section, index) => /* @__PURE__ */ React20.createElement(View11, { key: `info-${index}`, style: styles11.infoSection }, /* @__PURE__ */ React20.createElement(View11, { style: styles11.infoIcon }, section.icon), /* @__PURE__ */ React20.createElement(View11, { style: styles11.infoContent }, /* @__PURE__ */ React20.createElement(
|
|
1619
1655
|
Text9,
|
|
1620
1656
|
{
|
|
1621
1657
|
style: [styles11.infoTitle, { color: theme.colors.text }]
|
|
1622
1658
|
},
|
|
1623
1659
|
section.title
|
|
1624
|
-
), /* @__PURE__ */
|
|
1660
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1625
1661
|
Text9,
|
|
1626
1662
|
{
|
|
1627
1663
|
style: [
|
|
@@ -1630,7 +1666,7 @@ var Auth = ({
|
|
|
1630
1666
|
]
|
|
1631
1667
|
},
|
|
1632
1668
|
section.text
|
|
1633
|
-
)))), errorMessage ? /* @__PURE__ */
|
|
1669
|
+
)))), errorMessage ? /* @__PURE__ */ React20.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React20.createElement(AlertDescription, null, errorMessage)) : null), /* @__PURE__ */ React20.createElement(View11, { style: styles11.footer }, /* @__PURE__ */ React20.createElement(
|
|
1634
1670
|
Button,
|
|
1635
1671
|
{
|
|
1636
1672
|
variant: "outline",
|
|
@@ -1641,14 +1677,14 @@ var Auth = ({
|
|
|
1641
1677
|
style: styles11.button
|
|
1642
1678
|
},
|
|
1643
1679
|
"Continue"
|
|
1644
|
-
), /* @__PURE__ */
|
|
1680
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1645
1681
|
Text9,
|
|
1646
1682
|
{
|
|
1647
1683
|
style: [styles11.footerText, { color: theme.colors.textSecondary }]
|
|
1648
1684
|
},
|
|
1649
1685
|
"By continuing, you agree to Kryptos",
|
|
1650
1686
|
" ",
|
|
1651
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ React20.createElement(
|
|
1652
1688
|
Text9,
|
|
1653
1689
|
{
|
|
1654
1690
|
style: {
|
|
@@ -1662,7 +1698,7 @@ var Auth = ({
|
|
|
1662
1698
|
" ",
|
|
1663
1699
|
"and",
|
|
1664
1700
|
" ",
|
|
1665
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ React20.createElement(
|
|
1666
1702
|
Text9,
|
|
1667
1703
|
{
|
|
1668
1704
|
style: {
|
|
@@ -1673,7 +1709,7 @@ var Auth = ({
|
|
|
1673
1709
|
},
|
|
1674
1710
|
"Terms of Service"
|
|
1675
1711
|
)
|
|
1676
|
-
)))), /* @__PURE__ */
|
|
1712
|
+
)))), /* @__PURE__ */ React20.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React20.createElement(Footer, null)));
|
|
1677
1713
|
};
|
|
1678
1714
|
var styles11 = StyleSheet11.create({
|
|
1679
1715
|
container: {
|
|
@@ -1740,8 +1776,8 @@ var styles11 = StyleSheet11.create({
|
|
|
1740
1776
|
});
|
|
1741
1777
|
|
|
1742
1778
|
// src/molecules/Init.tsx
|
|
1743
|
-
import
|
|
1744
|
-
import { ActivityIndicator as
|
|
1779
|
+
import React21 from "react";
|
|
1780
|
+
import { ActivityIndicator as ActivityIndicator3, StyleSheet as StyleSheet12, Text as Text10, View as View12 } from "react-native";
|
|
1745
1781
|
var Init = ({
|
|
1746
1782
|
open,
|
|
1747
1783
|
onSuccess,
|
|
@@ -1756,9 +1792,9 @@ var Init = ({
|
|
|
1756
1792
|
setUser
|
|
1757
1793
|
} = useKryptosConnect();
|
|
1758
1794
|
const theme = useTheme();
|
|
1759
|
-
const [isFetching, setIsFetching] =
|
|
1760
|
-
const [error, setError] =
|
|
1761
|
-
const fetchLinkToken =
|
|
1795
|
+
const [isFetching, setIsFetching] = React21.useState(false);
|
|
1796
|
+
const [error, setError] = React21.useState(null);
|
|
1797
|
+
const fetchLinkToken = React21.useCallback(async () => {
|
|
1762
1798
|
if (!open) return;
|
|
1763
1799
|
setIsFetching(true);
|
|
1764
1800
|
setError(null);
|
|
@@ -1785,17 +1821,17 @@ var Init = ({
|
|
|
1785
1821
|
setIsFetching(false);
|
|
1786
1822
|
}
|
|
1787
1823
|
}, []);
|
|
1788
|
-
|
|
1824
|
+
React21.useEffect(() => {
|
|
1789
1825
|
fetchLinkToken();
|
|
1790
1826
|
}, [fetchLinkToken]);
|
|
1791
|
-
return /* @__PURE__ */
|
|
1792
|
-
|
|
1827
|
+
return /* @__PURE__ */ React21.createElement(Modal, { isOpen: open, onClose, size: "xs" }, /* @__PURE__ */ React21.createElement(ModalHeader, { onClose }, "Kryptos Connect"), /* @__PURE__ */ React21.createElement(ModalBody, null, /* @__PURE__ */ React21.createElement(View12, { style: styles12.container }, isFetching && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
1828
|
+
ActivityIndicator3,
|
|
1793
1829
|
{
|
|
1794
1830
|
size: "large",
|
|
1795
1831
|
color: theme.colors.primary,
|
|
1796
1832
|
style: styles12.spinner
|
|
1797
1833
|
}
|
|
1798
|
-
), /* @__PURE__ */
|
|
1834
|
+
), /* @__PURE__ */ React21.createElement(Text10, { style: [styles12.message, { color: theme.colors.text }] }, isInitialized ? "Fetching link token..." : "Initializing...")), !isFetching && error && /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React21.createElement(AlertDescription, null, error)), /* @__PURE__ */ React21.createElement(
|
|
1799
1835
|
Button,
|
|
1800
1836
|
{
|
|
1801
1837
|
variant: "primary",
|
|
@@ -1804,7 +1840,7 @@ var Init = ({
|
|
|
1804
1840
|
style: styles12.retryButton
|
|
1805
1841
|
},
|
|
1806
1842
|
"Retry"
|
|
1807
|
-
)))), /* @__PURE__ */
|
|
1843
|
+
)))), /* @__PURE__ */ React21.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React21.createElement(Footer, null)));
|
|
1808
1844
|
};
|
|
1809
1845
|
var styles12 = StyleSheet12.create({
|
|
1810
1846
|
container: {
|
|
@@ -1833,10 +1869,10 @@ var styles12 = StyleSheet12.create({
|
|
|
1833
1869
|
});
|
|
1834
1870
|
|
|
1835
1871
|
// src/molecules/Integration.tsx
|
|
1836
|
-
import
|
|
1872
|
+
import React32 from "react";
|
|
1837
1873
|
import {
|
|
1838
1874
|
FlatList,
|
|
1839
|
-
Image as
|
|
1875
|
+
Image as Image4,
|
|
1840
1876
|
StyleSheet as StyleSheet15,
|
|
1841
1877
|
Text as Text13,
|
|
1842
1878
|
TouchableOpacity as TouchableOpacity6,
|
|
@@ -1844,13 +1880,13 @@ import {
|
|
|
1844
1880
|
} from "react-native";
|
|
1845
1881
|
|
|
1846
1882
|
// src/assets/ArrowLeftIcon.tsx
|
|
1847
|
-
import
|
|
1883
|
+
import React22 from "react";
|
|
1848
1884
|
import Svg7, { Path as Path7 } from "react-native-svg";
|
|
1849
1885
|
var ArrowLeftIcon = ({
|
|
1850
1886
|
size = 20,
|
|
1851
1887
|
color = "#000"
|
|
1852
1888
|
}) => {
|
|
1853
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React22.createElement(Svg7, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React22.createElement(
|
|
1854
1890
|
Path7,
|
|
1855
1891
|
{
|
|
1856
1892
|
d: "M19 12H5M12 19l-7-7 7-7",
|
|
@@ -1863,13 +1899,13 @@ var ArrowLeftIcon = ({
|
|
|
1863
1899
|
};
|
|
1864
1900
|
|
|
1865
1901
|
// src/assets/CheckCircleIcon.tsx
|
|
1866
|
-
import
|
|
1902
|
+
import React23 from "react";
|
|
1867
1903
|
import Svg8, { Path as Path8, Circle } from "react-native-svg";
|
|
1868
1904
|
var CheckCircleIcon = ({
|
|
1869
1905
|
size = 20,
|
|
1870
1906
|
color = "#10B981"
|
|
1871
1907
|
}) => {
|
|
1872
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ React23.createElement(Svg8, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React23.createElement(
|
|
1873
1909
|
Circle,
|
|
1874
1910
|
{
|
|
1875
1911
|
cx: 12,
|
|
@@ -1878,7 +1914,7 @@ var CheckCircleIcon = ({
|
|
|
1878
1914
|
stroke: color,
|
|
1879
1915
|
strokeWidth: 2
|
|
1880
1916
|
}
|
|
1881
|
-
), /* @__PURE__ */
|
|
1917
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1882
1918
|
Path8,
|
|
1883
1919
|
{
|
|
1884
1920
|
d: "m9 12 2 2 4-4",
|
|
@@ -1891,7 +1927,7 @@ var CheckCircleIcon = ({
|
|
|
1891
1927
|
};
|
|
1892
1928
|
|
|
1893
1929
|
// src/assets/LoaderIcon.tsx
|
|
1894
|
-
import
|
|
1930
|
+
import React24 from "react";
|
|
1895
1931
|
import { Animated as Animated2, Easing } from "react-native";
|
|
1896
1932
|
import Svg9, { Path as Path9 } from "react-native-svg";
|
|
1897
1933
|
var AnimatedSvg = Animated2.createAnimatedComponent(Svg9);
|
|
@@ -1899,8 +1935,8 @@ var LoaderIcon = ({
|
|
|
1899
1935
|
size = 20,
|
|
1900
1936
|
color = "#00C693"
|
|
1901
1937
|
}) => {
|
|
1902
|
-
const rotateAnim =
|
|
1903
|
-
|
|
1938
|
+
const rotateAnim = React24.useRef(new Animated2.Value(0)).current;
|
|
1939
|
+
React24.useEffect(() => {
|
|
1904
1940
|
Animated2.loop(
|
|
1905
1941
|
Animated2.timing(rotateAnim, {
|
|
1906
1942
|
toValue: 1,
|
|
@@ -1914,7 +1950,7 @@ var LoaderIcon = ({
|
|
|
1914
1950
|
inputRange: [0, 1],
|
|
1915
1951
|
outputRange: ["0deg", "360deg"]
|
|
1916
1952
|
});
|
|
1917
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1918
1954
|
AnimatedSvg,
|
|
1919
1955
|
{
|
|
1920
1956
|
width: size,
|
|
@@ -1923,7 +1959,7 @@ var LoaderIcon = ({
|
|
|
1923
1959
|
fill: "none",
|
|
1924
1960
|
style: { transform: [{ rotate: spin }] }
|
|
1925
1961
|
},
|
|
1926
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ React24.createElement(
|
|
1927
1963
|
Path9,
|
|
1928
1964
|
{
|
|
1929
1965
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
@@ -1937,10 +1973,10 @@ var LoaderIcon = ({
|
|
|
1937
1973
|
};
|
|
1938
1974
|
|
|
1939
1975
|
// src/assets/SuccessIcon.tsx
|
|
1940
|
-
import
|
|
1976
|
+
import React25 from "react";
|
|
1941
1977
|
import Svg10, { Circle as Circle2, Path as Path10 } from "react-native-svg";
|
|
1942
1978
|
var SuccessIcon = ({ size = 64 }) => {
|
|
1943
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ React25.createElement(Svg10, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React25.createElement(
|
|
1944
1980
|
Circle2,
|
|
1945
1981
|
{
|
|
1946
1982
|
cx: 32,
|
|
@@ -1949,7 +1985,7 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1949
1985
|
fill: "#00C693",
|
|
1950
1986
|
opacity: 0.1
|
|
1951
1987
|
}
|
|
1952
|
-
), /* @__PURE__ */
|
|
1988
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1953
1989
|
Circle2,
|
|
1954
1990
|
{
|
|
1955
1991
|
cx: 32,
|
|
@@ -1957,7 +1993,7 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1957
1993
|
r: 24,
|
|
1958
1994
|
fill: "#00C693"
|
|
1959
1995
|
}
|
|
1960
|
-
), /* @__PURE__ */
|
|
1996
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1961
1997
|
Path10,
|
|
1962
1998
|
{
|
|
1963
1999
|
d: "M24 32l6 6 12-12",
|
|
@@ -1970,10 +2006,10 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1970
2006
|
};
|
|
1971
2007
|
|
|
1972
2008
|
// src/assets/ErrorIcon.tsx
|
|
1973
|
-
import
|
|
2009
|
+
import React26 from "react";
|
|
1974
2010
|
import Svg11, { Circle as Circle3, Path as Path11 } from "react-native-svg";
|
|
1975
2011
|
var ErrorIcon = ({ size = 64 }) => {
|
|
1976
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ React26.createElement(Svg11, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React26.createElement(
|
|
1977
2013
|
Circle3,
|
|
1978
2014
|
{
|
|
1979
2015
|
cx: 32,
|
|
@@ -1982,7 +2018,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1982
2018
|
fill: "#EF4444",
|
|
1983
2019
|
opacity: 0.1
|
|
1984
2020
|
}
|
|
1985
|
-
), /* @__PURE__ */
|
|
2021
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1986
2022
|
Circle3,
|
|
1987
2023
|
{
|
|
1988
2024
|
cx: 32,
|
|
@@ -1990,7 +2026,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1990
2026
|
r: 24,
|
|
1991
2027
|
fill: "#EF4444"
|
|
1992
2028
|
}
|
|
1993
|
-
), /* @__PURE__ */
|
|
2029
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1994
2030
|
Path11,
|
|
1995
2031
|
{
|
|
1996
2032
|
d: "M24 24l16 16M40 24l-16 16",
|
|
@@ -2003,17 +2039,17 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2003
2039
|
};
|
|
2004
2040
|
|
|
2005
2041
|
// src/assets/SearchIcon.tsx
|
|
2006
|
-
import
|
|
2042
|
+
import React27 from "react";
|
|
2007
2043
|
import Svg12, { Circle as Circle4, Path as Path12 } from "react-native-svg";
|
|
2008
2044
|
|
|
2009
2045
|
// src/assets/PlusIcon.tsx
|
|
2010
|
-
import
|
|
2046
|
+
import React28 from "react";
|
|
2011
2047
|
import Svg13, { Path as Path13 } from "react-native-svg";
|
|
2012
2048
|
var PlusIcon = ({
|
|
2013
2049
|
size = 14,
|
|
2014
2050
|
color = "#6B7280"
|
|
2015
2051
|
}) => {
|
|
2016
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ React28.createElement(Svg13, { width: size, height: size, viewBox: "0 0 14 14", fill: "none" }, /* @__PURE__ */ React28.createElement(
|
|
2017
2053
|
Path13,
|
|
2018
2054
|
{
|
|
2019
2055
|
d: "M7 3.5v7M3.5 7h7",
|
|
@@ -2026,13 +2062,14 @@ var PlusIcon = ({
|
|
|
2026
2062
|
|
|
2027
2063
|
// src/wallet-connect/index.tsx
|
|
2028
2064
|
import { useAccount, useAppKit } from "@reown/appkit-react-native";
|
|
2029
|
-
import
|
|
2065
|
+
import React30, { useEffect as useEffect3, useMemo, useState as useState2 } from "react";
|
|
2030
2066
|
import {
|
|
2031
2067
|
ScrollView as ScrollView2,
|
|
2032
2068
|
StyleSheet as StyleSheet13,
|
|
2033
2069
|
Text as Text11,
|
|
2034
2070
|
TouchableOpacity as TouchableOpacity4,
|
|
2035
|
-
View as View13
|
|
2071
|
+
View as View13,
|
|
2072
|
+
Image as Image2
|
|
2036
2073
|
} from "react-native";
|
|
2037
2074
|
|
|
2038
2075
|
// src/utils/uuid.ts
|
|
@@ -2045,7 +2082,7 @@ function generateUUID() {
|
|
|
2045
2082
|
}
|
|
2046
2083
|
|
|
2047
2084
|
// src/wallet-connect/wallet-connect.tsx
|
|
2048
|
-
import
|
|
2085
|
+
import React29 from "react";
|
|
2049
2086
|
import { AppKit, AppKitProvider } from "@reown/appkit-react-native";
|
|
2050
2087
|
|
|
2051
2088
|
// src/wallet-connect/AppKitConfig.ts
|
|
@@ -2154,7 +2191,7 @@ var createAppKitInstance = (projectId) => {
|
|
|
2154
2191
|
// src/wallet-connect/wallet-connect.tsx
|
|
2155
2192
|
var WalletConnectWrapper = ({ children }) => {
|
|
2156
2193
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2157
|
-
const appKit =
|
|
2194
|
+
const appKit = React29.useMemo(() => {
|
|
2158
2195
|
if (!walletConnectProjectId) {
|
|
2159
2196
|
console.warn(
|
|
2160
2197
|
"walletConnectProjectId is missing in KryptosConnectProvider config"
|
|
@@ -2164,9 +2201,9 @@ var WalletConnectWrapper = ({ children }) => {
|
|
|
2164
2201
|
return createAppKitInstance(walletConnectProjectId);
|
|
2165
2202
|
}, [walletConnectProjectId]);
|
|
2166
2203
|
if (!appKit) {
|
|
2167
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, children);
|
|
2168
2205
|
}
|
|
2169
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ React29.createElement(AppKitProvider, { instance: appKit }, /* @__PURE__ */ React29.createElement(AppKit, null), children);
|
|
2170
2207
|
};
|
|
2171
2208
|
var wallet_connect_default = WalletConnectWrapper;
|
|
2172
2209
|
|
|
@@ -2177,12 +2214,13 @@ var WalletConnectComponent = ({
|
|
|
2177
2214
|
onAddHandle,
|
|
2178
2215
|
handleClose,
|
|
2179
2216
|
modalOpen,
|
|
2180
|
-
setAddIntegrationMode
|
|
2217
|
+
setAddIntegrationMode,
|
|
2218
|
+
providersList
|
|
2181
2219
|
}) => {
|
|
2182
2220
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2183
2221
|
const theme = useTheme();
|
|
2184
2222
|
if (!walletConnectProjectId) {
|
|
2185
|
-
return /* @__PURE__ */
|
|
2223
|
+
return /* @__PURE__ */ React30.createElement(Modal, { isOpen: modalOpen, onClose: handleClose, size: "full" }, /* @__PURE__ */ React30.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.headerContent }, /* @__PURE__ */ React30.createElement(
|
|
2186
2224
|
TouchableOpacity4,
|
|
2187
2225
|
{
|
|
2188
2226
|
onPress: () => {
|
|
@@ -2190,14 +2228,14 @@ var WalletConnectComponent = ({
|
|
|
2190
2228
|
},
|
|
2191
2229
|
style: styles13.backButton
|
|
2192
2230
|
},
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
), /* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ React30.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2232
|
+
), /* @__PURE__ */ React30.createElement(Text11, { style: [styles13.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React30.createElement(ModalBody, { scrollable: false, style: styles13.contentContainer }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.emptyState }, /* @__PURE__ */ React30.createElement(
|
|
2195
2233
|
Text11,
|
|
2196
2234
|
{
|
|
2197
2235
|
style: [styles13.emptyStateTitle, { color: theme.colors.text }]
|
|
2198
2236
|
},
|
|
2199
2237
|
"WalletConnect is not configured"
|
|
2200
|
-
), /* @__PURE__ */
|
|
2238
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2201
2239
|
Text11,
|
|
2202
2240
|
{
|
|
2203
2241
|
style: [
|
|
@@ -2206,7 +2244,7 @@ var WalletConnectComponent = ({
|
|
|
2206
2244
|
]
|
|
2207
2245
|
},
|
|
2208
2246
|
"Please add a walletConnectProjectId to KryptosConnectProvider to enable wallet connections."
|
|
2209
|
-
), /* @__PURE__ */
|
|
2247
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2210
2248
|
Button,
|
|
2211
2249
|
{
|
|
2212
2250
|
variant: "outline",
|
|
@@ -2217,7 +2255,7 @@ var WalletConnectComponent = ({
|
|
|
2217
2255
|
"Go back"
|
|
2218
2256
|
))));
|
|
2219
2257
|
}
|
|
2220
|
-
return /* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ React30.createElement(wallet_connect_default, null, /* @__PURE__ */ React30.createElement(
|
|
2221
2259
|
ConnectButton,
|
|
2222
2260
|
{
|
|
2223
2261
|
integration,
|
|
@@ -2225,7 +2263,8 @@ var WalletConnectComponent = ({
|
|
|
2225
2263
|
onClose,
|
|
2226
2264
|
handleClose,
|
|
2227
2265
|
modalOpen,
|
|
2228
|
-
setAddIntegrationMode
|
|
2266
|
+
setAddIntegrationMode,
|
|
2267
|
+
providersList
|
|
2229
2268
|
}
|
|
2230
2269
|
));
|
|
2231
2270
|
};
|
|
@@ -2234,17 +2273,85 @@ function ConnectButton({
|
|
|
2234
2273
|
onAddHandle,
|
|
2235
2274
|
handleClose,
|
|
2236
2275
|
modalOpen,
|
|
2237
|
-
setAddIntegrationMode
|
|
2276
|
+
setAddIntegrationMode,
|
|
2277
|
+
providersList
|
|
2238
2278
|
}) {
|
|
2239
2279
|
const theme = useTheme();
|
|
2240
2280
|
const { open, disconnect } = useAppKit();
|
|
2241
|
-
const { address, isConnected
|
|
2281
|
+
const { address, isConnected } = useAccount();
|
|
2242
2282
|
const { linkToken, user, clientId } = useKryptosConnect();
|
|
2243
|
-
const [selectedChains, setSelectedChains] =
|
|
2244
|
-
const [errorMessage, setErrorMessage] =
|
|
2245
|
-
const [chainErrors, setChainErrors] =
|
|
2246
|
-
const [isLoading, setIsLoading] =
|
|
2247
|
-
const userUsedChains =
|
|
2283
|
+
const [selectedChains, setSelectedChains] = useState2(/* @__PURE__ */ new Set());
|
|
2284
|
+
const [errorMessage, setErrorMessage] = useState2("");
|
|
2285
|
+
const [chainErrors, setChainErrors] = useState2({});
|
|
2286
|
+
const [isLoading, setIsLoading] = useState2(false);
|
|
2287
|
+
const [userUsedChains, setUserUsedChains] = useState2([]);
|
|
2288
|
+
const [isFetchingChains, setIsFetchingChains] = useState2(false);
|
|
2289
|
+
const availableChains = useMemo(() => {
|
|
2290
|
+
if (userUsedChains.length > 0) {
|
|
2291
|
+
return userUsedChains;
|
|
2292
|
+
}
|
|
2293
|
+
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2294
|
+
return integration.walletSupportedChains;
|
|
2295
|
+
}
|
|
2296
|
+
return [];
|
|
2297
|
+
}, [userUsedChains, integration.walletSupportedChains]);
|
|
2298
|
+
useEffect3(() => {
|
|
2299
|
+
if (!isConnected || !address || !address.trim()) {
|
|
2300
|
+
setUserUsedChains([]);
|
|
2301
|
+
setSelectedChains(/* @__PURE__ */ new Set());
|
|
2302
|
+
setIsFetchingChains(false);
|
|
2303
|
+
return;
|
|
2304
|
+
}
|
|
2305
|
+
const debounceTimer = setTimeout(async () => {
|
|
2306
|
+
if (linkToken && address && address.trim() && isConnected) {
|
|
2307
|
+
try {
|
|
2308
|
+
setIsFetchingChains(true);
|
|
2309
|
+
let chains = [];
|
|
2310
|
+
if (integration.isEvmWallet) {
|
|
2311
|
+
const res = await getUserUsedChains(linkToken, address.trim());
|
|
2312
|
+
if (res && Array.isArray(res) && res.length > 0) {
|
|
2313
|
+
chains = res;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
if (chains.length === 0 && integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2317
|
+
chains = integration.walletSupportedChains;
|
|
2318
|
+
}
|
|
2319
|
+
if (chains.length > 0) {
|
|
2320
|
+
setUserUsedChains(chains);
|
|
2321
|
+
setSelectedChains(new Set(chains.map((chain) => chain.id)));
|
|
2322
|
+
} else {
|
|
2323
|
+
setUserUsedChains([]);
|
|
2324
|
+
setSelectedChains(/* @__PURE__ */ new Set());
|
|
2325
|
+
}
|
|
2326
|
+
} catch (error) {
|
|
2327
|
+
console.error("Failed to fetch user chains:", error);
|
|
2328
|
+
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2329
|
+
setUserUsedChains(integration.walletSupportedChains);
|
|
2330
|
+
setSelectedChains(
|
|
2331
|
+
new Set(
|
|
2332
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2333
|
+
integration.walletSupportedChains.map((chain) => chain.id)
|
|
2334
|
+
)
|
|
2335
|
+
);
|
|
2336
|
+
} else {
|
|
2337
|
+
setUserUsedChains([]);
|
|
2338
|
+
setSelectedChains(/* @__PURE__ */ new Set());
|
|
2339
|
+
}
|
|
2340
|
+
} finally {
|
|
2341
|
+
setIsFetchingChains(false);
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}, 500);
|
|
2345
|
+
return () => {
|
|
2346
|
+
clearTimeout(debounceTimer);
|
|
2347
|
+
};
|
|
2348
|
+
}, [
|
|
2349
|
+
linkToken,
|
|
2350
|
+
address,
|
|
2351
|
+
isConnected,
|
|
2352
|
+
integration.isEvmWallet,
|
|
2353
|
+
integration.walletSupportedChains
|
|
2354
|
+
]);
|
|
2248
2355
|
const validateForm = () => {
|
|
2249
2356
|
if (!address) {
|
|
2250
2357
|
setErrorMessage("Please connect a wallet");
|
|
@@ -2262,7 +2369,7 @@ function ConnectButton({
|
|
|
2262
2369
|
setIsLoading(true);
|
|
2263
2370
|
setErrorMessage("");
|
|
2264
2371
|
setChainErrors({});
|
|
2265
|
-
const chainsToProcess =
|
|
2372
|
+
const chainsToProcess = availableChains.filter(
|
|
2266
2373
|
(c) => selectedChains.has(c.id)
|
|
2267
2374
|
);
|
|
2268
2375
|
const integrationsToAdd = [];
|
|
@@ -2270,43 +2377,46 @@ function ConnectButton({
|
|
|
2270
2377
|
const walletTestsPayload = chainsToProcess.map((chain) => {
|
|
2271
2378
|
const walletId = generateUUID();
|
|
2272
2379
|
const displaySuffix = address ? address?.length > 8 ? `${address.slice(0, 4)}...${address.slice(-4)}` : address : "";
|
|
2273
|
-
const alias = `${integration.
|
|
2380
|
+
const alias = `${integration.public_name} (${displaySuffix})`;
|
|
2381
|
+
const provider = providersList.find((p) => p.id === chain.id);
|
|
2274
2382
|
return {
|
|
2275
2383
|
chain,
|
|
2276
2384
|
walletId,
|
|
2277
2385
|
alias,
|
|
2278
2386
|
credential: {
|
|
2279
|
-
source:
|
|
2387
|
+
source: provider?.id,
|
|
2280
2388
|
credential: {
|
|
2281
2389
|
address,
|
|
2282
2390
|
userId: user?.user_id || "0",
|
|
2283
|
-
projectId:
|
|
2391
|
+
projectId: provider?.projectId,
|
|
2284
2392
|
apiKey: "0",
|
|
2285
2393
|
secret: "0",
|
|
2286
2394
|
privateKey: "0",
|
|
2287
2395
|
alias,
|
|
2288
2396
|
walletId,
|
|
2289
|
-
exchange:
|
|
2397
|
+
exchange: provider?.id
|
|
2290
2398
|
}
|
|
2291
2399
|
}
|
|
2292
2400
|
};
|
|
2293
2401
|
});
|
|
2294
2402
|
const results = await Promise.allSettled(
|
|
2403
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2295
2404
|
walletTestsPayload.map(
|
|
2296
|
-
(
|
|
2405
|
+
(testData) => testCredentials(linkToken, { ...testData.credential })
|
|
2297
2406
|
)
|
|
2298
2407
|
);
|
|
2299
2408
|
results.forEach((result, index) => {
|
|
2300
2409
|
const { chain, walletId, alias } = walletTestsPayload[index];
|
|
2301
|
-
|
|
2410
|
+
const provider = providersList.find((p) => p.id === chain.id);
|
|
2411
|
+
if (result.status === "fulfilled" && result.value?.valid && provider) {
|
|
2302
2412
|
const data = {
|
|
2303
2413
|
alias,
|
|
2304
|
-
exchange:
|
|
2305
|
-
id:
|
|
2306
|
-
public_name:
|
|
2414
|
+
exchange: provider.id.toLowerCase(),
|
|
2415
|
+
id: provider.id,
|
|
2416
|
+
public_name: provider.public_name,
|
|
2307
2417
|
sync_time: (/* @__PURE__ */ new Date()).getTime(),
|
|
2308
2418
|
fetchAll: true,
|
|
2309
|
-
logo:
|
|
2419
|
+
logo: provider.logo || null,
|
|
2310
2420
|
startTime: null,
|
|
2311
2421
|
endTime: null,
|
|
2312
2422
|
uid: user?.user_id || "",
|
|
@@ -2315,24 +2425,37 @@ function ConnectButton({
|
|
|
2315
2425
|
clientId,
|
|
2316
2426
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2317
2427
|
},
|
|
2318
|
-
metadata: {
|
|
2319
|
-
environment: "sandbox"
|
|
2320
|
-
},
|
|
2321
2428
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2322
|
-
default_chain:
|
|
2323
|
-
default_chain_logo:
|
|
2324
|
-
type:
|
|
2325
|
-
isNftSupported:
|
|
2326
|
-
chainId:
|
|
2327
|
-
|
|
2429
|
+
default_chain: integration?.id || "",
|
|
2430
|
+
default_chain_logo: integration?.logo || "",
|
|
2431
|
+
type: provider.type || "",
|
|
2432
|
+
isNftSupported: provider?.isEvmWallet || provider?.nftSupport || false,
|
|
2433
|
+
chainId: provider?.community_id,
|
|
2434
|
+
credsData: {
|
|
2435
|
+
address
|
|
2436
|
+
}
|
|
2328
2437
|
};
|
|
2329
2438
|
integrationsToAdd.push(data);
|
|
2330
2439
|
} else {
|
|
2331
|
-
|
|
2440
|
+
if (result.status === "rejected") {
|
|
2441
|
+
errors[chain.id] = result.reason?.response?.data?.message || "Failed to process chain";
|
|
2442
|
+
} else if (result.status === "fulfilled") {
|
|
2443
|
+
errors[chain.id] = result.value?.message || "Failed to verify chain";
|
|
2444
|
+
}
|
|
2332
2445
|
}
|
|
2333
2446
|
});
|
|
2447
|
+
setChainErrors(errors);
|
|
2448
|
+
if (Object.keys(errors).length > 0) {
|
|
2449
|
+
setErrorMessage(
|
|
2450
|
+
`Cannot add integrations. ${Object.keys(errors).length} chain${Object.keys(errors).length > 1 ? "s" : ""} failed verification. Please fix the errors and try again.`
|
|
2451
|
+
);
|
|
2452
|
+
return;
|
|
2453
|
+
}
|
|
2334
2454
|
if (integrationsToAdd.length > 0) {
|
|
2335
2455
|
onAddHandle(integrationsToAdd);
|
|
2456
|
+
if (isConnected) {
|
|
2457
|
+
disconnect();
|
|
2458
|
+
}
|
|
2336
2459
|
setChainErrors({});
|
|
2337
2460
|
setErrorMessage("");
|
|
2338
2461
|
} else {
|
|
@@ -2348,30 +2471,49 @@ function ConnectButton({
|
|
|
2348
2471
|
setIsLoading(false);
|
|
2349
2472
|
}
|
|
2350
2473
|
};
|
|
2351
|
-
const toggleChainSelection = (
|
|
2474
|
+
const toggleChainSelection = (chainId) => {
|
|
2352
2475
|
const newSelected = new Set(selectedChains);
|
|
2353
|
-
if (newSelected.has(
|
|
2354
|
-
newSelected.delete(
|
|
2476
|
+
if (newSelected.has(chainId)) {
|
|
2477
|
+
newSelected.delete(chainId);
|
|
2355
2478
|
} else {
|
|
2356
|
-
newSelected.add(
|
|
2479
|
+
newSelected.add(chainId);
|
|
2357
2480
|
}
|
|
2358
2481
|
setSelectedChains(newSelected);
|
|
2359
|
-
if (chainErrors[
|
|
2482
|
+
if (chainErrors[chainId]) {
|
|
2360
2483
|
const newErrors = { ...chainErrors };
|
|
2361
|
-
delete newErrors[
|
|
2484
|
+
delete newErrors[chainId];
|
|
2362
2485
|
setChainErrors(newErrors);
|
|
2363
2486
|
}
|
|
2364
2487
|
};
|
|
2365
|
-
return /* @__PURE__ */
|
|
2488
|
+
return /* @__PURE__ */ React30.createElement(Modal, { isOpen: modalOpen, onClose: handleClose, size: "full" }, /* @__PURE__ */ React30.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.headerContent }, /* @__PURE__ */ React30.createElement(
|
|
2366
2489
|
TouchableOpacity4,
|
|
2367
2490
|
{
|
|
2368
2491
|
onPress: () => {
|
|
2369
2492
|
setAddIntegrationMode(null);
|
|
2493
|
+
if (isConnected) {
|
|
2494
|
+
disconnect();
|
|
2495
|
+
}
|
|
2370
2496
|
},
|
|
2371
2497
|
style: styles13.backButton
|
|
2372
2498
|
},
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
), /* @__PURE__ */
|
|
2499
|
+
/* @__PURE__ */ React30.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2500
|
+
), /* @__PURE__ */ React30.createElement(Text11, { style: [styles13.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React30.createElement(ModalBody, { scrollable: false, style: styles13.contentContainer }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.header }, integration.logo ? isSvgUrl(integration.logo) ? /* @__PURE__ */ React30.createElement(RemoteSvg, { uri: integration.logo }) : /* @__PURE__ */ React30.createElement(
|
|
2501
|
+
Image2,
|
|
2502
|
+
{
|
|
2503
|
+
source: { uri: integration.logo },
|
|
2504
|
+
style: styles13.logo,
|
|
2505
|
+
resizeMode: "contain"
|
|
2506
|
+
}
|
|
2507
|
+
) : /* @__PURE__ */ React30.createElement(
|
|
2508
|
+
View13,
|
|
2509
|
+
{
|
|
2510
|
+
style: [
|
|
2511
|
+
styles13.logoPlaceholder,
|
|
2512
|
+
{ backgroundColor: theme.colors.surface }
|
|
2513
|
+
]
|
|
2514
|
+
},
|
|
2515
|
+
/* @__PURE__ */ React30.createElement(Text11, { style: { color: theme.colors.text } }, integration.name?.charAt(0) || "?")
|
|
2516
|
+
), /* @__PURE__ */ React30.createElement(Text11, { style: [styles13.name, { color: theme.colors.text }] }, integration.name)), !isConnected ? /* @__PURE__ */ React30.createElement(View13, null, /* @__PURE__ */ React30.createElement(Text11, { style: [styles13.infoText, { color: theme.colors.text }] }, "Connect your wallet to continue"), /* @__PURE__ */ React30.createElement(
|
|
2375
2517
|
Button,
|
|
2376
2518
|
{
|
|
2377
2519
|
variant: "primary",
|
|
@@ -2379,107 +2521,149 @@ function ConnectButton({
|
|
|
2379
2521
|
onPress: () => open({ view: "Connect" })
|
|
2380
2522
|
},
|
|
2381
2523
|
"Connect Wallet"
|
|
2382
|
-
)) : /* @__PURE__ */
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
}
|
|
2392
|
-
|
|
2393
|
-
|
|
2524
|
+
)) : /* @__PURE__ */ React30.createElement(View13, { style: styles13.connectedContainer }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.connectedHeader }, /* @__PURE__ */ React30.createElement(
|
|
2525
|
+
Text11,
|
|
2526
|
+
{
|
|
2527
|
+
style: [styles13.connectedTitle, { color: theme.colors.text }]
|
|
2528
|
+
},
|
|
2529
|
+
"Wallet Connected"
|
|
2530
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2531
|
+
Text11,
|
|
2532
|
+
{
|
|
2533
|
+
style: [styles13.connectedText, { color: theme.colors.text }]
|
|
2534
|
+
},
|
|
2535
|
+
"Address: ",
|
|
2536
|
+
address
|
|
2537
|
+
), /* @__PURE__ */ React30.createElement(Button, { variant: "ghost", size: "sm", onPress: () => disconnect() }, "Disconnect Wallet"), isFetchingChains ? /* @__PURE__ */ React30.createElement(
|
|
2538
|
+
Text11,
|
|
2539
|
+
{
|
|
2540
|
+
style: [styles13.fetchingText, { color: theme.colors.text }]
|
|
2541
|
+
},
|
|
2542
|
+
"Fetching chains..."
|
|
2543
|
+
) : null), availableChains.length > 0 && address && /* @__PURE__ */ React30.createElement(
|
|
2544
|
+
ScrollView2,
|
|
2545
|
+
{
|
|
2546
|
+
style: styles13.scrollView,
|
|
2547
|
+
contentContainerStyle: styles13.scrollViewContent,
|
|
2548
|
+
showsVerticalScrollIndicator: true,
|
|
2549
|
+
nestedScrollEnabled: true
|
|
2550
|
+
},
|
|
2551
|
+
/* @__PURE__ */ React30.createElement(Text11, { style: [styles13.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"),
|
|
2552
|
+
/* @__PURE__ */ React30.createElement(View13, null, /* @__PURE__ */ React30.createElement(View13, { style: styles13.chainChips }, availableChains.map((chain) => {
|
|
2553
|
+
const isSelected = selectedChains.has(chain.id);
|
|
2554
|
+
const hasError = chainErrors[chain.id];
|
|
2555
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2556
|
+
TouchableOpacity4,
|
|
2394
2557
|
{
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
2399
|
-
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2400
|
-
}
|
|
2401
|
-
]
|
|
2558
|
+
onPress: () => toggleChainSelection(chain.id),
|
|
2559
|
+
style: styles13.chainButton,
|
|
2560
|
+
key: chain.id
|
|
2402
2561
|
},
|
|
2403
|
-
/* @__PURE__ */
|
|
2404
|
-
|
|
2562
|
+
/* @__PURE__ */ React30.createElement(
|
|
2563
|
+
View13,
|
|
2405
2564
|
{
|
|
2406
2565
|
style: [
|
|
2407
|
-
styles13.
|
|
2566
|
+
styles13.chainChip,
|
|
2408
2567
|
{
|
|
2409
|
-
|
|
2568
|
+
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
2569
|
+
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2410
2570
|
}
|
|
2411
2571
|
]
|
|
2412
2572
|
},
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2573
|
+
/* @__PURE__ */ React30.createElement(
|
|
2574
|
+
Text11,
|
|
2575
|
+
{
|
|
2576
|
+
style: [
|
|
2577
|
+
styles13.chainName,
|
|
2578
|
+
{
|
|
2579
|
+
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
2580
|
+
}
|
|
2581
|
+
]
|
|
2582
|
+
},
|
|
2583
|
+
chain.id
|
|
2584
|
+
),
|
|
2585
|
+
isSelected ? /* @__PURE__ */ React30.createElement(
|
|
2586
|
+
CloseIcon,
|
|
2587
|
+
{
|
|
2588
|
+
size: 12,
|
|
2589
|
+
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2590
|
+
}
|
|
2591
|
+
) : /* @__PURE__ */ React30.createElement(
|
|
2592
|
+
PlusIcon,
|
|
2593
|
+
{
|
|
2594
|
+
size: 12,
|
|
2595
|
+
color: theme.colors.textSecondary
|
|
2596
|
+
}
|
|
2597
|
+
)
|
|
2427
2598
|
)
|
|
2428
|
-
)
|
|
2429
|
-
)
|
|
2430
|
-
}))), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React29.createElement(View13, { style: styles13.chainErrorsContainer }, /* @__PURE__ */ React29.createElement(
|
|
2431
|
-
Text11,
|
|
2432
|
-
{
|
|
2433
|
-
style: [
|
|
2434
|
-
styles13.chainErrorsTitle,
|
|
2435
|
-
{ color: theme.colors.error }
|
|
2436
|
-
]
|
|
2437
|
-
},
|
|
2438
|
-
"Errors:"
|
|
2439
|
-
), Object.entries(chainErrors).map(([chainId2, error]) => {
|
|
2440
|
-
const chain = userUsedChains.find(
|
|
2441
|
-
(c) => c.id === chainId2
|
|
2442
|
-
);
|
|
2443
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2599
|
+
);
|
|
2600
|
+
})), errorMessage ? /* @__PURE__ */ React30.createElement(View13, { style: styles13.errorMessageContainer }, /* @__PURE__ */ React30.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React30.createElement(AlertDescription, null, errorMessage))) : null, Object.keys(chainErrors || {}).length > 0 && /* @__PURE__ */ React30.createElement(View13, { style: styles13.chainErrorsContainer }, /* @__PURE__ */ React30.createElement(
|
|
2444
2601
|
Text11,
|
|
2445
2602
|
{
|
|
2446
|
-
key: chainId2,
|
|
2447
2603
|
style: [
|
|
2448
|
-
styles13.
|
|
2604
|
+
styles13.chainErrorsTitle,
|
|
2449
2605
|
{ color: theme.colors.error }
|
|
2450
2606
|
]
|
|
2451
2607
|
},
|
|
2452
|
-
"
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2608
|
+
"Errors:"
|
|
2609
|
+
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
2610
|
+
const chain = availableChains.find(
|
|
2611
|
+
(c) => c.id === chainId
|
|
2612
|
+
);
|
|
2613
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2614
|
+
Text11,
|
|
2615
|
+
{
|
|
2616
|
+
key: chainId,
|
|
2617
|
+
style: [
|
|
2618
|
+
styles13.chainErrorItem,
|
|
2619
|
+
{ color: theme.colors.error }
|
|
2620
|
+
]
|
|
2621
|
+
},
|
|
2622
|
+
"\u2022 ",
|
|
2623
|
+
chain?.name ?? chainId,
|
|
2624
|
+
": ",
|
|
2625
|
+
String(error)
|
|
2626
|
+
);
|
|
2627
|
+
})))
|
|
2628
|
+
))), availableChains.length > 0 && address && /* @__PURE__ */ React30.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React30.createElement(
|
|
2458
2629
|
Button,
|
|
2459
2630
|
{
|
|
2460
2631
|
variant: "outline",
|
|
2461
2632
|
size: "lg",
|
|
2462
2633
|
onPress: onSubmitWalletConnect,
|
|
2463
2634
|
loading: isLoading,
|
|
2464
|
-
disabled: isLoading || !!address &&
|
|
2635
|
+
disabled: isLoading || !!address && availableChains.length > 0 && selectedChains.size === 0,
|
|
2465
2636
|
style: styles13.button
|
|
2466
2637
|
},
|
|
2467
2638
|
selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size > 1 ? "s" : ""}` : "Add Integration"
|
|
2468
|
-
), /* @__PURE__ */
|
|
2639
|
+
), /* @__PURE__ */ React30.createElement(Footer, null)));
|
|
2469
2640
|
}
|
|
2470
2641
|
var styles13 = StyleSheet13.create({
|
|
2471
|
-
|
|
2642
|
+
connectedContainer: {
|
|
2643
|
+
flex: 1
|
|
2644
|
+
},
|
|
2645
|
+
connectedHeader: {
|
|
2646
|
+
marginBottom: 8
|
|
2647
|
+
},
|
|
2648
|
+
connectedTitle: { fontSize: 12, fontWeight: "600", marginBottom: 4 },
|
|
2472
2649
|
connectedText: { fontSize: 14, marginBottom: 4 },
|
|
2650
|
+
fetchingText: { fontSize: 12, marginBottom: 4, textAlign: "center" },
|
|
2473
2651
|
infoText: {
|
|
2474
2652
|
fontSize: 16,
|
|
2475
2653
|
fontWeight: "600",
|
|
2476
2654
|
marginBottom: 8,
|
|
2477
2655
|
textAlign: "center"
|
|
2478
2656
|
},
|
|
2657
|
+
scrollView: {
|
|
2658
|
+
flex: 1
|
|
2659
|
+
},
|
|
2479
2660
|
scrollViewContent: {
|
|
2480
|
-
paddingBottom:
|
|
2661
|
+
paddingBottom: 40,
|
|
2481
2662
|
flexGrow: 1
|
|
2482
2663
|
},
|
|
2664
|
+
errorMessageContainer: {
|
|
2665
|
+
marginTop: 16
|
|
2666
|
+
},
|
|
2483
2667
|
headerContent: {
|
|
2484
2668
|
flexDirection: "row",
|
|
2485
2669
|
alignItems: "center"
|
|
@@ -2498,17 +2682,13 @@ var styles13 = StyleSheet13.create({
|
|
|
2498
2682
|
contentContainer: {
|
|
2499
2683
|
padding: 20,
|
|
2500
2684
|
// theme.spacing.xl
|
|
2501
|
-
paddingBottom:
|
|
2685
|
+
paddingBottom: 20,
|
|
2502
2686
|
width: "100%",
|
|
2503
2687
|
overflow: "hidden",
|
|
2504
2688
|
alignSelf: "center",
|
|
2505
2689
|
flexDirection: "column",
|
|
2506
2690
|
flex: 1
|
|
2507
2691
|
},
|
|
2508
|
-
chainSelection: {
|
|
2509
|
-
marginBottom: 16
|
|
2510
|
-
// theme.spacing.lg
|
|
2511
|
-
},
|
|
2512
2692
|
chainTitle: {
|
|
2513
2693
|
fontSize: 14,
|
|
2514
2694
|
// theme.fontSize.md
|
|
@@ -2560,9 +2740,7 @@ var styles13 = StyleSheet13.create({
|
|
|
2560
2740
|
// theme.spacing.xs
|
|
2561
2741
|
},
|
|
2562
2742
|
button: {
|
|
2563
|
-
width: "100%"
|
|
2564
|
-
marginTop: 16
|
|
2565
|
-
// theme.spacing.lg - consistent button spacing
|
|
2743
|
+
width: "100%"
|
|
2566
2744
|
},
|
|
2567
2745
|
emptyState: {
|
|
2568
2746
|
flex: 1,
|
|
@@ -2576,13 +2754,42 @@ var styles13 = StyleSheet13.create({
|
|
|
2576
2754
|
},
|
|
2577
2755
|
emptyStateButton: {
|
|
2578
2756
|
marginTop: 8
|
|
2757
|
+
},
|
|
2758
|
+
header: {
|
|
2759
|
+
flexDirection: "row",
|
|
2760
|
+
justifyContent: "center",
|
|
2761
|
+
alignItems: "center",
|
|
2762
|
+
marginBottom: 16
|
|
2763
|
+
// theme.spacing.lg
|
|
2764
|
+
},
|
|
2765
|
+
logo: {
|
|
2766
|
+
width: 32,
|
|
2767
|
+
height: 32,
|
|
2768
|
+
borderRadius: 8
|
|
2769
|
+
// theme.borderRadius.sm
|
|
2770
|
+
},
|
|
2771
|
+
logoPlaceholder: {
|
|
2772
|
+
width: 32,
|
|
2773
|
+
height: 32,
|
|
2774
|
+
borderRadius: 8,
|
|
2775
|
+
// theme.borderRadius.sm
|
|
2776
|
+
alignItems: "center",
|
|
2777
|
+
justifyContent: "center"
|
|
2778
|
+
},
|
|
2779
|
+
name: {
|
|
2780
|
+
fontSize: 16,
|
|
2781
|
+
// theme.fontSize.lg
|
|
2782
|
+
fontWeight: "600",
|
|
2783
|
+
marginLeft: 12,
|
|
2784
|
+
// theme.spacing.md
|
|
2785
|
+
textTransform: "capitalize"
|
|
2579
2786
|
}
|
|
2580
2787
|
});
|
|
2581
2788
|
|
|
2582
2789
|
// src/molecules/IntegrationForm.tsx
|
|
2583
|
-
import
|
|
2790
|
+
import React31 from "react";
|
|
2584
2791
|
import {
|
|
2585
|
-
Image as
|
|
2792
|
+
Image as Image3,
|
|
2586
2793
|
ScrollView as ScrollView3,
|
|
2587
2794
|
StyleSheet as StyleSheet14,
|
|
2588
2795
|
Text as Text12,
|
|
@@ -2594,29 +2801,30 @@ var IntegrationForm = ({
|
|
|
2594
2801
|
onAddHandle,
|
|
2595
2802
|
open,
|
|
2596
2803
|
setAddIntegrationMode,
|
|
2597
|
-
handleClose
|
|
2804
|
+
handleClose,
|
|
2805
|
+
providersList
|
|
2598
2806
|
}) => {
|
|
2599
2807
|
const { clientId, linkToken, user } = useKryptosConnect();
|
|
2600
2808
|
const theme = useTheme();
|
|
2601
|
-
const [isLoading, setIsLoading] =
|
|
2602
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
2603
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2604
|
-
const [selectedChains, setSelectedChains] =
|
|
2809
|
+
const [isLoading, setIsLoading] = React31.useState(false);
|
|
2810
|
+
const [isFetchingChains, setIsFetchingChains] = React31.useState(false);
|
|
2811
|
+
const [userUsedChains, setUserUsedChains] = React31.useState([]);
|
|
2812
|
+
const [selectedChains, setSelectedChains] = React31.useState(
|
|
2605
2813
|
/* @__PURE__ */ new Set()
|
|
2606
2814
|
);
|
|
2607
|
-
const [chainErrors, setChainErrors] =
|
|
2815
|
+
const [chainErrors, setChainErrors] = React31.useState(
|
|
2608
2816
|
{}
|
|
2609
2817
|
);
|
|
2610
|
-
const [errorMessage, setErrorMessage] =
|
|
2611
|
-
const [formValues, setFormValues] =
|
|
2818
|
+
const [errorMessage, setErrorMessage] = React31.useState("");
|
|
2819
|
+
const [formValues, setFormValues] = React31.useState({
|
|
2612
2820
|
address: "",
|
|
2613
2821
|
account_name: "",
|
|
2614
2822
|
api_key: "",
|
|
2615
2823
|
secret_key: "",
|
|
2616
2824
|
password: ""
|
|
2617
2825
|
});
|
|
2618
|
-
const [formErrors, setFormErrors] =
|
|
2619
|
-
|
|
2826
|
+
const [formErrors, setFormErrors] = React31.useState({});
|
|
2827
|
+
React31.useEffect(() => {
|
|
2620
2828
|
if (!formValues.address || !formValues.address.trim()) {
|
|
2621
2829
|
setUserUsedChains([]);
|
|
2622
2830
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2742,9 +2950,6 @@ var IntegrationForm = ({
|
|
|
2742
2950
|
clientId,
|
|
2743
2951
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2744
2952
|
},
|
|
2745
|
-
metadata: {
|
|
2746
|
-
environment: "sandbox"
|
|
2747
|
-
},
|
|
2748
2953
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2749
2954
|
default_chain: chain.name,
|
|
2750
2955
|
default_chain_logo: chain.logo || null,
|
|
@@ -2828,7 +3033,7 @@ var IntegrationForm = ({
|
|
|
2828
3033
|
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false
|
|
2829
3034
|
};
|
|
2830
3035
|
if (metadata.community_id) {
|
|
2831
|
-
data.chainId =
|
|
3036
|
+
data.chainId = metadata.community_id;
|
|
2832
3037
|
}
|
|
2833
3038
|
if (formValues.address) data.address = formValues.address;
|
|
2834
3039
|
if (formValues.account_name) data.accountName = formValues.account_name;
|
|
@@ -2863,14 +3068,14 @@ var IntegrationForm = ({
|
|
|
2863
3068
|
};
|
|
2864
3069
|
const hasNoFields = !metadata.password && !metadata.secret_key && !metadata.api_key && !metadata.address && !metadata.account_name;
|
|
2865
3070
|
const shouldShowFormFields = metadata.password || metadata.secret_key || metadata.api_key || metadata.address || metadata.account_name;
|
|
2866
|
-
const renderLogo = () => metadata.logo ? /* @__PURE__ */
|
|
2867
|
-
|
|
3071
|
+
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */ React31.createElement(RemoteSvg, { uri: metadata.logo }) : /* @__PURE__ */ React31.createElement(
|
|
3072
|
+
Image3,
|
|
2868
3073
|
{
|
|
2869
3074
|
source: { uri: metadata.logo },
|
|
2870
3075
|
style: styles14.logo,
|
|
2871
3076
|
resizeMode: "contain"
|
|
2872
3077
|
}
|
|
2873
|
-
) : /* @__PURE__ */
|
|
3078
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
2874
3079
|
View14,
|
|
2875
3080
|
{
|
|
2876
3081
|
style: [
|
|
@@ -2878,9 +3083,9 @@ var IntegrationForm = ({
|
|
|
2878
3083
|
{ backgroundColor: theme.colors.surface }
|
|
2879
3084
|
]
|
|
2880
3085
|
},
|
|
2881
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ React31.createElement(Text12, { style: { color: theme.colors.text } }, metadata.name?.charAt(0) || "?")
|
|
2882
3087
|
);
|
|
2883
|
-
const renderInput = (key, props) => /* @__PURE__ */
|
|
3088
|
+
const renderInput = (key, props) => /* @__PURE__ */ React31.createElement(
|
|
2884
3089
|
Input,
|
|
2885
3090
|
{
|
|
2886
3091
|
placeholder: props.placeholder,
|
|
@@ -2892,18 +3097,18 @@ var IntegrationForm = ({
|
|
|
2892
3097
|
secureTextEntry: props.secureTextEntry
|
|
2893
3098
|
}
|
|
2894
3099
|
);
|
|
2895
|
-
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */
|
|
2896
|
-
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */
|
|
3100
|
+
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */ React31.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React31.createElement(AlertDescription, null, errorMessage)) : null;
|
|
3101
|
+
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */ React31.createElement(View14, { style: styles14.chainSelection }, /* @__PURE__ */ React31.createElement(Text12, { style: [styles14.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"), /* @__PURE__ */ React31.createElement(ScrollView3, { contentContainerStyle: styles14.scrollViewContent }, /* @__PURE__ */ React31.createElement(View14, { style: styles14.chainChips }, userUsedChains.map((chain) => {
|
|
2897
3102
|
const isSelected = selectedChains.has(chain.id);
|
|
2898
3103
|
const hasError = chainErrors[chain.id];
|
|
2899
|
-
return /* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2900
3105
|
TouchableOpacity5,
|
|
2901
3106
|
{
|
|
2902
3107
|
onPress: () => toggleChainSelection(chain.id),
|
|
2903
3108
|
style: styles14.chainButton,
|
|
2904
3109
|
key: chain.id
|
|
2905
3110
|
},
|
|
2906
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ React31.createElement(
|
|
2907
3112
|
View14,
|
|
2908
3113
|
{
|
|
2909
3114
|
style: [
|
|
@@ -2914,7 +3119,7 @@ var IntegrationForm = ({
|
|
|
2914
3119
|
}
|
|
2915
3120
|
]
|
|
2916
3121
|
},
|
|
2917
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ React31.createElement(
|
|
2918
3123
|
Text12,
|
|
2919
3124
|
{
|
|
2920
3125
|
style: [
|
|
@@ -2926,16 +3131,16 @@ var IntegrationForm = ({
|
|
|
2926
3131
|
},
|
|
2927
3132
|
chain.name
|
|
2928
3133
|
),
|
|
2929
|
-
isSelected ? /* @__PURE__ */
|
|
3134
|
+
isSelected ? /* @__PURE__ */ React31.createElement(
|
|
2930
3135
|
CloseIcon,
|
|
2931
3136
|
{
|
|
2932
3137
|
size: 12,
|
|
2933
3138
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2934
3139
|
}
|
|
2935
|
-
) : /* @__PURE__ */
|
|
3140
|
+
) : /* @__PURE__ */ React31.createElement(PlusIcon, { size: 12, color: theme.colors.textSecondary })
|
|
2936
3141
|
)
|
|
2937
3142
|
);
|
|
2938
|
-
}))), Object.keys(chainErrors).length > 0 && /* @__PURE__ */
|
|
3143
|
+
}))), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React31.createElement(View14, { style: styles14.chainErrorsContainer }, /* @__PURE__ */ React31.createElement(
|
|
2939
3144
|
Text12,
|
|
2940
3145
|
{
|
|
2941
3146
|
style: [styles14.chainErrorsTitle, { color: theme.colors.error }]
|
|
@@ -2943,7 +3148,7 @@ var IntegrationForm = ({
|
|
|
2943
3148
|
"Errors:"
|
|
2944
3149
|
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
2945
3150
|
const chain = userUsedChains.find((c) => c.id === chainId);
|
|
2946
|
-
return /* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ React31.createElement(
|
|
2947
3152
|
Text12,
|
|
2948
3153
|
{
|
|
2949
3154
|
key: chainId,
|
|
@@ -2955,7 +3160,7 @@ var IntegrationForm = ({
|
|
|
2955
3160
|
error
|
|
2956
3161
|
);
|
|
2957
3162
|
})));
|
|
2958
|
-
const renderFormBlock = () => /* @__PURE__ */
|
|
3163
|
+
const renderFormBlock = () => /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement(View14, { style: styles14.header }, renderLogo(), /* @__PURE__ */ React31.createElement(Text12, { style: [styles14.name, { color: theme.colors.text }] }, metadata.name)), renderErrorAlert(), shouldShowFormFields && /* @__PURE__ */ React31.createElement(React31.Fragment, null, metadata.address && /* @__PURE__ */ React31.createElement(React31.Fragment, null, renderInput("address", {
|
|
2959
3164
|
placeholder: "Enter address",
|
|
2960
3165
|
autoCapitalize: "none",
|
|
2961
3166
|
autoCorrect: false
|
|
@@ -2971,16 +3176,16 @@ var IntegrationForm = ({
|
|
|
2971
3176
|
}), metadata.password && renderInput("password", {
|
|
2972
3177
|
placeholder: "Enter Password",
|
|
2973
3178
|
secureTextEntry: true
|
|
2974
|
-
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */
|
|
3179
|
+
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */ React31.createElement(Alert, { variant: "default", style: { marginTop: 12 } }, /* @__PURE__ */ React31.createElement(AlertDescription, null, "This integration is not supported here yet \u2014 try using it through our Kryptos Platform.")));
|
|
2975
3180
|
const addIntegrationLabel = formValues.address && userUsedChains.length > 0 && selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size !== 1 ? "s" : ""}` : "Add Integration";
|
|
2976
|
-
return /* @__PURE__ */
|
|
3181
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, !metadata?.isWalletConnectSupported ? /* @__PURE__ */ React31.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React31.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React31.createElement(View14, { style: styles14.headerContent }, /* @__PURE__ */ React31.createElement(
|
|
2977
3182
|
TouchableOpacity5,
|
|
2978
3183
|
{
|
|
2979
3184
|
onPress: () => setAddIntegrationMode(null),
|
|
2980
3185
|
style: styles14.backButton
|
|
2981
3186
|
},
|
|
2982
|
-
/* @__PURE__ */
|
|
2983
|
-
), /* @__PURE__ */
|
|
3187
|
+
/* @__PURE__ */ React31.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3188
|
+
), /* @__PURE__ */ React31.createElement(Text12, { style: [styles14.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React31.createElement(ModalBody, { scrollable: false, style: styles14.contentContainer }, renderFormBlock()), !hasNoFields && /* @__PURE__ */ React31.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React31.createElement(
|
|
2984
3189
|
Button,
|
|
2985
3190
|
{
|
|
2986
3191
|
variant: "outline",
|
|
@@ -2991,7 +3196,7 @@ var IntegrationForm = ({
|
|
|
2991
3196
|
style: styles14.button
|
|
2992
3197
|
},
|
|
2993
3198
|
addIntegrationLabel
|
|
2994
|
-
), /* @__PURE__ */
|
|
3199
|
+
), /* @__PURE__ */ React31.createElement(Footer, null))) : /* @__PURE__ */ React31.createElement(
|
|
2995
3200
|
WalletConnectComponent,
|
|
2996
3201
|
{
|
|
2997
3202
|
integration: metadata,
|
|
@@ -2999,7 +3204,8 @@ var IntegrationForm = ({
|
|
|
2999
3204
|
onAddHandle,
|
|
3000
3205
|
modalOpen: open,
|
|
3001
3206
|
setAddIntegrationMode,
|
|
3002
|
-
handleClose
|
|
3207
|
+
handleClose,
|
|
3208
|
+
providersList
|
|
3003
3209
|
}
|
|
3004
3210
|
));
|
|
3005
3211
|
};
|
|
@@ -3132,14 +3338,14 @@ var Integration = ({
|
|
|
3132
3338
|
}) => {
|
|
3133
3339
|
const { appName, linkToken } = useKryptosConnect();
|
|
3134
3340
|
const theme = useTheme();
|
|
3135
|
-
const [addIntegrationMode, setAddIntegrationMode] =
|
|
3136
|
-
const [query, setQuery] =
|
|
3137
|
-
const [activeTab, setActiveTab] =
|
|
3138
|
-
const [supportedProviders, setSupportedProviders] =
|
|
3139
|
-
const [addedIntegrations, setAddedIntegrations] =
|
|
3140
|
-
const [existingIntegrations, setExistingIntegrations] =
|
|
3141
|
-
const [isLoading, setIsLoading] =
|
|
3142
|
-
const [errorMessage, setErrorMessage] =
|
|
3341
|
+
const [addIntegrationMode, setAddIntegrationMode] = React32.useState(null);
|
|
3342
|
+
const [query, setQuery] = React32.useState("");
|
|
3343
|
+
const [activeTab, setActiveTab] = React32.useState("all");
|
|
3344
|
+
const [supportedProviders, setSupportedProviders] = React32.useState([]);
|
|
3345
|
+
const [addedIntegrations, setAddedIntegrations] = React32.useState([]);
|
|
3346
|
+
const [existingIntegrations, setExistingIntegrations] = React32.useState([]);
|
|
3347
|
+
const [isLoading, setIsLoading] = React32.useState(false);
|
|
3348
|
+
const [errorMessage, setErrorMessage] = React32.useState("");
|
|
3143
3349
|
const handleClose = () => {
|
|
3144
3350
|
onClose();
|
|
3145
3351
|
};
|
|
@@ -3170,13 +3376,13 @@ var Integration = ({
|
|
|
3170
3376
|
setIsLoading(false);
|
|
3171
3377
|
}
|
|
3172
3378
|
};
|
|
3173
|
-
|
|
3379
|
+
React32.useEffect(() => {
|
|
3174
3380
|
if (linkToken) {
|
|
3175
3381
|
fetchSupportedProviders();
|
|
3176
3382
|
fetchExistingIntegrations();
|
|
3177
3383
|
}
|
|
3178
3384
|
}, [linkToken]);
|
|
3179
|
-
const isIntegrationAdded =
|
|
3385
|
+
const isIntegrationAdded = React32.useCallback(
|
|
3180
3386
|
(publicName) => {
|
|
3181
3387
|
const integrations = [...addedIntegrations, ...existingIntegrations];
|
|
3182
3388
|
return integrations.some(
|
|
@@ -3185,7 +3391,7 @@ var Integration = ({
|
|
|
3185
3391
|
},
|
|
3186
3392
|
[addedIntegrations, existingIntegrations]
|
|
3187
3393
|
);
|
|
3188
|
-
const getIntegrationCount =
|
|
3394
|
+
const getIntegrationCount = React32.useCallback(
|
|
3189
3395
|
(publicName) => {
|
|
3190
3396
|
const integrations = [...addedIntegrations, ...existingIntegrations];
|
|
3191
3397
|
return integrations.filter(
|
|
@@ -3194,7 +3400,7 @@ var Integration = ({
|
|
|
3194
3400
|
},
|
|
3195
3401
|
[addedIntegrations, existingIntegrations]
|
|
3196
3402
|
);
|
|
3197
|
-
const filteredResults =
|
|
3403
|
+
const filteredResults = React32.useMemo(() => {
|
|
3198
3404
|
let filtered = supportedProviders;
|
|
3199
3405
|
if (activeTab !== "all") {
|
|
3200
3406
|
filtered = filtered.filter((provider) => provider.type === activeTab);
|
|
@@ -3234,7 +3440,7 @@ var Integration = ({
|
|
|
3234
3440
|
setIsLoading(false);
|
|
3235
3441
|
}
|
|
3236
3442
|
};
|
|
3237
|
-
const renderProviderItem = ({ item }) => /* @__PURE__ */
|
|
3443
|
+
const renderProviderItem = ({ item }) => /* @__PURE__ */ React32.createElement(
|
|
3238
3444
|
TouchableOpacity6,
|
|
3239
3445
|
{
|
|
3240
3446
|
style: [
|
|
@@ -3247,14 +3453,14 @@ var Integration = ({
|
|
|
3247
3453
|
onPress: () => setAddIntegrationMode(item),
|
|
3248
3454
|
activeOpacity: 0.7
|
|
3249
3455
|
},
|
|
3250
|
-
/* @__PURE__ */
|
|
3251
|
-
|
|
3456
|
+
/* @__PURE__ */ React32.createElement(View15, { style: styles15.providerInfo }, item?.logo ? isSvgUrl(item?.logo) ? /* @__PURE__ */ React32.createElement(RemoteSvg, { uri: item?.logo }) : /* @__PURE__ */ React32.createElement(
|
|
3457
|
+
Image4,
|
|
3252
3458
|
{
|
|
3253
3459
|
source: { uri: item?.logo },
|
|
3254
3460
|
style: styles15.providerLogo,
|
|
3255
3461
|
resizeMode: "contain"
|
|
3256
3462
|
}
|
|
3257
|
-
) : /* @__PURE__ */
|
|
3463
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
3258
3464
|
View15,
|
|
3259
3465
|
{
|
|
3260
3466
|
style: [
|
|
@@ -3262,9 +3468,9 @@ var Integration = ({
|
|
|
3262
3468
|
{ backgroundColor: theme.colors.surfaceSecondary }
|
|
3263
3469
|
]
|
|
3264
3470
|
},
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
), /* @__PURE__ */
|
|
3267
|
-
isIntegrationAdded(item?.public_name) && /* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ React32.createElement(Text13, { style: { color: theme.colors.text } }, item?.name?.charAt(0) || "?")
|
|
3472
|
+
), /* @__PURE__ */ React32.createElement(Text13, { style: [styles15.providerName, { color: theme.colors.text }] }, item?.name + "\u200B")),
|
|
3473
|
+
isIntegrationAdded(item?.public_name) && /* @__PURE__ */ React32.createElement(View15, { style: styles15.providerStatus }, /* @__PURE__ */ React32.createElement(CheckCircleIcon, { size: 18, color: theme.colors.success }), /* @__PURE__ */ React32.createElement(
|
|
3268
3474
|
Text13,
|
|
3269
3475
|
{
|
|
3270
3476
|
style: [
|
|
@@ -3275,15 +3481,69 @@ var Integration = ({
|
|
|
3275
3481
|
getIntegrationCount(item?.public_name)
|
|
3276
3482
|
))
|
|
3277
3483
|
);
|
|
3278
|
-
const renderSkeletonItem = () => /* @__PURE__ */
|
|
3279
|
-
return /* @__PURE__ */
|
|
3484
|
+
const renderSkeletonItem = () => /* @__PURE__ */ React32.createElement(SkeletonItem_default, null);
|
|
3485
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, !addIntegrationMode ? /* @__PURE__ */ React32.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React32.createElement(View15, { style: styles15.headerContent }, addIntegrationMode && /* @__PURE__ */ React32.createElement(
|
|
3280
3486
|
TouchableOpacity6,
|
|
3281
3487
|
{
|
|
3282
3488
|
onPress: () => setAddIntegrationMode(null),
|
|
3283
3489
|
style: styles15.backButton
|
|
3284
3490
|
},
|
|
3285
|
-
/* @__PURE__ */
|
|
3286
|
-
), /* @__PURE__ */
|
|
3491
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3492
|
+
), /* @__PURE__ */ React32.createElement(Text13, { style: [styles15.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React32.createElement(ModalBody, { scrollable: false, style: styles15.noPadding }, /* @__PURE__ */ React32.createElement(View15, { style: styles15.container }, /* @__PURE__ */ React32.createElement(View15, { style: styles15.headerSection }, /* @__PURE__ */ React32.createElement(ConnectLogo, null), /* @__PURE__ */ React32.createElement(Text13, { style: [styles15.title, { color: theme.colors.text }] }, "Select an account to link to ", appName)), /* @__PURE__ */ React32.createElement(
|
|
3493
|
+
View15,
|
|
3494
|
+
{
|
|
3495
|
+
style: {
|
|
3496
|
+
paddingHorizontal: theme.spacing.xl,
|
|
3497
|
+
paddingVertical: theme.spacing.sm + 2,
|
|
3498
|
+
backgroundColor: theme.colors.background,
|
|
3499
|
+
zIndex: 10
|
|
3500
|
+
}
|
|
3501
|
+
},
|
|
3502
|
+
/* @__PURE__ */ React32.createElement(
|
|
3503
|
+
Input,
|
|
3504
|
+
{
|
|
3505
|
+
value: query,
|
|
3506
|
+
onChangeText: setQuery,
|
|
3507
|
+
placeholder: "Search Integrations...",
|
|
3508
|
+
containerStyle: styles15.searchInput
|
|
3509
|
+
}
|
|
3510
|
+
),
|
|
3511
|
+
/* @__PURE__ */ React32.createElement(View15, { style: styles15.tabsContainer }, [
|
|
3512
|
+
{ label: "All", value: "all" },
|
|
3513
|
+
{ label: "Exchanges", value: "exchange" },
|
|
3514
|
+
{ label: "Blockchains", value: "blockchain" },
|
|
3515
|
+
{ label: "Wallets", value: "wallet" }
|
|
3516
|
+
].map((tab) => /* @__PURE__ */ React32.createElement(
|
|
3517
|
+
TouchableOpacity6,
|
|
3518
|
+
{
|
|
3519
|
+
key: tab.value,
|
|
3520
|
+
style: [
|
|
3521
|
+
styles15.tab,
|
|
3522
|
+
{
|
|
3523
|
+
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
3524
|
+
borderColor: theme.colors.border
|
|
3525
|
+
}
|
|
3526
|
+
],
|
|
3527
|
+
onPress: () => {
|
|
3528
|
+
setActiveTab(
|
|
3529
|
+
tab.value
|
|
3530
|
+
);
|
|
3531
|
+
}
|
|
3532
|
+
},
|
|
3533
|
+
/* @__PURE__ */ React32.createElement(
|
|
3534
|
+
Text13,
|
|
3535
|
+
{
|
|
3536
|
+
style: [
|
|
3537
|
+
styles15.tabText,
|
|
3538
|
+
{
|
|
3539
|
+
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
3540
|
+
}
|
|
3541
|
+
]
|
|
3542
|
+
},
|
|
3543
|
+
tab.label
|
|
3544
|
+
)
|
|
3545
|
+
)))
|
|
3546
|
+
), /* @__PURE__ */ React32.createElement(
|
|
3287
3547
|
FlatList,
|
|
3288
3548
|
{
|
|
3289
3549
|
data: isLoading ? Array.from({ length: 8 }, (_, i) => ({
|
|
@@ -3300,61 +3560,7 @@ var Integration = ({
|
|
|
3300
3560
|
{ paddingHorizontal: theme.spacing.xl }
|
|
3301
3561
|
],
|
|
3302
3562
|
showsVerticalScrollIndicator: false,
|
|
3303
|
-
|
|
3304
|
-
View15,
|
|
3305
|
-
{
|
|
3306
|
-
style: {
|
|
3307
|
-
paddingVertical: theme.spacing.sm + 2,
|
|
3308
|
-
backgroundColor: theme.colors.background,
|
|
3309
|
-
zIndex: 10
|
|
3310
|
-
}
|
|
3311
|
-
},
|
|
3312
|
-
/* @__PURE__ */ React31.createElement(
|
|
3313
|
-
Input,
|
|
3314
|
-
{
|
|
3315
|
-
value: query,
|
|
3316
|
-
onChangeText: setQuery,
|
|
3317
|
-
placeholder: "Search Integrations...",
|
|
3318
|
-
containerStyle: styles15.searchInput
|
|
3319
|
-
}
|
|
3320
|
-
),
|
|
3321
|
-
/* @__PURE__ */ React31.createElement(View15, { style: styles15.tabsContainer }, [
|
|
3322
|
-
{ label: "All", value: "all" },
|
|
3323
|
-
{ label: "Exchanges", value: "exchange" },
|
|
3324
|
-
{ label: "Blockchains", value: "blockchain" },
|
|
3325
|
-
{ label: "Wallets", value: "wallet" }
|
|
3326
|
-
].map((tab) => /* @__PURE__ */ React31.createElement(
|
|
3327
|
-
TouchableOpacity6,
|
|
3328
|
-
{
|
|
3329
|
-
key: tab.value,
|
|
3330
|
-
style: [
|
|
3331
|
-
styles15.tab,
|
|
3332
|
-
{
|
|
3333
|
-
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
3334
|
-
borderColor: theme.colors.border
|
|
3335
|
-
}
|
|
3336
|
-
],
|
|
3337
|
-
onPress: () => setActiveTab(
|
|
3338
|
-
tab.value
|
|
3339
|
-
),
|
|
3340
|
-
activeOpacity: 0.7
|
|
3341
|
-
},
|
|
3342
|
-
/* @__PURE__ */ React31.createElement(
|
|
3343
|
-
Text13,
|
|
3344
|
-
{
|
|
3345
|
-
style: [
|
|
3346
|
-
styles15.tabText,
|
|
3347
|
-
{
|
|
3348
|
-
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
3349
|
-
}
|
|
3350
|
-
]
|
|
3351
|
-
},
|
|
3352
|
-
tab.label
|
|
3353
|
-
)
|
|
3354
|
-
)))
|
|
3355
|
-
),
|
|
3356
|
-
stickyHeaderIndices: [0],
|
|
3357
|
-
ListEmptyComponent: /* @__PURE__ */ React31.createElement(View15, { style: styles15.emptyContainer }, !isLoading && /* @__PURE__ */ React31.createElement(
|
|
3563
|
+
ListEmptyComponent: /* @__PURE__ */ React32.createElement(View15, { style: styles15.emptyContainer }, !isLoading && /* @__PURE__ */ React32.createElement(
|
|
3358
3564
|
Text13,
|
|
3359
3565
|
{
|
|
3360
3566
|
style: [
|
|
@@ -3365,7 +3571,7 @@ var Integration = ({
|
|
|
3365
3571
|
query ? "No search results found" : "No supported integrations found"
|
|
3366
3572
|
))
|
|
3367
3573
|
}
|
|
3368
|
-
), errorMessage && /* @__PURE__ */
|
|
3574
|
+
), errorMessage && /* @__PURE__ */ React32.createElement(View15, { style: styles15.errorContainer }, /* @__PURE__ */ React32.createElement(Alert, { variant: "destructive", style: styles15.errorAlert }, /* @__PURE__ */ React32.createElement(AlertDescription, null, errorMessage))))), /* @__PURE__ */ React32.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React32.createElement(
|
|
3369
3575
|
Button,
|
|
3370
3576
|
{
|
|
3371
3577
|
variant: "outline",
|
|
@@ -3376,7 +3582,7 @@ var Integration = ({
|
|
|
3376
3582
|
style: styles15.continueButton
|
|
3377
3583
|
},
|
|
3378
3584
|
"Continue"
|
|
3379
|
-
), /* @__PURE__ */
|
|
3585
|
+
), /* @__PURE__ */ React32.createElement(Footer, null))) : /* @__PURE__ */ React32.createElement(
|
|
3380
3586
|
IntegrationForm,
|
|
3381
3587
|
{
|
|
3382
3588
|
metadata: addIntegrationMode,
|
|
@@ -3386,7 +3592,8 @@ var Integration = ({
|
|
|
3386
3592
|
},
|
|
3387
3593
|
open: !!addIntegrationMode,
|
|
3388
3594
|
setAddIntegrationMode,
|
|
3389
|
-
handleClose
|
|
3595
|
+
handleClose,
|
|
3596
|
+
providersList: supportedProviders
|
|
3390
3597
|
}
|
|
3391
3598
|
));
|
|
3392
3599
|
};
|
|
@@ -3413,9 +3620,10 @@ var styles15 = StyleSheet15.create({
|
|
|
3413
3620
|
flex: 1
|
|
3414
3621
|
},
|
|
3415
3622
|
headerSection: {
|
|
3416
|
-
paddingHorizontal: 20
|
|
3623
|
+
paddingHorizontal: 20,
|
|
3624
|
+
// theme.spacing.xl
|
|
3625
|
+
paddingTop: 10
|
|
3417
3626
|
// theme.spacing.xl
|
|
3418
|
-
// paddingTop: 10, // theme.spacing.xl
|
|
3419
3627
|
},
|
|
3420
3628
|
title: {
|
|
3421
3629
|
fontSize: 16,
|
|
@@ -3438,7 +3646,9 @@ var styles15 = StyleSheet15.create({
|
|
|
3438
3646
|
flexDirection: "row",
|
|
3439
3647
|
alignItems: "center",
|
|
3440
3648
|
justifyContent: "space-between",
|
|
3441
|
-
|
|
3649
|
+
paddingVertical: 8,
|
|
3650
|
+
// theme.spacing.md
|
|
3651
|
+
paddingHorizontal: 12,
|
|
3442
3652
|
// theme.spacing.md
|
|
3443
3653
|
borderRadius: 12,
|
|
3444
3654
|
// theme.borderRadius.md
|
|
@@ -3507,30 +3717,30 @@ var styles15 = StyleSheet15.create({
|
|
|
3507
3717
|
},
|
|
3508
3718
|
tabsContainer: {
|
|
3509
3719
|
flexDirection: "row",
|
|
3510
|
-
gap:
|
|
3720
|
+
gap: 6,
|
|
3511
3721
|
// theme.spacing.sm
|
|
3512
3722
|
flexWrap: "wrap"
|
|
3513
3723
|
},
|
|
3514
3724
|
tab: {
|
|
3515
|
-
paddingVertical:
|
|
3725
|
+
paddingVertical: 4,
|
|
3516
3726
|
// theme.spacing.sm
|
|
3517
|
-
paddingHorizontal:
|
|
3727
|
+
paddingHorizontal: 10,
|
|
3518
3728
|
// theme.spacing.lg
|
|
3519
|
-
borderRadius:
|
|
3729
|
+
borderRadius: 8,
|
|
3520
3730
|
// theme.borderRadius.full / 2
|
|
3521
3731
|
borderWidth: 1,
|
|
3522
3732
|
alignItems: "center",
|
|
3523
3733
|
justifyContent: "center"
|
|
3524
3734
|
},
|
|
3525
3735
|
tabText: {
|
|
3526
|
-
fontSize:
|
|
3736
|
+
fontSize: 12,
|
|
3527
3737
|
// theme.fontSize.sm
|
|
3528
3738
|
fontWeight: "600"
|
|
3529
3739
|
}
|
|
3530
3740
|
});
|
|
3531
3741
|
|
|
3532
3742
|
// src/molecules/OTPVerify.tsx
|
|
3533
|
-
import
|
|
3743
|
+
import React33 from "react";
|
|
3534
3744
|
import { StyleSheet as StyleSheet16, Text as Text14, TouchableOpacity as TouchableOpacity7, View as View16 } from "react-native";
|
|
3535
3745
|
var OTPVerify = ({
|
|
3536
3746
|
open,
|
|
@@ -3538,13 +3748,13 @@ var OTPVerify = ({
|
|
|
3538
3748
|
onClose
|
|
3539
3749
|
}) => {
|
|
3540
3750
|
const theme = useTheme();
|
|
3541
|
-
const [otp, setOtp] =
|
|
3751
|
+
const [otp, setOtp] = React33.useState("");
|
|
3542
3752
|
const { linkToken, clientId, email, setUser } = useKryptosConnect();
|
|
3543
|
-
const [isLoading, setIsLoading] =
|
|
3544
|
-
const [isResending, setIsResending] =
|
|
3545
|
-
const [resendCooldown, setResendCooldown] =
|
|
3546
|
-
const [errorMessage, setErrorMessage] =
|
|
3547
|
-
const [successMessage, setSuccessMessage] =
|
|
3753
|
+
const [isLoading, setIsLoading] = React33.useState(false);
|
|
3754
|
+
const [isResending, setIsResending] = React33.useState(false);
|
|
3755
|
+
const [resendCooldown, setResendCooldown] = React33.useState(0);
|
|
3756
|
+
const [errorMessage, setErrorMessage] = React33.useState("");
|
|
3757
|
+
const [successMessage, setSuccessMessage] = React33.useState("");
|
|
3548
3758
|
const handleSubmit = async () => {
|
|
3549
3759
|
if (otp.length !== 6) return;
|
|
3550
3760
|
setIsLoading(true);
|
|
@@ -3595,7 +3805,7 @@ var OTPVerify = ({
|
|
|
3595
3805
|
setSuccessMessage("");
|
|
3596
3806
|
setOtp("");
|
|
3597
3807
|
};
|
|
3598
|
-
|
|
3808
|
+
React33.useEffect(() => {
|
|
3599
3809
|
if (resendCooldown > 0) {
|
|
3600
3810
|
const timer = setTimeout(() => {
|
|
3601
3811
|
setResendCooldown(resendCooldown - 1);
|
|
@@ -3604,20 +3814,20 @@ var OTPVerify = ({
|
|
|
3604
3814
|
}
|
|
3605
3815
|
return void 0;
|
|
3606
3816
|
}, [resendCooldown]);
|
|
3607
|
-
return /* @__PURE__ */
|
|
3817
|
+
return /* @__PURE__ */ React33.createElement(Modal, { isOpen: open, onClose: handleClose, size: "lg" }, /* @__PURE__ */ React33.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React33.createElement(View16, { style: styles16.headerContent }, /* @__PURE__ */ React33.createElement(Text14, { style: [styles16.headerTitle, { color: theme.colors.text }] }, "OTP Verification"))), /* @__PURE__ */ React33.createElement(ModalBody, null, /* @__PURE__ */ React33.createElement(View16, { style: styles16.container }, /* @__PURE__ */ React33.createElement(ConnectLogo, null), /* @__PURE__ */ React33.createElement(View16, { style: styles16.emailInfo }, /* @__PURE__ */ React33.createElement(
|
|
3608
3818
|
Text14,
|
|
3609
3819
|
{
|
|
3610
3820
|
style: [styles16.infoText, { color: theme.colors.textSecondary }]
|
|
3611
3821
|
},
|
|
3612
3822
|
"We have sent a verification code to"
|
|
3613
|
-
), /* @__PURE__ */
|
|
3823
|
+
), /* @__PURE__ */ React33.createElement(Text14, { style: [styles16.emailText, { color: theme.colors.text }] }, email)), /* @__PURE__ */ React33.createElement(
|
|
3614
3824
|
OTP,
|
|
3615
3825
|
{
|
|
3616
3826
|
onComplete: handleOtpComplete,
|
|
3617
3827
|
length: 6,
|
|
3618
3828
|
setErrorMessage
|
|
3619
3829
|
}
|
|
3620
|
-
), errorMessage ? /* @__PURE__ */
|
|
3830
|
+
), errorMessage ? /* @__PURE__ */ React33.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React33.createElement(AlertDescription, null, errorMessage)) : null, successMessage ? /* @__PURE__ */ React33.createElement(Alert, { variant: "default" }, /* @__PURE__ */ React33.createElement(AlertDescription, null, successMessage)) : null, /* @__PURE__ */ React33.createElement(
|
|
3621
3831
|
Button,
|
|
3622
3832
|
{
|
|
3623
3833
|
variant: "outline",
|
|
@@ -3628,21 +3838,21 @@ var OTPVerify = ({
|
|
|
3628
3838
|
style: styles16.button
|
|
3629
3839
|
},
|
|
3630
3840
|
"Continue"
|
|
3631
|
-
), /* @__PURE__ */
|
|
3841
|
+
), /* @__PURE__ */ React33.createElement(
|
|
3632
3842
|
TouchableOpacity7,
|
|
3633
3843
|
{
|
|
3634
3844
|
onPress: handleResendOtp,
|
|
3635
3845
|
disabled: resendCooldown > 0 || isResending,
|
|
3636
3846
|
style: styles16.resendContainer
|
|
3637
3847
|
},
|
|
3638
|
-
isResending ? /* @__PURE__ */
|
|
3848
|
+
isResending ? /* @__PURE__ */ React33.createElement(View16, { style: styles16.resendLoading }, /* @__PURE__ */ React33.createElement(LoaderIcon, { size: 16, color: theme.colors.primary }), /* @__PURE__ */ React33.createElement(
|
|
3639
3849
|
Text14,
|
|
3640
3850
|
{
|
|
3641
3851
|
style: [styles16.resendText, { color: theme.colors.primary }]
|
|
3642
3852
|
},
|
|
3643
3853
|
" ",
|
|
3644
3854
|
"Sending..."
|
|
3645
|
-
)) : resendCooldown > 0 ? /* @__PURE__ */
|
|
3855
|
+
)) : resendCooldown > 0 ? /* @__PURE__ */ React33.createElement(
|
|
3646
3856
|
Text14,
|
|
3647
3857
|
{
|
|
3648
3858
|
style: [
|
|
@@ -3653,14 +3863,14 @@ var OTPVerify = ({
|
|
|
3653
3863
|
"Resend OTP in ",
|
|
3654
3864
|
resendCooldown,
|
|
3655
3865
|
"s"
|
|
3656
|
-
) : /* @__PURE__ */
|
|
3866
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
3657
3867
|
Text14,
|
|
3658
3868
|
{
|
|
3659
3869
|
style: [styles16.resendText, { color: theme.colors.primary }]
|
|
3660
3870
|
},
|
|
3661
3871
|
"Resend OTP"
|
|
3662
3872
|
)
|
|
3663
|
-
))), /* @__PURE__ */
|
|
3873
|
+
))), /* @__PURE__ */ React33.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React33.createElement(Footer, null)));
|
|
3664
3874
|
};
|
|
3665
3875
|
var styles16 = StyleSheet16.create({
|
|
3666
3876
|
headerContent: {
|
|
@@ -3721,7 +3931,7 @@ var styles16 = StyleSheet16.create({
|
|
|
3721
3931
|
});
|
|
3722
3932
|
|
|
3723
3933
|
// src/molecules/Permissions.tsx
|
|
3724
|
-
import
|
|
3934
|
+
import React34 from "react";
|
|
3725
3935
|
import { StyleSheet as StyleSheet17, Text as Text15, View as View17 } from "react-native";
|
|
3726
3936
|
var Permissions = ({
|
|
3727
3937
|
open,
|
|
@@ -3730,8 +3940,8 @@ var Permissions = ({
|
|
|
3730
3940
|
}) => {
|
|
3731
3941
|
const { appName, linkToken, setUserConsent } = useKryptosConnect();
|
|
3732
3942
|
const theme = useTheme();
|
|
3733
|
-
const [isLoading, setIsLoading] =
|
|
3734
|
-
const [errorMessage, setErrorMessage] =
|
|
3943
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
3944
|
+
const [errorMessage, setErrorMessage] = React34.useState("");
|
|
3735
3945
|
const handleConsentClick = async () => {
|
|
3736
3946
|
try {
|
|
3737
3947
|
setIsLoading(true);
|
|
@@ -3754,7 +3964,7 @@ var Permissions = ({
|
|
|
3754
3964
|
"Access your transaction history and trading activity",
|
|
3755
3965
|
"Keep this data updated and accessible when you're offline"
|
|
3756
3966
|
];
|
|
3757
|
-
return /* @__PURE__ */
|
|
3967
|
+
return /* @__PURE__ */ React34.createElement(Modal, { isOpen: open, onClose, size: "xl" }, /* @__PURE__ */ React34.createElement(ModalHeader, { onClose }, "Permissions"), /* @__PURE__ */ React34.createElement(ModalBody, null, /* @__PURE__ */ React34.createElement(View17, { style: styles17.container }, /* @__PURE__ */ React34.createElement(ConnectLogo, null), errorMessage ? /* @__PURE__ */ React34.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React34.createElement(AlertDescription, null, errorMessage)) : null, /* @__PURE__ */ React34.createElement(View17, { style: styles17.permissionsList }, /* @__PURE__ */ React34.createElement(
|
|
3758
3968
|
Text15,
|
|
3759
3969
|
{
|
|
3760
3970
|
style: [styles17.subtitle, { color: theme.colors.textSecondary }]
|
|
@@ -3762,13 +3972,13 @@ var Permissions = ({
|
|
|
3762
3972
|
"Allow ",
|
|
3763
3973
|
appName,
|
|
3764
3974
|
" to:"
|
|
3765
|
-
), permissionItems.map((item, index) => /* @__PURE__ */
|
|
3975
|
+
), permissionItems.map((item, index) => /* @__PURE__ */ React34.createElement(View17, { key: `permission-${index}`, style: styles17.permissionItem }, /* @__PURE__ */ React34.createElement(Text15, { style: [styles17.bullet, { color: theme.colors.primary }] }, index + 1, "."), /* @__PURE__ */ React34.createElement(
|
|
3766
3976
|
Text15,
|
|
3767
3977
|
{
|
|
3768
3978
|
style: [styles17.permissionText, { color: theme.colors.text }]
|
|
3769
3979
|
},
|
|
3770
3980
|
item
|
|
3771
|
-
)))), /* @__PURE__ */
|
|
3981
|
+
)))), /* @__PURE__ */ React34.createElement(
|
|
3772
3982
|
View17,
|
|
3773
3983
|
{
|
|
3774
3984
|
style: [
|
|
@@ -3779,17 +3989,17 @@ var Permissions = ({
|
|
|
3779
3989
|
}
|
|
3780
3990
|
]
|
|
3781
3991
|
},
|
|
3782
|
-
/* @__PURE__ */
|
|
3992
|
+
/* @__PURE__ */ React34.createElement(
|
|
3783
3993
|
Text15,
|
|
3784
3994
|
{
|
|
3785
3995
|
style: [styles17.infoText, { color: theme.colors.textSecondary }]
|
|
3786
3996
|
},
|
|
3787
3997
|
"By selecting",
|
|
3788
3998
|
" ",
|
|
3789
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ React34.createElement(Text15, { style: { fontWeight: "600", color: theme.colors.text } }, "'Allow'"),
|
|
3790
4000
|
", you agree to share this information and keep it updated."
|
|
3791
4001
|
)
|
|
3792
|
-
))), /* @__PURE__ */
|
|
4002
|
+
))), /* @__PURE__ */ React34.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React34.createElement(
|
|
3793
4003
|
Button,
|
|
3794
4004
|
{
|
|
3795
4005
|
variant: "outline",
|
|
@@ -3800,7 +4010,7 @@ var Permissions = ({
|
|
|
3800
4010
|
style: styles17.button
|
|
3801
4011
|
},
|
|
3802
4012
|
"Allow"
|
|
3803
|
-
), /* @__PURE__ */
|
|
4013
|
+
), /* @__PURE__ */ React34.createElement(Footer, null)));
|
|
3804
4014
|
};
|
|
3805
4015
|
var styles17 = StyleSheet17.create({
|
|
3806
4016
|
container: {
|
|
@@ -3860,7 +4070,7 @@ var styles17 = StyleSheet17.create({
|
|
|
3860
4070
|
});
|
|
3861
4071
|
|
|
3862
4072
|
// src/molecules/StatusModal.tsx
|
|
3863
|
-
import
|
|
4073
|
+
import React35 from "react";
|
|
3864
4074
|
import { StyleSheet as StyleSheet18, Text as Text16, View as View18 } from "react-native";
|
|
3865
4075
|
var StatusModal = ({
|
|
3866
4076
|
open,
|
|
@@ -3878,7 +4088,7 @@ var StatusModal = ({
|
|
|
3878
4088
|
}
|
|
3879
4089
|
onClose();
|
|
3880
4090
|
};
|
|
3881
|
-
return /* @__PURE__ */
|
|
4091
|
+
return /* @__PURE__ */ React35.createElement(Modal, { isOpen: open, onClose: handleClose, size: "sm" }, /* @__PURE__ */ React35.createElement(ModalHeader, { showCloseButton: false, onClose: handleClose }, ""), /* @__PURE__ */ React35.createElement(ModalBody, null, /* @__PURE__ */ React35.createElement(View18, { style: styles18.container }, /* @__PURE__ */ React35.createElement(View18, { style: styles18.iconContainer }, status === "success" ? /* @__PURE__ */ React35.createElement(SuccessIcon, { size: 80 }) : /* @__PURE__ */ React35.createElement(ErrorIcon, { size: 80 })), /* @__PURE__ */ React35.createElement(Text16, { style: [styles18.message, { color: theme.colors.text }] }, status === "success" ? "Connection successful" : "Connection failed"))), /* @__PURE__ */ React35.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React35.createElement(
|
|
3882
4092
|
Button,
|
|
3883
4093
|
{
|
|
3884
4094
|
variant: "outline",
|
|
@@ -3887,7 +4097,7 @@ var StatusModal = ({
|
|
|
3887
4097
|
style: styles18.button
|
|
3888
4098
|
},
|
|
3889
4099
|
status === "success" ? "Continue" : "Try again later"
|
|
3890
|
-
), /* @__PURE__ */
|
|
4100
|
+
), /* @__PURE__ */ React35.createElement(Footer, null)));
|
|
3891
4101
|
};
|
|
3892
4102
|
var styles18 = StyleSheet18.create({
|
|
3893
4103
|
container: {
|
|
@@ -3914,18 +4124,18 @@ var styles18 = StyleSheet18.create({
|
|
|
3914
4124
|
});
|
|
3915
4125
|
|
|
3916
4126
|
// src/molecules/EndModal.tsx
|
|
3917
|
-
import
|
|
4127
|
+
import React36, { useEffect as useEffect4 } from "react";
|
|
3918
4128
|
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
3919
4129
|
var EndModal = ({ open, onClose }) => {
|
|
3920
4130
|
const theme = useTheme();
|
|
3921
|
-
|
|
4131
|
+
useEffect4(() => {
|
|
3922
4132
|
if (!open) return;
|
|
3923
4133
|
const timer = setTimeout(() => {
|
|
3924
4134
|
onClose();
|
|
3925
4135
|
}, 5e3);
|
|
3926
4136
|
return () => clearTimeout(timer);
|
|
3927
4137
|
}, []);
|
|
3928
|
-
return /* @__PURE__ */
|
|
4138
|
+
return /* @__PURE__ */ React36.createElement(Modal, { isOpen: open, onClose, size: "md" }, /* @__PURE__ */ React36.createElement(ModalHeader, { onClose }, ""), /* @__PURE__ */ React36.createElement(ModalBody, null, /* @__PURE__ */ React36.createElement(View19, { style: styles19.container }, /* @__PURE__ */ React36.createElement(
|
|
3929
4139
|
View19,
|
|
3930
4140
|
{
|
|
3931
4141
|
style: [
|
|
@@ -3933,9 +4143,9 @@ var EndModal = ({ open, onClose }) => {
|
|
|
3933
4143
|
{ backgroundColor: theme.colors.successLight }
|
|
3934
4144
|
]
|
|
3935
4145
|
},
|
|
3936
|
-
/* @__PURE__ */
|
|
3937
|
-
), /* @__PURE__ */
|
|
3938
|
-
than expected, tap the button below to continue.`))), /* @__PURE__ */
|
|
4146
|
+
/* @__PURE__ */ React36.createElement(SuccessIcon, { size: 80 })
|
|
4147
|
+
), /* @__PURE__ */ React36.createElement(Text17, { style: [styles19.message, { color: theme.colors.text }] }, `All set! We're redirecting you back to the app. If it takes longer
|
|
4148
|
+
than expected, tap the button below to continue.`))), /* @__PURE__ */ React36.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React36.createElement(
|
|
3939
4149
|
Button,
|
|
3940
4150
|
{
|
|
3941
4151
|
variant: "primary",
|
|
@@ -3944,7 +4154,7 @@ var EndModal = ({ open, onClose }) => {
|
|
|
3944
4154
|
style: styles19.button
|
|
3945
4155
|
},
|
|
3946
4156
|
"Continue to App"
|
|
3947
|
-
), /* @__PURE__ */
|
|
4157
|
+
), /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
3948
4158
|
};
|
|
3949
4159
|
var styles19 = StyleSheet19.create({
|
|
3950
4160
|
container: {
|
|
@@ -3981,9 +4191,9 @@ var KryptosConnectButton = ({
|
|
|
3981
4191
|
textStyle
|
|
3982
4192
|
}) => {
|
|
3983
4193
|
const { theme: themeName } = useKryptosConnect();
|
|
3984
|
-
const [open, setOpen] =
|
|
4194
|
+
const [open, setOpen] = React37.useState(false);
|
|
3985
4195
|
const theme = useTheme();
|
|
3986
|
-
return /* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, children ? /* @__PURE__ */ React37.createElement(TouchableOpacity8, { onPress: () => setOpen(true), style }, children) : /* @__PURE__ */ React37.createElement(
|
|
3987
4197
|
TouchableOpacity8,
|
|
3988
4198
|
{
|
|
3989
4199
|
onPress: () => setOpen(true),
|
|
@@ -4002,7 +4212,7 @@ var KryptosConnectButton = ({
|
|
|
4002
4212
|
],
|
|
4003
4213
|
activeOpacity: 0.8
|
|
4004
4214
|
},
|
|
4005
|
-
/* @__PURE__ */
|
|
4215
|
+
/* @__PURE__ */ React37.createElement(
|
|
4006
4216
|
Text18,
|
|
4007
4217
|
{
|
|
4008
4218
|
style: [
|
|
@@ -4017,8 +4227,8 @@ var KryptosConnectButton = ({
|
|
|
4017
4227
|
"Connect with",
|
|
4018
4228
|
" "
|
|
4019
4229
|
),
|
|
4020
|
-
/* @__PURE__ */
|
|
4021
|
-
), /* @__PURE__ */
|
|
4230
|
+
/* @__PURE__ */ React37.createElement(LogoIcon, { size: 24 })
|
|
4231
|
+
), /* @__PURE__ */ React37.createElement(
|
|
4022
4232
|
KryptosConnectModal,
|
|
4023
4233
|
{
|
|
4024
4234
|
open,
|
|
@@ -4046,7 +4256,7 @@ var KryptosConnectModal = ({
|
|
|
4046
4256
|
isAuthorized,
|
|
4047
4257
|
linkToken
|
|
4048
4258
|
} = useKryptosConnect();
|
|
4049
|
-
const [step, setStep] =
|
|
4259
|
+
const [step, setStep] = React37.useState("INIT" /* INIT */);
|
|
4050
4260
|
const handleClose = () => {
|
|
4051
4261
|
setOpen(false);
|
|
4052
4262
|
setIsInitialized(false);
|
|
@@ -4082,7 +4292,7 @@ var KryptosConnectModal = ({
|
|
|
4082
4292
|
handleClose();
|
|
4083
4293
|
};
|
|
4084
4294
|
if (!open) return null;
|
|
4085
|
-
return /* @__PURE__ */
|
|
4295
|
+
return /* @__PURE__ */ React37.createElement(View20, { style: styles20.container }, step === "INIT" /* INIT */ && /* @__PURE__ */ React37.createElement(
|
|
4086
4296
|
Init,
|
|
4087
4297
|
{
|
|
4088
4298
|
open,
|
|
@@ -4096,7 +4306,7 @@ var KryptosConnectModal = ({
|
|
|
4096
4306
|
},
|
|
4097
4307
|
onClose: handleAbort
|
|
4098
4308
|
}
|
|
4099
|
-
), step === "AUTH" /* AUTH */ && /* @__PURE__ */
|
|
4309
|
+
), step === "AUTH" /* AUTH */ && /* @__PURE__ */ React37.createElement(
|
|
4100
4310
|
Auth,
|
|
4101
4311
|
{
|
|
4102
4312
|
open,
|
|
@@ -4104,28 +4314,28 @@ var KryptosConnectModal = ({
|
|
|
4104
4314
|
onGuestSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4105
4315
|
onClose: handleAbort
|
|
4106
4316
|
}
|
|
4107
|
-
), step === "OTP" /* OTP */ && /* @__PURE__ */
|
|
4317
|
+
), step === "OTP" /* OTP */ && /* @__PURE__ */ React37.createElement(
|
|
4108
4318
|
OTPVerify,
|
|
4109
4319
|
{
|
|
4110
4320
|
open,
|
|
4111
4321
|
onSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4112
4322
|
onClose: handleAbort
|
|
4113
4323
|
}
|
|
4114
|
-
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */
|
|
4324
|
+
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */ React37.createElement(
|
|
4115
4325
|
Integration,
|
|
4116
4326
|
{
|
|
4117
4327
|
open,
|
|
4118
4328
|
onSuccess: handleConsentClick,
|
|
4119
4329
|
onClose: handleAbort
|
|
4120
4330
|
}
|
|
4121
|
-
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */
|
|
4331
|
+
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */ React37.createElement(
|
|
4122
4332
|
Permissions,
|
|
4123
4333
|
{
|
|
4124
4334
|
open,
|
|
4125
4335
|
onClose: handleAbort,
|
|
4126
4336
|
onSuccess: () => setStep("STATUS" /* STATUS */)
|
|
4127
4337
|
}
|
|
4128
|
-
), step === "STATUS" /* STATUS */ && /* @__PURE__ */
|
|
4338
|
+
), step === "STATUS" /* STATUS */ && /* @__PURE__ */ React37.createElement(
|
|
4129
4339
|
StatusModal,
|
|
4130
4340
|
{
|
|
4131
4341
|
open,
|
|
@@ -4134,7 +4344,7 @@ var KryptosConnectModal = ({
|
|
|
4134
4344
|
onError: handleError,
|
|
4135
4345
|
status: userConsent?.public_token ? "success" : "error"
|
|
4136
4346
|
}
|
|
4137
|
-
), step === "END" /* END */ && /* @__PURE__ */
|
|
4347
|
+
), step === "END" /* END */ && /* @__PURE__ */ React37.createElement(
|
|
4138
4348
|
EndModal,
|
|
4139
4349
|
{
|
|
4140
4350
|
open,
|