@kryptos_connect/mobile-sdk 1.0.3 → 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 +446 -366
- package/dist/index.mjs +355 -274
- 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({
|
|
@@ -1002,8 +1007,7 @@ var styles4 = StyleSheet4.create({
|
|
|
1002
1007
|
flex: 1
|
|
1003
1008
|
},
|
|
1004
1009
|
footer: {
|
|
1005
|
-
borderTopWidth: 1
|
|
1006
|
-
marginBottom: 24
|
|
1010
|
+
borderTopWidth: 1
|
|
1007
1011
|
}
|
|
1008
1012
|
});
|
|
1009
1013
|
|
|
@@ -1306,7 +1310,7 @@ var styles9 = StyleSheet9.create({
|
|
|
1306
1310
|
});
|
|
1307
1311
|
|
|
1308
1312
|
// src/molecules/Auth.tsx
|
|
1309
|
-
import
|
|
1313
|
+
import React20 from "react";
|
|
1310
1314
|
import { Linking as Linking2, StyleSheet as StyleSheet11, Text as Text9, View as View11 } from "react-native";
|
|
1311
1315
|
|
|
1312
1316
|
// src/assets/LinkIcon.tsx
|
|
@@ -1376,7 +1380,7 @@ var EyeIcon = ({
|
|
|
1376
1380
|
};
|
|
1377
1381
|
|
|
1378
1382
|
// src/molecules/ConnectLogo.tsx
|
|
1379
|
-
import
|
|
1383
|
+
import React19, { isValidElement } from "react";
|
|
1380
1384
|
import {
|
|
1381
1385
|
Image,
|
|
1382
1386
|
StyleSheet as StyleSheet10,
|
|
@@ -1441,15 +1445,40 @@ var UnplugIcon = ({
|
|
|
1441
1445
|
));
|
|
1442
1446
|
};
|
|
1443
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
|
+
|
|
1444
1473
|
// src/molecules/ConnectLogo.tsx
|
|
1445
1474
|
var KryptosLogo = () => {
|
|
1446
1475
|
const theme = useTheme();
|
|
1447
|
-
return /* @__PURE__ */
|
|
1476
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1448
1477
|
View10,
|
|
1449
1478
|
{
|
|
1450
1479
|
style: [styles10.logoContainer, { backgroundColor: theme.colors.surface }]
|
|
1451
1480
|
},
|
|
1452
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ React19.createElement(LogoIcon, { size: 36 })
|
|
1453
1482
|
);
|
|
1454
1483
|
};
|
|
1455
1484
|
var ConnectLogo = () => {
|
|
@@ -1467,7 +1496,7 @@ var ConnectLogo = () => {
|
|
|
1467
1496
|
if (isValidElement(appLogo)) {
|
|
1468
1497
|
return appLogo;
|
|
1469
1498
|
} else if (typeof appLogo === "string" && isValidUrl(appLogo)) {
|
|
1470
|
-
return /* @__PURE__ */
|
|
1499
|
+
return isSvgUrl(appLogo) ? /* @__PURE__ */ React19.createElement(RemoteSvg, { uri: appLogo }) : /* @__PURE__ */ React19.createElement(
|
|
1471
1500
|
Image,
|
|
1472
1501
|
{
|
|
1473
1502
|
source: { uri: appLogo },
|
|
@@ -1476,7 +1505,7 @@ var ConnectLogo = () => {
|
|
|
1476
1505
|
}
|
|
1477
1506
|
);
|
|
1478
1507
|
} else if (typeof appLogo === "number" || typeof appLogo === "object" && appLogo !== null) {
|
|
1479
|
-
return /* @__PURE__ */
|
|
1508
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1480
1509
|
Image,
|
|
1481
1510
|
{
|
|
1482
1511
|
source: appLogo,
|
|
@@ -1485,11 +1514,11 @@ var ConnectLogo = () => {
|
|
|
1485
1514
|
}
|
|
1486
1515
|
);
|
|
1487
1516
|
} else if (appName) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, appName.charAt(0).toUpperCase());
|
|
1489
1518
|
}
|
|
1490
|
-
return /* @__PURE__ */
|
|
1519
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, "?");
|
|
1491
1520
|
};
|
|
1492
|
-
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(
|
|
1493
1522
|
View10,
|
|
1494
1523
|
{
|
|
1495
1524
|
style: [
|
|
@@ -1541,11 +1570,11 @@ var Auth = ({
|
|
|
1541
1570
|
}) => {
|
|
1542
1571
|
const { appName, linkToken, clientId, setUser, setEmail } = useKryptosConnect();
|
|
1543
1572
|
const theme = useTheme();
|
|
1544
|
-
const [isLoading, setIsLoading] =
|
|
1545
|
-
const [errorMessage, setErrorMessage] =
|
|
1546
|
-
const [emailValue, setEmailValue] =
|
|
1547
|
-
const [emailError, setEmailError] =
|
|
1548
|
-
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);
|
|
1549
1578
|
const validateEmail = (email) => {
|
|
1550
1579
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1551
1580
|
if (!email) {
|
|
@@ -1607,28 +1636,28 @@ var Auth = ({
|
|
|
1607
1636
|
};
|
|
1608
1637
|
const infoSections = [
|
|
1609
1638
|
{
|
|
1610
|
-
icon: /* @__PURE__ */
|
|
1639
|
+
icon: /* @__PURE__ */ React20.createElement(LinkIcon, { size: 20, color: theme.colors.primary }),
|
|
1611
1640
|
title: "Simple and secure",
|
|
1612
1641
|
text: "Link your accounts in just a few clicks"
|
|
1613
1642
|
},
|
|
1614
1643
|
{
|
|
1615
|
-
icon: /* @__PURE__ */
|
|
1644
|
+
icon: /* @__PURE__ */ React20.createElement(ShieldIcon, { size: 20, color: theme.colors.primary }),
|
|
1616
1645
|
title: "Control what you share",
|
|
1617
1646
|
text: "We never share your data without your permission"
|
|
1618
1647
|
},
|
|
1619
1648
|
{
|
|
1620
|
-
icon: /* @__PURE__ */
|
|
1649
|
+
icon: /* @__PURE__ */ React20.createElement(EyeIcon, { size: 20, color: theme.colors.primary }),
|
|
1621
1650
|
title: "View Only Access",
|
|
1622
1651
|
text: "Kryptos retrieves view-only data and cannot perform any transactions on your behalf."
|
|
1623
1652
|
}
|
|
1624
1653
|
];
|
|
1625
|
-
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(
|
|
1626
1655
|
Text9,
|
|
1627
1656
|
{
|
|
1628
1657
|
style: [styles11.infoTitle, { color: theme.colors.text }]
|
|
1629
1658
|
},
|
|
1630
1659
|
section.title
|
|
1631
|
-
), /* @__PURE__ */
|
|
1660
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1632
1661
|
Text9,
|
|
1633
1662
|
{
|
|
1634
1663
|
style: [
|
|
@@ -1637,7 +1666,7 @@ var Auth = ({
|
|
|
1637
1666
|
]
|
|
1638
1667
|
},
|
|
1639
1668
|
section.text
|
|
1640
|
-
)))), 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(
|
|
1641
1670
|
Button,
|
|
1642
1671
|
{
|
|
1643
1672
|
variant: "outline",
|
|
@@ -1648,14 +1677,14 @@ var Auth = ({
|
|
|
1648
1677
|
style: styles11.button
|
|
1649
1678
|
},
|
|
1650
1679
|
"Continue"
|
|
1651
|
-
), /* @__PURE__ */
|
|
1680
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1652
1681
|
Text9,
|
|
1653
1682
|
{
|
|
1654
1683
|
style: [styles11.footerText, { color: theme.colors.textSecondary }]
|
|
1655
1684
|
},
|
|
1656
1685
|
"By continuing, you agree to Kryptos",
|
|
1657
1686
|
" ",
|
|
1658
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ React20.createElement(
|
|
1659
1688
|
Text9,
|
|
1660
1689
|
{
|
|
1661
1690
|
style: {
|
|
@@ -1669,7 +1698,7 @@ var Auth = ({
|
|
|
1669
1698
|
" ",
|
|
1670
1699
|
"and",
|
|
1671
1700
|
" ",
|
|
1672
|
-
/* @__PURE__ */
|
|
1701
|
+
/* @__PURE__ */ React20.createElement(
|
|
1673
1702
|
Text9,
|
|
1674
1703
|
{
|
|
1675
1704
|
style: {
|
|
@@ -1680,7 +1709,7 @@ var Auth = ({
|
|
|
1680
1709
|
},
|
|
1681
1710
|
"Terms of Service"
|
|
1682
1711
|
)
|
|
1683
|
-
)))), /* @__PURE__ */
|
|
1712
|
+
)))), /* @__PURE__ */ React20.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React20.createElement(Footer, null)));
|
|
1684
1713
|
};
|
|
1685
1714
|
var styles11 = StyleSheet11.create({
|
|
1686
1715
|
container: {
|
|
@@ -1747,8 +1776,8 @@ var styles11 = StyleSheet11.create({
|
|
|
1747
1776
|
});
|
|
1748
1777
|
|
|
1749
1778
|
// src/molecules/Init.tsx
|
|
1750
|
-
import
|
|
1751
|
-
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";
|
|
1752
1781
|
var Init = ({
|
|
1753
1782
|
open,
|
|
1754
1783
|
onSuccess,
|
|
@@ -1763,9 +1792,9 @@ var Init = ({
|
|
|
1763
1792
|
setUser
|
|
1764
1793
|
} = useKryptosConnect();
|
|
1765
1794
|
const theme = useTheme();
|
|
1766
|
-
const [isFetching, setIsFetching] =
|
|
1767
|
-
const [error, setError] =
|
|
1768
|
-
const fetchLinkToken =
|
|
1795
|
+
const [isFetching, setIsFetching] = React21.useState(false);
|
|
1796
|
+
const [error, setError] = React21.useState(null);
|
|
1797
|
+
const fetchLinkToken = React21.useCallback(async () => {
|
|
1769
1798
|
if (!open) return;
|
|
1770
1799
|
setIsFetching(true);
|
|
1771
1800
|
setError(null);
|
|
@@ -1792,17 +1821,17 @@ var Init = ({
|
|
|
1792
1821
|
setIsFetching(false);
|
|
1793
1822
|
}
|
|
1794
1823
|
}, []);
|
|
1795
|
-
|
|
1824
|
+
React21.useEffect(() => {
|
|
1796
1825
|
fetchLinkToken();
|
|
1797
1826
|
}, [fetchLinkToken]);
|
|
1798
|
-
return /* @__PURE__ */
|
|
1799
|
-
|
|
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,
|
|
1800
1829
|
{
|
|
1801
1830
|
size: "large",
|
|
1802
1831
|
color: theme.colors.primary,
|
|
1803
1832
|
style: styles12.spinner
|
|
1804
1833
|
}
|
|
1805
|
-
), /* @__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(
|
|
1806
1835
|
Button,
|
|
1807
1836
|
{
|
|
1808
1837
|
variant: "primary",
|
|
@@ -1811,7 +1840,7 @@ var Init = ({
|
|
|
1811
1840
|
style: styles12.retryButton
|
|
1812
1841
|
},
|
|
1813
1842
|
"Retry"
|
|
1814
|
-
)))), /* @__PURE__ */
|
|
1843
|
+
)))), /* @__PURE__ */ React21.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React21.createElement(Footer, null)));
|
|
1815
1844
|
};
|
|
1816
1845
|
var styles12 = StyleSheet12.create({
|
|
1817
1846
|
container: {
|
|
@@ -1840,10 +1869,10 @@ var styles12 = StyleSheet12.create({
|
|
|
1840
1869
|
});
|
|
1841
1870
|
|
|
1842
1871
|
// src/molecules/Integration.tsx
|
|
1843
|
-
import
|
|
1872
|
+
import React32 from "react";
|
|
1844
1873
|
import {
|
|
1845
1874
|
FlatList,
|
|
1846
|
-
Image as
|
|
1875
|
+
Image as Image4,
|
|
1847
1876
|
StyleSheet as StyleSheet15,
|
|
1848
1877
|
Text as Text13,
|
|
1849
1878
|
TouchableOpacity as TouchableOpacity6,
|
|
@@ -1851,13 +1880,13 @@ import {
|
|
|
1851
1880
|
} from "react-native";
|
|
1852
1881
|
|
|
1853
1882
|
// src/assets/ArrowLeftIcon.tsx
|
|
1854
|
-
import
|
|
1883
|
+
import React22 from "react";
|
|
1855
1884
|
import Svg7, { Path as Path7 } from "react-native-svg";
|
|
1856
1885
|
var ArrowLeftIcon = ({
|
|
1857
1886
|
size = 20,
|
|
1858
1887
|
color = "#000"
|
|
1859
1888
|
}) => {
|
|
1860
|
-
return /* @__PURE__ */
|
|
1889
|
+
return /* @__PURE__ */ React22.createElement(Svg7, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React22.createElement(
|
|
1861
1890
|
Path7,
|
|
1862
1891
|
{
|
|
1863
1892
|
d: "M19 12H5M12 19l-7-7 7-7",
|
|
@@ -1870,13 +1899,13 @@ var ArrowLeftIcon = ({
|
|
|
1870
1899
|
};
|
|
1871
1900
|
|
|
1872
1901
|
// src/assets/CheckCircleIcon.tsx
|
|
1873
|
-
import
|
|
1902
|
+
import React23 from "react";
|
|
1874
1903
|
import Svg8, { Path as Path8, Circle } from "react-native-svg";
|
|
1875
1904
|
var CheckCircleIcon = ({
|
|
1876
1905
|
size = 20,
|
|
1877
1906
|
color = "#10B981"
|
|
1878
1907
|
}) => {
|
|
1879
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ React23.createElement(Svg8, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React23.createElement(
|
|
1880
1909
|
Circle,
|
|
1881
1910
|
{
|
|
1882
1911
|
cx: 12,
|
|
@@ -1885,7 +1914,7 @@ var CheckCircleIcon = ({
|
|
|
1885
1914
|
stroke: color,
|
|
1886
1915
|
strokeWidth: 2
|
|
1887
1916
|
}
|
|
1888
|
-
), /* @__PURE__ */
|
|
1917
|
+
), /* @__PURE__ */ React23.createElement(
|
|
1889
1918
|
Path8,
|
|
1890
1919
|
{
|
|
1891
1920
|
d: "m9 12 2 2 4-4",
|
|
@@ -1898,7 +1927,7 @@ var CheckCircleIcon = ({
|
|
|
1898
1927
|
};
|
|
1899
1928
|
|
|
1900
1929
|
// src/assets/LoaderIcon.tsx
|
|
1901
|
-
import
|
|
1930
|
+
import React24 from "react";
|
|
1902
1931
|
import { Animated as Animated2, Easing } from "react-native";
|
|
1903
1932
|
import Svg9, { Path as Path9 } from "react-native-svg";
|
|
1904
1933
|
var AnimatedSvg = Animated2.createAnimatedComponent(Svg9);
|
|
@@ -1906,8 +1935,8 @@ var LoaderIcon = ({
|
|
|
1906
1935
|
size = 20,
|
|
1907
1936
|
color = "#00C693"
|
|
1908
1937
|
}) => {
|
|
1909
|
-
const rotateAnim =
|
|
1910
|
-
|
|
1938
|
+
const rotateAnim = React24.useRef(new Animated2.Value(0)).current;
|
|
1939
|
+
React24.useEffect(() => {
|
|
1911
1940
|
Animated2.loop(
|
|
1912
1941
|
Animated2.timing(rotateAnim, {
|
|
1913
1942
|
toValue: 1,
|
|
@@ -1921,7 +1950,7 @@ var LoaderIcon = ({
|
|
|
1921
1950
|
inputRange: [0, 1],
|
|
1922
1951
|
outputRange: ["0deg", "360deg"]
|
|
1923
1952
|
});
|
|
1924
|
-
return /* @__PURE__ */
|
|
1953
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1925
1954
|
AnimatedSvg,
|
|
1926
1955
|
{
|
|
1927
1956
|
width: size,
|
|
@@ -1930,7 +1959,7 @@ var LoaderIcon = ({
|
|
|
1930
1959
|
fill: "none",
|
|
1931
1960
|
style: { transform: [{ rotate: spin }] }
|
|
1932
1961
|
},
|
|
1933
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ React24.createElement(
|
|
1934
1963
|
Path9,
|
|
1935
1964
|
{
|
|
1936
1965
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
@@ -1944,10 +1973,10 @@ var LoaderIcon = ({
|
|
|
1944
1973
|
};
|
|
1945
1974
|
|
|
1946
1975
|
// src/assets/SuccessIcon.tsx
|
|
1947
|
-
import
|
|
1976
|
+
import React25 from "react";
|
|
1948
1977
|
import Svg10, { Circle as Circle2, Path as Path10 } from "react-native-svg";
|
|
1949
1978
|
var SuccessIcon = ({ size = 64 }) => {
|
|
1950
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ React25.createElement(Svg10, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React25.createElement(
|
|
1951
1980
|
Circle2,
|
|
1952
1981
|
{
|
|
1953
1982
|
cx: 32,
|
|
@@ -1956,7 +1985,7 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1956
1985
|
fill: "#00C693",
|
|
1957
1986
|
opacity: 0.1
|
|
1958
1987
|
}
|
|
1959
|
-
), /* @__PURE__ */
|
|
1988
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1960
1989
|
Circle2,
|
|
1961
1990
|
{
|
|
1962
1991
|
cx: 32,
|
|
@@ -1964,7 +1993,7 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1964
1993
|
r: 24,
|
|
1965
1994
|
fill: "#00C693"
|
|
1966
1995
|
}
|
|
1967
|
-
), /* @__PURE__ */
|
|
1996
|
+
), /* @__PURE__ */ React25.createElement(
|
|
1968
1997
|
Path10,
|
|
1969
1998
|
{
|
|
1970
1999
|
d: "M24 32l6 6 12-12",
|
|
@@ -1977,10 +2006,10 @@ var SuccessIcon = ({ size = 64 }) => {
|
|
|
1977
2006
|
};
|
|
1978
2007
|
|
|
1979
2008
|
// src/assets/ErrorIcon.tsx
|
|
1980
|
-
import
|
|
2009
|
+
import React26 from "react";
|
|
1981
2010
|
import Svg11, { Circle as Circle3, Path as Path11 } from "react-native-svg";
|
|
1982
2011
|
var ErrorIcon = ({ size = 64 }) => {
|
|
1983
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ React26.createElement(Svg11, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React26.createElement(
|
|
1984
2013
|
Circle3,
|
|
1985
2014
|
{
|
|
1986
2015
|
cx: 32,
|
|
@@ -1989,7 +2018,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1989
2018
|
fill: "#EF4444",
|
|
1990
2019
|
opacity: 0.1
|
|
1991
2020
|
}
|
|
1992
|
-
), /* @__PURE__ */
|
|
2021
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1993
2022
|
Circle3,
|
|
1994
2023
|
{
|
|
1995
2024
|
cx: 32,
|
|
@@ -1997,7 +2026,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1997
2026
|
r: 24,
|
|
1998
2027
|
fill: "#EF4444"
|
|
1999
2028
|
}
|
|
2000
|
-
), /* @__PURE__ */
|
|
2029
|
+
), /* @__PURE__ */ React26.createElement(
|
|
2001
2030
|
Path11,
|
|
2002
2031
|
{
|
|
2003
2032
|
d: "M24 24l16 16M40 24l-16 16",
|
|
@@ -2010,17 +2039,17 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2010
2039
|
};
|
|
2011
2040
|
|
|
2012
2041
|
// src/assets/SearchIcon.tsx
|
|
2013
|
-
import
|
|
2042
|
+
import React27 from "react";
|
|
2014
2043
|
import Svg12, { Circle as Circle4, Path as Path12 } from "react-native-svg";
|
|
2015
2044
|
|
|
2016
2045
|
// src/assets/PlusIcon.tsx
|
|
2017
|
-
import
|
|
2046
|
+
import React28 from "react";
|
|
2018
2047
|
import Svg13, { Path as Path13 } from "react-native-svg";
|
|
2019
2048
|
var PlusIcon = ({
|
|
2020
2049
|
size = 14,
|
|
2021
2050
|
color = "#6B7280"
|
|
2022
2051
|
}) => {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2052
|
+
return /* @__PURE__ */ React28.createElement(Svg13, { width: size, height: size, viewBox: "0 0 14 14", fill: "none" }, /* @__PURE__ */ React28.createElement(
|
|
2024
2053
|
Path13,
|
|
2025
2054
|
{
|
|
2026
2055
|
d: "M7 3.5v7M3.5 7h7",
|
|
@@ -2033,13 +2062,14 @@ var PlusIcon = ({
|
|
|
2033
2062
|
|
|
2034
2063
|
// src/wallet-connect/index.tsx
|
|
2035
2064
|
import { useAccount, useAppKit } from "@reown/appkit-react-native";
|
|
2036
|
-
import
|
|
2065
|
+
import React30, { useEffect as useEffect3, useMemo, useState as useState2 } from "react";
|
|
2037
2066
|
import {
|
|
2038
2067
|
ScrollView as ScrollView2,
|
|
2039
2068
|
StyleSheet as StyleSheet13,
|
|
2040
2069
|
Text as Text11,
|
|
2041
2070
|
TouchableOpacity as TouchableOpacity4,
|
|
2042
|
-
View as View13
|
|
2071
|
+
View as View13,
|
|
2072
|
+
Image as Image2
|
|
2043
2073
|
} from "react-native";
|
|
2044
2074
|
|
|
2045
2075
|
// src/utils/uuid.ts
|
|
@@ -2052,7 +2082,7 @@ function generateUUID() {
|
|
|
2052
2082
|
}
|
|
2053
2083
|
|
|
2054
2084
|
// src/wallet-connect/wallet-connect.tsx
|
|
2055
|
-
import
|
|
2085
|
+
import React29 from "react";
|
|
2056
2086
|
import { AppKit, AppKitProvider } from "@reown/appkit-react-native";
|
|
2057
2087
|
|
|
2058
2088
|
// src/wallet-connect/AppKitConfig.ts
|
|
@@ -2161,7 +2191,7 @@ var createAppKitInstance = (projectId) => {
|
|
|
2161
2191
|
// src/wallet-connect/wallet-connect.tsx
|
|
2162
2192
|
var WalletConnectWrapper = ({ children }) => {
|
|
2163
2193
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2164
|
-
const appKit =
|
|
2194
|
+
const appKit = React29.useMemo(() => {
|
|
2165
2195
|
if (!walletConnectProjectId) {
|
|
2166
2196
|
console.warn(
|
|
2167
2197
|
"walletConnectProjectId is missing in KryptosConnectProvider config"
|
|
@@ -2171,9 +2201,9 @@ var WalletConnectWrapper = ({ children }) => {
|
|
|
2171
2201
|
return createAppKitInstance(walletConnectProjectId);
|
|
2172
2202
|
}, [walletConnectProjectId]);
|
|
2173
2203
|
if (!appKit) {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, children);
|
|
2175
2205
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ React29.createElement(AppKitProvider, { instance: appKit }, /* @__PURE__ */ React29.createElement(AppKit, null), children);
|
|
2177
2207
|
};
|
|
2178
2208
|
var wallet_connect_default = WalletConnectWrapper;
|
|
2179
2209
|
|
|
@@ -2190,7 +2220,7 @@ var WalletConnectComponent = ({
|
|
|
2190
2220
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2191
2221
|
const theme = useTheme();
|
|
2192
2222
|
if (!walletConnectProjectId) {
|
|
2193
|
-
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(
|
|
2194
2224
|
TouchableOpacity4,
|
|
2195
2225
|
{
|
|
2196
2226
|
onPress: () => {
|
|
@@ -2198,14 +2228,14 @@ var WalletConnectComponent = ({
|
|
|
2198
2228
|
},
|
|
2199
2229
|
style: styles13.backButton
|
|
2200
2230
|
},
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
), /* @__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(
|
|
2203
2233
|
Text11,
|
|
2204
2234
|
{
|
|
2205
2235
|
style: [styles13.emptyStateTitle, { color: theme.colors.text }]
|
|
2206
2236
|
},
|
|
2207
2237
|
"WalletConnect is not configured"
|
|
2208
|
-
), /* @__PURE__ */
|
|
2238
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2209
2239
|
Text11,
|
|
2210
2240
|
{
|
|
2211
2241
|
style: [
|
|
@@ -2214,7 +2244,7 @@ var WalletConnectComponent = ({
|
|
|
2214
2244
|
]
|
|
2215
2245
|
},
|
|
2216
2246
|
"Please add a walletConnectProjectId to KryptosConnectProvider to enable wallet connections."
|
|
2217
|
-
), /* @__PURE__ */
|
|
2247
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2218
2248
|
Button,
|
|
2219
2249
|
{
|
|
2220
2250
|
variant: "outline",
|
|
@@ -2225,7 +2255,7 @@ var WalletConnectComponent = ({
|
|
|
2225
2255
|
"Go back"
|
|
2226
2256
|
))));
|
|
2227
2257
|
}
|
|
2228
|
-
return /* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ React30.createElement(wallet_connect_default, null, /* @__PURE__ */ React30.createElement(
|
|
2229
2259
|
ConnectButton,
|
|
2230
2260
|
{
|
|
2231
2261
|
integration,
|
|
@@ -2250,12 +2280,12 @@ function ConnectButton({
|
|
|
2250
2280
|
const { open, disconnect } = useAppKit();
|
|
2251
2281
|
const { address, isConnected } = useAccount();
|
|
2252
2282
|
const { linkToken, user, clientId } = useKryptosConnect();
|
|
2253
|
-
const [selectedChains, setSelectedChains] =
|
|
2254
|
-
const [errorMessage, setErrorMessage] =
|
|
2255
|
-
const [chainErrors, setChainErrors] =
|
|
2256
|
-
const [isLoading, setIsLoading] =
|
|
2257
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2258
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
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);
|
|
2259
2289
|
const availableChains = useMemo(() => {
|
|
2260
2290
|
if (userUsedChains.length > 0) {
|
|
2261
2291
|
return userUsedChains;
|
|
@@ -2265,7 +2295,7 @@ function ConnectButton({
|
|
|
2265
2295
|
}
|
|
2266
2296
|
return [];
|
|
2267
2297
|
}, [userUsedChains, integration.walletSupportedChains]);
|
|
2268
|
-
|
|
2298
|
+
useEffect3(() => {
|
|
2269
2299
|
if (!isConnected || !address || !address.trim()) {
|
|
2270
2300
|
setUserUsedChains([]);
|
|
2271
2301
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2347,7 +2377,7 @@ function ConnectButton({
|
|
|
2347
2377
|
const walletTestsPayload = chainsToProcess.map((chain) => {
|
|
2348
2378
|
const walletId = generateUUID();
|
|
2349
2379
|
const displaySuffix = address ? address?.length > 8 ? `${address.slice(0, 4)}...${address.slice(-4)}` : address : "";
|
|
2350
|
-
const alias = `${
|
|
2380
|
+
const alias = `${integration.public_name} (${displaySuffix})`;
|
|
2351
2381
|
const provider = providersList.find((p) => p.id === chain.id);
|
|
2352
2382
|
return {
|
|
2353
2383
|
chain,
|
|
@@ -2395,14 +2425,15 @@ function ConnectButton({
|
|
|
2395
2425
|
clientId,
|
|
2396
2426
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2397
2427
|
},
|
|
2398
|
-
metadata: {
|
|
2399
|
-
environment: "sandbox"
|
|
2400
|
-
},
|
|
2401
2428
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2402
|
-
default_chain:
|
|
2403
|
-
default_chain_logo:
|
|
2404
|
-
type: provider.type,
|
|
2405
|
-
isNftSupported: provider
|
|
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
|
+
}
|
|
2406
2437
|
};
|
|
2407
2438
|
integrationsToAdd.push(data);
|
|
2408
2439
|
} else {
|
|
@@ -2422,6 +2453,9 @@ function ConnectButton({
|
|
|
2422
2453
|
}
|
|
2423
2454
|
if (integrationsToAdd.length > 0) {
|
|
2424
2455
|
onAddHandle(integrationsToAdd);
|
|
2456
|
+
if (isConnected) {
|
|
2457
|
+
disconnect();
|
|
2458
|
+
}
|
|
2425
2459
|
setChainErrors({});
|
|
2426
2460
|
setErrorMessage("");
|
|
2427
2461
|
} else {
|
|
@@ -2451,16 +2485,35 @@ function ConnectButton({
|
|
|
2451
2485
|
setChainErrors(newErrors);
|
|
2452
2486
|
}
|
|
2453
2487
|
};
|
|
2454
|
-
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(
|
|
2455
2489
|
TouchableOpacity4,
|
|
2456
2490
|
{
|
|
2457
2491
|
onPress: () => {
|
|
2458
2492
|
setAddIntegrationMode(null);
|
|
2493
|
+
if (isConnected) {
|
|
2494
|
+
disconnect();
|
|
2495
|
+
}
|
|
2459
2496
|
},
|
|
2460
2497
|
style: styles13.backButton
|
|
2461
2498
|
},
|
|
2462
|
-
/* @__PURE__ */
|
|
2463
|
-
), /* @__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(
|
|
2464
2517
|
Button,
|
|
2465
2518
|
{
|
|
2466
2519
|
variant: "primary",
|
|
@@ -2468,26 +2521,26 @@ function ConnectButton({
|
|
|
2468
2521
|
onPress: () => open({ view: "Connect" })
|
|
2469
2522
|
},
|
|
2470
2523
|
"Connect Wallet"
|
|
2471
|
-
)) : /* @__PURE__ */
|
|
2524
|
+
)) : /* @__PURE__ */ React30.createElement(View13, { style: styles13.connectedContainer }, /* @__PURE__ */ React30.createElement(View13, { style: styles13.connectedHeader }, /* @__PURE__ */ React30.createElement(
|
|
2472
2525
|
Text11,
|
|
2473
2526
|
{
|
|
2474
2527
|
style: [styles13.connectedTitle, { color: theme.colors.text }]
|
|
2475
2528
|
},
|
|
2476
2529
|
"Wallet Connected"
|
|
2477
|
-
), /* @__PURE__ */
|
|
2530
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2478
2531
|
Text11,
|
|
2479
2532
|
{
|
|
2480
2533
|
style: [styles13.connectedText, { color: theme.colors.text }]
|
|
2481
2534
|
},
|
|
2482
2535
|
"Address: ",
|
|
2483
2536
|
address
|
|
2484
|
-
), /* @__PURE__ */
|
|
2537
|
+
), /* @__PURE__ */ React30.createElement(Button, { variant: "ghost", size: "sm", onPress: () => disconnect() }, "Disconnect Wallet"), isFetchingChains ? /* @__PURE__ */ React30.createElement(
|
|
2485
2538
|
Text11,
|
|
2486
2539
|
{
|
|
2487
2540
|
style: [styles13.fetchingText, { color: theme.colors.text }]
|
|
2488
2541
|
},
|
|
2489
2542
|
"Fetching chains..."
|
|
2490
|
-
) : null), availableChains.length > 0 && address && /* @__PURE__ */
|
|
2543
|
+
) : null), availableChains.length > 0 && address && /* @__PURE__ */ React30.createElement(
|
|
2491
2544
|
ScrollView2,
|
|
2492
2545
|
{
|
|
2493
2546
|
style: styles13.scrollView,
|
|
@@ -2495,18 +2548,18 @@ function ConnectButton({
|
|
|
2495
2548
|
showsVerticalScrollIndicator: true,
|
|
2496
2549
|
nestedScrollEnabled: true
|
|
2497
2550
|
},
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
/* @__PURE__ */
|
|
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) => {
|
|
2500
2553
|
const isSelected = selectedChains.has(chain.id);
|
|
2501
2554
|
const hasError = chainErrors[chain.id];
|
|
2502
|
-
return /* @__PURE__ */
|
|
2555
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2503
2556
|
TouchableOpacity4,
|
|
2504
2557
|
{
|
|
2505
2558
|
onPress: () => toggleChainSelection(chain.id),
|
|
2506
2559
|
style: styles13.chainButton,
|
|
2507
2560
|
key: chain.id
|
|
2508
2561
|
},
|
|
2509
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ React30.createElement(
|
|
2510
2563
|
View13,
|
|
2511
2564
|
{
|
|
2512
2565
|
style: [
|
|
@@ -2517,7 +2570,7 @@ function ConnectButton({
|
|
|
2517
2570
|
}
|
|
2518
2571
|
]
|
|
2519
2572
|
},
|
|
2520
|
-
/* @__PURE__ */
|
|
2573
|
+
/* @__PURE__ */ React30.createElement(
|
|
2521
2574
|
Text11,
|
|
2522
2575
|
{
|
|
2523
2576
|
style: [
|
|
@@ -2529,13 +2582,13 @@ function ConnectButton({
|
|
|
2529
2582
|
},
|
|
2530
2583
|
chain.id
|
|
2531
2584
|
),
|
|
2532
|
-
isSelected ? /* @__PURE__ */
|
|
2585
|
+
isSelected ? /* @__PURE__ */ React30.createElement(
|
|
2533
2586
|
CloseIcon,
|
|
2534
2587
|
{
|
|
2535
2588
|
size: 12,
|
|
2536
2589
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2537
2590
|
}
|
|
2538
|
-
) : /* @__PURE__ */
|
|
2591
|
+
) : /* @__PURE__ */ React30.createElement(
|
|
2539
2592
|
PlusIcon,
|
|
2540
2593
|
{
|
|
2541
2594
|
size: 12,
|
|
@@ -2544,7 +2597,7 @@ function ConnectButton({
|
|
|
2544
2597
|
)
|
|
2545
2598
|
)
|
|
2546
2599
|
);
|
|
2547
|
-
})), errorMessage ? /* @__PURE__ */
|
|
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(
|
|
2548
2601
|
Text11,
|
|
2549
2602
|
{
|
|
2550
2603
|
style: [
|
|
@@ -2557,7 +2610,7 @@ function ConnectButton({
|
|
|
2557
2610
|
const chain = availableChains.find(
|
|
2558
2611
|
(c) => c.id === chainId
|
|
2559
2612
|
);
|
|
2560
|
-
return /* @__PURE__ */
|
|
2613
|
+
return /* @__PURE__ */ React30.createElement(
|
|
2561
2614
|
Text11,
|
|
2562
2615
|
{
|
|
2563
2616
|
key: chainId,
|
|
@@ -2572,7 +2625,7 @@ function ConnectButton({
|
|
|
2572
2625
|
String(error)
|
|
2573
2626
|
);
|
|
2574
2627
|
})))
|
|
2575
|
-
))), availableChains.length > 0 && address && /* @__PURE__ */
|
|
2628
|
+
))), availableChains.length > 0 && address && /* @__PURE__ */ React30.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React30.createElement(
|
|
2576
2629
|
Button,
|
|
2577
2630
|
{
|
|
2578
2631
|
variant: "outline",
|
|
@@ -2583,7 +2636,7 @@ function ConnectButton({
|
|
|
2583
2636
|
style: styles13.button
|
|
2584
2637
|
},
|
|
2585
2638
|
selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size > 1 ? "s" : ""}` : "Add Integration"
|
|
2586
|
-
), /* @__PURE__ */
|
|
2639
|
+
), /* @__PURE__ */ React30.createElement(Footer, null)));
|
|
2587
2640
|
}
|
|
2588
2641
|
var styles13 = StyleSheet13.create({
|
|
2589
2642
|
connectedContainer: {
|
|
@@ -2701,13 +2754,42 @@ var styles13 = StyleSheet13.create({
|
|
|
2701
2754
|
},
|
|
2702
2755
|
emptyStateButton: {
|
|
2703
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"
|
|
2704
2786
|
}
|
|
2705
2787
|
});
|
|
2706
2788
|
|
|
2707
2789
|
// src/molecules/IntegrationForm.tsx
|
|
2708
|
-
import
|
|
2790
|
+
import React31 from "react";
|
|
2709
2791
|
import {
|
|
2710
|
-
Image as
|
|
2792
|
+
Image as Image3,
|
|
2711
2793
|
ScrollView as ScrollView3,
|
|
2712
2794
|
StyleSheet as StyleSheet14,
|
|
2713
2795
|
Text as Text12,
|
|
@@ -2724,25 +2806,25 @@ var IntegrationForm = ({
|
|
|
2724
2806
|
}) => {
|
|
2725
2807
|
const { clientId, linkToken, user } = useKryptosConnect();
|
|
2726
2808
|
const theme = useTheme();
|
|
2727
|
-
const [isLoading, setIsLoading] =
|
|
2728
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
2729
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2730
|
-
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(
|
|
2731
2813
|
/* @__PURE__ */ new Set()
|
|
2732
2814
|
);
|
|
2733
|
-
const [chainErrors, setChainErrors] =
|
|
2815
|
+
const [chainErrors, setChainErrors] = React31.useState(
|
|
2734
2816
|
{}
|
|
2735
2817
|
);
|
|
2736
|
-
const [errorMessage, setErrorMessage] =
|
|
2737
|
-
const [formValues, setFormValues] =
|
|
2818
|
+
const [errorMessage, setErrorMessage] = React31.useState("");
|
|
2819
|
+
const [formValues, setFormValues] = React31.useState({
|
|
2738
2820
|
address: "",
|
|
2739
2821
|
account_name: "",
|
|
2740
2822
|
api_key: "",
|
|
2741
2823
|
secret_key: "",
|
|
2742
2824
|
password: ""
|
|
2743
2825
|
});
|
|
2744
|
-
const [formErrors, setFormErrors] =
|
|
2745
|
-
|
|
2826
|
+
const [formErrors, setFormErrors] = React31.useState({});
|
|
2827
|
+
React31.useEffect(() => {
|
|
2746
2828
|
if (!formValues.address || !formValues.address.trim()) {
|
|
2747
2829
|
setUserUsedChains([]);
|
|
2748
2830
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2868,9 +2950,6 @@ var IntegrationForm = ({
|
|
|
2868
2950
|
clientId,
|
|
2869
2951
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2870
2952
|
},
|
|
2871
|
-
metadata: {
|
|
2872
|
-
environment: "sandbox"
|
|
2873
|
-
},
|
|
2874
2953
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2875
2954
|
default_chain: chain.name,
|
|
2876
2955
|
default_chain_logo: chain.logo || null,
|
|
@@ -2989,14 +3068,14 @@ var IntegrationForm = ({
|
|
|
2989
3068
|
};
|
|
2990
3069
|
const hasNoFields = !metadata.password && !metadata.secret_key && !metadata.api_key && !metadata.address && !metadata.account_name;
|
|
2991
3070
|
const shouldShowFormFields = metadata.password || metadata.secret_key || metadata.api_key || metadata.address || metadata.account_name;
|
|
2992
|
-
const renderLogo = () => metadata.logo ? /* @__PURE__ */
|
|
2993
|
-
|
|
3071
|
+
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */ React31.createElement(RemoteSvg, { uri: metadata.logo }) : /* @__PURE__ */ React31.createElement(
|
|
3072
|
+
Image3,
|
|
2994
3073
|
{
|
|
2995
3074
|
source: { uri: metadata.logo },
|
|
2996
3075
|
style: styles14.logo,
|
|
2997
3076
|
resizeMode: "contain"
|
|
2998
3077
|
}
|
|
2999
|
-
) : /* @__PURE__ */
|
|
3078
|
+
) : /* @__PURE__ */ React31.createElement(
|
|
3000
3079
|
View14,
|
|
3001
3080
|
{
|
|
3002
3081
|
style: [
|
|
@@ -3004,9 +3083,9 @@ var IntegrationForm = ({
|
|
|
3004
3083
|
{ backgroundColor: theme.colors.surface }
|
|
3005
3084
|
]
|
|
3006
3085
|
},
|
|
3007
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ React31.createElement(Text12, { style: { color: theme.colors.text } }, metadata.name?.charAt(0) || "?")
|
|
3008
3087
|
);
|
|
3009
|
-
const renderInput = (key, props) => /* @__PURE__ */
|
|
3088
|
+
const renderInput = (key, props) => /* @__PURE__ */ React31.createElement(
|
|
3010
3089
|
Input,
|
|
3011
3090
|
{
|
|
3012
3091
|
placeholder: props.placeholder,
|
|
@@ -3018,18 +3097,18 @@ var IntegrationForm = ({
|
|
|
3018
3097
|
secureTextEntry: props.secureTextEntry
|
|
3019
3098
|
}
|
|
3020
3099
|
);
|
|
3021
|
-
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */
|
|
3022
|
-
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) => {
|
|
3023
3102
|
const isSelected = selectedChains.has(chain.id);
|
|
3024
3103
|
const hasError = chainErrors[chain.id];
|
|
3025
|
-
return /* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ React31.createElement(
|
|
3026
3105
|
TouchableOpacity5,
|
|
3027
3106
|
{
|
|
3028
3107
|
onPress: () => toggleChainSelection(chain.id),
|
|
3029
3108
|
style: styles14.chainButton,
|
|
3030
3109
|
key: chain.id
|
|
3031
3110
|
},
|
|
3032
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ React31.createElement(
|
|
3033
3112
|
View14,
|
|
3034
3113
|
{
|
|
3035
3114
|
style: [
|
|
@@ -3040,7 +3119,7 @@ var IntegrationForm = ({
|
|
|
3040
3119
|
}
|
|
3041
3120
|
]
|
|
3042
3121
|
},
|
|
3043
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ React31.createElement(
|
|
3044
3123
|
Text12,
|
|
3045
3124
|
{
|
|
3046
3125
|
style: [
|
|
@@ -3052,16 +3131,16 @@ var IntegrationForm = ({
|
|
|
3052
3131
|
},
|
|
3053
3132
|
chain.name
|
|
3054
3133
|
),
|
|
3055
|
-
isSelected ? /* @__PURE__ */
|
|
3134
|
+
isSelected ? /* @__PURE__ */ React31.createElement(
|
|
3056
3135
|
CloseIcon,
|
|
3057
3136
|
{
|
|
3058
3137
|
size: 12,
|
|
3059
3138
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
3060
3139
|
}
|
|
3061
|
-
) : /* @__PURE__ */
|
|
3140
|
+
) : /* @__PURE__ */ React31.createElement(PlusIcon, { size: 12, color: theme.colors.textSecondary })
|
|
3062
3141
|
)
|
|
3063
3142
|
);
|
|
3064
|
-
}))), Object.keys(chainErrors).length > 0 && /* @__PURE__ */
|
|
3143
|
+
}))), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React31.createElement(View14, { style: styles14.chainErrorsContainer }, /* @__PURE__ */ React31.createElement(
|
|
3065
3144
|
Text12,
|
|
3066
3145
|
{
|
|
3067
3146
|
style: [styles14.chainErrorsTitle, { color: theme.colors.error }]
|
|
@@ -3069,7 +3148,7 @@ var IntegrationForm = ({
|
|
|
3069
3148
|
"Errors:"
|
|
3070
3149
|
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
3071
3150
|
const chain = userUsedChains.find((c) => c.id === chainId);
|
|
3072
|
-
return /* @__PURE__ */
|
|
3151
|
+
return /* @__PURE__ */ React31.createElement(
|
|
3073
3152
|
Text12,
|
|
3074
3153
|
{
|
|
3075
3154
|
key: chainId,
|
|
@@ -3081,7 +3160,7 @@ var IntegrationForm = ({
|
|
|
3081
3160
|
error
|
|
3082
3161
|
);
|
|
3083
3162
|
})));
|
|
3084
|
-
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", {
|
|
3085
3164
|
placeholder: "Enter address",
|
|
3086
3165
|
autoCapitalize: "none",
|
|
3087
3166
|
autoCorrect: false
|
|
@@ -3097,16 +3176,16 @@ var IntegrationForm = ({
|
|
|
3097
3176
|
}), metadata.password && renderInput("password", {
|
|
3098
3177
|
placeholder: "Enter Password",
|
|
3099
3178
|
secureTextEntry: true
|
|
3100
|
-
})), 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.")));
|
|
3101
3180
|
const addIntegrationLabel = formValues.address && userUsedChains.length > 0 && selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size !== 1 ? "s" : ""}` : "Add Integration";
|
|
3102
|
-
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(
|
|
3103
3182
|
TouchableOpacity5,
|
|
3104
3183
|
{
|
|
3105
3184
|
onPress: () => setAddIntegrationMode(null),
|
|
3106
3185
|
style: styles14.backButton
|
|
3107
3186
|
},
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
), /* @__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(
|
|
3110
3189
|
Button,
|
|
3111
3190
|
{
|
|
3112
3191
|
variant: "outline",
|
|
@@ -3117,7 +3196,7 @@ var IntegrationForm = ({
|
|
|
3117
3196
|
style: styles14.button
|
|
3118
3197
|
},
|
|
3119
3198
|
addIntegrationLabel
|
|
3120
|
-
), /* @__PURE__ */
|
|
3199
|
+
), /* @__PURE__ */ React31.createElement(Footer, null))) : /* @__PURE__ */ React31.createElement(
|
|
3121
3200
|
WalletConnectComponent,
|
|
3122
3201
|
{
|
|
3123
3202
|
integration: metadata,
|
|
@@ -3259,14 +3338,14 @@ var Integration = ({
|
|
|
3259
3338
|
}) => {
|
|
3260
3339
|
const { appName, linkToken } = useKryptosConnect();
|
|
3261
3340
|
const theme = useTheme();
|
|
3262
|
-
const [addIntegrationMode, setAddIntegrationMode] =
|
|
3263
|
-
const [query, setQuery] =
|
|
3264
|
-
const [activeTab, setActiveTab] =
|
|
3265
|
-
const [supportedProviders, setSupportedProviders] =
|
|
3266
|
-
const [addedIntegrations, setAddedIntegrations] =
|
|
3267
|
-
const [existingIntegrations, setExistingIntegrations] =
|
|
3268
|
-
const [isLoading, setIsLoading] =
|
|
3269
|
-
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("");
|
|
3270
3349
|
const handleClose = () => {
|
|
3271
3350
|
onClose();
|
|
3272
3351
|
};
|
|
@@ -3297,13 +3376,13 @@ var Integration = ({
|
|
|
3297
3376
|
setIsLoading(false);
|
|
3298
3377
|
}
|
|
3299
3378
|
};
|
|
3300
|
-
|
|
3379
|
+
React32.useEffect(() => {
|
|
3301
3380
|
if (linkToken) {
|
|
3302
3381
|
fetchSupportedProviders();
|
|
3303
3382
|
fetchExistingIntegrations();
|
|
3304
3383
|
}
|
|
3305
3384
|
}, [linkToken]);
|
|
3306
|
-
const isIntegrationAdded =
|
|
3385
|
+
const isIntegrationAdded = React32.useCallback(
|
|
3307
3386
|
(publicName) => {
|
|
3308
3387
|
const integrations = [...addedIntegrations, ...existingIntegrations];
|
|
3309
3388
|
return integrations.some(
|
|
@@ -3312,7 +3391,7 @@ var Integration = ({
|
|
|
3312
3391
|
},
|
|
3313
3392
|
[addedIntegrations, existingIntegrations]
|
|
3314
3393
|
);
|
|
3315
|
-
const getIntegrationCount =
|
|
3394
|
+
const getIntegrationCount = React32.useCallback(
|
|
3316
3395
|
(publicName) => {
|
|
3317
3396
|
const integrations = [...addedIntegrations, ...existingIntegrations];
|
|
3318
3397
|
return integrations.filter(
|
|
@@ -3321,7 +3400,7 @@ var Integration = ({
|
|
|
3321
3400
|
},
|
|
3322
3401
|
[addedIntegrations, existingIntegrations]
|
|
3323
3402
|
);
|
|
3324
|
-
const filteredResults =
|
|
3403
|
+
const filteredResults = React32.useMemo(() => {
|
|
3325
3404
|
let filtered = supportedProviders;
|
|
3326
3405
|
if (activeTab !== "all") {
|
|
3327
3406
|
filtered = filtered.filter((provider) => provider.type === activeTab);
|
|
@@ -3361,7 +3440,7 @@ var Integration = ({
|
|
|
3361
3440
|
setIsLoading(false);
|
|
3362
3441
|
}
|
|
3363
3442
|
};
|
|
3364
|
-
const renderProviderItem = ({ item }) => /* @__PURE__ */
|
|
3443
|
+
const renderProviderItem = ({ item }) => /* @__PURE__ */ React32.createElement(
|
|
3365
3444
|
TouchableOpacity6,
|
|
3366
3445
|
{
|
|
3367
3446
|
style: [
|
|
@@ -3374,14 +3453,14 @@ var Integration = ({
|
|
|
3374
3453
|
onPress: () => setAddIntegrationMode(item),
|
|
3375
3454
|
activeOpacity: 0.7
|
|
3376
3455
|
},
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
|
|
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,
|
|
3379
3458
|
{
|
|
3380
3459
|
source: { uri: item?.logo },
|
|
3381
3460
|
style: styles15.providerLogo,
|
|
3382
3461
|
resizeMode: "contain"
|
|
3383
3462
|
}
|
|
3384
|
-
) : /* @__PURE__ */
|
|
3463
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
3385
3464
|
View15,
|
|
3386
3465
|
{
|
|
3387
3466
|
style: [
|
|
@@ -3389,9 +3468,9 @@ var Integration = ({
|
|
|
3389
3468
|
{ backgroundColor: theme.colors.surfaceSecondary }
|
|
3390
3469
|
]
|
|
3391
3470
|
},
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
), /* @__PURE__ */
|
|
3394
|
-
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(
|
|
3395
3474
|
Text13,
|
|
3396
3475
|
{
|
|
3397
3476
|
style: [
|
|
@@ -3402,15 +3481,69 @@ var Integration = ({
|
|
|
3402
3481
|
getIntegrationCount(item?.public_name)
|
|
3403
3482
|
))
|
|
3404
3483
|
);
|
|
3405
|
-
const renderSkeletonItem = () => /* @__PURE__ */
|
|
3406
|
-
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(
|
|
3407
3486
|
TouchableOpacity6,
|
|
3408
3487
|
{
|
|
3409
3488
|
onPress: () => setAddIntegrationMode(null),
|
|
3410
3489
|
style: styles15.backButton
|
|
3411
3490
|
},
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
), /* @__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(
|
|
3414
3547
|
FlatList,
|
|
3415
3548
|
{
|
|
3416
3549
|
data: isLoading ? Array.from({ length: 8 }, (_, i) => ({
|
|
@@ -3427,61 +3560,7 @@ var Integration = ({
|
|
|
3427
3560
|
{ paddingHorizontal: theme.spacing.xl }
|
|
3428
3561
|
],
|
|
3429
3562
|
showsVerticalScrollIndicator: false,
|
|
3430
|
-
|
|
3431
|
-
View15,
|
|
3432
|
-
{
|
|
3433
|
-
style: {
|
|
3434
|
-
paddingVertical: theme.spacing.sm + 2,
|
|
3435
|
-
backgroundColor: theme.colors.background,
|
|
3436
|
-
zIndex: 10
|
|
3437
|
-
}
|
|
3438
|
-
},
|
|
3439
|
-
/* @__PURE__ */ React31.createElement(
|
|
3440
|
-
Input,
|
|
3441
|
-
{
|
|
3442
|
-
value: query,
|
|
3443
|
-
onChangeText: setQuery,
|
|
3444
|
-
placeholder: "Search Integrations...",
|
|
3445
|
-
containerStyle: styles15.searchInput
|
|
3446
|
-
}
|
|
3447
|
-
),
|
|
3448
|
-
/* @__PURE__ */ React31.createElement(View15, { style: styles15.tabsContainer }, [
|
|
3449
|
-
{ label: "All", value: "all" },
|
|
3450
|
-
{ label: "Exchanges", value: "exchange" },
|
|
3451
|
-
{ label: "Blockchains", value: "blockchain" },
|
|
3452
|
-
{ label: "Wallets", value: "wallet" }
|
|
3453
|
-
].map((tab) => /* @__PURE__ */ React31.createElement(
|
|
3454
|
-
TouchableOpacity6,
|
|
3455
|
-
{
|
|
3456
|
-
key: tab.value,
|
|
3457
|
-
style: [
|
|
3458
|
-
styles15.tab,
|
|
3459
|
-
{
|
|
3460
|
-
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
3461
|
-
borderColor: theme.colors.border
|
|
3462
|
-
}
|
|
3463
|
-
],
|
|
3464
|
-
onPress: () => setActiveTab(
|
|
3465
|
-
tab.value
|
|
3466
|
-
),
|
|
3467
|
-
activeOpacity: 0.7
|
|
3468
|
-
},
|
|
3469
|
-
/* @__PURE__ */ React31.createElement(
|
|
3470
|
-
Text13,
|
|
3471
|
-
{
|
|
3472
|
-
style: [
|
|
3473
|
-
styles15.tabText,
|
|
3474
|
-
{
|
|
3475
|
-
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
3476
|
-
}
|
|
3477
|
-
]
|
|
3478
|
-
},
|
|
3479
|
-
tab.label
|
|
3480
|
-
)
|
|
3481
|
-
)))
|
|
3482
|
-
),
|
|
3483
|
-
stickyHeaderIndices: [0],
|
|
3484
|
-
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(
|
|
3485
3564
|
Text13,
|
|
3486
3565
|
{
|
|
3487
3566
|
style: [
|
|
@@ -3492,7 +3571,7 @@ var Integration = ({
|
|
|
3492
3571
|
query ? "No search results found" : "No supported integrations found"
|
|
3493
3572
|
))
|
|
3494
3573
|
}
|
|
3495
|
-
), 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(
|
|
3496
3575
|
Button,
|
|
3497
3576
|
{
|
|
3498
3577
|
variant: "outline",
|
|
@@ -3503,7 +3582,7 @@ var Integration = ({
|
|
|
3503
3582
|
style: styles15.continueButton
|
|
3504
3583
|
},
|
|
3505
3584
|
"Continue"
|
|
3506
|
-
), /* @__PURE__ */
|
|
3585
|
+
), /* @__PURE__ */ React32.createElement(Footer, null))) : /* @__PURE__ */ React32.createElement(
|
|
3507
3586
|
IntegrationForm,
|
|
3508
3587
|
{
|
|
3509
3588
|
metadata: addIntegrationMode,
|
|
@@ -3567,7 +3646,9 @@ var styles15 = StyleSheet15.create({
|
|
|
3567
3646
|
flexDirection: "row",
|
|
3568
3647
|
alignItems: "center",
|
|
3569
3648
|
justifyContent: "space-between",
|
|
3570
|
-
|
|
3649
|
+
paddingVertical: 8,
|
|
3650
|
+
// theme.spacing.md
|
|
3651
|
+
paddingHorizontal: 12,
|
|
3571
3652
|
// theme.spacing.md
|
|
3572
3653
|
borderRadius: 12,
|
|
3573
3654
|
// theme.borderRadius.md
|
|
@@ -3636,30 +3717,30 @@ var styles15 = StyleSheet15.create({
|
|
|
3636
3717
|
},
|
|
3637
3718
|
tabsContainer: {
|
|
3638
3719
|
flexDirection: "row",
|
|
3639
|
-
gap:
|
|
3720
|
+
gap: 6,
|
|
3640
3721
|
// theme.spacing.sm
|
|
3641
3722
|
flexWrap: "wrap"
|
|
3642
3723
|
},
|
|
3643
3724
|
tab: {
|
|
3644
|
-
paddingVertical:
|
|
3725
|
+
paddingVertical: 4,
|
|
3645
3726
|
// theme.spacing.sm
|
|
3646
|
-
paddingHorizontal:
|
|
3727
|
+
paddingHorizontal: 10,
|
|
3647
3728
|
// theme.spacing.lg
|
|
3648
|
-
borderRadius:
|
|
3729
|
+
borderRadius: 8,
|
|
3649
3730
|
// theme.borderRadius.full / 2
|
|
3650
3731
|
borderWidth: 1,
|
|
3651
3732
|
alignItems: "center",
|
|
3652
3733
|
justifyContent: "center"
|
|
3653
3734
|
},
|
|
3654
3735
|
tabText: {
|
|
3655
|
-
fontSize:
|
|
3736
|
+
fontSize: 12,
|
|
3656
3737
|
// theme.fontSize.sm
|
|
3657
3738
|
fontWeight: "600"
|
|
3658
3739
|
}
|
|
3659
3740
|
});
|
|
3660
3741
|
|
|
3661
3742
|
// src/molecules/OTPVerify.tsx
|
|
3662
|
-
import
|
|
3743
|
+
import React33 from "react";
|
|
3663
3744
|
import { StyleSheet as StyleSheet16, Text as Text14, TouchableOpacity as TouchableOpacity7, View as View16 } from "react-native";
|
|
3664
3745
|
var OTPVerify = ({
|
|
3665
3746
|
open,
|
|
@@ -3667,13 +3748,13 @@ var OTPVerify = ({
|
|
|
3667
3748
|
onClose
|
|
3668
3749
|
}) => {
|
|
3669
3750
|
const theme = useTheme();
|
|
3670
|
-
const [otp, setOtp] =
|
|
3751
|
+
const [otp, setOtp] = React33.useState("");
|
|
3671
3752
|
const { linkToken, clientId, email, setUser } = useKryptosConnect();
|
|
3672
|
-
const [isLoading, setIsLoading] =
|
|
3673
|
-
const [isResending, setIsResending] =
|
|
3674
|
-
const [resendCooldown, setResendCooldown] =
|
|
3675
|
-
const [errorMessage, setErrorMessage] =
|
|
3676
|
-
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("");
|
|
3677
3758
|
const handleSubmit = async () => {
|
|
3678
3759
|
if (otp.length !== 6) return;
|
|
3679
3760
|
setIsLoading(true);
|
|
@@ -3724,7 +3805,7 @@ var OTPVerify = ({
|
|
|
3724
3805
|
setSuccessMessage("");
|
|
3725
3806
|
setOtp("");
|
|
3726
3807
|
};
|
|
3727
|
-
|
|
3808
|
+
React33.useEffect(() => {
|
|
3728
3809
|
if (resendCooldown > 0) {
|
|
3729
3810
|
const timer = setTimeout(() => {
|
|
3730
3811
|
setResendCooldown(resendCooldown - 1);
|
|
@@ -3733,20 +3814,20 @@ var OTPVerify = ({
|
|
|
3733
3814
|
}
|
|
3734
3815
|
return void 0;
|
|
3735
3816
|
}, [resendCooldown]);
|
|
3736
|
-
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(
|
|
3737
3818
|
Text14,
|
|
3738
3819
|
{
|
|
3739
3820
|
style: [styles16.infoText, { color: theme.colors.textSecondary }]
|
|
3740
3821
|
},
|
|
3741
3822
|
"We have sent a verification code to"
|
|
3742
|
-
), /* @__PURE__ */
|
|
3823
|
+
), /* @__PURE__ */ React33.createElement(Text14, { style: [styles16.emailText, { color: theme.colors.text }] }, email)), /* @__PURE__ */ React33.createElement(
|
|
3743
3824
|
OTP,
|
|
3744
3825
|
{
|
|
3745
3826
|
onComplete: handleOtpComplete,
|
|
3746
3827
|
length: 6,
|
|
3747
3828
|
setErrorMessage
|
|
3748
3829
|
}
|
|
3749
|
-
), 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(
|
|
3750
3831
|
Button,
|
|
3751
3832
|
{
|
|
3752
3833
|
variant: "outline",
|
|
@@ -3757,21 +3838,21 @@ var OTPVerify = ({
|
|
|
3757
3838
|
style: styles16.button
|
|
3758
3839
|
},
|
|
3759
3840
|
"Continue"
|
|
3760
|
-
), /* @__PURE__ */
|
|
3841
|
+
), /* @__PURE__ */ React33.createElement(
|
|
3761
3842
|
TouchableOpacity7,
|
|
3762
3843
|
{
|
|
3763
3844
|
onPress: handleResendOtp,
|
|
3764
3845
|
disabled: resendCooldown > 0 || isResending,
|
|
3765
3846
|
style: styles16.resendContainer
|
|
3766
3847
|
},
|
|
3767
|
-
isResending ? /* @__PURE__ */
|
|
3848
|
+
isResending ? /* @__PURE__ */ React33.createElement(View16, { style: styles16.resendLoading }, /* @__PURE__ */ React33.createElement(LoaderIcon, { size: 16, color: theme.colors.primary }), /* @__PURE__ */ React33.createElement(
|
|
3768
3849
|
Text14,
|
|
3769
3850
|
{
|
|
3770
3851
|
style: [styles16.resendText, { color: theme.colors.primary }]
|
|
3771
3852
|
},
|
|
3772
3853
|
" ",
|
|
3773
3854
|
"Sending..."
|
|
3774
|
-
)) : resendCooldown > 0 ? /* @__PURE__ */
|
|
3855
|
+
)) : resendCooldown > 0 ? /* @__PURE__ */ React33.createElement(
|
|
3775
3856
|
Text14,
|
|
3776
3857
|
{
|
|
3777
3858
|
style: [
|
|
@@ -3782,14 +3863,14 @@ var OTPVerify = ({
|
|
|
3782
3863
|
"Resend OTP in ",
|
|
3783
3864
|
resendCooldown,
|
|
3784
3865
|
"s"
|
|
3785
|
-
) : /* @__PURE__ */
|
|
3866
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
3786
3867
|
Text14,
|
|
3787
3868
|
{
|
|
3788
3869
|
style: [styles16.resendText, { color: theme.colors.primary }]
|
|
3789
3870
|
},
|
|
3790
3871
|
"Resend OTP"
|
|
3791
3872
|
)
|
|
3792
|
-
))), /* @__PURE__ */
|
|
3873
|
+
))), /* @__PURE__ */ React33.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React33.createElement(Footer, null)));
|
|
3793
3874
|
};
|
|
3794
3875
|
var styles16 = StyleSheet16.create({
|
|
3795
3876
|
headerContent: {
|
|
@@ -3850,7 +3931,7 @@ var styles16 = StyleSheet16.create({
|
|
|
3850
3931
|
});
|
|
3851
3932
|
|
|
3852
3933
|
// src/molecules/Permissions.tsx
|
|
3853
|
-
import
|
|
3934
|
+
import React34 from "react";
|
|
3854
3935
|
import { StyleSheet as StyleSheet17, Text as Text15, View as View17 } from "react-native";
|
|
3855
3936
|
var Permissions = ({
|
|
3856
3937
|
open,
|
|
@@ -3859,8 +3940,8 @@ var Permissions = ({
|
|
|
3859
3940
|
}) => {
|
|
3860
3941
|
const { appName, linkToken, setUserConsent } = useKryptosConnect();
|
|
3861
3942
|
const theme = useTheme();
|
|
3862
|
-
const [isLoading, setIsLoading] =
|
|
3863
|
-
const [errorMessage, setErrorMessage] =
|
|
3943
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
3944
|
+
const [errorMessage, setErrorMessage] = React34.useState("");
|
|
3864
3945
|
const handleConsentClick = async () => {
|
|
3865
3946
|
try {
|
|
3866
3947
|
setIsLoading(true);
|
|
@@ -3883,7 +3964,7 @@ var Permissions = ({
|
|
|
3883
3964
|
"Access your transaction history and trading activity",
|
|
3884
3965
|
"Keep this data updated and accessible when you're offline"
|
|
3885
3966
|
];
|
|
3886
|
-
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(
|
|
3887
3968
|
Text15,
|
|
3888
3969
|
{
|
|
3889
3970
|
style: [styles17.subtitle, { color: theme.colors.textSecondary }]
|
|
@@ -3891,13 +3972,13 @@ var Permissions = ({
|
|
|
3891
3972
|
"Allow ",
|
|
3892
3973
|
appName,
|
|
3893
3974
|
" to:"
|
|
3894
|
-
), 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(
|
|
3895
3976
|
Text15,
|
|
3896
3977
|
{
|
|
3897
3978
|
style: [styles17.permissionText, { color: theme.colors.text }]
|
|
3898
3979
|
},
|
|
3899
3980
|
item
|
|
3900
|
-
)))), /* @__PURE__ */
|
|
3981
|
+
)))), /* @__PURE__ */ React34.createElement(
|
|
3901
3982
|
View17,
|
|
3902
3983
|
{
|
|
3903
3984
|
style: [
|
|
@@ -3908,17 +3989,17 @@ var Permissions = ({
|
|
|
3908
3989
|
}
|
|
3909
3990
|
]
|
|
3910
3991
|
},
|
|
3911
|
-
/* @__PURE__ */
|
|
3992
|
+
/* @__PURE__ */ React34.createElement(
|
|
3912
3993
|
Text15,
|
|
3913
3994
|
{
|
|
3914
3995
|
style: [styles17.infoText, { color: theme.colors.textSecondary }]
|
|
3915
3996
|
},
|
|
3916
3997
|
"By selecting",
|
|
3917
3998
|
" ",
|
|
3918
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ React34.createElement(Text15, { style: { fontWeight: "600", color: theme.colors.text } }, "'Allow'"),
|
|
3919
4000
|
", you agree to share this information and keep it updated."
|
|
3920
4001
|
)
|
|
3921
|
-
))), /* @__PURE__ */
|
|
4002
|
+
))), /* @__PURE__ */ React34.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React34.createElement(
|
|
3922
4003
|
Button,
|
|
3923
4004
|
{
|
|
3924
4005
|
variant: "outline",
|
|
@@ -3929,7 +4010,7 @@ var Permissions = ({
|
|
|
3929
4010
|
style: styles17.button
|
|
3930
4011
|
},
|
|
3931
4012
|
"Allow"
|
|
3932
|
-
), /* @__PURE__ */
|
|
4013
|
+
), /* @__PURE__ */ React34.createElement(Footer, null)));
|
|
3933
4014
|
};
|
|
3934
4015
|
var styles17 = StyleSheet17.create({
|
|
3935
4016
|
container: {
|
|
@@ -3989,7 +4070,7 @@ var styles17 = StyleSheet17.create({
|
|
|
3989
4070
|
});
|
|
3990
4071
|
|
|
3991
4072
|
// src/molecules/StatusModal.tsx
|
|
3992
|
-
import
|
|
4073
|
+
import React35 from "react";
|
|
3993
4074
|
import { StyleSheet as StyleSheet18, Text as Text16, View as View18 } from "react-native";
|
|
3994
4075
|
var StatusModal = ({
|
|
3995
4076
|
open,
|
|
@@ -4007,7 +4088,7 @@ var StatusModal = ({
|
|
|
4007
4088
|
}
|
|
4008
4089
|
onClose();
|
|
4009
4090
|
};
|
|
4010
|
-
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(
|
|
4011
4092
|
Button,
|
|
4012
4093
|
{
|
|
4013
4094
|
variant: "outline",
|
|
@@ -4016,7 +4097,7 @@ var StatusModal = ({
|
|
|
4016
4097
|
style: styles18.button
|
|
4017
4098
|
},
|
|
4018
4099
|
status === "success" ? "Continue" : "Try again later"
|
|
4019
|
-
), /* @__PURE__ */
|
|
4100
|
+
), /* @__PURE__ */ React35.createElement(Footer, null)));
|
|
4020
4101
|
};
|
|
4021
4102
|
var styles18 = StyleSheet18.create({
|
|
4022
4103
|
container: {
|
|
@@ -4043,18 +4124,18 @@ var styles18 = StyleSheet18.create({
|
|
|
4043
4124
|
});
|
|
4044
4125
|
|
|
4045
4126
|
// src/molecules/EndModal.tsx
|
|
4046
|
-
import
|
|
4127
|
+
import React36, { useEffect as useEffect4 } from "react";
|
|
4047
4128
|
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
4048
4129
|
var EndModal = ({ open, onClose }) => {
|
|
4049
4130
|
const theme = useTheme();
|
|
4050
|
-
|
|
4131
|
+
useEffect4(() => {
|
|
4051
4132
|
if (!open) return;
|
|
4052
4133
|
const timer = setTimeout(() => {
|
|
4053
4134
|
onClose();
|
|
4054
4135
|
}, 5e3);
|
|
4055
4136
|
return () => clearTimeout(timer);
|
|
4056
4137
|
}, []);
|
|
4057
|
-
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(
|
|
4058
4139
|
View19,
|
|
4059
4140
|
{
|
|
4060
4141
|
style: [
|
|
@@ -4062,9 +4143,9 @@ var EndModal = ({ open, onClose }) => {
|
|
|
4062
4143
|
{ backgroundColor: theme.colors.successLight }
|
|
4063
4144
|
]
|
|
4064
4145
|
},
|
|
4065
|
-
/* @__PURE__ */
|
|
4066
|
-
), /* @__PURE__ */
|
|
4067
|
-
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(
|
|
4068
4149
|
Button,
|
|
4069
4150
|
{
|
|
4070
4151
|
variant: "primary",
|
|
@@ -4073,7 +4154,7 @@ var EndModal = ({ open, onClose }) => {
|
|
|
4073
4154
|
style: styles19.button
|
|
4074
4155
|
},
|
|
4075
4156
|
"Continue to App"
|
|
4076
|
-
), /* @__PURE__ */
|
|
4157
|
+
), /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
4077
4158
|
};
|
|
4078
4159
|
var styles19 = StyleSheet19.create({
|
|
4079
4160
|
container: {
|
|
@@ -4110,9 +4191,9 @@ var KryptosConnectButton = ({
|
|
|
4110
4191
|
textStyle
|
|
4111
4192
|
}) => {
|
|
4112
4193
|
const { theme: themeName } = useKryptosConnect();
|
|
4113
|
-
const [open, setOpen] =
|
|
4194
|
+
const [open, setOpen] = React37.useState(false);
|
|
4114
4195
|
const theme = useTheme();
|
|
4115
|
-
return /* @__PURE__ */
|
|
4196
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, children ? /* @__PURE__ */ React37.createElement(TouchableOpacity8, { onPress: () => setOpen(true), style }, children) : /* @__PURE__ */ React37.createElement(
|
|
4116
4197
|
TouchableOpacity8,
|
|
4117
4198
|
{
|
|
4118
4199
|
onPress: () => setOpen(true),
|
|
@@ -4131,7 +4212,7 @@ var KryptosConnectButton = ({
|
|
|
4131
4212
|
],
|
|
4132
4213
|
activeOpacity: 0.8
|
|
4133
4214
|
},
|
|
4134
|
-
/* @__PURE__ */
|
|
4215
|
+
/* @__PURE__ */ React37.createElement(
|
|
4135
4216
|
Text18,
|
|
4136
4217
|
{
|
|
4137
4218
|
style: [
|
|
@@ -4146,8 +4227,8 @@ var KryptosConnectButton = ({
|
|
|
4146
4227
|
"Connect with",
|
|
4147
4228
|
" "
|
|
4148
4229
|
),
|
|
4149
|
-
/* @__PURE__ */
|
|
4150
|
-
), /* @__PURE__ */
|
|
4230
|
+
/* @__PURE__ */ React37.createElement(LogoIcon, { size: 24 })
|
|
4231
|
+
), /* @__PURE__ */ React37.createElement(
|
|
4151
4232
|
KryptosConnectModal,
|
|
4152
4233
|
{
|
|
4153
4234
|
open,
|
|
@@ -4175,7 +4256,7 @@ var KryptosConnectModal = ({
|
|
|
4175
4256
|
isAuthorized,
|
|
4176
4257
|
linkToken
|
|
4177
4258
|
} = useKryptosConnect();
|
|
4178
|
-
const [step, setStep] =
|
|
4259
|
+
const [step, setStep] = React37.useState("INIT" /* INIT */);
|
|
4179
4260
|
const handleClose = () => {
|
|
4180
4261
|
setOpen(false);
|
|
4181
4262
|
setIsInitialized(false);
|
|
@@ -4211,7 +4292,7 @@ var KryptosConnectModal = ({
|
|
|
4211
4292
|
handleClose();
|
|
4212
4293
|
};
|
|
4213
4294
|
if (!open) return null;
|
|
4214
|
-
return /* @__PURE__ */
|
|
4295
|
+
return /* @__PURE__ */ React37.createElement(View20, { style: styles20.container }, step === "INIT" /* INIT */ && /* @__PURE__ */ React37.createElement(
|
|
4215
4296
|
Init,
|
|
4216
4297
|
{
|
|
4217
4298
|
open,
|
|
@@ -4225,7 +4306,7 @@ var KryptosConnectModal = ({
|
|
|
4225
4306
|
},
|
|
4226
4307
|
onClose: handleAbort
|
|
4227
4308
|
}
|
|
4228
|
-
), step === "AUTH" /* AUTH */ && /* @__PURE__ */
|
|
4309
|
+
), step === "AUTH" /* AUTH */ && /* @__PURE__ */ React37.createElement(
|
|
4229
4310
|
Auth,
|
|
4230
4311
|
{
|
|
4231
4312
|
open,
|
|
@@ -4233,28 +4314,28 @@ var KryptosConnectModal = ({
|
|
|
4233
4314
|
onGuestSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4234
4315
|
onClose: handleAbort
|
|
4235
4316
|
}
|
|
4236
|
-
), step === "OTP" /* OTP */ && /* @__PURE__ */
|
|
4317
|
+
), step === "OTP" /* OTP */ && /* @__PURE__ */ React37.createElement(
|
|
4237
4318
|
OTPVerify,
|
|
4238
4319
|
{
|
|
4239
4320
|
open,
|
|
4240
4321
|
onSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4241
4322
|
onClose: handleAbort
|
|
4242
4323
|
}
|
|
4243
|
-
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */
|
|
4324
|
+
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */ React37.createElement(
|
|
4244
4325
|
Integration,
|
|
4245
4326
|
{
|
|
4246
4327
|
open,
|
|
4247
4328
|
onSuccess: handleConsentClick,
|
|
4248
4329
|
onClose: handleAbort
|
|
4249
4330
|
}
|
|
4250
|
-
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */
|
|
4331
|
+
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */ React37.createElement(
|
|
4251
4332
|
Permissions,
|
|
4252
4333
|
{
|
|
4253
4334
|
open,
|
|
4254
4335
|
onClose: handleAbort,
|
|
4255
4336
|
onSuccess: () => setStep("STATUS" /* STATUS */)
|
|
4256
4337
|
}
|
|
4257
|
-
), step === "STATUS" /* STATUS */ && /* @__PURE__ */
|
|
4338
|
+
), step === "STATUS" /* STATUS */ && /* @__PURE__ */ React37.createElement(
|
|
4258
4339
|
StatusModal,
|
|
4259
4340
|
{
|
|
4260
4341
|
open,
|
|
@@ -4263,7 +4344,7 @@ var KryptosConnectModal = ({
|
|
|
4263
4344
|
onError: handleError,
|
|
4264
4345
|
status: userConsent?.public_token ? "success" : "error"
|
|
4265
4346
|
}
|
|
4266
|
-
), step === "END" /* END */ && /* @__PURE__ */
|
|
4347
|
+
), step === "END" /* END */ && /* @__PURE__ */ React37.createElement(
|
|
4267
4348
|
EndModal,
|
|
4268
4349
|
{
|
|
4269
4350
|
open,
|