@kryptos_connect/mobile-sdk 1.0.3 → 1.0.6-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +1318 -782
- package/dist/index.mjs +1279 -755
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,51 +1,9 @@
|
|
|
1
1
|
// src/KryptosConnectButton.tsx
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
StyleSheet as StyleSheet20,
|
|
5
|
-
Text as Text18,
|
|
6
|
-
TouchableOpacity as TouchableOpacity8,
|
|
7
|
-
View as View20
|
|
8
|
-
} from "react-native";
|
|
9
|
-
|
|
10
|
-
// src/assets/LogoIcon.tsx
|
|
11
|
-
import React from "react";
|
|
12
|
-
import Svg, { Path } from "react-native-svg";
|
|
13
|
-
var LogoIcon = ({ size = 36 }) => {
|
|
14
|
-
return /* @__PURE__ */ React.createElement(Svg, { width: size, height: size, viewBox: "0 0 36 36", fill: "none" }, /* @__PURE__ */ React.createElement(
|
|
15
|
-
Path,
|
|
16
|
-
{
|
|
17
|
-
d: "M0 4.11429C0 1.84203 1.84203 0 4.11429 0H31.8857C34.158 0 36 1.84203 36 4.11429V31.8857C36 34.158 34.158 36 31.8857 36H4.11429C1.84203 36 0 34.158 0 31.8857V4.11429Z",
|
|
18
|
-
fill: "#00C693"
|
|
19
|
-
}
|
|
20
|
-
), /* @__PURE__ */ React.createElement(
|
|
21
|
-
Path,
|
|
22
|
-
{
|
|
23
|
-
d: "M12.3916 28.2857H8.43388C8.03646 28.2857 7.71429 27.9886 7.71429 27.6221V22.92C7.71429 22.744 7.7901 22.5752 7.92505 22.4508L9.66229 20.8487C9.79724 20.7243 9.98027 20.6544 10.1711 20.6544H12.3916C12.789 20.6544 13.1112 20.9515 13.1112 21.318V27.6221C13.1112 27.9886 12.789 28.2857 12.3916 28.2857Z",
|
|
24
|
-
fill: "white"
|
|
25
|
-
}
|
|
26
|
-
), /* @__PURE__ */ React.createElement(
|
|
27
|
-
Path,
|
|
28
|
-
{
|
|
29
|
-
d: "M27.5647 28.2857H22.0443C21.8535 28.2857 21.6704 28.2158 21.5355 28.0914L13.9798 21.1236C13.6988 20.8645 13.6988 20.4443 13.9798 20.1851L15.7788 18.5262C15.9137 18.4017 16.0968 18.3318 16.2876 18.3318H18.21C18.4009 18.3318 18.5839 18.4017 18.7189 18.5262L28.0735 27.1529C28.5268 27.5709 28.2058 28.2857 27.5647 28.2857Z",
|
|
30
|
-
fill: "white"
|
|
31
|
-
}
|
|
32
|
-
), /* @__PURE__ */ React.createElement(
|
|
33
|
-
Path,
|
|
34
|
-
{
|
|
35
|
-
d: "M27.5647 7.71429H22.0443C21.8535 7.71429 21.6704 7.7842 21.5355 7.90865L13.9798 14.8764C13.6988 15.1355 13.6988 15.5557 13.9798 15.8149L15.7788 17.4738C15.9137 17.5983 16.0968 17.6682 16.2876 17.6682H18.21C18.4009 17.6682 18.5839 17.5983 18.7189 17.4738L28.0735 8.84711C28.5268 8.42907 28.2058 7.71429 27.5647 7.71429Z",
|
|
36
|
-
fill: "white"
|
|
37
|
-
}
|
|
38
|
-
), /* @__PURE__ */ React.createElement(
|
|
39
|
-
Path,
|
|
40
|
-
{
|
|
41
|
-
d: "M12.3916 7.71429H8.43388C8.03646 7.71429 7.71429 8.01139 7.71429 8.37788V13.08C7.71429 13.256 7.7901 13.4248 7.92505 13.5492L9.66229 15.1513C9.79724 15.2757 9.98027 15.3456 10.1711 15.3456H12.3916C12.789 15.3456 13.1112 15.0485 13.1112 14.682V8.37788C13.1112 8.01139 12.789 7.71429 12.3916 7.71429Z",
|
|
42
|
-
fill: "white"
|
|
43
|
-
}
|
|
44
|
-
));
|
|
45
|
-
};
|
|
2
|
+
import React39, { useEffect as useEffect5, useState as useState4 } from "react";
|
|
3
|
+
import { StyleSheet as StyleSheet21, Text as Text19, TouchableOpacity as TouchableOpacity9, View as View21 } from "react-native";
|
|
46
4
|
|
|
47
5
|
// src/contexts/KryptosContext.tsx
|
|
48
|
-
import
|
|
6
|
+
import React from "react";
|
|
49
7
|
|
|
50
8
|
// src/services/api.ts
|
|
51
9
|
import axios from "axios";
|
|
@@ -54,6 +12,11 @@ import axios from "axios";
|
|
|
54
12
|
var getBaseUrl = () => {
|
|
55
13
|
return getGlobalBaseUrl() || "https://connect-api.kryptos.io/";
|
|
56
14
|
};
|
|
15
|
+
var isSvgUrl = (url) => {
|
|
16
|
+
if (!url) return false;
|
|
17
|
+
const urlWithoutParams = url.split("?")[0].split("#")[0];
|
|
18
|
+
return /\.svg$/i.test(urlWithoutParams);
|
|
19
|
+
};
|
|
57
20
|
|
|
58
21
|
// src/services/api.ts
|
|
59
22
|
var api = axios.create({
|
|
@@ -109,7 +72,7 @@ async function createAnonymousUser(linkToken, clientId) {
|
|
|
109
72
|
}
|
|
110
73
|
}
|
|
111
74
|
);
|
|
112
|
-
return res.data;
|
|
75
|
+
return res.data?.data;
|
|
113
76
|
}
|
|
114
77
|
async function addUserIntegration(linkToken, integration) {
|
|
115
78
|
const res = await api.post(
|
|
@@ -145,8 +108,8 @@ async function testCredentials(linkToken, data) {
|
|
|
145
108
|
});
|
|
146
109
|
return res.data?.data;
|
|
147
110
|
}
|
|
148
|
-
async function getSupportedProviders(linkToken) {
|
|
149
|
-
const res = await api.get(
|
|
111
|
+
async function getSupportedProviders(linkToken, id) {
|
|
112
|
+
const res = await api.get(`/integrations/providers${id ? `?id=${id}` : ""}`, {
|
|
150
113
|
headers: {
|
|
151
114
|
"X-LINK-TOKEN": linkToken
|
|
152
115
|
}
|
|
@@ -192,23 +155,23 @@ async function getUserInfo(linkToken) {
|
|
|
192
155
|
// src/contexts/KryptosContext.tsx
|
|
193
156
|
var globalBaseUrl;
|
|
194
157
|
var getGlobalBaseUrl = () => globalBaseUrl;
|
|
195
|
-
var KryptosContext =
|
|
158
|
+
var KryptosContext = React.createContext(
|
|
196
159
|
void 0
|
|
197
160
|
);
|
|
198
161
|
var KryptosConnectProvider = ({ children, config }) => {
|
|
199
|
-
const [isInitialized, setIsInitialized] =
|
|
200
|
-
const [linkToken, setLinkToken] =
|
|
201
|
-
const [user, setUser] =
|
|
202
|
-
const [email, setEmail] =
|
|
203
|
-
const [userConsent, setUserConsent] =
|
|
162
|
+
const [isInitialized, setIsInitialized] = React.useState(false);
|
|
163
|
+
const [linkToken, setLinkToken] = React.useState("");
|
|
164
|
+
const [user, setUser] = React.useState(null);
|
|
165
|
+
const [email, setEmail] = React.useState("");
|
|
166
|
+
const [userConsent, setUserConsent] = React.useState(
|
|
204
167
|
null
|
|
205
168
|
);
|
|
206
|
-
const [isAuthorized, setIsAuthorized] =
|
|
207
|
-
const [clientInfo, setClientInfo] =
|
|
208
|
-
|
|
169
|
+
const [isAuthorized, setIsAuthorized] = React.useState(false);
|
|
170
|
+
const [clientInfo, setClientInfo] = React.useState(null);
|
|
171
|
+
React.useEffect(() => {
|
|
209
172
|
globalBaseUrl = config.baseUrl;
|
|
210
173
|
}, [config.baseUrl]);
|
|
211
|
-
|
|
174
|
+
React.useEffect(() => {
|
|
212
175
|
const fetchClientInfo = async () => {
|
|
213
176
|
if (linkToken) {
|
|
214
177
|
const res = await getClientInfo(linkToken);
|
|
@@ -217,7 +180,7 @@ var KryptosConnectProvider = ({ children, config }) => {
|
|
|
217
180
|
};
|
|
218
181
|
fetchClientInfo();
|
|
219
182
|
}, [linkToken]);
|
|
220
|
-
return /* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ React.createElement(
|
|
221
184
|
KryptosContext.Provider,
|
|
222
185
|
{
|
|
223
186
|
value: {
|
|
@@ -241,7 +204,7 @@ var KryptosConnectProvider = ({ children, config }) => {
|
|
|
241
204
|
);
|
|
242
205
|
};
|
|
243
206
|
var useKryptosConnect = () => {
|
|
244
|
-
const ctx =
|
|
207
|
+
const ctx = React.useContext(KryptosContext);
|
|
245
208
|
if (!ctx)
|
|
246
209
|
throw new Error(
|
|
247
210
|
"useKryptosConnect must be used inside <KryptosConnectProvider>"
|
|
@@ -250,7 +213,7 @@ var useKryptosConnect = () => {
|
|
|
250
213
|
};
|
|
251
214
|
|
|
252
215
|
// src/hooks/useTheme.ts
|
|
253
|
-
import
|
|
216
|
+
import React2 from "react";
|
|
254
217
|
|
|
255
218
|
// src/theme/index.ts
|
|
256
219
|
var lightTheme = {
|
|
@@ -391,14 +354,14 @@ var getTheme = (isDark) => {
|
|
|
391
354
|
// src/hooks/useTheme.ts
|
|
392
355
|
var useTheme = () => {
|
|
393
356
|
const { theme } = useKryptosConnect();
|
|
394
|
-
const currentTheme =
|
|
357
|
+
const currentTheme = React2.useMemo(() => {
|
|
395
358
|
return getTheme(theme === "dark");
|
|
396
359
|
}, [theme]);
|
|
397
360
|
return currentTheme;
|
|
398
361
|
};
|
|
399
362
|
|
|
400
363
|
// src/components/Button.tsx
|
|
401
|
-
import
|
|
364
|
+
import React3 from "react";
|
|
402
365
|
import {
|
|
403
366
|
TouchableOpacity,
|
|
404
367
|
Text,
|
|
@@ -517,7 +480,7 @@ var Button = ({
|
|
|
517
480
|
}
|
|
518
481
|
};
|
|
519
482
|
const sizeStyles = getSizeStyles();
|
|
520
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ React3.createElement(
|
|
521
484
|
TouchableOpacity,
|
|
522
485
|
{
|
|
523
486
|
onPress,
|
|
@@ -531,7 +494,7 @@ var Button = ({
|
|
|
531
494
|
style
|
|
532
495
|
]
|
|
533
496
|
},
|
|
534
|
-
loading ? /* @__PURE__ */
|
|
497
|
+
loading ? /* @__PURE__ */ React3.createElement(ActivityIndicator, { size: "small", color: getTextColor() }) : typeof children === "string" ? /* @__PURE__ */ React3.createElement(
|
|
535
498
|
Text,
|
|
536
499
|
{
|
|
537
500
|
style: [
|
|
@@ -542,7 +505,7 @@ var Button = ({
|
|
|
542
505
|
]
|
|
543
506
|
},
|
|
544
507
|
children
|
|
545
|
-
) : /* @__PURE__ */
|
|
508
|
+
) : /* @__PURE__ */ React3.createElement(View, { style: styles.contentContainer }, children)
|
|
546
509
|
);
|
|
547
510
|
};
|
|
548
511
|
var styles = StyleSheet.create({
|
|
@@ -567,7 +530,7 @@ var styles = StyleSheet.create({
|
|
|
567
530
|
});
|
|
568
531
|
|
|
569
532
|
// src/components/Input.tsx
|
|
570
|
-
import
|
|
533
|
+
import React4 from "react";
|
|
571
534
|
import {
|
|
572
535
|
View as View2,
|
|
573
536
|
TextInput,
|
|
@@ -596,7 +559,7 @@ var Input = ({
|
|
|
596
559
|
return theme.colors.border;
|
|
597
560
|
}
|
|
598
561
|
};
|
|
599
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ React4.createElement(View2, { style: [styles2.wrapper, containerStyle] }, label && /* @__PURE__ */ React4.createElement(
|
|
600
563
|
Text2,
|
|
601
564
|
{
|
|
602
565
|
style: [
|
|
@@ -606,7 +569,7 @@ var Input = ({
|
|
|
606
569
|
]
|
|
607
570
|
},
|
|
608
571
|
label
|
|
609
|
-
), /* @__PURE__ */
|
|
572
|
+
), /* @__PURE__ */ React4.createElement(
|
|
610
573
|
TextInput,
|
|
611
574
|
{
|
|
612
575
|
placeholderTextColor: theme.colors.textTertiary,
|
|
@@ -625,7 +588,7 @@ var Input = ({
|
|
|
625
588
|
],
|
|
626
589
|
...props
|
|
627
590
|
}
|
|
628
|
-
), error && /* @__PURE__ */
|
|
591
|
+
), error && /* @__PURE__ */ React4.createElement(
|
|
629
592
|
Text2,
|
|
630
593
|
{
|
|
631
594
|
style: [
|
|
@@ -634,7 +597,7 @@ var Input = ({
|
|
|
634
597
|
]
|
|
635
598
|
},
|
|
636
599
|
error
|
|
637
|
-
), helperText && !error && /* @__PURE__ */
|
|
600
|
+
), helperText && !error && /* @__PURE__ */ React4.createElement(
|
|
638
601
|
Text2,
|
|
639
602
|
{
|
|
640
603
|
style: [
|
|
@@ -673,7 +636,7 @@ var styles2 = StyleSheet2.create({
|
|
|
673
636
|
});
|
|
674
637
|
|
|
675
638
|
// src/components/Alert.tsx
|
|
676
|
-
import
|
|
639
|
+
import React5 from "react";
|
|
677
640
|
import { StyleSheet as StyleSheet3, Text as Text3, View as View3 } from "react-native";
|
|
678
641
|
var Alert = ({
|
|
679
642
|
variant = "default",
|
|
@@ -695,7 +658,7 @@ var Alert = ({
|
|
|
695
658
|
};
|
|
696
659
|
}
|
|
697
660
|
};
|
|
698
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ React5.createElement(
|
|
699
662
|
View3,
|
|
700
663
|
{
|
|
701
664
|
style: [
|
|
@@ -711,12 +674,30 @@ var Alert = ({
|
|
|
711
674
|
children
|
|
712
675
|
);
|
|
713
676
|
};
|
|
677
|
+
var AlertTitle = ({ children, style }) => {
|
|
678
|
+
const theme = useTheme();
|
|
679
|
+
return /* @__PURE__ */ React5.createElement(
|
|
680
|
+
Text3,
|
|
681
|
+
{
|
|
682
|
+
style: [
|
|
683
|
+
styles3.title,
|
|
684
|
+
{
|
|
685
|
+
color: theme.colors.text,
|
|
686
|
+
fontSize: theme.fontSize.md,
|
|
687
|
+
textAlign: "center"
|
|
688
|
+
},
|
|
689
|
+
style
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
children
|
|
693
|
+
);
|
|
694
|
+
};
|
|
714
695
|
var AlertDescription = ({
|
|
715
696
|
children,
|
|
716
697
|
style
|
|
717
698
|
}) => {
|
|
718
699
|
const theme = useTheme();
|
|
719
|
-
return /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ React5.createElement(
|
|
720
701
|
Text3,
|
|
721
702
|
{
|
|
722
703
|
style: [
|
|
@@ -749,7 +730,7 @@ var styles3 = StyleSheet3.create({
|
|
|
749
730
|
});
|
|
750
731
|
|
|
751
732
|
// src/components/Modal.tsx
|
|
752
|
-
import
|
|
733
|
+
import React7 from "react";
|
|
753
734
|
import {
|
|
754
735
|
Dimensions,
|
|
755
736
|
KeyboardAvoidingView,
|
|
@@ -763,14 +744,14 @@ import {
|
|
|
763
744
|
} from "react-native";
|
|
764
745
|
|
|
765
746
|
// src/assets/CloseIcon.tsx
|
|
766
|
-
import
|
|
767
|
-
import
|
|
747
|
+
import React6 from "react";
|
|
748
|
+
import Svg, { Path } from "react-native-svg";
|
|
768
749
|
var CloseIcon = ({
|
|
769
750
|
size = 20,
|
|
770
751
|
color = "#000"
|
|
771
752
|
}) => {
|
|
772
|
-
return /* @__PURE__ */
|
|
773
|
-
|
|
753
|
+
return /* @__PURE__ */ React6.createElement(Svg, { width: size, height: size, viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ React6.createElement(
|
|
754
|
+
Path,
|
|
774
755
|
{
|
|
775
756
|
d: "M15 5L5 15M5 5L15 15",
|
|
776
757
|
stroke: color,
|
|
@@ -796,7 +777,7 @@ var Modal = ({
|
|
|
796
777
|
const getSizeStyles = () => {
|
|
797
778
|
switch (size) {
|
|
798
779
|
case "xs":
|
|
799
|
-
return { maxHeight: SCREEN_HEIGHT * 0.
|
|
780
|
+
return { maxHeight: SCREEN_HEIGHT * 0.4 };
|
|
800
781
|
case "sm":
|
|
801
782
|
return { maxHeight: SCREEN_HEIGHT * 0.45 };
|
|
802
783
|
case "md":
|
|
@@ -814,13 +795,13 @@ var Modal = ({
|
|
|
814
795
|
const handleOverlayPress = () => {
|
|
815
796
|
if (!disableClose && closeOnOverlayClick) onClose();
|
|
816
797
|
};
|
|
817
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ React7.createElement(
|
|
818
799
|
KeyboardAvoidingView,
|
|
819
800
|
{
|
|
820
801
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
821
802
|
style: styles4.keyboardView
|
|
822
803
|
},
|
|
823
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ React7.createElement(
|
|
824
805
|
RNModal,
|
|
825
806
|
{
|
|
826
807
|
visible: isOpen,
|
|
@@ -829,14 +810,14 @@ var Modal = ({
|
|
|
829
810
|
statusBarTranslucent: true,
|
|
830
811
|
onRequestClose: disableClose ? void 0 : onClose
|
|
831
812
|
},
|
|
832
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ React7.createElement(
|
|
833
814
|
TouchableOpacity2,
|
|
834
815
|
{
|
|
835
816
|
activeOpacity: 1,
|
|
836
817
|
style: [styles4.overlay, { backgroundColor: theme.colors.overlay }],
|
|
837
818
|
onPress: handleOverlayPress
|
|
838
819
|
},
|
|
839
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ React7.createElement(
|
|
840
821
|
View4,
|
|
841
822
|
{
|
|
842
823
|
style: [
|
|
@@ -867,7 +848,7 @@ var ModalHeader = ({
|
|
|
867
848
|
style
|
|
868
849
|
}) => {
|
|
869
850
|
const theme = useTheme();
|
|
870
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ React7.createElement(
|
|
871
852
|
View4,
|
|
872
853
|
{
|
|
873
854
|
style: [
|
|
@@ -880,7 +861,7 @@ var ModalHeader = ({
|
|
|
880
861
|
style
|
|
881
862
|
]
|
|
882
863
|
},
|
|
883
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ React7.createElement(View4, { style: styles4.headerContent }, typeof children === "string" ? /* @__PURE__ */ React7.createElement(
|
|
884
865
|
Text4,
|
|
885
866
|
{
|
|
886
867
|
style: [
|
|
@@ -890,7 +871,7 @@ var ModalHeader = ({
|
|
|
890
871
|
},
|
|
891
872
|
children
|
|
892
873
|
) : children),
|
|
893
|
-
showCloseButton && onClose && /* @__PURE__ */
|
|
874
|
+
showCloseButton && onClose && /* @__PURE__ */ React7.createElement(
|
|
894
875
|
TouchableOpacity2,
|
|
895
876
|
{
|
|
896
877
|
onPress: onClose,
|
|
@@ -900,7 +881,7 @@ var ModalHeader = ({
|
|
|
900
881
|
{ backgroundColor: theme.colors.surface }
|
|
901
882
|
]
|
|
902
883
|
},
|
|
903
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ React7.createElement(CloseIcon, { color: theme.colors.text, size: 20 })
|
|
904
885
|
)
|
|
905
886
|
);
|
|
906
887
|
};
|
|
@@ -911,7 +892,7 @@ var ModalBody = ({
|
|
|
911
892
|
}) => {
|
|
912
893
|
const theme = useTheme();
|
|
913
894
|
if (scrollable) {
|
|
914
|
-
return /* @__PURE__ */
|
|
895
|
+
return /* @__PURE__ */ React7.createElement(
|
|
915
896
|
ScrollView,
|
|
916
897
|
{
|
|
917
898
|
style: styles4.bodyScroll,
|
|
@@ -926,14 +907,14 @@ var ModalBody = ({
|
|
|
926
907
|
children
|
|
927
908
|
);
|
|
928
909
|
}
|
|
929
|
-
return /* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ React7.createElement(View4, { style: [styles4.body, { padding: theme.spacing.lg }, style] }, children);
|
|
930
911
|
};
|
|
931
912
|
var ModalFooter = ({
|
|
932
913
|
children,
|
|
933
914
|
style
|
|
934
915
|
}) => {
|
|
935
916
|
const theme = useTheme();
|
|
936
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ React7.createElement(
|
|
937
918
|
View4,
|
|
938
919
|
{
|
|
939
920
|
style: [
|
|
@@ -1002,13 +983,12 @@ var styles4 = StyleSheet4.create({
|
|
|
1002
983
|
flex: 1
|
|
1003
984
|
},
|
|
1004
985
|
footer: {
|
|
1005
|
-
borderTopWidth: 1
|
|
1006
|
-
marginBottom: 24
|
|
986
|
+
borderTopWidth: 1
|
|
1007
987
|
}
|
|
1008
988
|
});
|
|
1009
989
|
|
|
1010
990
|
// src/components/OTP.tsx
|
|
1011
|
-
import
|
|
991
|
+
import React8 from "react";
|
|
1012
992
|
import {
|
|
1013
993
|
View as View5,
|
|
1014
994
|
TextInput as TextInput2,
|
|
@@ -1029,11 +1009,11 @@ var OTP = ({
|
|
|
1029
1009
|
}) => {
|
|
1030
1010
|
const theme = useTheme();
|
|
1031
1011
|
const AUTO_SUBMIT_DELAY = 500;
|
|
1032
|
-
const [otp, setOtp] =
|
|
1012
|
+
const [otp, setOtp] = React8.useState(
|
|
1033
1013
|
value.split("").concat(Array(length).fill("")).slice(0, length)
|
|
1034
1014
|
);
|
|
1035
|
-
const inputRefs =
|
|
1036
|
-
|
|
1015
|
+
const inputRefs = React8.useRef([]);
|
|
1016
|
+
React8.useEffect(() => {
|
|
1037
1017
|
const isComplete = otp.every((digit) => digit !== "");
|
|
1038
1018
|
let timer;
|
|
1039
1019
|
if (isComplete && onComplete) {
|
|
@@ -1045,12 +1025,12 @@ var OTP = ({
|
|
|
1045
1025
|
if (timer) clearTimeout(timer);
|
|
1046
1026
|
};
|
|
1047
1027
|
}, [otp, onComplete]);
|
|
1048
|
-
|
|
1028
|
+
React8.useEffect(() => {
|
|
1049
1029
|
setTimeout(() => {
|
|
1050
1030
|
inputRefs.current[0]?.focus();
|
|
1051
1031
|
}, 100);
|
|
1052
1032
|
}, []);
|
|
1053
|
-
const handleChange =
|
|
1033
|
+
const handleChange = React8.useCallback(
|
|
1054
1034
|
(index, val) => {
|
|
1055
1035
|
if (disabled) return;
|
|
1056
1036
|
setErrorMessage("");
|
|
@@ -1073,7 +1053,7 @@ var OTP = ({
|
|
|
1073
1053
|
},
|
|
1074
1054
|
[otp, length, onChange, onComplete, disabled]
|
|
1075
1055
|
);
|
|
1076
|
-
const handleKeyPress =
|
|
1056
|
+
const handleKeyPress = React8.useCallback(
|
|
1077
1057
|
(index, e) => {
|
|
1078
1058
|
if (disabled) return;
|
|
1079
1059
|
if (e.nativeEvent.key === "Backspace") {
|
|
@@ -1094,7 +1074,7 @@ var OTP = ({
|
|
|
1094
1074
|
if (otp[index]) return theme.colors.success;
|
|
1095
1075
|
return theme.colors.border;
|
|
1096
1076
|
};
|
|
1097
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ React8.createElement(View5, { style: [styles5.wrapper, containerStyle] }, label && /* @__PURE__ */ React8.createElement(
|
|
1098
1078
|
Text5,
|
|
1099
1079
|
{
|
|
1100
1080
|
style: [
|
|
@@ -1103,7 +1083,7 @@ var OTP = ({
|
|
|
1103
1083
|
]
|
|
1104
1084
|
},
|
|
1105
1085
|
label
|
|
1106
|
-
), /* @__PURE__ */
|
|
1086
|
+
), /* @__PURE__ */ React8.createElement(View5, { style: styles5.container }, Array.from({ length }, (_, index) => /* @__PURE__ */ React8.createElement(
|
|
1107
1087
|
TextInput2,
|
|
1108
1088
|
{
|
|
1109
1089
|
key: index,
|
|
@@ -1128,7 +1108,7 @@ var OTP = ({
|
|
|
1128
1108
|
selectTextOnFocus: true,
|
|
1129
1109
|
caretHidden: true
|
|
1130
1110
|
}
|
|
1131
|
-
))), error && /* @__PURE__ */
|
|
1111
|
+
))), error && /* @__PURE__ */ React8.createElement(
|
|
1132
1112
|
Text5,
|
|
1133
1113
|
{
|
|
1134
1114
|
style: [
|
|
@@ -1171,7 +1151,7 @@ var styles5 = StyleSheet5.create({
|
|
|
1171
1151
|
});
|
|
1172
1152
|
|
|
1173
1153
|
// src/components/SkeletonItem.tsx
|
|
1174
|
-
import
|
|
1154
|
+
import React9, { useEffect, useRef } from "react";
|
|
1175
1155
|
import { Animated, View as View6, StyleSheet as StyleSheet6 } from "react-native";
|
|
1176
1156
|
var SkeletonItem = () => {
|
|
1177
1157
|
const opacity = useRef(new Animated.Value(0.3)).current;
|
|
@@ -1191,7 +1171,7 @@ var SkeletonItem = () => {
|
|
|
1191
1171
|
])
|
|
1192
1172
|
).start();
|
|
1193
1173
|
}, []);
|
|
1194
|
-
return /* @__PURE__ */
|
|
1174
|
+
return /* @__PURE__ */ React9.createElement(Animated.View, { style: [styles6.row, { opacity }] }, /* @__PURE__ */ React9.createElement(View6, { style: styles6.iconCircle }), /* @__PURE__ */ React9.createElement(View6, { style: styles6.textBlock }, /* @__PURE__ */ React9.createElement(View6, { style: styles6.lineLong }), /* @__PURE__ */ React9.createElement(View6, { style: styles6.lineShort })));
|
|
1195
1175
|
};
|
|
1196
1176
|
var styles6 = StyleSheet6.create({
|
|
1197
1177
|
row: {
|
|
@@ -1226,14 +1206,14 @@ var styles6 = StyleSheet6.create({
|
|
|
1226
1206
|
var SkeletonItem_default = SkeletonItem;
|
|
1227
1207
|
|
|
1228
1208
|
// src/components/Mode.tsx
|
|
1229
|
-
import
|
|
1209
|
+
import React10 from "react";
|
|
1230
1210
|
import { View as View7, Text as Text6, StyleSheet as StyleSheet7 } from "react-native";
|
|
1231
1211
|
var Mode = () => {
|
|
1232
1212
|
const { clientInfo } = useKryptosConnect();
|
|
1233
1213
|
const theme = useTheme();
|
|
1234
1214
|
if (!clientInfo) return null;
|
|
1235
1215
|
if (clientInfo?.project_stage === "production") return null;
|
|
1236
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ React10.createElement(View7, { style: [styles7.container, { backgroundColor: theme.colors.warning }] }, /* @__PURE__ */ React10.createElement(Text6, { style: [styles7.text, { color: theme.colors.warningText }] }, "Sandbox Mode"));
|
|
1237
1217
|
};
|
|
1238
1218
|
var styles7 = StyleSheet7.create({
|
|
1239
1219
|
container: {
|
|
@@ -1262,6 +1242,45 @@ import {
|
|
|
1262
1242
|
TouchableOpacity as TouchableOpacity3,
|
|
1263
1243
|
View as View8
|
|
1264
1244
|
} from "react-native";
|
|
1245
|
+
|
|
1246
|
+
// src/assets/LogoIcon.tsx
|
|
1247
|
+
import React11 from "react";
|
|
1248
|
+
import Svg2, { Path as Path2 } from "react-native-svg";
|
|
1249
|
+
var LogoIcon = ({ size = 36 }) => {
|
|
1250
|
+
return /* @__PURE__ */ React11.createElement(Svg2, { width: size, height: size, viewBox: "0 0 36 36", fill: "none" }, /* @__PURE__ */ React11.createElement(
|
|
1251
|
+
Path2,
|
|
1252
|
+
{
|
|
1253
|
+
d: "M0 4.11429C0 1.84203 1.84203 0 4.11429 0H31.8857C34.158 0 36 1.84203 36 4.11429V31.8857C36 34.158 34.158 36 31.8857 36H4.11429C1.84203 36 0 34.158 0 31.8857V4.11429Z",
|
|
1254
|
+
fill: "#00C693"
|
|
1255
|
+
}
|
|
1256
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1257
|
+
Path2,
|
|
1258
|
+
{
|
|
1259
|
+
d: "M12.3916 28.2857H8.43388C8.03646 28.2857 7.71429 27.9886 7.71429 27.6221V22.92C7.71429 22.744 7.7901 22.5752 7.92505 22.4508L9.66229 20.8487C9.79724 20.7243 9.98027 20.6544 10.1711 20.6544H12.3916C12.789 20.6544 13.1112 20.9515 13.1112 21.318V27.6221C13.1112 27.9886 12.789 28.2857 12.3916 28.2857Z",
|
|
1260
|
+
fill: "white"
|
|
1261
|
+
}
|
|
1262
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1263
|
+
Path2,
|
|
1264
|
+
{
|
|
1265
|
+
d: "M27.5647 28.2857H22.0443C21.8535 28.2857 21.6704 28.2158 21.5355 28.0914L13.9798 21.1236C13.6988 20.8645 13.6988 20.4443 13.9798 20.1851L15.7788 18.5262C15.9137 18.4017 16.0968 18.3318 16.2876 18.3318H18.21C18.4009 18.3318 18.5839 18.4017 18.7189 18.5262L28.0735 27.1529C28.5268 27.5709 28.2058 28.2857 27.5647 28.2857Z",
|
|
1266
|
+
fill: "white"
|
|
1267
|
+
}
|
|
1268
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1269
|
+
Path2,
|
|
1270
|
+
{
|
|
1271
|
+
d: "M27.5647 7.71429H22.0443C21.8535 7.71429 21.6704 7.7842 21.5355 7.90865L13.9798 14.8764C13.6988 15.1355 13.6988 15.5557 13.9798 15.8149L15.7788 17.4738C15.9137 17.5983 16.0968 17.6682 16.2876 17.6682H18.21C18.4009 17.6682 18.5839 17.5983 18.7189 17.4738L28.0735 8.84711C28.5268 8.42907 28.2058 7.71429 27.5647 7.71429Z",
|
|
1272
|
+
fill: "white"
|
|
1273
|
+
}
|
|
1274
|
+
), /* @__PURE__ */ React11.createElement(
|
|
1275
|
+
Path2,
|
|
1276
|
+
{
|
|
1277
|
+
d: "M12.3916 7.71429H8.43388C8.03646 7.71429 7.71429 8.01139 7.71429 8.37788V13.08C7.71429 13.256 7.7901 13.4248 7.92505 13.5492L9.66229 15.1513C9.79724 15.2757 9.98027 15.3456 10.1711 15.3456H12.3916C12.789 15.3456 13.1112 15.0485 13.1112 14.682V8.37788C13.1112 8.01139 12.789 7.71429 12.3916 7.71429Z",
|
|
1278
|
+
fill: "white"
|
|
1279
|
+
}
|
|
1280
|
+
));
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
// src/components/PoweredByKryptos.tsx
|
|
1265
1284
|
var PoweredByKryptos = () => {
|
|
1266
1285
|
const theme = useTheme();
|
|
1267
1286
|
const handlePress = () => {
|
|
@@ -1306,7 +1325,7 @@ var styles9 = StyleSheet9.create({
|
|
|
1306
1325
|
});
|
|
1307
1326
|
|
|
1308
1327
|
// src/molecules/Auth.tsx
|
|
1309
|
-
import
|
|
1328
|
+
import React20 from "react";
|
|
1310
1329
|
import { Linking as Linking2, StyleSheet as StyleSheet11, Text as Text9, View as View11 } from "react-native";
|
|
1311
1330
|
|
|
1312
1331
|
// src/assets/LinkIcon.tsx
|
|
@@ -1376,7 +1395,7 @@ var EyeIcon = ({
|
|
|
1376
1395
|
};
|
|
1377
1396
|
|
|
1378
1397
|
// src/molecules/ConnectLogo.tsx
|
|
1379
|
-
import
|
|
1398
|
+
import React19, { isValidElement } from "react";
|
|
1380
1399
|
import {
|
|
1381
1400
|
Image,
|
|
1382
1401
|
StyleSheet as StyleSheet10,
|
|
@@ -1441,15 +1460,40 @@ var UnplugIcon = ({
|
|
|
1441
1460
|
));
|
|
1442
1461
|
};
|
|
1443
1462
|
|
|
1463
|
+
// src/components/remote-svg.tsx
|
|
1464
|
+
import React18, { useEffect as useEffect2, useState } from "react";
|
|
1465
|
+
import { ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
1466
|
+
import { SvgXml } from "react-native-svg";
|
|
1467
|
+
function RemoteSvg({
|
|
1468
|
+
uri,
|
|
1469
|
+
width = 32,
|
|
1470
|
+
height = 32
|
|
1471
|
+
}) {
|
|
1472
|
+
const [svgXml, setSvgXml] = useState(null);
|
|
1473
|
+
useEffect2(() => {
|
|
1474
|
+
fetch(uri).then((res) => res.text()).then((text) => setSvgXml(text)).catch((err) => console.error("SVG load error:", err));
|
|
1475
|
+
}, [uri]);
|
|
1476
|
+
if (!svgXml) return /* @__PURE__ */ React18.createElement(ActivityIndicator2, null);
|
|
1477
|
+
return /* @__PURE__ */ React18.createElement(
|
|
1478
|
+
SvgXml,
|
|
1479
|
+
{
|
|
1480
|
+
xml: svgXml,
|
|
1481
|
+
width,
|
|
1482
|
+
height,
|
|
1483
|
+
style: { borderRadius: 8 }
|
|
1484
|
+
}
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1444
1488
|
// src/molecules/ConnectLogo.tsx
|
|
1445
1489
|
var KryptosLogo = () => {
|
|
1446
1490
|
const theme = useTheme();
|
|
1447
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1448
1492
|
View10,
|
|
1449
1493
|
{
|
|
1450
1494
|
style: [styles10.logoContainer, { backgroundColor: theme.colors.surface }]
|
|
1451
1495
|
},
|
|
1452
|
-
/* @__PURE__ */
|
|
1496
|
+
/* @__PURE__ */ React19.createElement(LogoIcon, { size: 36 })
|
|
1453
1497
|
);
|
|
1454
1498
|
};
|
|
1455
1499
|
var ConnectLogo = () => {
|
|
@@ -1467,7 +1511,7 @@ var ConnectLogo = () => {
|
|
|
1467
1511
|
if (isValidElement(appLogo)) {
|
|
1468
1512
|
return appLogo;
|
|
1469
1513
|
} else if (typeof appLogo === "string" && isValidUrl(appLogo)) {
|
|
1470
|
-
return /* @__PURE__ */
|
|
1514
|
+
return isSvgUrl(appLogo) ? /* @__PURE__ */ React19.createElement(RemoteSvg, { uri: appLogo }) : /* @__PURE__ */ React19.createElement(
|
|
1471
1515
|
Image,
|
|
1472
1516
|
{
|
|
1473
1517
|
source: { uri: appLogo },
|
|
@@ -1476,7 +1520,7 @@ var ConnectLogo = () => {
|
|
|
1476
1520
|
}
|
|
1477
1521
|
);
|
|
1478
1522
|
} else if (typeof appLogo === "number" || typeof appLogo === "object" && appLogo !== null) {
|
|
1479
|
-
return /* @__PURE__ */
|
|
1523
|
+
return /* @__PURE__ */ React19.createElement(
|
|
1480
1524
|
Image,
|
|
1481
1525
|
{
|
|
1482
1526
|
source: appLogo,
|
|
@@ -1485,11 +1529,11 @@ var ConnectLogo = () => {
|
|
|
1485
1529
|
}
|
|
1486
1530
|
);
|
|
1487
1531
|
} else if (appName) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, appName.charAt(0).toUpperCase());
|
|
1489
1533
|
}
|
|
1490
|
-
return /* @__PURE__ */
|
|
1534
|
+
return /* @__PURE__ */ React19.createElement(Text8, { style: [styles10.appLogoText, { color: theme.colors.text }] }, "?");
|
|
1491
1535
|
};
|
|
1492
|
-
return /* @__PURE__ */
|
|
1536
|
+
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
1537
|
View10,
|
|
1494
1538
|
{
|
|
1495
1539
|
style: [
|
|
@@ -1541,11 +1585,11 @@ var Auth = ({
|
|
|
1541
1585
|
}) => {
|
|
1542
1586
|
const { appName, linkToken, clientId, setUser, setEmail } = useKryptosConnect();
|
|
1543
1587
|
const theme = useTheme();
|
|
1544
|
-
const [isLoading, setIsLoading] =
|
|
1545
|
-
const [errorMessage, setErrorMessage] =
|
|
1546
|
-
const [emailValue, setEmailValue] =
|
|
1547
|
-
const [emailError, setEmailError] =
|
|
1548
|
-
const [loadingType, setLoadingType] =
|
|
1588
|
+
const [isLoading, setIsLoading] = React20.useState(false);
|
|
1589
|
+
const [errorMessage, setErrorMessage] = React20.useState("");
|
|
1590
|
+
const [emailValue, setEmailValue] = React20.useState("");
|
|
1591
|
+
const [emailError, setEmailError] = React20.useState("");
|
|
1592
|
+
const [loadingType, setLoadingType] = React20.useState(null);
|
|
1549
1593
|
const validateEmail = (email) => {
|
|
1550
1594
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1551
1595
|
if (!email) {
|
|
@@ -1607,28 +1651,28 @@ var Auth = ({
|
|
|
1607
1651
|
};
|
|
1608
1652
|
const infoSections = [
|
|
1609
1653
|
{
|
|
1610
|
-
icon: /* @__PURE__ */
|
|
1654
|
+
icon: /* @__PURE__ */ React20.createElement(LinkIcon, { size: 20, color: theme.colors.primary }),
|
|
1611
1655
|
title: "Simple and secure",
|
|
1612
1656
|
text: "Link your accounts in just a few clicks"
|
|
1613
1657
|
},
|
|
1614
1658
|
{
|
|
1615
|
-
icon: /* @__PURE__ */
|
|
1659
|
+
icon: /* @__PURE__ */ React20.createElement(ShieldIcon, { size: 20, color: theme.colors.primary }),
|
|
1616
1660
|
title: "Control what you share",
|
|
1617
1661
|
text: "We never share your data without your permission"
|
|
1618
1662
|
},
|
|
1619
1663
|
{
|
|
1620
|
-
icon: /* @__PURE__ */
|
|
1664
|
+
icon: /* @__PURE__ */ React20.createElement(EyeIcon, { size: 20, color: theme.colors.primary }),
|
|
1621
1665
|
title: "View Only Access",
|
|
1622
1666
|
text: "Kryptos retrieves view-only data and cannot perform any transactions on your behalf."
|
|
1623
1667
|
}
|
|
1624
1668
|
];
|
|
1625
|
-
return /* @__PURE__ */
|
|
1669
|
+
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
1670
|
Text9,
|
|
1627
1671
|
{
|
|
1628
1672
|
style: [styles11.infoTitle, { color: theme.colors.text }]
|
|
1629
1673
|
},
|
|
1630
1674
|
section.title
|
|
1631
|
-
), /* @__PURE__ */
|
|
1675
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1632
1676
|
Text9,
|
|
1633
1677
|
{
|
|
1634
1678
|
style: [
|
|
@@ -1637,7 +1681,7 @@ var Auth = ({
|
|
|
1637
1681
|
]
|
|
1638
1682
|
},
|
|
1639
1683
|
section.text
|
|
1640
|
-
)))), errorMessage ? /* @__PURE__ */
|
|
1684
|
+
)))), 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
1685
|
Button,
|
|
1642
1686
|
{
|
|
1643
1687
|
variant: "outline",
|
|
@@ -1648,14 +1692,14 @@ var Auth = ({
|
|
|
1648
1692
|
style: styles11.button
|
|
1649
1693
|
},
|
|
1650
1694
|
"Continue"
|
|
1651
|
-
), /* @__PURE__ */
|
|
1695
|
+
), /* @__PURE__ */ React20.createElement(
|
|
1652
1696
|
Text9,
|
|
1653
1697
|
{
|
|
1654
1698
|
style: [styles11.footerText, { color: theme.colors.textSecondary }]
|
|
1655
1699
|
},
|
|
1656
1700
|
"By continuing, you agree to Kryptos",
|
|
1657
1701
|
" ",
|
|
1658
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ React20.createElement(
|
|
1659
1703
|
Text9,
|
|
1660
1704
|
{
|
|
1661
1705
|
style: {
|
|
@@ -1669,7 +1713,7 @@ var Auth = ({
|
|
|
1669
1713
|
" ",
|
|
1670
1714
|
"and",
|
|
1671
1715
|
" ",
|
|
1672
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ React20.createElement(
|
|
1673
1717
|
Text9,
|
|
1674
1718
|
{
|
|
1675
1719
|
style: {
|
|
@@ -1680,7 +1724,7 @@ var Auth = ({
|
|
|
1680
1724
|
},
|
|
1681
1725
|
"Terms of Service"
|
|
1682
1726
|
)
|
|
1683
|
-
)))), /* @__PURE__ */
|
|
1727
|
+
)))), /* @__PURE__ */ React20.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React20.createElement(Footer, null)));
|
|
1684
1728
|
};
|
|
1685
1729
|
var styles11 = StyleSheet11.create({
|
|
1686
1730
|
container: {
|
|
@@ -1746,9 +1790,101 @@ var styles11 = StyleSheet11.create({
|
|
|
1746
1790
|
}
|
|
1747
1791
|
});
|
|
1748
1792
|
|
|
1793
|
+
// src/molecules/EndModal.tsx
|
|
1794
|
+
import React22, { useEffect as useEffect3 } from "react";
|
|
1795
|
+
import { StyleSheet as StyleSheet12, Text as Text10, View as View12 } from "react-native";
|
|
1796
|
+
|
|
1797
|
+
// src/assets/SuccessIcon.tsx
|
|
1798
|
+
import React21 from "react";
|
|
1799
|
+
import Svg7, { Circle, Path as Path7 } from "react-native-svg";
|
|
1800
|
+
var SuccessIcon = ({ size = 64 }) => {
|
|
1801
|
+
return /* @__PURE__ */ React21.createElement(Svg7, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React21.createElement(
|
|
1802
|
+
Circle,
|
|
1803
|
+
{
|
|
1804
|
+
cx: 32,
|
|
1805
|
+
cy: 32,
|
|
1806
|
+
r: 30,
|
|
1807
|
+
fill: "#00C693",
|
|
1808
|
+
opacity: 0.1
|
|
1809
|
+
}
|
|
1810
|
+
), /* @__PURE__ */ React21.createElement(
|
|
1811
|
+
Circle,
|
|
1812
|
+
{
|
|
1813
|
+
cx: 32,
|
|
1814
|
+
cy: 32,
|
|
1815
|
+
r: 24,
|
|
1816
|
+
fill: "#00C693"
|
|
1817
|
+
}
|
|
1818
|
+
), /* @__PURE__ */ React21.createElement(
|
|
1819
|
+
Path7,
|
|
1820
|
+
{
|
|
1821
|
+
d: "M24 32l6 6 12-12",
|
|
1822
|
+
stroke: "white",
|
|
1823
|
+
strokeWidth: 3,
|
|
1824
|
+
strokeLinecap: "round",
|
|
1825
|
+
strokeLinejoin: "round"
|
|
1826
|
+
}
|
|
1827
|
+
));
|
|
1828
|
+
};
|
|
1829
|
+
|
|
1830
|
+
// src/molecules/EndModal.tsx
|
|
1831
|
+
var EndModal = ({ open, onClose }) => {
|
|
1832
|
+
const theme = useTheme();
|
|
1833
|
+
useEffect3(() => {
|
|
1834
|
+
if (!open) return;
|
|
1835
|
+
const timer = setTimeout(() => {
|
|
1836
|
+
onClose();
|
|
1837
|
+
}, 5e3);
|
|
1838
|
+
return () => clearTimeout(timer);
|
|
1839
|
+
}, []);
|
|
1840
|
+
return /* @__PURE__ */ React22.createElement(Modal, { isOpen: open, onClose, size: "xl" }, /* @__PURE__ */ React22.createElement(ModalHeader, { onClose }, ""), /* @__PURE__ */ React22.createElement(ModalBody, null, /* @__PURE__ */ React22.createElement(View12, { style: styles12.container }, /* @__PURE__ */ React22.createElement(
|
|
1841
|
+
View12,
|
|
1842
|
+
{
|
|
1843
|
+
style: [
|
|
1844
|
+
styles12.iconContainer,
|
|
1845
|
+
{ backgroundColor: theme.colors.successLight }
|
|
1846
|
+
]
|
|
1847
|
+
},
|
|
1848
|
+
/* @__PURE__ */ React22.createElement(SuccessIcon, { size: 80 })
|
|
1849
|
+
), /* @__PURE__ */ React22.createElement(Text10, { style: [styles12.message, { color: theme.colors.text }] }, "All set! We're redirecting you back to the app. If it takes longer than expected, tap the button below to continue."), /* @__PURE__ */ React22.createElement(Alert, null, /* @__PURE__ */ React22.createElement(AlertTitle, null, "Sync in Progress"), /* @__PURE__ */ React22.createElement(AlertDescription, null, "The syncing process might take a moment. Please wait, and your data will be updated soon.")))), /* @__PURE__ */ React22.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React22.createElement(
|
|
1850
|
+
Button,
|
|
1851
|
+
{
|
|
1852
|
+
variant: "primary",
|
|
1853
|
+
size: "lg",
|
|
1854
|
+
onPress: onClose,
|
|
1855
|
+
style: styles12.button
|
|
1856
|
+
},
|
|
1857
|
+
"Continue to App"
|
|
1858
|
+
), /* @__PURE__ */ React22.createElement(Footer, null)));
|
|
1859
|
+
};
|
|
1860
|
+
var styles12 = StyleSheet12.create({
|
|
1861
|
+
container: {
|
|
1862
|
+
alignItems: "center",
|
|
1863
|
+
paddingVertical: 20
|
|
1864
|
+
},
|
|
1865
|
+
iconContainer: {
|
|
1866
|
+
width: 80,
|
|
1867
|
+
height: 80,
|
|
1868
|
+
borderRadius: 40,
|
|
1869
|
+
alignItems: "center",
|
|
1870
|
+
justifyContent: "center",
|
|
1871
|
+
marginBottom: 20
|
|
1872
|
+
},
|
|
1873
|
+
message: {
|
|
1874
|
+
fontSize: 14,
|
|
1875
|
+
textAlign: "center",
|
|
1876
|
+
lineHeight: 20,
|
|
1877
|
+
marginBottom: 24,
|
|
1878
|
+
paddingHorizontal: 20
|
|
1879
|
+
},
|
|
1880
|
+
button: {
|
|
1881
|
+
width: "100%"
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
|
|
1749
1885
|
// src/molecules/Init.tsx
|
|
1750
|
-
import
|
|
1751
|
-
import { ActivityIndicator as
|
|
1886
|
+
import React23 from "react";
|
|
1887
|
+
import { ActivityIndicator as ActivityIndicator3, StyleSheet as StyleSheet13, Text as Text11, View as View13 } from "react-native";
|
|
1752
1888
|
var Init = ({
|
|
1753
1889
|
open,
|
|
1754
1890
|
onSuccess,
|
|
@@ -1763,9 +1899,9 @@ var Init = ({
|
|
|
1763
1899
|
setUser
|
|
1764
1900
|
} = useKryptosConnect();
|
|
1765
1901
|
const theme = useTheme();
|
|
1766
|
-
const [isFetching, setIsFetching] =
|
|
1767
|
-
const [error, setError] =
|
|
1768
|
-
const fetchLinkToken =
|
|
1902
|
+
const [isFetching, setIsFetching] = React23.useState(false);
|
|
1903
|
+
const [error, setError] = React23.useState(null);
|
|
1904
|
+
const fetchLinkToken = React23.useCallback(async () => {
|
|
1769
1905
|
if (!open) return;
|
|
1770
1906
|
setIsFetching(true);
|
|
1771
1907
|
setError(null);
|
|
@@ -1792,28 +1928,28 @@ var Init = ({
|
|
|
1792
1928
|
setIsFetching(false);
|
|
1793
1929
|
}
|
|
1794
1930
|
}, []);
|
|
1795
|
-
|
|
1931
|
+
React23.useEffect(() => {
|
|
1796
1932
|
fetchLinkToken();
|
|
1797
1933
|
}, [fetchLinkToken]);
|
|
1798
|
-
return /* @__PURE__ */
|
|
1799
|
-
|
|
1934
|
+
return /* @__PURE__ */ React23.createElement(Modal, { isOpen: open, onClose, size: "md" }, /* @__PURE__ */ React23.createElement(ModalHeader, { onClose }, "Kryptos Connect"), /* @__PURE__ */ React23.createElement(ModalBody, null, /* @__PURE__ */ React23.createElement(View13, { style: styles13.container }, isFetching && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(
|
|
1935
|
+
ActivityIndicator3,
|
|
1800
1936
|
{
|
|
1801
1937
|
size: "large",
|
|
1802
1938
|
color: theme.colors.primary,
|
|
1803
|
-
style:
|
|
1939
|
+
style: styles13.spinner
|
|
1804
1940
|
}
|
|
1805
|
-
), /* @__PURE__ */
|
|
1941
|
+
), /* @__PURE__ */ React23.createElement(Text11, { style: [styles13.message, { color: theme.colors.text }] }, isInitialized ? "Fetching link token..." : "Initializing...")), !isFetching && error && /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React23.createElement(AlertDescription, null, error)), /* @__PURE__ */ React23.createElement(
|
|
1806
1942
|
Button,
|
|
1807
1943
|
{
|
|
1808
1944
|
variant: "primary",
|
|
1809
1945
|
size: "lg",
|
|
1810
1946
|
onPress: fetchLinkToken,
|
|
1811
|
-
style:
|
|
1947
|
+
style: styles13.retryButton
|
|
1812
1948
|
},
|
|
1813
1949
|
"Retry"
|
|
1814
|
-
)))), /* @__PURE__ */
|
|
1950
|
+
)))), /* @__PURE__ */ React23.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React23.createElement(Footer, null)));
|
|
1815
1951
|
};
|
|
1816
|
-
var
|
|
1952
|
+
var styles13 = StyleSheet13.create({
|
|
1817
1953
|
container: {
|
|
1818
1954
|
flex: 1,
|
|
1819
1955
|
alignItems: "center",
|
|
@@ -1840,25 +1976,25 @@ var styles12 = StyleSheet12.create({
|
|
|
1840
1976
|
});
|
|
1841
1977
|
|
|
1842
1978
|
// src/molecules/Integration.tsx
|
|
1843
|
-
import
|
|
1979
|
+
import React35, { useCallback } from "react";
|
|
1844
1980
|
import {
|
|
1845
1981
|
FlatList,
|
|
1846
|
-
Image as
|
|
1847
|
-
StyleSheet as
|
|
1848
|
-
Text as
|
|
1849
|
-
TouchableOpacity as
|
|
1850
|
-
View as
|
|
1982
|
+
Image as Image4,
|
|
1983
|
+
StyleSheet as StyleSheet17,
|
|
1984
|
+
Text as Text15,
|
|
1985
|
+
TouchableOpacity as TouchableOpacity7,
|
|
1986
|
+
View as View17
|
|
1851
1987
|
} from "react-native";
|
|
1852
1988
|
|
|
1853
1989
|
// src/assets/ArrowLeftIcon.tsx
|
|
1854
|
-
import
|
|
1855
|
-
import
|
|
1990
|
+
import React24 from "react";
|
|
1991
|
+
import Svg8, { Path as Path8 } from "react-native-svg";
|
|
1856
1992
|
var ArrowLeftIcon = ({
|
|
1857
1993
|
size = 20,
|
|
1858
1994
|
color = "#000"
|
|
1859
1995
|
}) => {
|
|
1860
|
-
return /* @__PURE__ */
|
|
1861
|
-
|
|
1996
|
+
return /* @__PURE__ */ React24.createElement(Svg8, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React24.createElement(
|
|
1997
|
+
Path8,
|
|
1862
1998
|
{
|
|
1863
1999
|
d: "M19 12H5M12 19l-7-7 7-7",
|
|
1864
2000
|
stroke: color,
|
|
@@ -1870,14 +2006,14 @@ var ArrowLeftIcon = ({
|
|
|
1870
2006
|
};
|
|
1871
2007
|
|
|
1872
2008
|
// src/assets/CheckCircleIcon.tsx
|
|
1873
|
-
import
|
|
1874
|
-
import
|
|
2009
|
+
import React25 from "react";
|
|
2010
|
+
import Svg9, { Path as Path9, Circle as Circle2 } from "react-native-svg";
|
|
1875
2011
|
var CheckCircleIcon = ({
|
|
1876
2012
|
size = 20,
|
|
1877
2013
|
color = "#10B981"
|
|
1878
2014
|
}) => {
|
|
1879
|
-
return /* @__PURE__ */
|
|
1880
|
-
|
|
2015
|
+
return /* @__PURE__ */ React25.createElement(Svg9, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React25.createElement(
|
|
2016
|
+
Circle2,
|
|
1881
2017
|
{
|
|
1882
2018
|
cx: 12,
|
|
1883
2019
|
cy: 12,
|
|
@@ -1885,8 +2021,8 @@ var CheckCircleIcon = ({
|
|
|
1885
2021
|
stroke: color,
|
|
1886
2022
|
strokeWidth: 2
|
|
1887
2023
|
}
|
|
1888
|
-
), /* @__PURE__ */
|
|
1889
|
-
|
|
2024
|
+
), /* @__PURE__ */ React25.createElement(
|
|
2025
|
+
Path9,
|
|
1890
2026
|
{
|
|
1891
2027
|
d: "m9 12 2 2 4-4",
|
|
1892
2028
|
stroke: color,
|
|
@@ -1898,16 +2034,16 @@ var CheckCircleIcon = ({
|
|
|
1898
2034
|
};
|
|
1899
2035
|
|
|
1900
2036
|
// src/assets/LoaderIcon.tsx
|
|
1901
|
-
import
|
|
2037
|
+
import React26 from "react";
|
|
1902
2038
|
import { Animated as Animated2, Easing } from "react-native";
|
|
1903
|
-
import
|
|
1904
|
-
var AnimatedSvg = Animated2.createAnimatedComponent(
|
|
2039
|
+
import Svg10, { Path as Path10 } from "react-native-svg";
|
|
2040
|
+
var AnimatedSvg = Animated2.createAnimatedComponent(Svg10);
|
|
1905
2041
|
var LoaderIcon = ({
|
|
1906
2042
|
size = 20,
|
|
1907
2043
|
color = "#00C693"
|
|
1908
2044
|
}) => {
|
|
1909
|
-
const rotateAnim =
|
|
1910
|
-
|
|
2045
|
+
const rotateAnim = React26.useRef(new Animated2.Value(0)).current;
|
|
2046
|
+
React26.useEffect(() => {
|
|
1911
2047
|
Animated2.loop(
|
|
1912
2048
|
Animated2.timing(rotateAnim, {
|
|
1913
2049
|
toValue: 1,
|
|
@@ -1921,7 +2057,7 @@ var LoaderIcon = ({
|
|
|
1921
2057
|
inputRange: [0, 1],
|
|
1922
2058
|
outputRange: ["0deg", "360deg"]
|
|
1923
2059
|
});
|
|
1924
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1925
2061
|
AnimatedSvg,
|
|
1926
2062
|
{
|
|
1927
2063
|
width: size,
|
|
@@ -1930,8 +2066,8 @@ var LoaderIcon = ({
|
|
|
1930
2066
|
fill: "none",
|
|
1931
2067
|
style: { transform: [{ rotate: spin }] }
|
|
1932
2068
|
},
|
|
1933
|
-
/* @__PURE__ */
|
|
1934
|
-
|
|
2069
|
+
/* @__PURE__ */ React26.createElement(
|
|
2070
|
+
Path10,
|
|
1935
2071
|
{
|
|
1936
2072
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
1937
2073
|
stroke: color,
|
|
@@ -1943,44 +2079,11 @@ var LoaderIcon = ({
|
|
|
1943
2079
|
);
|
|
1944
2080
|
};
|
|
1945
2081
|
|
|
1946
|
-
// src/assets/SuccessIcon.tsx
|
|
1947
|
-
import React24 from "react";
|
|
1948
|
-
import Svg10, { Circle as Circle2, Path as Path10 } from "react-native-svg";
|
|
1949
|
-
var SuccessIcon = ({ size = 64 }) => {
|
|
1950
|
-
return /* @__PURE__ */ React24.createElement(Svg10, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React24.createElement(
|
|
1951
|
-
Circle2,
|
|
1952
|
-
{
|
|
1953
|
-
cx: 32,
|
|
1954
|
-
cy: 32,
|
|
1955
|
-
r: 30,
|
|
1956
|
-
fill: "#00C693",
|
|
1957
|
-
opacity: 0.1
|
|
1958
|
-
}
|
|
1959
|
-
), /* @__PURE__ */ React24.createElement(
|
|
1960
|
-
Circle2,
|
|
1961
|
-
{
|
|
1962
|
-
cx: 32,
|
|
1963
|
-
cy: 32,
|
|
1964
|
-
r: 24,
|
|
1965
|
-
fill: "#00C693"
|
|
1966
|
-
}
|
|
1967
|
-
), /* @__PURE__ */ React24.createElement(
|
|
1968
|
-
Path10,
|
|
1969
|
-
{
|
|
1970
|
-
d: "M24 32l6 6 12-12",
|
|
1971
|
-
stroke: "white",
|
|
1972
|
-
strokeWidth: 3,
|
|
1973
|
-
strokeLinecap: "round",
|
|
1974
|
-
strokeLinejoin: "round"
|
|
1975
|
-
}
|
|
1976
|
-
));
|
|
1977
|
-
};
|
|
1978
|
-
|
|
1979
2082
|
// src/assets/ErrorIcon.tsx
|
|
1980
|
-
import
|
|
2083
|
+
import React27 from "react";
|
|
1981
2084
|
import Svg11, { Circle as Circle3, Path as Path11 } from "react-native-svg";
|
|
1982
2085
|
var ErrorIcon = ({ size = 64 }) => {
|
|
1983
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ React27.createElement(Svg11, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React27.createElement(
|
|
1984
2087
|
Circle3,
|
|
1985
2088
|
{
|
|
1986
2089
|
cx: 32,
|
|
@@ -1989,7 +2092,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1989
2092
|
fill: "#EF4444",
|
|
1990
2093
|
opacity: 0.1
|
|
1991
2094
|
}
|
|
1992
|
-
), /* @__PURE__ */
|
|
2095
|
+
), /* @__PURE__ */ React27.createElement(
|
|
1993
2096
|
Circle3,
|
|
1994
2097
|
{
|
|
1995
2098
|
cx: 32,
|
|
@@ -1997,7 +2100,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
1997
2100
|
r: 24,
|
|
1998
2101
|
fill: "#EF4444"
|
|
1999
2102
|
}
|
|
2000
|
-
), /* @__PURE__ */
|
|
2103
|
+
), /* @__PURE__ */ React27.createElement(
|
|
2001
2104
|
Path11,
|
|
2002
2105
|
{
|
|
2003
2106
|
d: "M24 24l16 16M40 24l-16 16",
|
|
@@ -2010,17 +2113,17 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2010
2113
|
};
|
|
2011
2114
|
|
|
2012
2115
|
// src/assets/SearchIcon.tsx
|
|
2013
|
-
import
|
|
2116
|
+
import React28 from "react";
|
|
2014
2117
|
import Svg12, { Circle as Circle4, Path as Path12 } from "react-native-svg";
|
|
2015
2118
|
|
|
2016
2119
|
// src/assets/PlusIcon.tsx
|
|
2017
|
-
import
|
|
2120
|
+
import React29 from "react";
|
|
2018
2121
|
import Svg13, { Path as Path13 } from "react-native-svg";
|
|
2019
2122
|
var PlusIcon = ({
|
|
2020
2123
|
size = 14,
|
|
2021
2124
|
color = "#6B7280"
|
|
2022
2125
|
}) => {
|
|
2023
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ React29.createElement(Svg13, { width: size, height: size, viewBox: "0 0 14 14", fill: "none" }, /* @__PURE__ */ React29.createElement(
|
|
2024
2127
|
Path13,
|
|
2025
2128
|
{
|
|
2026
2129
|
d: "M7 3.5v7M3.5 7h7",
|
|
@@ -2031,16 +2134,48 @@ var PlusIcon = ({
|
|
|
2031
2134
|
));
|
|
2032
2135
|
};
|
|
2033
2136
|
|
|
2034
|
-
// src/
|
|
2035
|
-
import
|
|
2036
|
-
import
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2137
|
+
// src/assets/RedirectIcon.tsx
|
|
2138
|
+
import React30 from "react";
|
|
2139
|
+
import Svg14, { Path as Path14 } from "react-native-svg";
|
|
2140
|
+
var RedirectIcon = ({
|
|
2141
|
+
width = 20,
|
|
2142
|
+
height = 20,
|
|
2143
|
+
color = "currentColor"
|
|
2144
|
+
}) => {
|
|
2145
|
+
return /* @__PURE__ */ React30.createElement(Svg14, { width, height, viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ React30.createElement(
|
|
2146
|
+
Path14,
|
|
2147
|
+
{
|
|
2148
|
+
d: "M10.8333 9.16536L17.6666 2.33203",
|
|
2149
|
+
stroke: color,
|
|
2150
|
+
strokeWidth: 2,
|
|
2151
|
+
strokeLinecap: "round",
|
|
2152
|
+
strokeLinejoin: "round"
|
|
2153
|
+
}
|
|
2154
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2155
|
+
Path14,
|
|
2156
|
+
{
|
|
2157
|
+
d: "M18.3333 5.66797V1.66797H14.3333",
|
|
2158
|
+
stroke: color,
|
|
2159
|
+
strokeWidth: 2,
|
|
2160
|
+
strokeLinecap: "round",
|
|
2161
|
+
strokeLinejoin: "round"
|
|
2162
|
+
}
|
|
2163
|
+
), /* @__PURE__ */ React30.createElement(
|
|
2164
|
+
Path14,
|
|
2165
|
+
{
|
|
2166
|
+
d: "M9.16669 1.66797H7.50002C3.33335 1.66797 1.66669 3.33464 1.66669 7.5013V12.5013C1.66669 16.668 3.33335 18.3346 7.50002 18.3346H12.5C16.6667 18.3346 18.3334 16.668 18.3334 12.5013V10.8346",
|
|
2167
|
+
stroke: color,
|
|
2168
|
+
strokeWidth: 2,
|
|
2169
|
+
strokeLinecap: "round",
|
|
2170
|
+
strokeLinejoin: "round"
|
|
2171
|
+
}
|
|
2172
|
+
));
|
|
2173
|
+
};
|
|
2174
|
+
|
|
2175
|
+
// src/wallet-connect/index.tsx
|
|
2176
|
+
import { useAccount, useAppKit } from "@reown/appkit-react-native";
|
|
2177
|
+
import React32, { useEffect as useEffect4, useMemo, useState as useState2 } from "react";
|
|
2178
|
+
import { StyleSheet as StyleSheet14, Text as Text12, TouchableOpacity as TouchableOpacity4, View as View14, Image as Image2 } from "react-native";
|
|
2044
2179
|
|
|
2045
2180
|
// src/utils/uuid.ts
|
|
2046
2181
|
function generateUUID() {
|
|
@@ -2052,7 +2187,7 @@ function generateUUID() {
|
|
|
2052
2187
|
}
|
|
2053
2188
|
|
|
2054
2189
|
// src/wallet-connect/wallet-connect.tsx
|
|
2055
|
-
import
|
|
2190
|
+
import React31 from "react";
|
|
2056
2191
|
import { AppKit, AppKitProvider } from "@reown/appkit-react-native";
|
|
2057
2192
|
|
|
2058
2193
|
// src/wallet-connect/AppKitConfig.ts
|
|
@@ -2161,7 +2296,7 @@ var createAppKitInstance = (projectId) => {
|
|
|
2161
2296
|
// src/wallet-connect/wallet-connect.tsx
|
|
2162
2297
|
var WalletConnectWrapper = ({ children }) => {
|
|
2163
2298
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2164
|
-
const appKit =
|
|
2299
|
+
const appKit = React31.useMemo(() => {
|
|
2165
2300
|
if (!walletConnectProjectId) {
|
|
2166
2301
|
console.warn(
|
|
2167
2302
|
"walletConnectProjectId is missing in KryptosConnectProvider config"
|
|
@@ -2171,9 +2306,9 @@ var WalletConnectWrapper = ({ children }) => {
|
|
|
2171
2306
|
return createAppKitInstance(walletConnectProjectId);
|
|
2172
2307
|
}, [walletConnectProjectId]);
|
|
2173
2308
|
if (!appKit) {
|
|
2174
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, children);
|
|
2175
2310
|
}
|
|
2176
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React31.createElement(AppKitProvider, { instance: appKit }, /* @__PURE__ */ React31.createElement(AppKit, null), children);
|
|
2177
2312
|
};
|
|
2178
2313
|
var wallet_connect_default = WalletConnectWrapper;
|
|
2179
2314
|
|
|
@@ -2185,47 +2320,48 @@ var WalletConnectComponent = ({
|
|
|
2185
2320
|
handleClose,
|
|
2186
2321
|
modalOpen,
|
|
2187
2322
|
setAddIntegrationMode,
|
|
2188
|
-
providersList
|
|
2323
|
+
providersList,
|
|
2324
|
+
errorMessage
|
|
2189
2325
|
}) => {
|
|
2190
2326
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2191
2327
|
const theme = useTheme();
|
|
2192
2328
|
if (!walletConnectProjectId) {
|
|
2193
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose: handleClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, /* @__PURE__ */ React32.createElement(
|
|
2194
2330
|
TouchableOpacity4,
|
|
2195
2331
|
{
|
|
2196
2332
|
onPress: () => {
|
|
2197
2333
|
setAddIntegrationMode(null);
|
|
2198
2334
|
},
|
|
2199
|
-
style:
|
|
2335
|
+
style: styles14.backButton
|
|
2200
2336
|
},
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
), /* @__PURE__ */
|
|
2203
|
-
|
|
2337
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2338
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React32.createElement(ModalBody, { scrollable: true, style: styles14.contentContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.emptyState }, /* @__PURE__ */ React32.createElement(
|
|
2339
|
+
Text12,
|
|
2204
2340
|
{
|
|
2205
|
-
style: [
|
|
2341
|
+
style: [styles14.emptyStateTitle, { color: theme.colors.text }]
|
|
2206
2342
|
},
|
|
2207
2343
|
"WalletConnect is not configured"
|
|
2208
|
-
), /* @__PURE__ */
|
|
2209
|
-
|
|
2344
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2345
|
+
Text12,
|
|
2210
2346
|
{
|
|
2211
2347
|
style: [
|
|
2212
|
-
|
|
2348
|
+
styles14.infoText,
|
|
2213
2349
|
{ color: theme.colors.textSecondary, textAlign: "center" }
|
|
2214
2350
|
]
|
|
2215
2351
|
},
|
|
2216
2352
|
"Please add a walletConnectProjectId to KryptosConnectProvider to enable wallet connections."
|
|
2217
|
-
), /* @__PURE__ */
|
|
2353
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2218
2354
|
Button,
|
|
2219
2355
|
{
|
|
2220
2356
|
variant: "outline",
|
|
2221
2357
|
size: "sm",
|
|
2222
2358
|
onPress: () => setAddIntegrationMode(null),
|
|
2223
|
-
style:
|
|
2359
|
+
style: styles14.emptyStateButton
|
|
2224
2360
|
},
|
|
2225
2361
|
"Go back"
|
|
2226
2362
|
))));
|
|
2227
2363
|
}
|
|
2228
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ React32.createElement(wallet_connect_default, null, /* @__PURE__ */ React32.createElement(
|
|
2229
2365
|
ConnectButton,
|
|
2230
2366
|
{
|
|
2231
2367
|
integration,
|
|
@@ -2234,7 +2370,8 @@ var WalletConnectComponent = ({
|
|
|
2234
2370
|
handleClose,
|
|
2235
2371
|
modalOpen,
|
|
2236
2372
|
setAddIntegrationMode,
|
|
2237
|
-
providersList
|
|
2373
|
+
providersList,
|
|
2374
|
+
errorMessage
|
|
2238
2375
|
}
|
|
2239
2376
|
));
|
|
2240
2377
|
};
|
|
@@ -2244,28 +2381,35 @@ function ConnectButton({
|
|
|
2244
2381
|
handleClose,
|
|
2245
2382
|
modalOpen,
|
|
2246
2383
|
setAddIntegrationMode,
|
|
2247
|
-
providersList
|
|
2384
|
+
providersList,
|
|
2385
|
+
errorMessage: errorMessageProp
|
|
2248
2386
|
}) {
|
|
2249
2387
|
const theme = useTheme();
|
|
2250
2388
|
const { open, disconnect } = useAppKit();
|
|
2251
2389
|
const { address, isConnected } = useAccount();
|
|
2252
2390
|
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] =
|
|
2391
|
+
const [selectedChains, setSelectedChains] = useState2(/* @__PURE__ */ new Set());
|
|
2392
|
+
const [errorMessage, setErrorMessage] = useState2("");
|
|
2393
|
+
const [chainErrors, setChainErrors] = useState2({});
|
|
2394
|
+
const [isLoading, setIsLoading] = useState2(false);
|
|
2395
|
+
const [userUsedChains, setUserUsedChains] = useState2([]);
|
|
2396
|
+
const [isFetchingChains, setIsFetchingChains] = useState2(false);
|
|
2259
2397
|
const availableChains = useMemo(() => {
|
|
2260
2398
|
if (userUsedChains.length > 0) {
|
|
2261
2399
|
return userUsedChains;
|
|
2262
2400
|
}
|
|
2263
2401
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2264
|
-
return integration.walletSupportedChains
|
|
2402
|
+
return integration.walletSupportedChains.filter((supportedChain) => {
|
|
2403
|
+
const provider = providersList.find(
|
|
2404
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2405
|
+
(p) => p.id === supportedChain.id
|
|
2406
|
+
);
|
|
2407
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2408
|
+
});
|
|
2265
2409
|
}
|
|
2266
2410
|
return [];
|
|
2267
|
-
}, [userUsedChains, integration.walletSupportedChains]);
|
|
2268
|
-
|
|
2411
|
+
}, [userUsedChains, integration.walletSupportedChains, providersList]);
|
|
2412
|
+
useEffect4(() => {
|
|
2269
2413
|
if (!isConnected || !address || !address.trim()) {
|
|
2270
2414
|
setUserUsedChains([]);
|
|
2271
2415
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2284,7 +2428,16 @@ function ConnectButton({
|
|
|
2284
2428
|
}
|
|
2285
2429
|
}
|
|
2286
2430
|
if (chains.length === 0 && integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2287
|
-
chains = integration.walletSupportedChains
|
|
2431
|
+
chains = integration.walletSupportedChains.filter(
|
|
2432
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2433
|
+
(supportedChain) => {
|
|
2434
|
+
const provider = providersList.find(
|
|
2435
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2436
|
+
(p) => p.id === supportedChain.id
|
|
2437
|
+
);
|
|
2438
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2439
|
+
}
|
|
2440
|
+
);
|
|
2288
2441
|
}
|
|
2289
2442
|
if (chains.length > 0) {
|
|
2290
2443
|
setUserUsedChains(chains);
|
|
@@ -2296,11 +2449,21 @@ function ConnectButton({
|
|
|
2296
2449
|
} catch (error) {
|
|
2297
2450
|
console.error("Failed to fetch user chains:", error);
|
|
2298
2451
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2299
|
-
|
|
2452
|
+
const validChains = integration.walletSupportedChains.filter(
|
|
2453
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2454
|
+
(supportedChain) => {
|
|
2455
|
+
const provider = providersList.find(
|
|
2456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2457
|
+
(p) => p.id === supportedChain.id
|
|
2458
|
+
);
|
|
2459
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2460
|
+
}
|
|
2461
|
+
);
|
|
2462
|
+
setUserUsedChains(validChains);
|
|
2300
2463
|
setSelectedChains(
|
|
2301
2464
|
new Set(
|
|
2302
2465
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2303
|
-
|
|
2466
|
+
validChains.map((chain) => chain.id)
|
|
2304
2467
|
)
|
|
2305
2468
|
);
|
|
2306
2469
|
} else {
|
|
@@ -2320,7 +2483,8 @@ function ConnectButton({
|
|
|
2320
2483
|
address,
|
|
2321
2484
|
isConnected,
|
|
2322
2485
|
integration.isEvmWallet,
|
|
2323
|
-
integration.walletSupportedChains
|
|
2486
|
+
integration.walletSupportedChains,
|
|
2487
|
+
providersList
|
|
2324
2488
|
]);
|
|
2325
2489
|
const validateForm = () => {
|
|
2326
2490
|
if (!address) {
|
|
@@ -2347,7 +2511,7 @@ function ConnectButton({
|
|
|
2347
2511
|
const walletTestsPayload = chainsToProcess.map((chain) => {
|
|
2348
2512
|
const walletId = generateUUID();
|
|
2349
2513
|
const displaySuffix = address ? address?.length > 8 ? `${address.slice(0, 4)}...${address.slice(-4)}` : address : "";
|
|
2350
|
-
const alias = `${
|
|
2514
|
+
const alias = `${integration.public_name} (${displaySuffix})`;
|
|
2351
2515
|
const provider = providersList.find((p) => p.id === chain.id);
|
|
2352
2516
|
return {
|
|
2353
2517
|
chain,
|
|
@@ -2357,11 +2521,11 @@ function ConnectButton({
|
|
|
2357
2521
|
source: provider?.id,
|
|
2358
2522
|
credential: {
|
|
2359
2523
|
address,
|
|
2360
|
-
userId: user?.user_id || "
|
|
2524
|
+
userId: user?.user_id || "",
|
|
2361
2525
|
projectId: provider?.projectId,
|
|
2362
|
-
apiKey: "
|
|
2363
|
-
secret: "
|
|
2364
|
-
privateKey: "
|
|
2526
|
+
apiKey: "",
|
|
2527
|
+
secret: "",
|
|
2528
|
+
privateKey: "",
|
|
2365
2529
|
alias,
|
|
2366
2530
|
walletId,
|
|
2367
2531
|
exchange: provider?.id
|
|
@@ -2395,14 +2559,14 @@ function ConnectButton({
|
|
|
2395
2559
|
clientId,
|
|
2396
2560
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2397
2561
|
},
|
|
2398
|
-
metadata: {
|
|
2399
|
-
environment: "sandbox"
|
|
2400
|
-
},
|
|
2401
2562
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2402
|
-
default_chain:
|
|
2403
|
-
default_chain_logo:
|
|
2404
|
-
type: provider.type,
|
|
2405
|
-
isNftSupported: provider
|
|
2563
|
+
default_chain: integration?.id || "",
|
|
2564
|
+
default_chain_logo: integration?.logo || "",
|
|
2565
|
+
type: provider.type || "",
|
|
2566
|
+
isNftSupported: provider?.isEvmWallet || provider?.nftSupport || false,
|
|
2567
|
+
isCustomWallet: false,
|
|
2568
|
+
chainId: provider?.community_id,
|
|
2569
|
+
address: address?.trim()
|
|
2406
2570
|
};
|
|
2407
2571
|
integrationsToAdd.push(data);
|
|
2408
2572
|
} else {
|
|
@@ -2421,7 +2585,10 @@ function ConnectButton({
|
|
|
2421
2585
|
return;
|
|
2422
2586
|
}
|
|
2423
2587
|
if (integrationsToAdd.length > 0) {
|
|
2424
|
-
onAddHandle(integrationsToAdd);
|
|
2588
|
+
await onAddHandle(integrationsToAdd);
|
|
2589
|
+
if (isConnected) {
|
|
2590
|
+
disconnect();
|
|
2591
|
+
}
|
|
2425
2592
|
setChainErrors({});
|
|
2426
2593
|
setErrorMessage("");
|
|
2427
2594
|
} else {
|
|
@@ -2431,7 +2598,7 @@ function ConnectButton({
|
|
|
2431
2598
|
const err = error;
|
|
2432
2599
|
console.error(error);
|
|
2433
2600
|
setErrorMessage(
|
|
2434
|
-
err?.response?.data?.message || "Failed to add
|
|
2601
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to add integrations"
|
|
2435
2602
|
);
|
|
2436
2603
|
} finally {
|
|
2437
2604
|
setIsLoading(false);
|
|
@@ -2451,16 +2618,41 @@ function ConnectButton({
|
|
|
2451
2618
|
setChainErrors(newErrors);
|
|
2452
2619
|
}
|
|
2453
2620
|
};
|
|
2454
|
-
|
|
2621
|
+
const onClose = () => {
|
|
2622
|
+
if (isConnected) {
|
|
2623
|
+
disconnect();
|
|
2624
|
+
}
|
|
2625
|
+
handleClose();
|
|
2626
|
+
};
|
|
2627
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, /* @__PURE__ */ React32.createElement(
|
|
2455
2628
|
TouchableOpacity4,
|
|
2456
2629
|
{
|
|
2457
2630
|
onPress: () => {
|
|
2458
2631
|
setAddIntegrationMode(null);
|
|
2632
|
+
if (isConnected) {
|
|
2633
|
+
disconnect();
|
|
2634
|
+
}
|
|
2459
2635
|
},
|
|
2460
|
-
style:
|
|
2636
|
+
style: styles14.backButton
|
|
2637
|
+
},
|
|
2638
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2639
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React32.createElement(ModalBody, { scrollable: true, style: styles14.contentContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.header }, integration.logo ? isSvgUrl(integration.logo) ? /* @__PURE__ */ React32.createElement(RemoteSvg, { uri: integration.logo }) : /* @__PURE__ */ React32.createElement(
|
|
2640
|
+
Image2,
|
|
2641
|
+
{
|
|
2642
|
+
source: { uri: integration.logo },
|
|
2643
|
+
style: styles14.logo,
|
|
2644
|
+
resizeMode: "contain"
|
|
2645
|
+
}
|
|
2646
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2647
|
+
View14,
|
|
2648
|
+
{
|
|
2649
|
+
style: [
|
|
2650
|
+
styles14.logoPlaceholder,
|
|
2651
|
+
{ backgroundColor: theme.colors.surface }
|
|
2652
|
+
]
|
|
2461
2653
|
},
|
|
2462
|
-
/* @__PURE__ */
|
|
2463
|
-
), /* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ React32.createElement(Text12, { style: { color: theme.colors.text } }, integration.name?.charAt(0) || "?")
|
|
2655
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.name, { color: theme.colors.text }] }, integration.name)), !isConnected ? /* @__PURE__ */ React32.createElement(View14, null, /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.infoText, { color: theme.colors.text }] }, "Connect your wallet to continue"), /* @__PURE__ */ React32.createElement(
|
|
2464
2656
|
Button,
|
|
2465
2657
|
{
|
|
2466
2658
|
variant: "primary",
|
|
@@ -2468,111 +2660,132 @@ function ConnectButton({
|
|
|
2468
2660
|
onPress: () => open({ view: "Connect" })
|
|
2469
2661
|
},
|
|
2470
2662
|
"Connect Wallet"
|
|
2471
|
-
)) : /* @__PURE__ */
|
|
2472
|
-
|
|
2663
|
+
)) : /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedHeader }, /* @__PURE__ */ React32.createElement(
|
|
2664
|
+
Text12,
|
|
2473
2665
|
{
|
|
2474
|
-
style: [
|
|
2666
|
+
style: [styles14.connectedTitle, { color: theme.colors.text }]
|
|
2475
2667
|
},
|
|
2476
2668
|
"Wallet Connected"
|
|
2477
|
-
), /* @__PURE__ */
|
|
2478
|
-
|
|
2669
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2670
|
+
Text12,
|
|
2479
2671
|
{
|
|
2480
|
-
style: [
|
|
2672
|
+
style: [styles14.connectedText, { color: theme.colors.text }]
|
|
2481
2673
|
},
|
|
2482
2674
|
"Address: ",
|
|
2483
2675
|
address
|
|
2484
|
-
), /* @__PURE__ */
|
|
2485
|
-
|
|
2676
|
+
), /* @__PURE__ */ React32.createElement(Button, { variant: "ghost", size: "sm", onPress: () => disconnect() }, "Disconnect Wallet"), isFetchingChains ? /* @__PURE__ */ React32.createElement(
|
|
2677
|
+
Text12,
|
|
2486
2678
|
{
|
|
2487
|
-
style: [
|
|
2679
|
+
style: [styles14.fetchingText, { color: theme.colors.text }]
|
|
2488
2680
|
},
|
|
2489
2681
|
"Fetching chains..."
|
|
2490
|
-
) : null), availableChains.length > 0 && address && /* @__PURE__ */
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2503
|
-
TouchableOpacity4,
|
|
2682
|
+
) : null), availableChains.length > 0 && address && /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainListWrapper }, /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"), /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainListContent }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainChips }, availableChains.map((chain) => {
|
|
2683
|
+
const isSelected = selectedChains.has(chain.id);
|
|
2684
|
+
const hasError = chainErrors[chain.id];
|
|
2685
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2686
|
+
TouchableOpacity4,
|
|
2687
|
+
{
|
|
2688
|
+
onPress: () => toggleChainSelection(chain.id),
|
|
2689
|
+
style: styles14.chainButton,
|
|
2690
|
+
key: chain.id
|
|
2691
|
+
},
|
|
2692
|
+
/* @__PURE__ */ React32.createElement(
|
|
2693
|
+
View14,
|
|
2504
2694
|
{
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2695
|
+
style: [
|
|
2696
|
+
styles14.chainChip,
|
|
2697
|
+
{
|
|
2698
|
+
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
2699
|
+
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2700
|
+
}
|
|
2701
|
+
]
|
|
2508
2702
|
},
|
|
2509
|
-
/* @__PURE__ */
|
|
2510
|
-
|
|
2703
|
+
/* @__PURE__ */ React32.createElement(
|
|
2704
|
+
Text12,
|
|
2511
2705
|
{
|
|
2512
2706
|
style: [
|
|
2513
|
-
|
|
2707
|
+
styles14.chainName,
|
|
2514
2708
|
{
|
|
2515
|
-
|
|
2516
|
-
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2709
|
+
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
2517
2710
|
}
|
|
2518
2711
|
]
|
|
2519
2712
|
},
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
{
|
|
2535
|
-
size: 12,
|
|
2536
|
-
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2537
|
-
}
|
|
2538
|
-
) : /* @__PURE__ */ React29.createElement(
|
|
2539
|
-
PlusIcon,
|
|
2540
|
-
{
|
|
2541
|
-
size: 12,
|
|
2542
|
-
color: theme.colors.textSecondary
|
|
2543
|
-
}
|
|
2544
|
-
)
|
|
2713
|
+
chain.name || chain?.id
|
|
2714
|
+
),
|
|
2715
|
+
isSelected ? /* @__PURE__ */ React32.createElement(
|
|
2716
|
+
CloseIcon,
|
|
2717
|
+
{
|
|
2718
|
+
size: 12,
|
|
2719
|
+
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2720
|
+
}
|
|
2721
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2722
|
+
PlusIcon,
|
|
2723
|
+
{
|
|
2724
|
+
size: 12,
|
|
2725
|
+
color: theme.colors.textSecondary
|
|
2726
|
+
}
|
|
2545
2727
|
)
|
|
2546
|
-
)
|
|
2547
|
-
|
|
2548
|
-
|
|
2728
|
+
)
|
|
2729
|
+
);
|
|
2730
|
+
})), selectedChains.size > 0 && availableChains.length > 0 && /* @__PURE__ */ React32.createElement(
|
|
2731
|
+
TouchableOpacity4,
|
|
2732
|
+
{
|
|
2733
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
2734
|
+
style: styles14.chainButton,
|
|
2735
|
+
activeOpacity: 0.7
|
|
2736
|
+
},
|
|
2737
|
+
/* @__PURE__ */ React32.createElement(
|
|
2738
|
+
View14,
|
|
2549
2739
|
{
|
|
2550
2740
|
style: [
|
|
2551
|
-
|
|
2552
|
-
|
|
2741
|
+
styles14.chainChip,
|
|
2742
|
+
styles14.chainChipRemoveAll,
|
|
2743
|
+
{
|
|
2744
|
+
borderWidth: 0,
|
|
2745
|
+
backgroundColor: "transparent"
|
|
2746
|
+
}
|
|
2553
2747
|
]
|
|
2554
2748
|
},
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
const chain = availableChains.find(
|
|
2558
|
-
(c) => c.id === chainId
|
|
2559
|
-
);
|
|
2560
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2561
|
-
Text11,
|
|
2749
|
+
/* @__PURE__ */ React32.createElement(
|
|
2750
|
+
Text12,
|
|
2562
2751
|
{
|
|
2563
|
-
key: chainId,
|
|
2564
2752
|
style: [
|
|
2565
|
-
|
|
2566
|
-
{ color: theme.colors.
|
|
2753
|
+
styles14.chainName,
|
|
2754
|
+
{ color: theme.colors.primary }
|
|
2567
2755
|
]
|
|
2568
2756
|
},
|
|
2569
|
-
"
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2757
|
+
"Remove All Chains"
|
|
2758
|
+
),
|
|
2759
|
+
/* @__PURE__ */ React32.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
2760
|
+
)
|
|
2761
|
+
), Object.keys(chainErrors || {}).length > 0 && /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainErrorsContainer }, /* @__PURE__ */ React32.createElement(
|
|
2762
|
+
Text12,
|
|
2763
|
+
{
|
|
2764
|
+
style: [
|
|
2765
|
+
styles14.chainErrorsTitle,
|
|
2766
|
+
{ color: theme.colors.error }
|
|
2767
|
+
]
|
|
2768
|
+
},
|
|
2769
|
+
"Errors:"
|
|
2770
|
+
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
2771
|
+
const chain = availableChains.find(
|
|
2772
|
+
(c) => c.id === chainId
|
|
2773
|
+
);
|
|
2774
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2775
|
+
Text12,
|
|
2776
|
+
{
|
|
2777
|
+
key: chainId,
|
|
2778
|
+
style: [
|
|
2779
|
+
styles14.chainErrorItem,
|
|
2780
|
+
{ color: theme.colors.error }
|
|
2781
|
+
]
|
|
2782
|
+
},
|
|
2783
|
+
"\u2022 ",
|
|
2784
|
+
chain?.name ?? chainId,
|
|
2785
|
+
": ",
|
|
2786
|
+
String(error)
|
|
2787
|
+
);
|
|
2788
|
+
})))), errorMessage || errorMessageProp ? /* @__PURE__ */ React32.createElement(View14, { style: styles14.errorMessageContainer }, /* @__PURE__ */ React32.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React32.createElement(AlertDescription, null, errorMessage || errorMessageProp))) : null)), /* @__PURE__ */ React32.createElement(ModalFooter, { style: { paddingVertical: 8 } }, availableChains.length > 0 && address && /* @__PURE__ */ React32.createElement(
|
|
2576
2789
|
Button,
|
|
2577
2790
|
{
|
|
2578
2791
|
variant: "outline",
|
|
@@ -2580,14 +2793,20 @@ function ConnectButton({
|
|
|
2580
2793
|
onPress: onSubmitWalletConnect,
|
|
2581
2794
|
loading: isLoading,
|
|
2582
2795
|
disabled: isLoading || !!address && availableChains.length > 0 && selectedChains.size === 0,
|
|
2583
|
-
style:
|
|
2796
|
+
style: styles14.button
|
|
2584
2797
|
},
|
|
2585
2798
|
selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size > 1 ? "s" : ""}` : "Add Integration"
|
|
2586
|
-
), /* @__PURE__ */
|
|
2799
|
+
), /* @__PURE__ */ React32.createElement(Footer, null)));
|
|
2587
2800
|
}
|
|
2588
|
-
var
|
|
2801
|
+
var styles14 = StyleSheet14.create({
|
|
2589
2802
|
connectedContainer: {
|
|
2590
|
-
|
|
2803
|
+
flexShrink: 0
|
|
2804
|
+
},
|
|
2805
|
+
chainListWrapper: {
|
|
2806
|
+
marginTop: 8
|
|
2807
|
+
},
|
|
2808
|
+
chainListContent: {
|
|
2809
|
+
paddingBottom: 8
|
|
2591
2810
|
},
|
|
2592
2811
|
connectedHeader: {
|
|
2593
2812
|
marginBottom: 8
|
|
@@ -2601,13 +2820,6 @@ var styles13 = StyleSheet13.create({
|
|
|
2601
2820
|
marginBottom: 8,
|
|
2602
2821
|
textAlign: "center"
|
|
2603
2822
|
},
|
|
2604
|
-
scrollView: {
|
|
2605
|
-
flex: 1
|
|
2606
|
-
},
|
|
2607
|
-
scrollViewContent: {
|
|
2608
|
-
paddingBottom: 40,
|
|
2609
|
-
flexGrow: 1
|
|
2610
|
-
},
|
|
2611
2823
|
errorMessageContainer: {
|
|
2612
2824
|
marginTop: 16
|
|
2613
2825
|
},
|
|
@@ -2631,10 +2843,8 @@ var styles13 = StyleSheet13.create({
|
|
|
2631
2843
|
// theme.spacing.xl
|
|
2632
2844
|
paddingBottom: 20,
|
|
2633
2845
|
width: "100%",
|
|
2634
|
-
overflow: "hidden",
|
|
2635
2846
|
alignSelf: "center",
|
|
2636
|
-
flexDirection: "column"
|
|
2637
|
-
flex: 1
|
|
2847
|
+
flexDirection: "column"
|
|
2638
2848
|
},
|
|
2639
2849
|
chainTitle: {
|
|
2640
2850
|
fontSize: 14,
|
|
@@ -2660,89 +2870,399 @@ var styles13 = StyleSheet13.create({
|
|
|
2660
2870
|
// theme.borderRadius.md
|
|
2661
2871
|
borderWidth: 1
|
|
2662
2872
|
},
|
|
2873
|
+
chainChipRemoveAll: {
|
|
2874
|
+
marginTop: 6,
|
|
2875
|
+
// theme.spacing.sm - separate from chain list
|
|
2876
|
+
width: "auto"
|
|
2877
|
+
},
|
|
2663
2878
|
chainName: {
|
|
2664
2879
|
fontSize: 12,
|
|
2665
2880
|
fontWeight: "500",
|
|
2666
2881
|
marginRight: 6
|
|
2667
2882
|
// theme.spacing.xs
|
|
2668
2883
|
},
|
|
2669
|
-
chainButton: {
|
|
2670
|
-
padding: 2
|
|
2671
|
-
// theme.spacing.xs
|
|
2884
|
+
chainButton: {
|
|
2885
|
+
padding: 2
|
|
2886
|
+
// theme.spacing.xs
|
|
2887
|
+
},
|
|
2888
|
+
chainErrorsContainer: {
|
|
2889
|
+
marginTop: 12
|
|
2890
|
+
// theme.spacing.md - consistent spacing
|
|
2891
|
+
},
|
|
2892
|
+
chainErrorsTitle: {
|
|
2893
|
+
fontSize: 13,
|
|
2894
|
+
fontWeight: "500",
|
|
2895
|
+
marginBottom: 4
|
|
2896
|
+
// theme.spacing.xs
|
|
2897
|
+
},
|
|
2898
|
+
chainErrorItem: {
|
|
2899
|
+
fontSize: 12,
|
|
2900
|
+
// theme.fontSize.sm
|
|
2901
|
+
marginBottom: 4
|
|
2902
|
+
// theme.spacing.xs
|
|
2903
|
+
},
|
|
2904
|
+
button: {
|
|
2905
|
+
width: "100%"
|
|
2906
|
+
},
|
|
2907
|
+
emptyState: {
|
|
2908
|
+
flex: 1,
|
|
2909
|
+
alignItems: "center",
|
|
2910
|
+
justifyContent: "center",
|
|
2911
|
+
gap: 12
|
|
2912
|
+
},
|
|
2913
|
+
emptyStateTitle: {
|
|
2914
|
+
fontSize: 18,
|
|
2915
|
+
fontWeight: "600"
|
|
2916
|
+
},
|
|
2917
|
+
emptyStateButton: {
|
|
2918
|
+
marginTop: 8
|
|
2919
|
+
},
|
|
2920
|
+
header: {
|
|
2921
|
+
flexDirection: "row",
|
|
2922
|
+
justifyContent: "center",
|
|
2923
|
+
alignItems: "center",
|
|
2924
|
+
marginBottom: 16
|
|
2925
|
+
// theme.spacing.lg
|
|
2926
|
+
},
|
|
2927
|
+
logo: {
|
|
2928
|
+
width: 32,
|
|
2929
|
+
height: 32,
|
|
2930
|
+
borderRadius: 8
|
|
2931
|
+
// theme.borderRadius.sm
|
|
2932
|
+
},
|
|
2933
|
+
logoPlaceholder: {
|
|
2934
|
+
width: 32,
|
|
2935
|
+
height: 32,
|
|
2936
|
+
borderRadius: 8,
|
|
2937
|
+
// theme.borderRadius.sm
|
|
2938
|
+
alignItems: "center",
|
|
2939
|
+
justifyContent: "center"
|
|
2940
|
+
},
|
|
2941
|
+
name: {
|
|
2942
|
+
fontSize: 16,
|
|
2943
|
+
// theme.fontSize.lg
|
|
2944
|
+
fontWeight: "600",
|
|
2945
|
+
marginLeft: 12,
|
|
2946
|
+
// theme.spacing.md
|
|
2947
|
+
textTransform: "capitalize"
|
|
2948
|
+
}
|
|
2949
|
+
});
|
|
2950
|
+
|
|
2951
|
+
// src/molecules/IntegrationForm.tsx
|
|
2952
|
+
import React34 from "react";
|
|
2953
|
+
import { Image as Image3, StyleSheet as StyleSheet16, Text as Text14, TouchableOpacity as TouchableOpacity6, View as View16 } from "react-native";
|
|
2954
|
+
|
|
2955
|
+
// src/molecules/IntegrationInfo.tsx
|
|
2956
|
+
import React33, { useMemo as useMemo2, useState as useState3 } from "react";
|
|
2957
|
+
import {
|
|
2958
|
+
Linking as Linking3,
|
|
2959
|
+
StyleSheet as StyleSheet15,
|
|
2960
|
+
Text as Text13,
|
|
2961
|
+
TouchableOpacity as TouchableOpacity5,
|
|
2962
|
+
View as View15
|
|
2963
|
+
} from "react-native";
|
|
2964
|
+
var ChevronDown = ({ isOpen, color }) => /* @__PURE__ */ React33.createElement(Text13, { style: [styles15.chevron, { color }] }, isOpen ? "\u25BC" : "\u25B6");
|
|
2965
|
+
var IntegrationInfo = ({
|
|
2966
|
+
content,
|
|
2967
|
+
type,
|
|
2968
|
+
import_guide
|
|
2969
|
+
}) => {
|
|
2970
|
+
const theme = useTheme();
|
|
2971
|
+
const instructionsData = useMemo2(
|
|
2972
|
+
() => content?.instructions?.[type] || null,
|
|
2973
|
+
[content, type]
|
|
2974
|
+
);
|
|
2975
|
+
const featuresData = useMemo2(
|
|
2976
|
+
() => content?.features?.[type] || [],
|
|
2977
|
+
[content, type]
|
|
2978
|
+
);
|
|
2979
|
+
const gtkData = useMemo2(() => content?.gtk?.[type] || [], [content, type]);
|
|
2980
|
+
const hasInstructions = instructionsData && (instructionsData?.content?.length ?? 0) > 0;
|
|
2981
|
+
const hasFeatures = (featuresData?.length ?? 0) > 0;
|
|
2982
|
+
const hasGtk = (gtkData?.length ?? 0) > 0;
|
|
2983
|
+
const defaultSection = hasInstructions ? "instructions" : hasGtk ? "good-to-know" : hasFeatures ? "supported-features" : null;
|
|
2984
|
+
const [openSection, setOpenSection] = useState3(defaultSection);
|
|
2985
|
+
const toggleSection = (value) => {
|
|
2986
|
+
setOpenSection((prev) => prev === value ? null : value);
|
|
2987
|
+
};
|
|
2988
|
+
const handleImportGuidePress = () => {
|
|
2989
|
+
if (import_guide) Linking3.openURL(import_guide);
|
|
2990
|
+
};
|
|
2991
|
+
if (!hasInstructions && !hasFeatures && !hasGtk && !import_guide) {
|
|
2992
|
+
return null;
|
|
2993
|
+
}
|
|
2994
|
+
return /* @__PURE__ */ React33.createElement(View15, { style: styles15.container }, import_guide && /* @__PURE__ */ React33.createElement(
|
|
2995
|
+
TouchableOpacity5,
|
|
2996
|
+
{
|
|
2997
|
+
onPress: handleImportGuidePress,
|
|
2998
|
+
style: [styles15.importGuide, { borderColor: theme.colors.primary }],
|
|
2999
|
+
activeOpacity: 0.7
|
|
3000
|
+
},
|
|
3001
|
+
/* @__PURE__ */ React33.createElement(
|
|
3002
|
+
Text13,
|
|
3003
|
+
{
|
|
3004
|
+
style: [styles15.importGuideText, { color: theme.colors.primary }]
|
|
3005
|
+
},
|
|
3006
|
+
"Import Guide"
|
|
3007
|
+
),
|
|
3008
|
+
/* @__PURE__ */ React33.createElement(RedirectIcon, { width: 14, height: 14, color: theme.colors.primary })
|
|
3009
|
+
), hasInstructions && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3010
|
+
TouchableOpacity5,
|
|
3011
|
+
{
|
|
3012
|
+
onPress: () => toggleSection("instructions"),
|
|
3013
|
+
style: [
|
|
3014
|
+
styles15.trigger,
|
|
3015
|
+
{
|
|
3016
|
+
borderBottomColor: theme.colors.border,
|
|
3017
|
+
backgroundColor: theme.colors.surface
|
|
3018
|
+
}
|
|
3019
|
+
],
|
|
3020
|
+
activeOpacity: 0.7
|
|
3021
|
+
},
|
|
3022
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Instructions"),
|
|
3023
|
+
/* @__PURE__ */ React33.createElement(
|
|
3024
|
+
ChevronDown,
|
|
3025
|
+
{
|
|
3026
|
+
isOpen: openSection === "instructions",
|
|
3027
|
+
color: theme.colors.textSecondary
|
|
3028
|
+
}
|
|
3029
|
+
)
|
|
3030
|
+
), openSection === "instructions" && /* @__PURE__ */ React33.createElement(
|
|
3031
|
+
View15,
|
|
3032
|
+
{
|
|
3033
|
+
style: [
|
|
3034
|
+
styles15.content,
|
|
3035
|
+
{
|
|
3036
|
+
backgroundColor: theme.colors.background,
|
|
3037
|
+
borderBottomColor: theme.colors.border
|
|
3038
|
+
}
|
|
3039
|
+
]
|
|
3040
|
+
},
|
|
3041
|
+
instructionsData?.content && /* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, instructionsData.content.map(
|
|
3042
|
+
(step, index) => /* @__PURE__ */ React33.createElement(
|
|
3043
|
+
Text13,
|
|
3044
|
+
{
|
|
3045
|
+
key: index,
|
|
3046
|
+
style: [
|
|
3047
|
+
styles15.listItem,
|
|
3048
|
+
styles15.orderedItem,
|
|
3049
|
+
{ color: theme.colors.textSecondary }
|
|
3050
|
+
]
|
|
3051
|
+
},
|
|
3052
|
+
index + 1,
|
|
3053
|
+
". ",
|
|
3054
|
+
step
|
|
3055
|
+
)
|
|
3056
|
+
)),
|
|
3057
|
+
instructionsData?.videoLink && /* @__PURE__ */ React33.createElement(
|
|
3058
|
+
TouchableOpacity5,
|
|
3059
|
+
{
|
|
3060
|
+
onPress: () => Linking3.openURL(instructionsData.videoLink),
|
|
3061
|
+
style: styles15.videoLink,
|
|
3062
|
+
activeOpacity: 0.7
|
|
3063
|
+
},
|
|
3064
|
+
/* @__PURE__ */ React33.createElement(
|
|
3065
|
+
Text13,
|
|
3066
|
+
{
|
|
3067
|
+
style: [
|
|
3068
|
+
styles15.videoLinkText,
|
|
3069
|
+
{ color: theme.colors.primary }
|
|
3070
|
+
]
|
|
3071
|
+
},
|
|
3072
|
+
"\u25B6 Watch Video Tutorial"
|
|
3073
|
+
)
|
|
3074
|
+
)
|
|
3075
|
+
)), hasGtk && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3076
|
+
TouchableOpacity5,
|
|
3077
|
+
{
|
|
3078
|
+
onPress: () => toggleSection("good-to-know"),
|
|
3079
|
+
style: [
|
|
3080
|
+
styles15.trigger,
|
|
3081
|
+
{
|
|
3082
|
+
borderBottomColor: theme.colors.border,
|
|
3083
|
+
backgroundColor: theme.colors.surface
|
|
3084
|
+
}
|
|
3085
|
+
],
|
|
3086
|
+
activeOpacity: 0.7
|
|
3087
|
+
},
|
|
3088
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Good to know"),
|
|
3089
|
+
/* @__PURE__ */ React33.createElement(
|
|
3090
|
+
ChevronDown,
|
|
3091
|
+
{
|
|
3092
|
+
isOpen: openSection === "good-to-know",
|
|
3093
|
+
color: theme.colors.textSecondary
|
|
3094
|
+
}
|
|
3095
|
+
)
|
|
3096
|
+
), openSection === "good-to-know" && /* @__PURE__ */ React33.createElement(
|
|
3097
|
+
View15,
|
|
3098
|
+
{
|
|
3099
|
+
style: [
|
|
3100
|
+
styles15.content,
|
|
3101
|
+
{
|
|
3102
|
+
backgroundColor: theme.colors.background,
|
|
3103
|
+
borderBottomColor: theme.colors.border
|
|
3104
|
+
}
|
|
3105
|
+
]
|
|
3106
|
+
},
|
|
3107
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, gtkData.map((item, index) => /* @__PURE__ */ React33.createElement(
|
|
3108
|
+
Text13,
|
|
3109
|
+
{
|
|
3110
|
+
key: index,
|
|
3111
|
+
style: [
|
|
3112
|
+
styles15.listItem,
|
|
3113
|
+
styles15.bulletItem,
|
|
3114
|
+
{ color: theme.colors.textSecondary }
|
|
3115
|
+
]
|
|
3116
|
+
},
|
|
3117
|
+
"\u2022 ",
|
|
3118
|
+
item
|
|
3119
|
+
)))
|
|
3120
|
+
)), hasFeatures && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3121
|
+
TouchableOpacity5,
|
|
3122
|
+
{
|
|
3123
|
+
onPress: () => toggleSection("supported-features"),
|
|
3124
|
+
style: [
|
|
3125
|
+
styles15.trigger,
|
|
3126
|
+
{
|
|
3127
|
+
borderBottomColor: theme.colors.border,
|
|
3128
|
+
backgroundColor: theme.colors.surface
|
|
3129
|
+
}
|
|
3130
|
+
],
|
|
3131
|
+
activeOpacity: 0.7
|
|
3132
|
+
},
|
|
3133
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Supported Features"),
|
|
3134
|
+
/* @__PURE__ */ React33.createElement(
|
|
3135
|
+
ChevronDown,
|
|
3136
|
+
{
|
|
3137
|
+
isOpen: openSection === "supported-features",
|
|
3138
|
+
color: theme.colors.textSecondary
|
|
3139
|
+
}
|
|
3140
|
+
)
|
|
3141
|
+
), openSection === "supported-features" && /* @__PURE__ */ React33.createElement(
|
|
3142
|
+
View15,
|
|
3143
|
+
{
|
|
3144
|
+
style: [
|
|
3145
|
+
styles15.content,
|
|
3146
|
+
{
|
|
3147
|
+
backgroundColor: theme.colors.background,
|
|
3148
|
+
borderBottomColor: theme.colors.border
|
|
3149
|
+
}
|
|
3150
|
+
]
|
|
3151
|
+
},
|
|
3152
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, featuresData.map((feature, index) => /* @__PURE__ */ React33.createElement(
|
|
3153
|
+
Text13,
|
|
3154
|
+
{
|
|
3155
|
+
key: index,
|
|
3156
|
+
style: [
|
|
3157
|
+
styles15.listItem,
|
|
3158
|
+
styles15.bulletItem,
|
|
3159
|
+
{ color: theme.colors.textSecondary }
|
|
3160
|
+
]
|
|
3161
|
+
},
|
|
3162
|
+
"\u2022 ",
|
|
3163
|
+
feature
|
|
3164
|
+
)))
|
|
3165
|
+
)));
|
|
3166
|
+
};
|
|
3167
|
+
var styles15 = StyleSheet15.create({
|
|
3168
|
+
container: {
|
|
3169
|
+
marginTop: 8
|
|
3170
|
+
},
|
|
3171
|
+
importGuide: {
|
|
3172
|
+
flexDirection: "row",
|
|
3173
|
+
alignItems: "center",
|
|
3174
|
+
alignSelf: "flex-end",
|
|
3175
|
+
gap: 4,
|
|
3176
|
+
paddingVertical: 6,
|
|
3177
|
+
paddingHorizontal: 8,
|
|
3178
|
+
marginBottom: 8
|
|
3179
|
+
},
|
|
3180
|
+
importGuideText: {
|
|
3181
|
+
fontSize: 14,
|
|
3182
|
+
fontWeight: "500"
|
|
3183
|
+
},
|
|
3184
|
+
accordionItem: {
|
|
3185
|
+
marginBottom: 4,
|
|
3186
|
+
borderRadius: 8,
|
|
3187
|
+
overflow: "hidden"
|
|
3188
|
+
},
|
|
3189
|
+
trigger: {
|
|
3190
|
+
flexDirection: "row",
|
|
3191
|
+
alignItems: "center",
|
|
3192
|
+
justifyContent: "space-between",
|
|
3193
|
+
paddingVertical: 12,
|
|
3194
|
+
paddingHorizontal: 16,
|
|
3195
|
+
borderBottomWidth: 1
|
|
3196
|
+
},
|
|
3197
|
+
triggerText: {
|
|
3198
|
+
fontSize: 14,
|
|
3199
|
+
fontWeight: "600"
|
|
2672
3200
|
},
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
// theme.spacing.md - consistent spacing
|
|
3201
|
+
chevron: {
|
|
3202
|
+
fontSize: 12
|
|
2676
3203
|
},
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
// theme.spacing.xs
|
|
3204
|
+
content: {
|
|
3205
|
+
paddingVertical: 12,
|
|
3206
|
+
paddingHorizontal: 16,
|
|
3207
|
+
borderBottomWidth: 1
|
|
2682
3208
|
},
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
// theme.fontSize.sm
|
|
2686
|
-
marginBottom: 4
|
|
2687
|
-
// theme.spacing.xs
|
|
3209
|
+
list: {
|
|
3210
|
+
paddingLeft: 4
|
|
2688
3211
|
},
|
|
2689
|
-
|
|
2690
|
-
|
|
3212
|
+
listItem: {
|
|
3213
|
+
fontSize: 13,
|
|
3214
|
+
lineHeight: 20,
|
|
3215
|
+
marginBottom: 6
|
|
2691
3216
|
},
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
alignItems: "center",
|
|
2695
|
-
justifyContent: "center",
|
|
2696
|
-
gap: 12
|
|
3217
|
+
orderedItem: {
|
|
3218
|
+
marginLeft: 0
|
|
2697
3219
|
},
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
fontWeight: "600"
|
|
3220
|
+
bulletItem: {
|
|
3221
|
+
marginLeft: 0
|
|
2701
3222
|
},
|
|
2702
|
-
|
|
2703
|
-
marginTop: 8
|
|
3223
|
+
videoLink: {
|
|
3224
|
+
marginTop: 8,
|
|
3225
|
+
paddingVertical: 8,
|
|
3226
|
+
paddingHorizontal: 12
|
|
3227
|
+
},
|
|
3228
|
+
videoLinkText: {
|
|
3229
|
+
fontSize: 13,
|
|
3230
|
+
fontWeight: "500"
|
|
2704
3231
|
}
|
|
2705
3232
|
});
|
|
2706
3233
|
|
|
2707
3234
|
// src/molecules/IntegrationForm.tsx
|
|
2708
|
-
import React30 from "react";
|
|
2709
|
-
import {
|
|
2710
|
-
Image as Image2,
|
|
2711
|
-
ScrollView as ScrollView3,
|
|
2712
|
-
StyleSheet as StyleSheet14,
|
|
2713
|
-
Text as Text12,
|
|
2714
|
-
TouchableOpacity as TouchableOpacity5,
|
|
2715
|
-
View as View14
|
|
2716
|
-
} from "react-native";
|
|
2717
3235
|
var IntegrationForm = ({
|
|
2718
3236
|
metadata,
|
|
2719
3237
|
onAddHandle,
|
|
2720
3238
|
open,
|
|
2721
3239
|
setAddIntegrationMode,
|
|
2722
3240
|
handleClose,
|
|
2723
|
-
providersList
|
|
3241
|
+
providersList,
|
|
3242
|
+
errorMessage: errorMessageProp,
|
|
3243
|
+
showBackButton = true
|
|
2724
3244
|
}) => {
|
|
2725
3245
|
const { clientId, linkToken, user } = useKryptosConnect();
|
|
2726
3246
|
const theme = useTheme();
|
|
2727
|
-
const [isLoading, setIsLoading] =
|
|
2728
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
2729
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2730
|
-
const [selectedChains, setSelectedChains] =
|
|
3247
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
3248
|
+
const [isFetchingChains, setIsFetchingChains] = React34.useState(false);
|
|
3249
|
+
const [userUsedChains, setUserUsedChains] = React34.useState([]);
|
|
3250
|
+
const [selectedChains, setSelectedChains] = React34.useState(
|
|
2731
3251
|
/* @__PURE__ */ new Set()
|
|
2732
3252
|
);
|
|
2733
|
-
const [chainErrors, setChainErrors] =
|
|
3253
|
+
const [chainErrors, setChainErrors] = React34.useState(
|
|
2734
3254
|
{}
|
|
2735
3255
|
);
|
|
2736
|
-
const [errorMessage, setErrorMessage] =
|
|
2737
|
-
const [formValues, setFormValues] =
|
|
3256
|
+
const [errorMessage, setErrorMessage] = React34.useState("");
|
|
3257
|
+
const [formValues, setFormValues] = React34.useState({
|
|
2738
3258
|
address: "",
|
|
2739
3259
|
account_name: "",
|
|
2740
3260
|
api_key: "",
|
|
2741
3261
|
secret_key: "",
|
|
2742
3262
|
password: ""
|
|
2743
3263
|
});
|
|
2744
|
-
const [formErrors, setFormErrors] =
|
|
2745
|
-
|
|
3264
|
+
const [formErrors, setFormErrors] = React34.useState({});
|
|
3265
|
+
React34.useEffect(() => {
|
|
2746
3266
|
if (!formValues.address || !formValues.address.trim()) {
|
|
2747
3267
|
setUserUsedChains([]);
|
|
2748
3268
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2825,18 +3345,18 @@ var IntegrationForm = ({
|
|
|
2825
3345
|
const credentialTestsData = chainsToProcess.map((chain) => {
|
|
2826
3346
|
const walletId = generateUUID();
|
|
2827
3347
|
const displaySuffix = primaryField.length >= 8 ? `${primaryField.slice(0, 4)}...${primaryField.slice(-4)}` : primaryField;
|
|
2828
|
-
const alias = `${metadata.id} - ${chain
|
|
3348
|
+
const alias = `${metadata.id} - ${chain?.name || ""} (${displaySuffix})`;
|
|
2829
3349
|
const credential = {
|
|
2830
3350
|
source: metadata.id,
|
|
2831
3351
|
credential: {
|
|
2832
|
-
apiKey: formValues.api_key?.trim() || "
|
|
2833
|
-
secret: formValues.secret_key?.trim() || "
|
|
2834
|
-
accountName: formValues.account_name?.trim() || "
|
|
2835
|
-
address: formValues.address?.trim() || "
|
|
2836
|
-
password: formValues.password?.trim() || "
|
|
2837
|
-
userId: user?.user_id || "
|
|
2838
|
-
projectId: metadata?.projectId || "
|
|
2839
|
-
privateKey: "
|
|
3352
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3353
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3354
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3355
|
+
address: formValues.address?.trim() || "",
|
|
3356
|
+
password: formValues.password?.trim() || "",
|
|
3357
|
+
userId: user?.user_id || "",
|
|
3358
|
+
projectId: metadata?.projectId || "",
|
|
3359
|
+
privateKey: "",
|
|
2840
3360
|
alias,
|
|
2841
3361
|
walletId,
|
|
2842
3362
|
exchange: metadata.id
|
|
@@ -2868,16 +3388,14 @@ var IntegrationForm = ({
|
|
|
2868
3388
|
clientId,
|
|
2869
3389
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2870
3390
|
},
|
|
2871
|
-
metadata: {
|
|
2872
|
-
environment: "sandbox"
|
|
2873
|
-
},
|
|
2874
3391
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2875
3392
|
default_chain: chain.name,
|
|
2876
|
-
default_chain_logo:
|
|
3393
|
+
default_chain_logo: "",
|
|
2877
3394
|
type: metadata.type,
|
|
2878
3395
|
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
2879
3396
|
chainId: chain?.community_id || "",
|
|
2880
|
-
address: formValues.address
|
|
3397
|
+
address: formValues.address,
|
|
3398
|
+
isCustomWallet: false
|
|
2881
3399
|
};
|
|
2882
3400
|
if (formValues.account_name)
|
|
2883
3401
|
data.accountName = formValues.account_name;
|
|
@@ -2887,10 +3405,9 @@ var IntegrationForm = ({
|
|
|
2887
3405
|
integrationsToAdd.push(data);
|
|
2888
3406
|
} else {
|
|
2889
3407
|
if (result.status === "rejected") {
|
|
2890
|
-
|
|
2891
|
-
errors[chain.id] = reason?.response?.data?.message || "Failed to process chain";
|
|
3408
|
+
errors[chain.id] = result.reason?.response?.data?.message || "Failed to process chain";
|
|
2892
3409
|
} else if (result.status === "fulfilled") {
|
|
2893
|
-
errors[chain.id] = result.value?.
|
|
3410
|
+
errors[chain.id] = result.value?.message || "Failed to verify chain";
|
|
2894
3411
|
}
|
|
2895
3412
|
}
|
|
2896
3413
|
});
|
|
@@ -2908,14 +3425,14 @@ var IntegrationForm = ({
|
|
|
2908
3425
|
const credential = {
|
|
2909
3426
|
source: metadata.id,
|
|
2910
3427
|
credential: {
|
|
2911
|
-
apiKey: formValues.api_key?.trim() || "
|
|
2912
|
-
secret: formValues.secret_key?.trim() || "
|
|
2913
|
-
accountName: formValues.account_name?.trim() || "
|
|
2914
|
-
address: formValues.address?.trim() || "
|
|
2915
|
-
password: formValues.password?.trim() || "
|
|
2916
|
-
userId: user?.user_id || "
|
|
2917
|
-
projectId: metadata?.projectId || "
|
|
2918
|
-
privateKey: "
|
|
3428
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3429
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3430
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3431
|
+
address: formValues.address?.trim() || "",
|
|
3432
|
+
password: formValues.password?.trim() || "",
|
|
3433
|
+
userId: user?.user_id || "",
|
|
3434
|
+
projectId: metadata?.projectId || "",
|
|
3435
|
+
privateKey: "",
|
|
2919
3436
|
alias,
|
|
2920
3437
|
walletId,
|
|
2921
3438
|
exchange: metadata.id
|
|
@@ -2923,9 +3440,7 @@ var IntegrationForm = ({
|
|
|
2923
3440
|
};
|
|
2924
3441
|
const testResult = await testCredentials(linkToken, { ...credential });
|
|
2925
3442
|
if (!testResult?.valid) {
|
|
2926
|
-
setErrorMessage(
|
|
2927
|
-
testResult?.value?.message || "Credentials are invalid"
|
|
2928
|
-
);
|
|
3443
|
+
setErrorMessage(testResult?.message || "Credentials are invalid");
|
|
2929
3444
|
return;
|
|
2930
3445
|
}
|
|
2931
3446
|
const data = {
|
|
@@ -2944,14 +3459,12 @@ var IntegrationForm = ({
|
|
|
2944
3459
|
clientId,
|
|
2945
3460
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2946
3461
|
},
|
|
2947
|
-
metadata: {
|
|
2948
|
-
environment: "sandbox"
|
|
2949
|
-
},
|
|
2950
3462
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2951
3463
|
default_chain: metadata.id,
|
|
2952
|
-
default_chain_logo:
|
|
3464
|
+
default_chain_logo: "",
|
|
2953
3465
|
type: metadata.type,
|
|
2954
|
-
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false
|
|
3466
|
+
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
3467
|
+
isCustomWallet: false
|
|
2955
3468
|
};
|
|
2956
3469
|
if (metadata.community_id) {
|
|
2957
3470
|
data.chainId = metadata.community_id;
|
|
@@ -2964,7 +3477,7 @@ var IntegrationForm = ({
|
|
|
2964
3477
|
integrationsToAdd.push(data);
|
|
2965
3478
|
}
|
|
2966
3479
|
if (integrationsToAdd.length > 0) {
|
|
2967
|
-
onAddHandle(integrationsToAdd);
|
|
3480
|
+
await onAddHandle(integrationsToAdd);
|
|
2968
3481
|
setFormErrors({});
|
|
2969
3482
|
setFormValues({
|
|
2970
3483
|
address: "",
|
|
@@ -2978,10 +3491,9 @@ var IntegrationForm = ({
|
|
|
2978
3491
|
setErrorMessage("No integrations could be added. Please try again.");
|
|
2979
3492
|
}
|
|
2980
3493
|
} catch (error) {
|
|
2981
|
-
const err = error;
|
|
2982
3494
|
console.error(error);
|
|
2983
3495
|
setErrorMessage(
|
|
2984
|
-
|
|
3496
|
+
error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations"
|
|
2985
3497
|
);
|
|
2986
3498
|
} finally {
|
|
2987
3499
|
setIsLoading(false);
|
|
@@ -2989,24 +3501,24 @@ var IntegrationForm = ({
|
|
|
2989
3501
|
};
|
|
2990
3502
|
const hasNoFields = !metadata.password && !metadata.secret_key && !metadata.api_key && !metadata.address && !metadata.account_name;
|
|
2991
3503
|
const shouldShowFormFields = metadata.password || metadata.secret_key || metadata.api_key || metadata.address || metadata.account_name;
|
|
2992
|
-
const renderLogo = () => metadata.logo ? /* @__PURE__ */
|
|
2993
|
-
|
|
3504
|
+
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */ React34.createElement(RemoteSvg, { uri: metadata.logo }) : /* @__PURE__ */ React34.createElement(
|
|
3505
|
+
Image3,
|
|
2994
3506
|
{
|
|
2995
3507
|
source: { uri: metadata.logo },
|
|
2996
|
-
style:
|
|
3508
|
+
style: styles16.logo,
|
|
2997
3509
|
resizeMode: "contain"
|
|
2998
3510
|
}
|
|
2999
|
-
) : /* @__PURE__ */
|
|
3000
|
-
|
|
3511
|
+
) : /* @__PURE__ */ React34.createElement(
|
|
3512
|
+
View16,
|
|
3001
3513
|
{
|
|
3002
3514
|
style: [
|
|
3003
|
-
|
|
3515
|
+
styles16.logoPlaceholder,
|
|
3004
3516
|
{ backgroundColor: theme.colors.surface }
|
|
3005
3517
|
]
|
|
3006
3518
|
},
|
|
3007
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ React34.createElement(Text14, { style: { color: theme.colors.text } }, metadata.name?.charAt(0) || "?")
|
|
3008
3520
|
);
|
|
3009
|
-
const renderInput = (key, props) => /* @__PURE__ */
|
|
3521
|
+
const renderInput = (key, props) => /* @__PURE__ */ React34.createElement(
|
|
3010
3522
|
Input,
|
|
3011
3523
|
{
|
|
3012
3524
|
placeholder: props.placeholder,
|
|
@@ -3018,33 +3530,33 @@ var IntegrationForm = ({
|
|
|
3018
3530
|
secureTextEntry: props.secureTextEntry
|
|
3019
3531
|
}
|
|
3020
3532
|
);
|
|
3021
|
-
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */
|
|
3022
|
-
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */
|
|
3533
|
+
const renderErrorAlert = () => errorMessage || errorMessageProp ? /* @__PURE__ */ React34.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React34.createElement(AlertDescription, null, errorMessage || errorMessageProp)) : null;
|
|
3534
|
+
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainSelection }, /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"), /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainListContent }, /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainChips }, userUsedChains.map((chain) => {
|
|
3023
3535
|
const isSelected = selectedChains.has(chain.id);
|
|
3024
3536
|
const hasError = chainErrors[chain.id];
|
|
3025
|
-
return /* @__PURE__ */
|
|
3026
|
-
|
|
3537
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3538
|
+
TouchableOpacity6,
|
|
3027
3539
|
{
|
|
3028
3540
|
onPress: () => toggleChainSelection(chain.id),
|
|
3029
|
-
style:
|
|
3541
|
+
style: styles16.chainButton,
|
|
3030
3542
|
key: chain.id
|
|
3031
3543
|
},
|
|
3032
|
-
/* @__PURE__ */
|
|
3033
|
-
|
|
3544
|
+
/* @__PURE__ */ React34.createElement(
|
|
3545
|
+
View16,
|
|
3034
3546
|
{
|
|
3035
3547
|
style: [
|
|
3036
|
-
|
|
3548
|
+
styles16.chainChip,
|
|
3037
3549
|
{
|
|
3038
3550
|
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
3039
3551
|
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
3040
3552
|
}
|
|
3041
3553
|
]
|
|
3042
3554
|
},
|
|
3043
|
-
/* @__PURE__ */
|
|
3044
|
-
|
|
3555
|
+
/* @__PURE__ */ React34.createElement(
|
|
3556
|
+
Text14,
|
|
3045
3557
|
{
|
|
3046
3558
|
style: [
|
|
3047
|
-
|
|
3559
|
+
styles16.chainName,
|
|
3048
3560
|
{
|
|
3049
3561
|
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
3050
3562
|
}
|
|
@@ -3052,28 +3564,55 @@ var IntegrationForm = ({
|
|
|
3052
3564
|
},
|
|
3053
3565
|
chain.name
|
|
3054
3566
|
),
|
|
3055
|
-
isSelected ? /* @__PURE__ */
|
|
3567
|
+
isSelected ? /* @__PURE__ */ React34.createElement(
|
|
3056
3568
|
CloseIcon,
|
|
3057
3569
|
{
|
|
3058
3570
|
size: 12,
|
|
3059
3571
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
3060
3572
|
}
|
|
3061
|
-
) : /* @__PURE__ */
|
|
3573
|
+
) : /* @__PURE__ */ React34.createElement(PlusIcon, { size: 12, color: theme.colors.textSecondary })
|
|
3062
3574
|
)
|
|
3063
3575
|
);
|
|
3064
|
-
}))
|
|
3065
|
-
|
|
3576
|
+
})), selectedChains.size > 0 && userUsedChains.length > 0 && /* @__PURE__ */ React34.createElement(
|
|
3577
|
+
TouchableOpacity6,
|
|
3578
|
+
{
|
|
3579
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
3580
|
+
style: styles16.chainButton,
|
|
3581
|
+
activeOpacity: 0.7
|
|
3582
|
+
},
|
|
3583
|
+
/* @__PURE__ */ React34.createElement(
|
|
3584
|
+
View16,
|
|
3585
|
+
{
|
|
3586
|
+
style: [
|
|
3587
|
+
styles16.chainChip,
|
|
3588
|
+
styles16.chainChipRemoveAll,
|
|
3589
|
+
{
|
|
3590
|
+
borderWidth: 0
|
|
3591
|
+
}
|
|
3592
|
+
]
|
|
3593
|
+
},
|
|
3594
|
+
/* @__PURE__ */ React34.createElement(
|
|
3595
|
+
Text14,
|
|
3596
|
+
{
|
|
3597
|
+
style: [styles16.chainName, { color: theme.colors.primary }]
|
|
3598
|
+
},
|
|
3599
|
+
"Remove All Chains"
|
|
3600
|
+
),
|
|
3601
|
+
/* @__PURE__ */ React34.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
3602
|
+
)
|
|
3603
|
+
)), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainErrorsContainer }, /* @__PURE__ */ React34.createElement(
|
|
3604
|
+
Text14,
|
|
3066
3605
|
{
|
|
3067
|
-
style: [
|
|
3606
|
+
style: [styles16.chainErrorsTitle, { color: theme.colors.error }]
|
|
3068
3607
|
},
|
|
3069
3608
|
"Errors:"
|
|
3070
3609
|
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
3071
3610
|
const chain = userUsedChains.find((c) => c.id === chainId);
|
|
3072
|
-
return /* @__PURE__ */
|
|
3073
|
-
|
|
3611
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3612
|
+
Text14,
|
|
3074
3613
|
{
|
|
3075
3614
|
key: chainId,
|
|
3076
|
-
style: [
|
|
3615
|
+
style: [styles16.chainErrorItem, { color: theme.colors.error }]
|
|
3077
3616
|
},
|
|
3078
3617
|
"\u2022 ",
|
|
3079
3618
|
chain?.name,
|
|
@@ -3081,7 +3620,7 @@ var IntegrationForm = ({
|
|
|
3081
3620
|
error
|
|
3082
3621
|
);
|
|
3083
3622
|
})));
|
|
3084
|
-
const renderFormBlock = () => /* @__PURE__ */
|
|
3623
|
+
const renderFormBlock = () => /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(View16, { style: styles16.header }, renderLogo(), /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.name, { color: theme.colors.text }] }, metadata.name)), shouldShowFormFields && /* @__PURE__ */ React34.createElement(React34.Fragment, null, metadata.address && /* @__PURE__ */ React34.createElement(React34.Fragment, null, renderInput("address", {
|
|
3085
3624
|
placeholder: "Enter address",
|
|
3086
3625
|
autoCapitalize: "none",
|
|
3087
3626
|
autoCorrect: false
|
|
@@ -3097,16 +3636,23 @@ var IntegrationForm = ({
|
|
|
3097
3636
|
}), metadata.password && renderInput("password", {
|
|
3098
3637
|
placeholder: "Enter Password",
|
|
3099
3638
|
secureTextEntry: true
|
|
3100
|
-
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */
|
|
3639
|
+
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */ React34.createElement(Alert, { variant: "default", style: { marginTop: 12 } }, /* @__PURE__ */ React34.createElement(AlertDescription, null, "This integration is not supported here yet \u2014 try using it through our Kryptos Platform.")));
|
|
3101
3640
|
const addIntegrationLabel = formValues.address && userUsedChains.length > 0 && selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size !== 1 ? "s" : ""}` : "Add Integration";
|
|
3102
|
-
return /* @__PURE__ */
|
|
3103
|
-
|
|
3641
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, !metadata?.isWalletConnectSupported ? /* @__PURE__ */ React34.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React34.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React34.createElement(View16, { style: styles16.headerContent }, showBackButton && /* @__PURE__ */ React34.createElement(
|
|
3642
|
+
TouchableOpacity6,
|
|
3104
3643
|
{
|
|
3105
3644
|
onPress: () => setAddIntegrationMode(null),
|
|
3106
|
-
style:
|
|
3645
|
+
style: styles16.backButton
|
|
3107
3646
|
},
|
|
3108
|
-
/* @__PURE__ */
|
|
3109
|
-
), /* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ React34.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3648
|
+
), /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React34.createElement(ModalBody, { scrollable: true, style: styles16.contentContainer }, renderFormBlock(), renderErrorAlert(), !metadata?.isWalletConnectSupported && metadata?.walletLimitations && /* @__PURE__ */ React34.createElement(
|
|
3649
|
+
IntegrationInfo,
|
|
3650
|
+
{
|
|
3651
|
+
content: metadata.walletLimitations,
|
|
3652
|
+
type: "api",
|
|
3653
|
+
import_guide: metadata.import_guide
|
|
3654
|
+
}
|
|
3655
|
+
)), !hasNoFields && /* @__PURE__ */ React34.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React34.createElement(
|
|
3110
3656
|
Button,
|
|
3111
3657
|
{
|
|
3112
3658
|
variant: "outline",
|
|
@@ -3114,10 +3660,10 @@ var IntegrationForm = ({
|
|
|
3114
3660
|
onPress: handleSubmit,
|
|
3115
3661
|
loading: isLoading,
|
|
3116
3662
|
disabled: isLoading || isFetchingChains || !!formValues.address && userUsedChains.length > 0 && selectedChains.size === 0,
|
|
3117
|
-
style:
|
|
3663
|
+
style: styles16.button
|
|
3118
3664
|
},
|
|
3119
3665
|
addIntegrationLabel
|
|
3120
|
-
), /* @__PURE__ */
|
|
3666
|
+
), /* @__PURE__ */ React34.createElement(Footer, null))) : /* @__PURE__ */ React34.createElement(
|
|
3121
3667
|
WalletConnectComponent,
|
|
3122
3668
|
{
|
|
3123
3669
|
integration: metadata,
|
|
@@ -3126,14 +3672,14 @@ var IntegrationForm = ({
|
|
|
3126
3672
|
modalOpen: open,
|
|
3127
3673
|
setAddIntegrationMode,
|
|
3128
3674
|
handleClose,
|
|
3129
|
-
providersList
|
|
3675
|
+
providersList,
|
|
3676
|
+
errorMessage: errorMessageProp
|
|
3130
3677
|
}
|
|
3131
3678
|
));
|
|
3132
3679
|
};
|
|
3133
|
-
var
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
paddingBottom: 100
|
|
3680
|
+
var styles16 = StyleSheet16.create({
|
|
3681
|
+
chainListContent: {
|
|
3682
|
+
paddingBottom: 8
|
|
3137
3683
|
},
|
|
3138
3684
|
headerContent: {
|
|
3139
3685
|
flexDirection: "row",
|
|
@@ -3158,10 +3704,8 @@ var styles14 = StyleSheet14.create({
|
|
|
3158
3704
|
// theme.spacing.xl
|
|
3159
3705
|
paddingBottom: 40,
|
|
3160
3706
|
width: "100%",
|
|
3161
|
-
overflow: "hidden",
|
|
3162
3707
|
alignSelf: "center",
|
|
3163
|
-
flexDirection: "column"
|
|
3164
|
-
flex: 1
|
|
3708
|
+
flexDirection: "column"
|
|
3165
3709
|
},
|
|
3166
3710
|
header: {
|
|
3167
3711
|
flexDirection: "row",
|
|
@@ -3193,7 +3737,7 @@ var styles14 = StyleSheet14.create({
|
|
|
3193
3737
|
textTransform: "capitalize"
|
|
3194
3738
|
},
|
|
3195
3739
|
chainSelection: {
|
|
3196
|
-
marginBottom:
|
|
3740
|
+
marginBottom: 8
|
|
3197
3741
|
// theme.spacing.lg
|
|
3198
3742
|
},
|
|
3199
3743
|
chainTitle: {
|
|
@@ -3220,6 +3764,11 @@ var styles14 = StyleSheet14.create({
|
|
|
3220
3764
|
// theme.borderRadius.md
|
|
3221
3765
|
borderWidth: 1
|
|
3222
3766
|
},
|
|
3767
|
+
chainChipRemoveAll: {
|
|
3768
|
+
marginTop: 6,
|
|
3769
|
+
// theme.spacing.sm - separate from chain list
|
|
3770
|
+
width: "auto"
|
|
3771
|
+
},
|
|
3223
3772
|
chainName: {
|
|
3224
3773
|
fontSize: 12,
|
|
3225
3774
|
fontWeight: "500",
|
|
@@ -3255,18 +3804,23 @@ var styles14 = StyleSheet14.create({
|
|
|
3255
3804
|
var Integration = ({
|
|
3256
3805
|
open,
|
|
3257
3806
|
onSuccess,
|
|
3258
|
-
onClose
|
|
3807
|
+
onClose,
|
|
3808
|
+
integrationDetails
|
|
3259
3809
|
}) => {
|
|
3260
3810
|
const { appName, linkToken } = useKryptosConnect();
|
|
3261
3811
|
const theme = useTheme();
|
|
3262
|
-
const [addIntegrationMode, setAddIntegrationMode] =
|
|
3263
|
-
const [query, setQuery] =
|
|
3264
|
-
const [activeTab, setActiveTab] =
|
|
3265
|
-
const [supportedProviders, setSupportedProviders] =
|
|
3266
|
-
const [
|
|
3267
|
-
const [
|
|
3268
|
-
const [
|
|
3269
|
-
|
|
3812
|
+
const [addIntegrationMode, setAddIntegrationMode] = React35.useState(integrationDetails || null);
|
|
3813
|
+
const [query, setQuery] = React35.useState("");
|
|
3814
|
+
const [activeTab, setActiveTab] = React35.useState("all");
|
|
3815
|
+
const [supportedProviders, setSupportedProviders] = React35.useState([]);
|
|
3816
|
+
const [existingIntegrations, setExistingIntegrations] = React35.useState([]);
|
|
3817
|
+
const [isLoading, setIsLoading] = React35.useState(false);
|
|
3818
|
+
const [errorMessage, setErrorMessage] = React35.useState("");
|
|
3819
|
+
React35.useEffect(() => {
|
|
3820
|
+
if (integrationDetails) {
|
|
3821
|
+
setAddIntegrationMode(integrationDetails);
|
|
3822
|
+
}
|
|
3823
|
+
}, [integrationDetails]);
|
|
3270
3824
|
const handleClose = () => {
|
|
3271
3825
|
onClose();
|
|
3272
3826
|
};
|
|
@@ -3277,7 +3831,7 @@ var Integration = ({
|
|
|
3277
3831
|
} catch (error) {
|
|
3278
3832
|
const err = error;
|
|
3279
3833
|
setErrorMessage(
|
|
3280
|
-
err?.response?.data?.message || "Failed to fetch existing integrations"
|
|
3834
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch existing integrations"
|
|
3281
3835
|
);
|
|
3282
3836
|
console.error(error);
|
|
3283
3837
|
}
|
|
@@ -3290,38 +3844,38 @@ var Integration = ({
|
|
|
3290
3844
|
} catch (error) {
|
|
3291
3845
|
const err = error;
|
|
3292
3846
|
setErrorMessage(
|
|
3293
|
-
err?.response?.data?.message || "Failed to fetch supported providers"
|
|
3847
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch supported providers"
|
|
3294
3848
|
);
|
|
3295
3849
|
console.error(error);
|
|
3296
3850
|
} finally {
|
|
3297
3851
|
setIsLoading(false);
|
|
3298
3852
|
}
|
|
3299
3853
|
};
|
|
3300
|
-
|
|
3854
|
+
React35.useEffect(() => {
|
|
3301
3855
|
if (linkToken) {
|
|
3302
3856
|
fetchSupportedProviders();
|
|
3303
3857
|
fetchExistingIntegrations();
|
|
3304
3858
|
}
|
|
3305
3859
|
}, [linkToken]);
|
|
3306
|
-
const isIntegrationAdded =
|
|
3860
|
+
const isIntegrationAdded = useCallback(
|
|
3307
3861
|
(publicName) => {
|
|
3308
|
-
const integrations = [...
|
|
3862
|
+
const integrations = [...existingIntegrations];
|
|
3309
3863
|
return integrations.some(
|
|
3310
3864
|
(integration) => integration.public_name === publicName
|
|
3311
3865
|
);
|
|
3312
3866
|
},
|
|
3313
|
-
[
|
|
3867
|
+
[existingIntegrations]
|
|
3314
3868
|
);
|
|
3315
|
-
const getIntegrationCount =
|
|
3869
|
+
const getIntegrationCount = useCallback(
|
|
3316
3870
|
(publicName) => {
|
|
3317
|
-
const integrations = [...
|
|
3871
|
+
const integrations = [...existingIntegrations];
|
|
3318
3872
|
return integrations.filter(
|
|
3319
3873
|
(integration) => integration.public_name === publicName
|
|
3320
3874
|
).length;
|
|
3321
3875
|
},
|
|
3322
|
-
[
|
|
3876
|
+
[existingIntegrations]
|
|
3323
3877
|
);
|
|
3324
|
-
const filteredResults =
|
|
3878
|
+
const filteredResults = React35.useMemo(() => {
|
|
3325
3879
|
let filtered = supportedProviders;
|
|
3326
3880
|
if (activeTab !== "all") {
|
|
3327
3881
|
filtered = filtered.filter((provider) => provider.type === activeTab);
|
|
@@ -3339,33 +3893,41 @@ var Integration = ({
|
|
|
3339
3893
|
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
3340
3894
|
});
|
|
3341
3895
|
}, [query, supportedProviders, getIntegrationCount, activeTab]);
|
|
3342
|
-
const handleAddIntegration = async () => {
|
|
3896
|
+
const handleAddIntegration = async (integrationsList) => {
|
|
3343
3897
|
try {
|
|
3344
3898
|
setIsLoading(true);
|
|
3345
|
-
const integrations = [...
|
|
3899
|
+
const integrations = integrationsList ? integrationsList : [...existingIntegrations];
|
|
3346
3900
|
if (integrations.length === 0) {
|
|
3347
3901
|
setErrorMessage("Please add at least one integration");
|
|
3348
|
-
} else if (addedIntegrations.length === 0) {
|
|
3349
|
-
onSuccess();
|
|
3350
3902
|
} else {
|
|
3351
|
-
await addUserIntegration(linkToken,
|
|
3352
|
-
|
|
3903
|
+
await addUserIntegration(linkToken, integrations);
|
|
3904
|
+
if (integrationDetails) {
|
|
3905
|
+
onSuccess();
|
|
3906
|
+
}
|
|
3353
3907
|
}
|
|
3908
|
+
await fetchExistingIntegrations();
|
|
3909
|
+
setAddIntegrationMode(null);
|
|
3354
3910
|
} catch (error) {
|
|
3355
|
-
const
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
err?.response?.data?.message || "Failed to add integrations"
|
|
3359
|
-
);
|
|
3911
|
+
const message = error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations";
|
|
3912
|
+
setErrorMessage(message);
|
|
3913
|
+
throw error;
|
|
3360
3914
|
} finally {
|
|
3361
3915
|
setIsLoading(false);
|
|
3362
3916
|
}
|
|
3363
3917
|
};
|
|
3364
|
-
const
|
|
3365
|
-
|
|
3918
|
+
const handleContinue = () => {
|
|
3919
|
+
const integrations = [...existingIntegrations];
|
|
3920
|
+
if (integrations.length === 0) {
|
|
3921
|
+
setErrorMessage("Please add at least one integration");
|
|
3922
|
+
return;
|
|
3923
|
+
}
|
|
3924
|
+
onSuccess();
|
|
3925
|
+
};
|
|
3926
|
+
const renderProviderItem = ({ item }) => /* @__PURE__ */ React35.createElement(
|
|
3927
|
+
TouchableOpacity7,
|
|
3366
3928
|
{
|
|
3367
3929
|
style: [
|
|
3368
|
-
|
|
3930
|
+
styles17.providerItem,
|
|
3369
3931
|
{
|
|
3370
3932
|
backgroundColor: theme.colors.surface,
|
|
3371
3933
|
borderColor: theme.colors.border
|
|
@@ -3374,43 +3936,97 @@ var Integration = ({
|
|
|
3374
3936
|
onPress: () => setAddIntegrationMode(item),
|
|
3375
3937
|
activeOpacity: 0.7
|
|
3376
3938
|
},
|
|
3377
|
-
/* @__PURE__ */
|
|
3378
|
-
|
|
3939
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.providerInfo }, item?.logo ? isSvgUrl(item?.logo) ? /* @__PURE__ */ React35.createElement(RemoteSvg, { uri: item?.logo }) : /* @__PURE__ */ React35.createElement(
|
|
3940
|
+
Image4,
|
|
3379
3941
|
{
|
|
3380
3942
|
source: { uri: item?.logo },
|
|
3381
|
-
style:
|
|
3943
|
+
style: styles17.providerLogo,
|
|
3382
3944
|
resizeMode: "contain"
|
|
3383
3945
|
}
|
|
3384
|
-
) : /* @__PURE__ */
|
|
3385
|
-
|
|
3946
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
3947
|
+
View17,
|
|
3386
3948
|
{
|
|
3387
3949
|
style: [
|
|
3388
|
-
|
|
3950
|
+
styles17.providerLogoPlaceholder,
|
|
3389
3951
|
{ backgroundColor: theme.colors.surfaceSecondary }
|
|
3390
3952
|
]
|
|
3391
3953
|
},
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
), /* @__PURE__ */
|
|
3394
|
-
isIntegrationAdded(item?.public_name) && /* @__PURE__ */
|
|
3395
|
-
|
|
3954
|
+
/* @__PURE__ */ React35.createElement(Text15, { style: { color: theme.colors.text } }, item?.name?.charAt(0) || "?")
|
|
3955
|
+
), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.providerName, { color: theme.colors.text }] }, item?.name + "\u200B")),
|
|
3956
|
+
isIntegrationAdded(item?.public_name) && /* @__PURE__ */ React35.createElement(View17, { style: styles17.providerStatus }, /* @__PURE__ */ React35.createElement(CheckCircleIcon, { size: 18, color: theme.colors.success }), /* @__PURE__ */ React35.createElement(
|
|
3957
|
+
Text15,
|
|
3396
3958
|
{
|
|
3397
3959
|
style: [
|
|
3398
|
-
|
|
3960
|
+
styles17.providerCount,
|
|
3399
3961
|
{ color: theme.colors.textSecondary }
|
|
3400
3962
|
]
|
|
3401
3963
|
},
|
|
3402
3964
|
getIntegrationCount(item?.public_name)
|
|
3403
3965
|
))
|
|
3404
3966
|
);
|
|
3405
|
-
const renderSkeletonItem = () => /* @__PURE__ */
|
|
3406
|
-
return /* @__PURE__ */
|
|
3407
|
-
|
|
3967
|
+
const renderSkeletonItem = () => /* @__PURE__ */ React35.createElement(SkeletonItem_default, null);
|
|
3968
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, !addIntegrationMode ? /* @__PURE__ */ React35.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React35.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.headerContent }, addIntegrationMode && /* @__PURE__ */ React35.createElement(
|
|
3969
|
+
TouchableOpacity7,
|
|
3408
3970
|
{
|
|
3409
3971
|
onPress: () => setAddIntegrationMode(null),
|
|
3410
|
-
style:
|
|
3972
|
+
style: styles17.backButton
|
|
3973
|
+
},
|
|
3974
|
+
/* @__PURE__ */ React35.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3975
|
+
), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React35.createElement(ModalBody, { scrollable: false, style: styles17.noPadding }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.container }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.headerSection }, /* @__PURE__ */ React35.createElement(ConnectLogo, null), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.title, { color: theme.colors.text }] }, "Select an account to link to ", appName)), /* @__PURE__ */ React35.createElement(
|
|
3976
|
+
View17,
|
|
3977
|
+
{
|
|
3978
|
+
style: {
|
|
3979
|
+
paddingHorizontal: theme.spacing.xl,
|
|
3980
|
+
paddingVertical: theme.spacing.sm + 2,
|
|
3981
|
+
backgroundColor: theme.colors.background,
|
|
3982
|
+
zIndex: 10
|
|
3983
|
+
}
|
|
3411
3984
|
},
|
|
3412
|
-
/* @__PURE__ */
|
|
3413
|
-
|
|
3985
|
+
/* @__PURE__ */ React35.createElement(
|
|
3986
|
+
Input,
|
|
3987
|
+
{
|
|
3988
|
+
value: query,
|
|
3989
|
+
onChangeText: setQuery,
|
|
3990
|
+
placeholder: "Search Integrations...",
|
|
3991
|
+
containerStyle: styles17.searchInput
|
|
3992
|
+
}
|
|
3993
|
+
),
|
|
3994
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.tabsContainer }, [
|
|
3995
|
+
{ label: "All", value: "all" },
|
|
3996
|
+
{ label: "Exchanges", value: "exchange" },
|
|
3997
|
+
{ label: "Blockchains", value: "blockchain" },
|
|
3998
|
+
{ label: "Wallets", value: "wallet" }
|
|
3999
|
+
].map((tab) => /* @__PURE__ */ React35.createElement(
|
|
4000
|
+
TouchableOpacity7,
|
|
4001
|
+
{
|
|
4002
|
+
key: tab.value,
|
|
4003
|
+
style: [
|
|
4004
|
+
styles17.tab,
|
|
4005
|
+
{
|
|
4006
|
+
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
4007
|
+
borderColor: theme.colors.border
|
|
4008
|
+
}
|
|
4009
|
+
],
|
|
4010
|
+
onPress: () => {
|
|
4011
|
+
setActiveTab(
|
|
4012
|
+
tab.value
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
},
|
|
4016
|
+
/* @__PURE__ */ React35.createElement(
|
|
4017
|
+
Text15,
|
|
4018
|
+
{
|
|
4019
|
+
style: [
|
|
4020
|
+
styles17.tabText,
|
|
4021
|
+
{
|
|
4022
|
+
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
4023
|
+
}
|
|
4024
|
+
]
|
|
4025
|
+
},
|
|
4026
|
+
tab.label
|
|
4027
|
+
)
|
|
4028
|
+
)))
|
|
4029
|
+
), /* @__PURE__ */ React35.createElement(
|
|
3414
4030
|
FlatList,
|
|
3415
4031
|
{
|
|
3416
4032
|
data: isLoading ? Array.from({ length: 8 }, (_, i) => ({
|
|
@@ -3421,104 +4037,53 @@ var Integration = ({
|
|
|
3421
4037
|
})) : filteredResults,
|
|
3422
4038
|
keyExtractor: (item, index) => isLoading ? item.id : `provider-${item.id}-${index}`,
|
|
3423
4039
|
renderItem: isLoading ? renderSkeletonItem : renderProviderItem,
|
|
3424
|
-
style:
|
|
4040
|
+
style: styles17.list,
|
|
3425
4041
|
contentContainerStyle: [
|
|
3426
|
-
|
|
4042
|
+
styles17.listContent,
|
|
3427
4043
|
{ paddingHorizontal: theme.spacing.xl }
|
|
3428
4044
|
],
|
|
3429
4045
|
showsVerticalScrollIndicator: false,
|
|
3430
|
-
|
|
3431
|
-
|
|
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(
|
|
3485
|
-
Text13,
|
|
4046
|
+
ListEmptyComponent: /* @__PURE__ */ React35.createElement(View17, { style: styles17.emptyContainer }, !isLoading && /* @__PURE__ */ React35.createElement(
|
|
4047
|
+
Text15,
|
|
3486
4048
|
{
|
|
3487
4049
|
style: [
|
|
3488
|
-
|
|
4050
|
+
styles17.emptyText,
|
|
3489
4051
|
{ color: theme.colors.textSecondary }
|
|
3490
4052
|
]
|
|
3491
4053
|
},
|
|
3492
4054
|
query ? "No search results found" : "No supported integrations found"
|
|
3493
|
-
))
|
|
4055
|
+
)),
|
|
4056
|
+
ListFooterComponent: errorMessage ? /* @__PURE__ */ React35.createElement(View17, { style: styles17.errorContainer }, /* @__PURE__ */ React35.createElement(Alert, { variant: "destructive", style: styles17.errorAlert }, /* @__PURE__ */ React35.createElement(AlertDescription, null, errorMessage))) : null
|
|
3494
4057
|
}
|
|
3495
|
-
),
|
|
4058
|
+
))), /* @__PURE__ */ React35.createElement(ModalFooter, { style: { paddingVertical: 8 } }, filteredResults && filteredResults.length > 0 && /* @__PURE__ */ React35.createElement(
|
|
3496
4059
|
Button,
|
|
3497
4060
|
{
|
|
3498
4061
|
variant: "outline",
|
|
3499
4062
|
size: "lg",
|
|
3500
|
-
onPress:
|
|
4063
|
+
onPress: handleContinue,
|
|
3501
4064
|
loading: isLoading,
|
|
3502
4065
|
disabled: isLoading,
|
|
3503
|
-
style:
|
|
4066
|
+
style: styles17.continueButton
|
|
3504
4067
|
},
|
|
3505
4068
|
"Continue"
|
|
3506
|
-
), /* @__PURE__ */
|
|
4069
|
+
), /* @__PURE__ */ React35.createElement(Footer, null))) : /* @__PURE__ */ React35.createElement(
|
|
3507
4070
|
IntegrationForm,
|
|
3508
4071
|
{
|
|
3509
4072
|
metadata: addIntegrationMode,
|
|
3510
|
-
onAddHandle: (
|
|
3511
|
-
|
|
3512
|
-
|
|
4073
|
+
onAddHandle: async (int) => {
|
|
4074
|
+
const integrationsList = [...int];
|
|
4075
|
+
await handleAddIntegration(integrationsList);
|
|
3513
4076
|
},
|
|
3514
4077
|
open: !!addIntegrationMode,
|
|
3515
4078
|
setAddIntegrationMode,
|
|
3516
4079
|
handleClose,
|
|
3517
|
-
providersList: supportedProviders
|
|
4080
|
+
providersList: supportedProviders,
|
|
4081
|
+
errorMessage,
|
|
4082
|
+
showBackButton: !integrationDetails
|
|
3518
4083
|
}
|
|
3519
4084
|
));
|
|
3520
4085
|
};
|
|
3521
|
-
var
|
|
4086
|
+
var styles17 = StyleSheet17.create({
|
|
3522
4087
|
headerContent: {
|
|
3523
4088
|
flexDirection: "row",
|
|
3524
4089
|
alignItems: "center"
|
|
@@ -3567,7 +4132,9 @@ var styles15 = StyleSheet15.create({
|
|
|
3567
4132
|
flexDirection: "row",
|
|
3568
4133
|
alignItems: "center",
|
|
3569
4134
|
justifyContent: "space-between",
|
|
3570
|
-
|
|
4135
|
+
paddingVertical: 8,
|
|
4136
|
+
// theme.spacing.md
|
|
4137
|
+
paddingHorizontal: 12,
|
|
3571
4138
|
// theme.spacing.md
|
|
3572
4139
|
borderRadius: 12,
|
|
3573
4140
|
// theme.borderRadius.md
|
|
@@ -3627,53 +4194,53 @@ var styles15 = StyleSheet15.create({
|
|
|
3627
4194
|
width: "100%"
|
|
3628
4195
|
},
|
|
3629
4196
|
errorContainer: {
|
|
3630
|
-
paddingHorizontal: 20
|
|
4197
|
+
paddingHorizontal: 20,
|
|
3631
4198
|
// theme.spacing.xl
|
|
4199
|
+
marginBottom: 12
|
|
3632
4200
|
},
|
|
3633
4201
|
errorAlert: {
|
|
3634
|
-
marginTop:
|
|
3635
|
-
// theme.spacing.lg - consistent alert spacing
|
|
4202
|
+
marginTop: 8
|
|
3636
4203
|
},
|
|
3637
4204
|
tabsContainer: {
|
|
3638
4205
|
flexDirection: "row",
|
|
3639
|
-
gap:
|
|
4206
|
+
gap: 6,
|
|
3640
4207
|
// theme.spacing.sm
|
|
3641
4208
|
flexWrap: "wrap"
|
|
3642
4209
|
},
|
|
3643
4210
|
tab: {
|
|
3644
|
-
paddingVertical:
|
|
4211
|
+
paddingVertical: 4,
|
|
3645
4212
|
// theme.spacing.sm
|
|
3646
|
-
paddingHorizontal:
|
|
4213
|
+
paddingHorizontal: 10,
|
|
3647
4214
|
// theme.spacing.lg
|
|
3648
|
-
borderRadius:
|
|
4215
|
+
borderRadius: 8,
|
|
3649
4216
|
// theme.borderRadius.full / 2
|
|
3650
4217
|
borderWidth: 1,
|
|
3651
4218
|
alignItems: "center",
|
|
3652
4219
|
justifyContent: "center"
|
|
3653
4220
|
},
|
|
3654
4221
|
tabText: {
|
|
3655
|
-
fontSize:
|
|
4222
|
+
fontSize: 12,
|
|
3656
4223
|
// theme.fontSize.sm
|
|
3657
4224
|
fontWeight: "600"
|
|
3658
4225
|
}
|
|
3659
4226
|
});
|
|
3660
4227
|
|
|
3661
4228
|
// src/molecules/OTPVerify.tsx
|
|
3662
|
-
import
|
|
3663
|
-
import { StyleSheet as
|
|
4229
|
+
import React36 from "react";
|
|
4230
|
+
import { StyleSheet as StyleSheet18, Text as Text16, TouchableOpacity as TouchableOpacity8, View as View18 } from "react-native";
|
|
3664
4231
|
var OTPVerify = ({
|
|
3665
4232
|
open,
|
|
3666
4233
|
onSuccess,
|
|
3667
4234
|
onClose
|
|
3668
4235
|
}) => {
|
|
3669
4236
|
const theme = useTheme();
|
|
3670
|
-
const [otp, setOtp] =
|
|
4237
|
+
const [otp, setOtp] = React36.useState("");
|
|
3671
4238
|
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] =
|
|
4239
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
4240
|
+
const [isResending, setIsResending] = React36.useState(false);
|
|
4241
|
+
const [resendCooldown, setResendCooldown] = React36.useState(0);
|
|
4242
|
+
const [errorMessage, setErrorMessage] = React36.useState("");
|
|
4243
|
+
const [successMessage, setSuccessMessage] = React36.useState("");
|
|
3677
4244
|
const handleSubmit = async () => {
|
|
3678
4245
|
if (otp.length !== 6) return;
|
|
3679
4246
|
setIsLoading(true);
|
|
@@ -3724,7 +4291,7 @@ var OTPVerify = ({
|
|
|
3724
4291
|
setSuccessMessage("");
|
|
3725
4292
|
setOtp("");
|
|
3726
4293
|
};
|
|
3727
|
-
|
|
4294
|
+
React36.useEffect(() => {
|
|
3728
4295
|
if (resendCooldown > 0) {
|
|
3729
4296
|
const timer = setTimeout(() => {
|
|
3730
4297
|
setResendCooldown(resendCooldown - 1);
|
|
@@ -3733,20 +4300,20 @@ var OTPVerify = ({
|
|
|
3733
4300
|
}
|
|
3734
4301
|
return void 0;
|
|
3735
4302
|
}, [resendCooldown]);
|
|
3736
|
-
return /* @__PURE__ */
|
|
3737
|
-
|
|
4303
|
+
return /* @__PURE__ */ React36.createElement(Modal, { isOpen: open, onClose: handleClose, size: "lg" }, /* @__PURE__ */ React36.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React36.createElement(View18, { style: styles18.headerContent }, /* @__PURE__ */ React36.createElement(Text16, { style: [styles18.headerTitle, { color: theme.colors.text }] }, "OTP Verification"))), /* @__PURE__ */ React36.createElement(ModalBody, null, /* @__PURE__ */ React36.createElement(View18, { style: styles18.container }, /* @__PURE__ */ React36.createElement(ConnectLogo, null), /* @__PURE__ */ React36.createElement(View18, { style: styles18.emailInfo }, /* @__PURE__ */ React36.createElement(
|
|
4304
|
+
Text16,
|
|
3738
4305
|
{
|
|
3739
|
-
style: [
|
|
4306
|
+
style: [styles18.infoText, { color: theme.colors.textSecondary }]
|
|
3740
4307
|
},
|
|
3741
4308
|
"We have sent a verification code to"
|
|
3742
|
-
), /* @__PURE__ */
|
|
4309
|
+
), /* @__PURE__ */ React36.createElement(Text16, { style: [styles18.emailText, { color: theme.colors.text }] }, email)), /* @__PURE__ */ React36.createElement(
|
|
3743
4310
|
OTP,
|
|
3744
4311
|
{
|
|
3745
4312
|
onComplete: handleOtpComplete,
|
|
3746
4313
|
length: 6,
|
|
3747
4314
|
setErrorMessage
|
|
3748
4315
|
}
|
|
3749
|
-
), errorMessage ? /* @__PURE__ */
|
|
4316
|
+
), errorMessage ? /* @__PURE__ */ React36.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React36.createElement(AlertDescription, null, errorMessage)) : null, successMessage ? /* @__PURE__ */ React36.createElement(Alert, { variant: "default" }, /* @__PURE__ */ React36.createElement(AlertDescription, null, successMessage)) : null, /* @__PURE__ */ React36.createElement(
|
|
3750
4317
|
Button,
|
|
3751
4318
|
{
|
|
3752
4319
|
variant: "outline",
|
|
@@ -3754,44 +4321,44 @@ var OTPVerify = ({
|
|
|
3754
4321
|
onPress: handleSubmit,
|
|
3755
4322
|
loading: isLoading,
|
|
3756
4323
|
disabled: otp.length !== 6 || isLoading,
|
|
3757
|
-
style:
|
|
4324
|
+
style: styles18.button
|
|
3758
4325
|
},
|
|
3759
4326
|
"Continue"
|
|
3760
|
-
), /* @__PURE__ */
|
|
3761
|
-
|
|
4327
|
+
), /* @__PURE__ */ React36.createElement(
|
|
4328
|
+
TouchableOpacity8,
|
|
3762
4329
|
{
|
|
3763
4330
|
onPress: handleResendOtp,
|
|
3764
4331
|
disabled: resendCooldown > 0 || isResending,
|
|
3765
|
-
style:
|
|
4332
|
+
style: styles18.resendContainer
|
|
3766
4333
|
},
|
|
3767
|
-
isResending ? /* @__PURE__ */
|
|
3768
|
-
|
|
4334
|
+
isResending ? /* @__PURE__ */ React36.createElement(View18, { style: styles18.resendLoading }, /* @__PURE__ */ React36.createElement(LoaderIcon, { size: 16, color: theme.colors.primary }), /* @__PURE__ */ React36.createElement(
|
|
4335
|
+
Text16,
|
|
3769
4336
|
{
|
|
3770
|
-
style: [
|
|
4337
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3771
4338
|
},
|
|
3772
4339
|
" ",
|
|
3773
4340
|
"Sending..."
|
|
3774
|
-
)) : resendCooldown > 0 ? /* @__PURE__ */
|
|
3775
|
-
|
|
4341
|
+
)) : resendCooldown > 0 ? /* @__PURE__ */ React36.createElement(
|
|
4342
|
+
Text16,
|
|
3776
4343
|
{
|
|
3777
4344
|
style: [
|
|
3778
|
-
|
|
4345
|
+
styles18.resendText,
|
|
3779
4346
|
{ color: theme.colors.textSecondary }
|
|
3780
4347
|
]
|
|
3781
4348
|
},
|
|
3782
4349
|
"Resend OTP in ",
|
|
3783
4350
|
resendCooldown,
|
|
3784
4351
|
"s"
|
|
3785
|
-
) : /* @__PURE__ */
|
|
3786
|
-
|
|
4352
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
4353
|
+
Text16,
|
|
3787
4354
|
{
|
|
3788
|
-
style: [
|
|
4355
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3789
4356
|
},
|
|
3790
4357
|
"Resend OTP"
|
|
3791
4358
|
)
|
|
3792
|
-
))), /* @__PURE__ */
|
|
4359
|
+
))), /* @__PURE__ */ React36.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
3793
4360
|
};
|
|
3794
|
-
var
|
|
4361
|
+
var styles18 = StyleSheet18.create({
|
|
3795
4362
|
headerContent: {
|
|
3796
4363
|
flexDirection: "row",
|
|
3797
4364
|
alignItems: "center"
|
|
@@ -3850,8 +4417,8 @@ var styles16 = StyleSheet16.create({
|
|
|
3850
4417
|
});
|
|
3851
4418
|
|
|
3852
4419
|
// src/molecules/Permissions.tsx
|
|
3853
|
-
import
|
|
3854
|
-
import { StyleSheet as
|
|
4420
|
+
import React37 from "react";
|
|
4421
|
+
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
3855
4422
|
var Permissions = ({
|
|
3856
4423
|
open,
|
|
3857
4424
|
onClose,
|
|
@@ -3859,8 +4426,8 @@ var Permissions = ({
|
|
|
3859
4426
|
}) => {
|
|
3860
4427
|
const { appName, linkToken, setUserConsent } = useKryptosConnect();
|
|
3861
4428
|
const theme = useTheme();
|
|
3862
|
-
const [isLoading, setIsLoading] =
|
|
3863
|
-
const [errorMessage, setErrorMessage] =
|
|
4429
|
+
const [isLoading, setIsLoading] = React37.useState(false);
|
|
4430
|
+
const [errorMessage, setErrorMessage] = React37.useState("");
|
|
3864
4431
|
const handleConsentClick = async () => {
|
|
3865
4432
|
try {
|
|
3866
4433
|
setIsLoading(true);
|
|
@@ -3883,42 +4450,42 @@ var Permissions = ({
|
|
|
3883
4450
|
"Access your transaction history and trading activity",
|
|
3884
4451
|
"Keep this data updated and accessible when you're offline"
|
|
3885
4452
|
];
|
|
3886
|
-
return /* @__PURE__ */
|
|
3887
|
-
|
|
4453
|
+
return /* @__PURE__ */ React37.createElement(Modal, { isOpen: open, onClose, size: "xl" }, /* @__PURE__ */ React37.createElement(ModalHeader, { onClose }, "Permissions"), /* @__PURE__ */ React37.createElement(ModalBody, null, /* @__PURE__ */ React37.createElement(View19, { style: styles19.container }, /* @__PURE__ */ React37.createElement(ConnectLogo, null), errorMessage ? /* @__PURE__ */ React37.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React37.createElement(AlertDescription, null, errorMessage)) : null, /* @__PURE__ */ React37.createElement(View19, { style: styles19.permissionsList }, /* @__PURE__ */ React37.createElement(
|
|
4454
|
+
Text17,
|
|
3888
4455
|
{
|
|
3889
|
-
style: [
|
|
4456
|
+
style: [styles19.subtitle, { color: theme.colors.textSecondary }]
|
|
3890
4457
|
},
|
|
3891
4458
|
"Allow ",
|
|
3892
4459
|
appName,
|
|
3893
4460
|
" to:"
|
|
3894
|
-
), permissionItems.map((item, index) => /* @__PURE__ */
|
|
3895
|
-
|
|
4461
|
+
), permissionItems.map((item, index) => /* @__PURE__ */ React37.createElement(View19, { key: `permission-${index}`, style: styles19.permissionItem }, /* @__PURE__ */ React37.createElement(Text17, { style: [styles19.bullet, { color: theme.colors.primary }] }, index + 1, "."), /* @__PURE__ */ React37.createElement(
|
|
4462
|
+
Text17,
|
|
3896
4463
|
{
|
|
3897
|
-
style: [
|
|
4464
|
+
style: [styles19.permissionText, { color: theme.colors.text }]
|
|
3898
4465
|
},
|
|
3899
4466
|
item
|
|
3900
|
-
)))), /* @__PURE__ */
|
|
3901
|
-
|
|
4467
|
+
)))), /* @__PURE__ */ React37.createElement(
|
|
4468
|
+
View19,
|
|
3902
4469
|
{
|
|
3903
4470
|
style: [
|
|
3904
|
-
|
|
4471
|
+
styles19.infoBox,
|
|
3905
4472
|
{
|
|
3906
4473
|
backgroundColor: theme.colors.surface,
|
|
3907
4474
|
borderColor: theme.colors.border
|
|
3908
4475
|
}
|
|
3909
4476
|
]
|
|
3910
4477
|
},
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
|
|
4478
|
+
/* @__PURE__ */ React37.createElement(
|
|
4479
|
+
Text17,
|
|
3913
4480
|
{
|
|
3914
|
-
style: [
|
|
4481
|
+
style: [styles19.infoText, { color: theme.colors.textSecondary }]
|
|
3915
4482
|
},
|
|
3916
4483
|
"By selecting",
|
|
3917
4484
|
" ",
|
|
3918
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ React37.createElement(Text17, { style: { fontWeight: "600", color: theme.colors.text } }, "'Allow'"),
|
|
3919
4486
|
", you agree to share this information and keep it updated."
|
|
3920
4487
|
)
|
|
3921
|
-
))), /* @__PURE__ */
|
|
4488
|
+
))), /* @__PURE__ */ React37.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React37.createElement(
|
|
3922
4489
|
Button,
|
|
3923
4490
|
{
|
|
3924
4491
|
variant: "outline",
|
|
@@ -3926,12 +4493,12 @@ var Permissions = ({
|
|
|
3926
4493
|
onPress: handleConsentClick,
|
|
3927
4494
|
loading: isLoading,
|
|
3928
4495
|
disabled: isLoading,
|
|
3929
|
-
style:
|
|
4496
|
+
style: styles19.button
|
|
3930
4497
|
},
|
|
3931
4498
|
"Allow"
|
|
3932
|
-
), /* @__PURE__ */
|
|
4499
|
+
), /* @__PURE__ */ React37.createElement(Footer, null)));
|
|
3933
4500
|
};
|
|
3934
|
-
var
|
|
4501
|
+
var styles19 = StyleSheet19.create({
|
|
3935
4502
|
container: {
|
|
3936
4503
|
flex: 1
|
|
3937
4504
|
},
|
|
@@ -3989,8 +4556,8 @@ var styles17 = StyleSheet17.create({
|
|
|
3989
4556
|
});
|
|
3990
4557
|
|
|
3991
4558
|
// src/molecules/StatusModal.tsx
|
|
3992
|
-
import
|
|
3993
|
-
import { StyleSheet as
|
|
4559
|
+
import React38 from "react";
|
|
4560
|
+
import { StyleSheet as StyleSheet20, Text as Text18, View as View20 } from "react-native";
|
|
3994
4561
|
var StatusModal = ({
|
|
3995
4562
|
open,
|
|
3996
4563
|
onClose,
|
|
@@ -4007,18 +4574,18 @@ var StatusModal = ({
|
|
|
4007
4574
|
}
|
|
4008
4575
|
onClose();
|
|
4009
4576
|
};
|
|
4010
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ React38.createElement(Modal, { isOpen: open, onClose: handleClose, size: "xl" }, /* @__PURE__ */ React38.createElement(ModalHeader, { showCloseButton: false, onClose: handleClose }, ""), /* @__PURE__ */ React38.createElement(ModalBody, null, /* @__PURE__ */ React38.createElement(View20, { style: styles20.container }, /* @__PURE__ */ React38.createElement(View20, { style: styles20.iconContainer }, status === "success" ? /* @__PURE__ */ React38.createElement(SuccessIcon, { size: 80 }) : /* @__PURE__ */ React38.createElement(ErrorIcon, { size: 80 })), /* @__PURE__ */ React38.createElement(Text18, { style: [styles20.message, { color: theme.colors.text }] }, status === "success" ? "Connection successful" : "Connection failed"), /* @__PURE__ */ React38.createElement(Alert, null, /* @__PURE__ */ React38.createElement(AlertTitle, null, "Sync in Progress"), /* @__PURE__ */ React38.createElement(AlertDescription, null, "The syncing process might take a moment. Please wait, and your data will be updated soon.")))), /* @__PURE__ */ React38.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React38.createElement(
|
|
4011
4578
|
Button,
|
|
4012
4579
|
{
|
|
4013
4580
|
variant: "outline",
|
|
4014
4581
|
size: "lg",
|
|
4015
4582
|
onPress: status === "success" ? onSuccess : onError,
|
|
4016
|
-
style:
|
|
4583
|
+
style: styles20.button
|
|
4017
4584
|
},
|
|
4018
4585
|
status === "success" ? "Continue" : "Try again later"
|
|
4019
|
-
), /* @__PURE__ */
|
|
4586
|
+
), /* @__PURE__ */ React38.createElement(Footer, null)));
|
|
4020
4587
|
};
|
|
4021
|
-
var
|
|
4588
|
+
var styles20 = StyleSheet20.create({
|
|
4022
4589
|
container: {
|
|
4023
4590
|
flex: 1,
|
|
4024
4591
|
alignItems: "center",
|
|
@@ -4042,64 +4609,6 @@ var styles18 = StyleSheet18.create({
|
|
|
4042
4609
|
}
|
|
4043
4610
|
});
|
|
4044
4611
|
|
|
4045
|
-
// src/molecules/EndModal.tsx
|
|
4046
|
-
import React35, { useEffect as useEffect3 } from "react";
|
|
4047
|
-
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
4048
|
-
var EndModal = ({ open, onClose }) => {
|
|
4049
|
-
const theme = useTheme();
|
|
4050
|
-
useEffect3(() => {
|
|
4051
|
-
if (!open) return;
|
|
4052
|
-
const timer = setTimeout(() => {
|
|
4053
|
-
onClose();
|
|
4054
|
-
}, 5e3);
|
|
4055
|
-
return () => clearTimeout(timer);
|
|
4056
|
-
}, []);
|
|
4057
|
-
return /* @__PURE__ */ React35.createElement(Modal, { isOpen: open, onClose, size: "md" }, /* @__PURE__ */ React35.createElement(ModalHeader, { onClose }, ""), /* @__PURE__ */ React35.createElement(ModalBody, null, /* @__PURE__ */ React35.createElement(View19, { style: styles19.container }, /* @__PURE__ */ React35.createElement(
|
|
4058
|
-
View19,
|
|
4059
|
-
{
|
|
4060
|
-
style: [
|
|
4061
|
-
styles19.iconContainer,
|
|
4062
|
-
{ backgroundColor: theme.colors.successLight }
|
|
4063
|
-
]
|
|
4064
|
-
},
|
|
4065
|
-
/* @__PURE__ */ React35.createElement(SuccessIcon, { size: 80 })
|
|
4066
|
-
), /* @__PURE__ */ React35.createElement(Text17, { style: [styles19.message, { color: theme.colors.text }] }, `All set! We're redirecting you back to the app. If it takes longer
|
|
4067
|
-
than expected, tap the button below to continue.`))), /* @__PURE__ */ React35.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React35.createElement(
|
|
4068
|
-
Button,
|
|
4069
|
-
{
|
|
4070
|
-
variant: "primary",
|
|
4071
|
-
size: "lg",
|
|
4072
|
-
onPress: onClose,
|
|
4073
|
-
style: styles19.button
|
|
4074
|
-
},
|
|
4075
|
-
"Continue to App"
|
|
4076
|
-
), /* @__PURE__ */ React35.createElement(Footer, null)));
|
|
4077
|
-
};
|
|
4078
|
-
var styles19 = StyleSheet19.create({
|
|
4079
|
-
container: {
|
|
4080
|
-
alignItems: "center",
|
|
4081
|
-
paddingVertical: 20
|
|
4082
|
-
},
|
|
4083
|
-
iconContainer: {
|
|
4084
|
-
width: 80,
|
|
4085
|
-
height: 80,
|
|
4086
|
-
borderRadius: 40,
|
|
4087
|
-
alignItems: "center",
|
|
4088
|
-
justifyContent: "center",
|
|
4089
|
-
marginBottom: 20
|
|
4090
|
-
},
|
|
4091
|
-
message: {
|
|
4092
|
-
fontSize: 14,
|
|
4093
|
-
textAlign: "center",
|
|
4094
|
-
lineHeight: 20,
|
|
4095
|
-
marginBottom: 24,
|
|
4096
|
-
paddingHorizontal: 20
|
|
4097
|
-
},
|
|
4098
|
-
button: {
|
|
4099
|
-
width: "100%"
|
|
4100
|
-
}
|
|
4101
|
-
});
|
|
4102
|
-
|
|
4103
4612
|
// src/KryptosConnectButton.tsx
|
|
4104
4613
|
var KryptosConnectButton = ({
|
|
4105
4614
|
children,
|
|
@@ -4107,17 +4616,18 @@ var KryptosConnectButton = ({
|
|
|
4107
4616
|
onError,
|
|
4108
4617
|
generateLinkToken,
|
|
4109
4618
|
style,
|
|
4110
|
-
textStyle
|
|
4619
|
+
textStyle,
|
|
4620
|
+
integrationName
|
|
4111
4621
|
}) => {
|
|
4112
4622
|
const { theme: themeName } = useKryptosConnect();
|
|
4113
|
-
const [open, setOpen] =
|
|
4623
|
+
const [open, setOpen] = React39.useState(false);
|
|
4114
4624
|
const theme = useTheme();
|
|
4115
|
-
return /* @__PURE__ */
|
|
4116
|
-
|
|
4625
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, children ? /* @__PURE__ */ React39.createElement(TouchableOpacity9, { onPress: () => setOpen(true), style }, children) : /* @__PURE__ */ React39.createElement(
|
|
4626
|
+
TouchableOpacity9,
|
|
4117
4627
|
{
|
|
4118
4628
|
onPress: () => setOpen(true),
|
|
4119
4629
|
style: [
|
|
4120
|
-
|
|
4630
|
+
styles21.defaultButton,
|
|
4121
4631
|
themeName === "light" ? {
|
|
4122
4632
|
backgroundColor: theme.colors.white,
|
|
4123
4633
|
borderRadius: theme.borderRadius.md,
|
|
@@ -4131,11 +4641,11 @@ var KryptosConnectButton = ({
|
|
|
4131
4641
|
],
|
|
4132
4642
|
activeOpacity: 0.8
|
|
4133
4643
|
},
|
|
4134
|
-
/* @__PURE__ */
|
|
4135
|
-
|
|
4644
|
+
/* @__PURE__ */ React39.createElement(
|
|
4645
|
+
Text19,
|
|
4136
4646
|
{
|
|
4137
4647
|
style: [
|
|
4138
|
-
|
|
4648
|
+
styles21.buttonText,
|
|
4139
4649
|
{
|
|
4140
4650
|
color: themeName === "light" ? theme.colors.primary : theme.colors.white,
|
|
4141
4651
|
fontSize: theme.fontSize.lg
|
|
@@ -4143,18 +4653,17 @@ var KryptosConnectButton = ({
|
|
|
4143
4653
|
textStyle
|
|
4144
4654
|
]
|
|
4145
4655
|
},
|
|
4146
|
-
"Connect
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
/* @__PURE__ */ React36.createElement(LogoIcon, { size: 24 })
|
|
4150
|
-
), /* @__PURE__ */ React36.createElement(
|
|
4656
|
+
integrationName ? `Connect ${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)} Account` : "Connect With Kryptos"
|
|
4657
|
+
)
|
|
4658
|
+
), open && /* @__PURE__ */ React39.createElement(
|
|
4151
4659
|
KryptosConnectModal,
|
|
4152
4660
|
{
|
|
4153
4661
|
open,
|
|
4154
4662
|
setOpen,
|
|
4155
4663
|
onSuccess,
|
|
4156
4664
|
onError,
|
|
4157
|
-
generateLinkToken
|
|
4665
|
+
generateLinkToken,
|
|
4666
|
+
integrationName
|
|
4158
4667
|
}
|
|
4159
4668
|
));
|
|
4160
4669
|
};
|
|
@@ -4163,7 +4672,8 @@ var KryptosConnectModal = ({
|
|
|
4163
4672
|
setOpen,
|
|
4164
4673
|
onSuccess,
|
|
4165
4674
|
onError,
|
|
4166
|
-
generateLinkToken
|
|
4675
|
+
generateLinkToken,
|
|
4676
|
+
integrationName
|
|
4167
4677
|
}) => {
|
|
4168
4678
|
const {
|
|
4169
4679
|
setIsInitialized,
|
|
@@ -4175,7 +4685,20 @@ var KryptosConnectModal = ({
|
|
|
4175
4685
|
isAuthorized,
|
|
4176
4686
|
linkToken
|
|
4177
4687
|
} = useKryptosConnect();
|
|
4178
|
-
const [step, setStep] =
|
|
4688
|
+
const [step, setStep] = React39.useState("INIT" /* INIT */);
|
|
4689
|
+
const [integrationDetails, setIntegrationDetails] = useState4(null);
|
|
4690
|
+
useEffect5(() => {
|
|
4691
|
+
if (integrationName && linkToken) {
|
|
4692
|
+
const fetchIntegrationDetails = async () => {
|
|
4693
|
+
const integrationDetails2 = await getSupportedProviders(
|
|
4694
|
+
linkToken,
|
|
4695
|
+
integrationName
|
|
4696
|
+
);
|
|
4697
|
+
setIntegrationDetails(integrationDetails2?.providers?.[0]);
|
|
4698
|
+
};
|
|
4699
|
+
fetchIntegrationDetails();
|
|
4700
|
+
}
|
|
4701
|
+
}, [integrationName, linkToken]);
|
|
4179
4702
|
const handleClose = () => {
|
|
4180
4703
|
setOpen(false);
|
|
4181
4704
|
setIsInitialized(false);
|
|
@@ -4211,7 +4734,7 @@ var KryptosConnectModal = ({
|
|
|
4211
4734
|
handleClose();
|
|
4212
4735
|
};
|
|
4213
4736
|
if (!open) return null;
|
|
4214
|
-
return /* @__PURE__ */
|
|
4737
|
+
return /* @__PURE__ */ React39.createElement(View21, { style: styles21.container }, step === "INIT" /* INIT */ && /* @__PURE__ */ React39.createElement(
|
|
4215
4738
|
Init,
|
|
4216
4739
|
{
|
|
4217
4740
|
open,
|
|
@@ -4225,7 +4748,7 @@ var KryptosConnectModal = ({
|
|
|
4225
4748
|
},
|
|
4226
4749
|
onClose: handleAbort
|
|
4227
4750
|
}
|
|
4228
|
-
), step === "AUTH" /* AUTH */ && /* @__PURE__ */
|
|
4751
|
+
), step === "AUTH" /* AUTH */ && /* @__PURE__ */ React39.createElement(
|
|
4229
4752
|
Auth,
|
|
4230
4753
|
{
|
|
4231
4754
|
open,
|
|
@@ -4233,28 +4756,29 @@ var KryptosConnectModal = ({
|
|
|
4233
4756
|
onGuestSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4234
4757
|
onClose: handleAbort
|
|
4235
4758
|
}
|
|
4236
|
-
), step === "OTP" /* OTP */ && /* @__PURE__ */
|
|
4759
|
+
), step === "OTP" /* OTP */ && /* @__PURE__ */ React39.createElement(
|
|
4237
4760
|
OTPVerify,
|
|
4238
4761
|
{
|
|
4239
4762
|
open,
|
|
4240
4763
|
onSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4241
4764
|
onClose: handleAbort
|
|
4242
4765
|
}
|
|
4243
|
-
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */
|
|
4766
|
+
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */ React39.createElement(
|
|
4244
4767
|
Integration,
|
|
4245
4768
|
{
|
|
4246
4769
|
open,
|
|
4247
4770
|
onSuccess: handleConsentClick,
|
|
4248
|
-
onClose: handleAbort
|
|
4771
|
+
onClose: handleAbort,
|
|
4772
|
+
integrationDetails
|
|
4249
4773
|
}
|
|
4250
|
-
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */
|
|
4774
|
+
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */ React39.createElement(
|
|
4251
4775
|
Permissions,
|
|
4252
4776
|
{
|
|
4253
4777
|
open,
|
|
4254
4778
|
onClose: handleAbort,
|
|
4255
4779
|
onSuccess: () => setStep("STATUS" /* STATUS */)
|
|
4256
4780
|
}
|
|
4257
|
-
), step === "STATUS" /* STATUS */ && /* @__PURE__ */
|
|
4781
|
+
), step === "STATUS" /* STATUS */ && /* @__PURE__ */ React39.createElement(
|
|
4258
4782
|
StatusModal,
|
|
4259
4783
|
{
|
|
4260
4784
|
open,
|
|
@@ -4263,7 +4787,7 @@ var KryptosConnectModal = ({
|
|
|
4263
4787
|
onError: handleError,
|
|
4264
4788
|
status: userConsent?.public_token ? "success" : "error"
|
|
4265
4789
|
}
|
|
4266
|
-
), step === "END" /* END */ && /* @__PURE__ */
|
|
4790
|
+
), step === "END" /* END */ && /* @__PURE__ */ React39.createElement(
|
|
4267
4791
|
EndModal,
|
|
4268
4792
|
{
|
|
4269
4793
|
open,
|
|
@@ -4275,7 +4799,7 @@ var KryptosConnectModal = ({
|
|
|
4275
4799
|
}
|
|
4276
4800
|
));
|
|
4277
4801
|
};
|
|
4278
|
-
var
|
|
4802
|
+
var styles21 = StyleSheet21.create({
|
|
4279
4803
|
defaultButton: {
|
|
4280
4804
|
flexDirection: "row",
|
|
4281
4805
|
alignItems: "center",
|