@kryptos_connect/mobile-sdk 1.0.4 → 1.0.6-dev.1
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/README.md +136 -80
- package/dist/index.d.mts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +1103 -643
- package/dist/index.mjs +1099 -652
- 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";
|
|
@@ -114,7 +72,7 @@ async function createAnonymousUser(linkToken, clientId) {
|
|
|
114
72
|
}
|
|
115
73
|
}
|
|
116
74
|
);
|
|
117
|
-
return res.data;
|
|
75
|
+
return res.data?.data;
|
|
118
76
|
}
|
|
119
77
|
async function addUserIntegration(linkToken, integration) {
|
|
120
78
|
const res = await api.post(
|
|
@@ -150,8 +108,8 @@ async function testCredentials(linkToken, data) {
|
|
|
150
108
|
});
|
|
151
109
|
return res.data?.data;
|
|
152
110
|
}
|
|
153
|
-
async function getSupportedProviders(linkToken) {
|
|
154
|
-
const res = await api.get(
|
|
111
|
+
async function getSupportedProviders(linkToken, id) {
|
|
112
|
+
const res = await api.get(`/integrations/providers${id ? `?id=${id}` : ""}`, {
|
|
155
113
|
headers: {
|
|
156
114
|
"X-LINK-TOKEN": linkToken
|
|
157
115
|
}
|
|
@@ -197,23 +155,23 @@ async function getUserInfo(linkToken) {
|
|
|
197
155
|
// src/contexts/KryptosContext.tsx
|
|
198
156
|
var globalBaseUrl;
|
|
199
157
|
var getGlobalBaseUrl = () => globalBaseUrl;
|
|
200
|
-
var KryptosContext =
|
|
158
|
+
var KryptosContext = React.createContext(
|
|
201
159
|
void 0
|
|
202
160
|
);
|
|
203
161
|
var KryptosConnectProvider = ({ children, config }) => {
|
|
204
|
-
const [isInitialized, setIsInitialized] =
|
|
205
|
-
const [linkToken, setLinkToken] =
|
|
206
|
-
const [user, setUser] =
|
|
207
|
-
const [email, setEmail] =
|
|
208
|
-
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(
|
|
209
167
|
null
|
|
210
168
|
);
|
|
211
|
-
const [isAuthorized, setIsAuthorized] =
|
|
212
|
-
const [clientInfo, setClientInfo] =
|
|
213
|
-
|
|
169
|
+
const [isAuthorized, setIsAuthorized] = React.useState(false);
|
|
170
|
+
const [clientInfo, setClientInfo] = React.useState(null);
|
|
171
|
+
React.useEffect(() => {
|
|
214
172
|
globalBaseUrl = config.baseUrl;
|
|
215
173
|
}, [config.baseUrl]);
|
|
216
|
-
|
|
174
|
+
React.useEffect(() => {
|
|
217
175
|
const fetchClientInfo = async () => {
|
|
218
176
|
if (linkToken) {
|
|
219
177
|
const res = await getClientInfo(linkToken);
|
|
@@ -222,7 +180,7 @@ var KryptosConnectProvider = ({ children, config }) => {
|
|
|
222
180
|
};
|
|
223
181
|
fetchClientInfo();
|
|
224
182
|
}, [linkToken]);
|
|
225
|
-
return /* @__PURE__ */
|
|
183
|
+
return /* @__PURE__ */ React.createElement(
|
|
226
184
|
KryptosContext.Provider,
|
|
227
185
|
{
|
|
228
186
|
value: {
|
|
@@ -246,7 +204,7 @@ var KryptosConnectProvider = ({ children, config }) => {
|
|
|
246
204
|
);
|
|
247
205
|
};
|
|
248
206
|
var useKryptosConnect = () => {
|
|
249
|
-
const ctx =
|
|
207
|
+
const ctx = React.useContext(KryptosContext);
|
|
250
208
|
if (!ctx)
|
|
251
209
|
throw new Error(
|
|
252
210
|
"useKryptosConnect must be used inside <KryptosConnectProvider>"
|
|
@@ -255,7 +213,7 @@ var useKryptosConnect = () => {
|
|
|
255
213
|
};
|
|
256
214
|
|
|
257
215
|
// src/hooks/useTheme.ts
|
|
258
|
-
import
|
|
216
|
+
import React2 from "react";
|
|
259
217
|
|
|
260
218
|
// src/theme/index.ts
|
|
261
219
|
var lightTheme = {
|
|
@@ -396,14 +354,14 @@ var getTheme = (isDark) => {
|
|
|
396
354
|
// src/hooks/useTheme.ts
|
|
397
355
|
var useTheme = () => {
|
|
398
356
|
const { theme } = useKryptosConnect();
|
|
399
|
-
const currentTheme =
|
|
357
|
+
const currentTheme = React2.useMemo(() => {
|
|
400
358
|
return getTheme(theme === "dark");
|
|
401
359
|
}, [theme]);
|
|
402
360
|
return currentTheme;
|
|
403
361
|
};
|
|
404
362
|
|
|
405
363
|
// src/components/Button.tsx
|
|
406
|
-
import
|
|
364
|
+
import React3 from "react";
|
|
407
365
|
import {
|
|
408
366
|
TouchableOpacity,
|
|
409
367
|
Text,
|
|
@@ -522,7 +480,7 @@ var Button = ({
|
|
|
522
480
|
}
|
|
523
481
|
};
|
|
524
482
|
const sizeStyles = getSizeStyles();
|
|
525
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ React3.createElement(
|
|
526
484
|
TouchableOpacity,
|
|
527
485
|
{
|
|
528
486
|
onPress,
|
|
@@ -536,7 +494,7 @@ var Button = ({
|
|
|
536
494
|
style
|
|
537
495
|
]
|
|
538
496
|
},
|
|
539
|
-
loading ? /* @__PURE__ */
|
|
497
|
+
loading ? /* @__PURE__ */ React3.createElement(ActivityIndicator, { size: "small", color: getTextColor() }) : typeof children === "string" ? /* @__PURE__ */ React3.createElement(
|
|
540
498
|
Text,
|
|
541
499
|
{
|
|
542
500
|
style: [
|
|
@@ -547,7 +505,7 @@ var Button = ({
|
|
|
547
505
|
]
|
|
548
506
|
},
|
|
549
507
|
children
|
|
550
|
-
) : /* @__PURE__ */
|
|
508
|
+
) : /* @__PURE__ */ React3.createElement(View, { style: styles.contentContainer }, children)
|
|
551
509
|
);
|
|
552
510
|
};
|
|
553
511
|
var styles = StyleSheet.create({
|
|
@@ -572,7 +530,7 @@ var styles = StyleSheet.create({
|
|
|
572
530
|
});
|
|
573
531
|
|
|
574
532
|
// src/components/Input.tsx
|
|
575
|
-
import
|
|
533
|
+
import React4 from "react";
|
|
576
534
|
import {
|
|
577
535
|
View as View2,
|
|
578
536
|
TextInput,
|
|
@@ -601,7 +559,7 @@ var Input = ({
|
|
|
601
559
|
return theme.colors.border;
|
|
602
560
|
}
|
|
603
561
|
};
|
|
604
|
-
return /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ React4.createElement(View2, { style: [styles2.wrapper, containerStyle] }, label && /* @__PURE__ */ React4.createElement(
|
|
605
563
|
Text2,
|
|
606
564
|
{
|
|
607
565
|
style: [
|
|
@@ -611,7 +569,7 @@ var Input = ({
|
|
|
611
569
|
]
|
|
612
570
|
},
|
|
613
571
|
label
|
|
614
|
-
), /* @__PURE__ */
|
|
572
|
+
), /* @__PURE__ */ React4.createElement(
|
|
615
573
|
TextInput,
|
|
616
574
|
{
|
|
617
575
|
placeholderTextColor: theme.colors.textTertiary,
|
|
@@ -630,7 +588,7 @@ var Input = ({
|
|
|
630
588
|
],
|
|
631
589
|
...props
|
|
632
590
|
}
|
|
633
|
-
), error && /* @__PURE__ */
|
|
591
|
+
), error && /* @__PURE__ */ React4.createElement(
|
|
634
592
|
Text2,
|
|
635
593
|
{
|
|
636
594
|
style: [
|
|
@@ -639,7 +597,7 @@ var Input = ({
|
|
|
639
597
|
]
|
|
640
598
|
},
|
|
641
599
|
error
|
|
642
|
-
), helperText && !error && /* @__PURE__ */
|
|
600
|
+
), helperText && !error && /* @__PURE__ */ React4.createElement(
|
|
643
601
|
Text2,
|
|
644
602
|
{
|
|
645
603
|
style: [
|
|
@@ -678,7 +636,7 @@ var styles2 = StyleSheet2.create({
|
|
|
678
636
|
});
|
|
679
637
|
|
|
680
638
|
// src/components/Alert.tsx
|
|
681
|
-
import
|
|
639
|
+
import React5 from "react";
|
|
682
640
|
import { StyleSheet as StyleSheet3, Text as Text3, View as View3 } from "react-native";
|
|
683
641
|
var Alert = ({
|
|
684
642
|
variant = "default",
|
|
@@ -700,7 +658,7 @@ var Alert = ({
|
|
|
700
658
|
};
|
|
701
659
|
}
|
|
702
660
|
};
|
|
703
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ React5.createElement(
|
|
704
662
|
View3,
|
|
705
663
|
{
|
|
706
664
|
style: [
|
|
@@ -716,12 +674,30 @@ var Alert = ({
|
|
|
716
674
|
children
|
|
717
675
|
);
|
|
718
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
|
+
};
|
|
719
695
|
var AlertDescription = ({
|
|
720
696
|
children,
|
|
721
697
|
style
|
|
722
698
|
}) => {
|
|
723
699
|
const theme = useTheme();
|
|
724
|
-
return /* @__PURE__ */
|
|
700
|
+
return /* @__PURE__ */ React5.createElement(
|
|
725
701
|
Text3,
|
|
726
702
|
{
|
|
727
703
|
style: [
|
|
@@ -754,7 +730,7 @@ var styles3 = StyleSheet3.create({
|
|
|
754
730
|
});
|
|
755
731
|
|
|
756
732
|
// src/components/Modal.tsx
|
|
757
|
-
import
|
|
733
|
+
import React7 from "react";
|
|
758
734
|
import {
|
|
759
735
|
Dimensions,
|
|
760
736
|
KeyboardAvoidingView,
|
|
@@ -768,14 +744,14 @@ import {
|
|
|
768
744
|
} from "react-native";
|
|
769
745
|
|
|
770
746
|
// src/assets/CloseIcon.tsx
|
|
771
|
-
import
|
|
772
|
-
import
|
|
747
|
+
import React6 from "react";
|
|
748
|
+
import Svg, { Path } from "react-native-svg";
|
|
773
749
|
var CloseIcon = ({
|
|
774
750
|
size = 20,
|
|
775
751
|
color = "#000"
|
|
776
752
|
}) => {
|
|
777
|
-
return /* @__PURE__ */
|
|
778
|
-
|
|
753
|
+
return /* @__PURE__ */ React6.createElement(Svg, { width: size, height: size, viewBox: "0 0 20 20", fill: "none" }, /* @__PURE__ */ React6.createElement(
|
|
754
|
+
Path,
|
|
779
755
|
{
|
|
780
756
|
d: "M15 5L5 15M5 5L15 15",
|
|
781
757
|
stroke: color,
|
|
@@ -801,7 +777,7 @@ var Modal = ({
|
|
|
801
777
|
const getSizeStyles = () => {
|
|
802
778
|
switch (size) {
|
|
803
779
|
case "xs":
|
|
804
|
-
return { maxHeight: SCREEN_HEIGHT * 0.
|
|
780
|
+
return { maxHeight: SCREEN_HEIGHT * 0.4 };
|
|
805
781
|
case "sm":
|
|
806
782
|
return { maxHeight: SCREEN_HEIGHT * 0.45 };
|
|
807
783
|
case "md":
|
|
@@ -819,13 +795,13 @@ var Modal = ({
|
|
|
819
795
|
const handleOverlayPress = () => {
|
|
820
796
|
if (!disableClose && closeOnOverlayClick) onClose();
|
|
821
797
|
};
|
|
822
|
-
return /* @__PURE__ */
|
|
798
|
+
return /* @__PURE__ */ React7.createElement(
|
|
823
799
|
KeyboardAvoidingView,
|
|
824
800
|
{
|
|
825
801
|
behavior: Platform.OS === "ios" ? "padding" : "height",
|
|
826
802
|
style: styles4.keyboardView
|
|
827
803
|
},
|
|
828
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ React7.createElement(
|
|
829
805
|
RNModal,
|
|
830
806
|
{
|
|
831
807
|
visible: isOpen,
|
|
@@ -834,14 +810,14 @@ var Modal = ({
|
|
|
834
810
|
statusBarTranslucent: true,
|
|
835
811
|
onRequestClose: disableClose ? void 0 : onClose
|
|
836
812
|
},
|
|
837
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ React7.createElement(
|
|
838
814
|
TouchableOpacity2,
|
|
839
815
|
{
|
|
840
816
|
activeOpacity: 1,
|
|
841
817
|
style: [styles4.overlay, { backgroundColor: theme.colors.overlay }],
|
|
842
818
|
onPress: handleOverlayPress
|
|
843
819
|
},
|
|
844
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ React7.createElement(
|
|
845
821
|
View4,
|
|
846
822
|
{
|
|
847
823
|
style: [
|
|
@@ -872,7 +848,7 @@ var ModalHeader = ({
|
|
|
872
848
|
style
|
|
873
849
|
}) => {
|
|
874
850
|
const theme = useTheme();
|
|
875
|
-
return /* @__PURE__ */
|
|
851
|
+
return /* @__PURE__ */ React7.createElement(
|
|
876
852
|
View4,
|
|
877
853
|
{
|
|
878
854
|
style: [
|
|
@@ -885,7 +861,7 @@ var ModalHeader = ({
|
|
|
885
861
|
style
|
|
886
862
|
]
|
|
887
863
|
},
|
|
888
|
-
/* @__PURE__ */
|
|
864
|
+
/* @__PURE__ */ React7.createElement(View4, { style: styles4.headerContent }, typeof children === "string" ? /* @__PURE__ */ React7.createElement(
|
|
889
865
|
Text4,
|
|
890
866
|
{
|
|
891
867
|
style: [
|
|
@@ -895,7 +871,7 @@ var ModalHeader = ({
|
|
|
895
871
|
},
|
|
896
872
|
children
|
|
897
873
|
) : children),
|
|
898
|
-
showCloseButton && onClose && /* @__PURE__ */
|
|
874
|
+
showCloseButton && onClose && /* @__PURE__ */ React7.createElement(
|
|
899
875
|
TouchableOpacity2,
|
|
900
876
|
{
|
|
901
877
|
onPress: onClose,
|
|
@@ -905,7 +881,7 @@ var ModalHeader = ({
|
|
|
905
881
|
{ backgroundColor: theme.colors.surface }
|
|
906
882
|
]
|
|
907
883
|
},
|
|
908
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ React7.createElement(CloseIcon, { color: theme.colors.text, size: 20 })
|
|
909
885
|
)
|
|
910
886
|
);
|
|
911
887
|
};
|
|
@@ -916,7 +892,7 @@ var ModalBody = ({
|
|
|
916
892
|
}) => {
|
|
917
893
|
const theme = useTheme();
|
|
918
894
|
if (scrollable) {
|
|
919
|
-
return /* @__PURE__ */
|
|
895
|
+
return /* @__PURE__ */ React7.createElement(
|
|
920
896
|
ScrollView,
|
|
921
897
|
{
|
|
922
898
|
style: styles4.bodyScroll,
|
|
@@ -931,14 +907,14 @@ var ModalBody = ({
|
|
|
931
907
|
children
|
|
932
908
|
);
|
|
933
909
|
}
|
|
934
|
-
return /* @__PURE__ */
|
|
910
|
+
return /* @__PURE__ */ React7.createElement(View4, { style: [styles4.body, { padding: theme.spacing.lg }, style] }, children);
|
|
935
911
|
};
|
|
936
912
|
var ModalFooter = ({
|
|
937
913
|
children,
|
|
938
914
|
style
|
|
939
915
|
}) => {
|
|
940
916
|
const theme = useTheme();
|
|
941
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ React7.createElement(
|
|
942
918
|
View4,
|
|
943
919
|
{
|
|
944
920
|
style: [
|
|
@@ -1012,7 +988,7 @@ var styles4 = StyleSheet4.create({
|
|
|
1012
988
|
});
|
|
1013
989
|
|
|
1014
990
|
// src/components/OTP.tsx
|
|
1015
|
-
import
|
|
991
|
+
import React8 from "react";
|
|
1016
992
|
import {
|
|
1017
993
|
View as View5,
|
|
1018
994
|
TextInput as TextInput2,
|
|
@@ -1033,11 +1009,11 @@ var OTP = ({
|
|
|
1033
1009
|
}) => {
|
|
1034
1010
|
const theme = useTheme();
|
|
1035
1011
|
const AUTO_SUBMIT_DELAY = 500;
|
|
1036
|
-
const [otp, setOtp] =
|
|
1012
|
+
const [otp, setOtp] = React8.useState(
|
|
1037
1013
|
value.split("").concat(Array(length).fill("")).slice(0, length)
|
|
1038
1014
|
);
|
|
1039
|
-
const inputRefs =
|
|
1040
|
-
|
|
1015
|
+
const inputRefs = React8.useRef([]);
|
|
1016
|
+
React8.useEffect(() => {
|
|
1041
1017
|
const isComplete = otp.every((digit) => digit !== "");
|
|
1042
1018
|
let timer;
|
|
1043
1019
|
if (isComplete && onComplete) {
|
|
@@ -1049,12 +1025,12 @@ var OTP = ({
|
|
|
1049
1025
|
if (timer) clearTimeout(timer);
|
|
1050
1026
|
};
|
|
1051
1027
|
}, [otp, onComplete]);
|
|
1052
|
-
|
|
1028
|
+
React8.useEffect(() => {
|
|
1053
1029
|
setTimeout(() => {
|
|
1054
1030
|
inputRefs.current[0]?.focus();
|
|
1055
1031
|
}, 100);
|
|
1056
1032
|
}, []);
|
|
1057
|
-
const handleChange =
|
|
1033
|
+
const handleChange = React8.useCallback(
|
|
1058
1034
|
(index, val) => {
|
|
1059
1035
|
if (disabled) return;
|
|
1060
1036
|
setErrorMessage("");
|
|
@@ -1077,7 +1053,7 @@ var OTP = ({
|
|
|
1077
1053
|
},
|
|
1078
1054
|
[otp, length, onChange, onComplete, disabled]
|
|
1079
1055
|
);
|
|
1080
|
-
const handleKeyPress =
|
|
1056
|
+
const handleKeyPress = React8.useCallback(
|
|
1081
1057
|
(index, e) => {
|
|
1082
1058
|
if (disabled) return;
|
|
1083
1059
|
if (e.nativeEvent.key === "Backspace") {
|
|
@@ -1098,7 +1074,7 @@ var OTP = ({
|
|
|
1098
1074
|
if (otp[index]) return theme.colors.success;
|
|
1099
1075
|
return theme.colors.border;
|
|
1100
1076
|
};
|
|
1101
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ React8.createElement(View5, { style: [styles5.wrapper, containerStyle] }, label && /* @__PURE__ */ React8.createElement(
|
|
1102
1078
|
Text5,
|
|
1103
1079
|
{
|
|
1104
1080
|
style: [
|
|
@@ -1107,7 +1083,7 @@ var OTP = ({
|
|
|
1107
1083
|
]
|
|
1108
1084
|
},
|
|
1109
1085
|
label
|
|
1110
|
-
), /* @__PURE__ */
|
|
1086
|
+
), /* @__PURE__ */ React8.createElement(View5, { style: styles5.container }, Array.from({ length }, (_, index) => /* @__PURE__ */ React8.createElement(
|
|
1111
1087
|
TextInput2,
|
|
1112
1088
|
{
|
|
1113
1089
|
key: index,
|
|
@@ -1132,7 +1108,7 @@ var OTP = ({
|
|
|
1132
1108
|
selectTextOnFocus: true,
|
|
1133
1109
|
caretHidden: true
|
|
1134
1110
|
}
|
|
1135
|
-
))), error && /* @__PURE__ */
|
|
1111
|
+
))), error && /* @__PURE__ */ React8.createElement(
|
|
1136
1112
|
Text5,
|
|
1137
1113
|
{
|
|
1138
1114
|
style: [
|
|
@@ -1175,7 +1151,7 @@ var styles5 = StyleSheet5.create({
|
|
|
1175
1151
|
});
|
|
1176
1152
|
|
|
1177
1153
|
// src/components/SkeletonItem.tsx
|
|
1178
|
-
import
|
|
1154
|
+
import React9, { useEffect, useRef } from "react";
|
|
1179
1155
|
import { Animated, View as View6, StyleSheet as StyleSheet6 } from "react-native";
|
|
1180
1156
|
var SkeletonItem = () => {
|
|
1181
1157
|
const opacity = useRef(new Animated.Value(0.3)).current;
|
|
@@ -1195,7 +1171,7 @@ var SkeletonItem = () => {
|
|
|
1195
1171
|
])
|
|
1196
1172
|
).start();
|
|
1197
1173
|
}, []);
|
|
1198
|
-
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 })));
|
|
1199
1175
|
};
|
|
1200
1176
|
var styles6 = StyleSheet6.create({
|
|
1201
1177
|
row: {
|
|
@@ -1230,14 +1206,14 @@ var styles6 = StyleSheet6.create({
|
|
|
1230
1206
|
var SkeletonItem_default = SkeletonItem;
|
|
1231
1207
|
|
|
1232
1208
|
// src/components/Mode.tsx
|
|
1233
|
-
import
|
|
1209
|
+
import React10 from "react";
|
|
1234
1210
|
import { View as View7, Text as Text6, StyleSheet as StyleSheet7 } from "react-native";
|
|
1235
1211
|
var Mode = () => {
|
|
1236
1212
|
const { clientInfo } = useKryptosConnect();
|
|
1237
1213
|
const theme = useTheme();
|
|
1238
1214
|
if (!clientInfo) return null;
|
|
1239
1215
|
if (clientInfo?.project_stage === "production") return null;
|
|
1240
|
-
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"));
|
|
1241
1217
|
};
|
|
1242
1218
|
var styles7 = StyleSheet7.create({
|
|
1243
1219
|
container: {
|
|
@@ -1266,6 +1242,45 @@ import {
|
|
|
1266
1242
|
TouchableOpacity as TouchableOpacity3,
|
|
1267
1243
|
View as View8
|
|
1268
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
|
|
1269
1284
|
var PoweredByKryptos = () => {
|
|
1270
1285
|
const theme = useTheme();
|
|
1271
1286
|
const handlePress = () => {
|
|
@@ -1627,7 +1642,7 @@ var Auth = ({
|
|
|
1627
1642
|
const err = error;
|
|
1628
1643
|
console.error(error);
|
|
1629
1644
|
setErrorMessage(
|
|
1630
|
-
err?.response?.data?.message || "Failed to continue as guest"
|
|
1645
|
+
err?.response?.data?.error || err?.response?.data?.message || "Failed to continue as guest"
|
|
1631
1646
|
);
|
|
1632
1647
|
} finally {
|
|
1633
1648
|
setIsLoading(false);
|
|
@@ -1775,9 +1790,101 @@ var styles11 = StyleSheet11.create({
|
|
|
1775
1790
|
}
|
|
1776
1791
|
});
|
|
1777
1792
|
|
|
1778
|
-
// src/molecules/
|
|
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
|
|
1779
1798
|
import React21 from "react";
|
|
1780
|
-
import
|
|
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
|
+
|
|
1885
|
+
// src/molecules/Init.tsx
|
|
1886
|
+
import React23 from "react";
|
|
1887
|
+
import { ActivityIndicator as ActivityIndicator3, StyleSheet as StyleSheet13, Text as Text11, View as View13 } from "react-native";
|
|
1781
1888
|
var Init = ({
|
|
1782
1889
|
open,
|
|
1783
1890
|
onSuccess,
|
|
@@ -1792,9 +1899,9 @@ var Init = ({
|
|
|
1792
1899
|
setUser
|
|
1793
1900
|
} = useKryptosConnect();
|
|
1794
1901
|
const theme = useTheme();
|
|
1795
|
-
const [isFetching, setIsFetching] =
|
|
1796
|
-
const [error, setError] =
|
|
1797
|
-
const fetchLinkToken =
|
|
1902
|
+
const [isFetching, setIsFetching] = React23.useState(false);
|
|
1903
|
+
const [error, setError] = React23.useState(null);
|
|
1904
|
+
const fetchLinkToken = React23.useCallback(async () => {
|
|
1798
1905
|
if (!open) return;
|
|
1799
1906
|
setIsFetching(true);
|
|
1800
1907
|
setError(null);
|
|
@@ -1821,28 +1928,28 @@ var Init = ({
|
|
|
1821
1928
|
setIsFetching(false);
|
|
1822
1929
|
}
|
|
1823
1930
|
}, []);
|
|
1824
|
-
|
|
1931
|
+
React23.useEffect(() => {
|
|
1825
1932
|
fetchLinkToken();
|
|
1826
1933
|
}, [fetchLinkToken]);
|
|
1827
|
-
return /* @__PURE__ */
|
|
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(
|
|
1828
1935
|
ActivityIndicator3,
|
|
1829
1936
|
{
|
|
1830
1937
|
size: "large",
|
|
1831
1938
|
color: theme.colors.primary,
|
|
1832
|
-
style:
|
|
1939
|
+
style: styles13.spinner
|
|
1833
1940
|
}
|
|
1834
|
-
), /* @__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(
|
|
1835
1942
|
Button,
|
|
1836
1943
|
{
|
|
1837
1944
|
variant: "primary",
|
|
1838
1945
|
size: "lg",
|
|
1839
1946
|
onPress: fetchLinkToken,
|
|
1840
|
-
style:
|
|
1947
|
+
style: styles13.retryButton
|
|
1841
1948
|
},
|
|
1842
1949
|
"Retry"
|
|
1843
|
-
)))), /* @__PURE__ */
|
|
1950
|
+
)))), /* @__PURE__ */ React23.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React23.createElement(Footer, null)));
|
|
1844
1951
|
};
|
|
1845
|
-
var
|
|
1952
|
+
var styles13 = StyleSheet13.create({
|
|
1846
1953
|
container: {
|
|
1847
1954
|
flex: 1,
|
|
1848
1955
|
alignItems: "center",
|
|
@@ -1869,25 +1976,25 @@ var styles12 = StyleSheet12.create({
|
|
|
1869
1976
|
});
|
|
1870
1977
|
|
|
1871
1978
|
// src/molecules/Integration.tsx
|
|
1872
|
-
import
|
|
1979
|
+
import React35, { useCallback } from "react";
|
|
1873
1980
|
import {
|
|
1874
1981
|
FlatList,
|
|
1875
1982
|
Image as Image4,
|
|
1876
|
-
StyleSheet as
|
|
1877
|
-
Text as
|
|
1878
|
-
TouchableOpacity as
|
|
1879
|
-
View as
|
|
1983
|
+
StyleSheet as StyleSheet17,
|
|
1984
|
+
Text as Text15,
|
|
1985
|
+
TouchableOpacity as TouchableOpacity7,
|
|
1986
|
+
View as View17
|
|
1880
1987
|
} from "react-native";
|
|
1881
1988
|
|
|
1882
1989
|
// src/assets/ArrowLeftIcon.tsx
|
|
1883
|
-
import
|
|
1884
|
-
import
|
|
1990
|
+
import React24 from "react";
|
|
1991
|
+
import Svg8, { Path as Path8 } from "react-native-svg";
|
|
1885
1992
|
var ArrowLeftIcon = ({
|
|
1886
1993
|
size = 20,
|
|
1887
1994
|
color = "#000"
|
|
1888
1995
|
}) => {
|
|
1889
|
-
return /* @__PURE__ */
|
|
1890
|
-
|
|
1996
|
+
return /* @__PURE__ */ React24.createElement(Svg8, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React24.createElement(
|
|
1997
|
+
Path8,
|
|
1891
1998
|
{
|
|
1892
1999
|
d: "M19 12H5M12 19l-7-7 7-7",
|
|
1893
2000
|
stroke: color,
|
|
@@ -1899,14 +2006,14 @@ var ArrowLeftIcon = ({
|
|
|
1899
2006
|
};
|
|
1900
2007
|
|
|
1901
2008
|
// src/assets/CheckCircleIcon.tsx
|
|
1902
|
-
import
|
|
1903
|
-
import
|
|
2009
|
+
import React25 from "react";
|
|
2010
|
+
import Svg9, { Path as Path9, Circle as Circle2 } from "react-native-svg";
|
|
1904
2011
|
var CheckCircleIcon = ({
|
|
1905
2012
|
size = 20,
|
|
1906
2013
|
color = "#10B981"
|
|
1907
2014
|
}) => {
|
|
1908
|
-
return /* @__PURE__ */
|
|
1909
|
-
|
|
2015
|
+
return /* @__PURE__ */ React25.createElement(Svg9, { width: size, height: size, viewBox: "0 0 24 24", fill: "none" }, /* @__PURE__ */ React25.createElement(
|
|
2016
|
+
Circle2,
|
|
1910
2017
|
{
|
|
1911
2018
|
cx: 12,
|
|
1912
2019
|
cy: 12,
|
|
@@ -1914,8 +2021,8 @@ var CheckCircleIcon = ({
|
|
|
1914
2021
|
stroke: color,
|
|
1915
2022
|
strokeWidth: 2
|
|
1916
2023
|
}
|
|
1917
|
-
), /* @__PURE__ */
|
|
1918
|
-
|
|
2024
|
+
), /* @__PURE__ */ React25.createElement(
|
|
2025
|
+
Path9,
|
|
1919
2026
|
{
|
|
1920
2027
|
d: "m9 12 2 2 4-4",
|
|
1921
2028
|
stroke: color,
|
|
@@ -1927,16 +2034,16 @@ var CheckCircleIcon = ({
|
|
|
1927
2034
|
};
|
|
1928
2035
|
|
|
1929
2036
|
// src/assets/LoaderIcon.tsx
|
|
1930
|
-
import
|
|
2037
|
+
import React26 from "react";
|
|
1931
2038
|
import { Animated as Animated2, Easing } from "react-native";
|
|
1932
|
-
import
|
|
1933
|
-
var AnimatedSvg = Animated2.createAnimatedComponent(
|
|
2039
|
+
import Svg10, { Path as Path10 } from "react-native-svg";
|
|
2040
|
+
var AnimatedSvg = Animated2.createAnimatedComponent(Svg10);
|
|
1934
2041
|
var LoaderIcon = ({
|
|
1935
2042
|
size = 20,
|
|
1936
2043
|
color = "#00C693"
|
|
1937
2044
|
}) => {
|
|
1938
|
-
const rotateAnim =
|
|
1939
|
-
|
|
2045
|
+
const rotateAnim = React26.useRef(new Animated2.Value(0)).current;
|
|
2046
|
+
React26.useEffect(() => {
|
|
1940
2047
|
Animated2.loop(
|
|
1941
2048
|
Animated2.timing(rotateAnim, {
|
|
1942
2049
|
toValue: 1,
|
|
@@ -1950,7 +2057,7 @@ var LoaderIcon = ({
|
|
|
1950
2057
|
inputRange: [0, 1],
|
|
1951
2058
|
outputRange: ["0deg", "360deg"]
|
|
1952
2059
|
});
|
|
1953
|
-
return /* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1954
2061
|
AnimatedSvg,
|
|
1955
2062
|
{
|
|
1956
2063
|
width: size,
|
|
@@ -1959,8 +2066,8 @@ var LoaderIcon = ({
|
|
|
1959
2066
|
fill: "none",
|
|
1960
2067
|
style: { transform: [{ rotate: spin }] }
|
|
1961
2068
|
},
|
|
1962
|
-
/* @__PURE__ */
|
|
1963
|
-
|
|
2069
|
+
/* @__PURE__ */ React26.createElement(
|
|
2070
|
+
Path10,
|
|
1964
2071
|
{
|
|
1965
2072
|
d: "M21 12a9 9 0 1 1-6.219-8.56",
|
|
1966
2073
|
stroke: color,
|
|
@@ -1972,44 +2079,11 @@ var LoaderIcon = ({
|
|
|
1972
2079
|
);
|
|
1973
2080
|
};
|
|
1974
2081
|
|
|
1975
|
-
// src/assets/SuccessIcon.tsx
|
|
1976
|
-
import React25 from "react";
|
|
1977
|
-
import Svg10, { Circle as Circle2, Path as Path10 } from "react-native-svg";
|
|
1978
|
-
var SuccessIcon = ({ size = 64 }) => {
|
|
1979
|
-
return /* @__PURE__ */ React25.createElement(Svg10, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React25.createElement(
|
|
1980
|
-
Circle2,
|
|
1981
|
-
{
|
|
1982
|
-
cx: 32,
|
|
1983
|
-
cy: 32,
|
|
1984
|
-
r: 30,
|
|
1985
|
-
fill: "#00C693",
|
|
1986
|
-
opacity: 0.1
|
|
1987
|
-
}
|
|
1988
|
-
), /* @__PURE__ */ React25.createElement(
|
|
1989
|
-
Circle2,
|
|
1990
|
-
{
|
|
1991
|
-
cx: 32,
|
|
1992
|
-
cy: 32,
|
|
1993
|
-
r: 24,
|
|
1994
|
-
fill: "#00C693"
|
|
1995
|
-
}
|
|
1996
|
-
), /* @__PURE__ */ React25.createElement(
|
|
1997
|
-
Path10,
|
|
1998
|
-
{
|
|
1999
|
-
d: "M24 32l6 6 12-12",
|
|
2000
|
-
stroke: "white",
|
|
2001
|
-
strokeWidth: 3,
|
|
2002
|
-
strokeLinecap: "round",
|
|
2003
|
-
strokeLinejoin: "round"
|
|
2004
|
-
}
|
|
2005
|
-
));
|
|
2006
|
-
};
|
|
2007
|
-
|
|
2008
2082
|
// src/assets/ErrorIcon.tsx
|
|
2009
|
-
import
|
|
2083
|
+
import React27 from "react";
|
|
2010
2084
|
import Svg11, { Circle as Circle3, Path as Path11 } from "react-native-svg";
|
|
2011
2085
|
var ErrorIcon = ({ size = 64 }) => {
|
|
2012
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ React27.createElement(Svg11, { width: size, height: size, viewBox: "0 0 64 64", fill: "none" }, /* @__PURE__ */ React27.createElement(
|
|
2013
2087
|
Circle3,
|
|
2014
2088
|
{
|
|
2015
2089
|
cx: 32,
|
|
@@ -2018,7 +2092,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2018
2092
|
fill: "#EF4444",
|
|
2019
2093
|
opacity: 0.1
|
|
2020
2094
|
}
|
|
2021
|
-
), /* @__PURE__ */
|
|
2095
|
+
), /* @__PURE__ */ React27.createElement(
|
|
2022
2096
|
Circle3,
|
|
2023
2097
|
{
|
|
2024
2098
|
cx: 32,
|
|
@@ -2026,7 +2100,7 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2026
2100
|
r: 24,
|
|
2027
2101
|
fill: "#EF4444"
|
|
2028
2102
|
}
|
|
2029
|
-
), /* @__PURE__ */
|
|
2103
|
+
), /* @__PURE__ */ React27.createElement(
|
|
2030
2104
|
Path11,
|
|
2031
2105
|
{
|
|
2032
2106
|
d: "M24 24l16 16M40 24l-16 16",
|
|
@@ -2039,17 +2113,17 @@ var ErrorIcon = ({ size = 64 }) => {
|
|
|
2039
2113
|
};
|
|
2040
2114
|
|
|
2041
2115
|
// src/assets/SearchIcon.tsx
|
|
2042
|
-
import
|
|
2116
|
+
import React28 from "react";
|
|
2043
2117
|
import Svg12, { Circle as Circle4, Path as Path12 } from "react-native-svg";
|
|
2044
2118
|
|
|
2045
2119
|
// src/assets/PlusIcon.tsx
|
|
2046
|
-
import
|
|
2120
|
+
import React29 from "react";
|
|
2047
2121
|
import Svg13, { Path as Path13 } from "react-native-svg";
|
|
2048
2122
|
var PlusIcon = ({
|
|
2049
2123
|
size = 14,
|
|
2050
2124
|
color = "#6B7280"
|
|
2051
2125
|
}) => {
|
|
2052
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ React29.createElement(Svg13, { width: size, height: size, viewBox: "0 0 14 14", fill: "none" }, /* @__PURE__ */ React29.createElement(
|
|
2053
2127
|
Path13,
|
|
2054
2128
|
{
|
|
2055
2129
|
d: "M7 3.5v7M3.5 7h7",
|
|
@@ -2060,31 +2134,62 @@ var PlusIcon = ({
|
|
|
2060
2134
|
));
|
|
2061
2135
|
};
|
|
2062
2136
|
|
|
2063
|
-
// src/
|
|
2064
|
-
import
|
|
2065
|
-
import
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
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";
|
|
2179
|
+
|
|
2180
|
+
// src/utils/uuid.ts
|
|
2181
|
+
function generateUUID() {
|
|
2182
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
|
|
2183
|
+
const r = Math.random() * 16 | 0;
|
|
2184
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
2185
|
+
return v.toString(16);
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
// src/wallet-connect/wallet-connect.tsx
|
|
2190
|
+
import React31 from "react";
|
|
2191
|
+
import { AppKit, AppKitProvider } from "@reown/appkit-react-native";
|
|
2192
|
+
|
|
2088
2193
|
// src/wallet-connect/AppKitConfig.ts
|
|
2089
2194
|
import "@walletconnect/react-native-compat";
|
|
2090
2195
|
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
@@ -2191,7 +2296,7 @@ var createAppKitInstance = (projectId) => {
|
|
|
2191
2296
|
// src/wallet-connect/wallet-connect.tsx
|
|
2192
2297
|
var WalletConnectWrapper = ({ children }) => {
|
|
2193
2298
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2194
|
-
const appKit =
|
|
2299
|
+
const appKit = React31.useMemo(() => {
|
|
2195
2300
|
if (!walletConnectProjectId) {
|
|
2196
2301
|
console.warn(
|
|
2197
2302
|
"walletConnectProjectId is missing in KryptosConnectProvider config"
|
|
@@ -2201,9 +2306,9 @@ var WalletConnectWrapper = ({ children }) => {
|
|
|
2201
2306
|
return createAppKitInstance(walletConnectProjectId);
|
|
2202
2307
|
}, [walletConnectProjectId]);
|
|
2203
2308
|
if (!appKit) {
|
|
2204
|
-
return /* @__PURE__ */
|
|
2309
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, children);
|
|
2205
2310
|
}
|
|
2206
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ React31.createElement(AppKitProvider, { instance: appKit }, /* @__PURE__ */ React31.createElement(AppKit, null), children);
|
|
2207
2312
|
};
|
|
2208
2313
|
var wallet_connect_default = WalletConnectWrapper;
|
|
2209
2314
|
|
|
@@ -2215,47 +2320,49 @@ var WalletConnectComponent = ({
|
|
|
2215
2320
|
handleClose,
|
|
2216
2321
|
modalOpen,
|
|
2217
2322
|
setAddIntegrationMode,
|
|
2218
|
-
providersList
|
|
2323
|
+
providersList,
|
|
2324
|
+
errorMessage,
|
|
2325
|
+
showBackButton
|
|
2219
2326
|
}) => {
|
|
2220
2327
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2221
2328
|
const theme = useTheme();
|
|
2222
2329
|
if (!walletConnectProjectId) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
2330
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose: handleClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, showBackButton && /* @__PURE__ */ React32.createElement(
|
|
2224
2331
|
TouchableOpacity4,
|
|
2225
2332
|
{
|
|
2226
2333
|
onPress: () => {
|
|
2227
2334
|
setAddIntegrationMode(null);
|
|
2228
2335
|
},
|
|
2229
|
-
style:
|
|
2336
|
+
style: styles14.backButton
|
|
2230
2337
|
},
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
), /* @__PURE__ */
|
|
2233
|
-
|
|
2338
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2339
|
+
), /* @__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(
|
|
2340
|
+
Text12,
|
|
2234
2341
|
{
|
|
2235
|
-
style: [
|
|
2342
|
+
style: [styles14.emptyStateTitle, { color: theme.colors.text }]
|
|
2236
2343
|
},
|
|
2237
2344
|
"WalletConnect is not configured"
|
|
2238
|
-
), /* @__PURE__ */
|
|
2239
|
-
|
|
2345
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2346
|
+
Text12,
|
|
2240
2347
|
{
|
|
2241
2348
|
style: [
|
|
2242
|
-
|
|
2349
|
+
styles14.infoText,
|
|
2243
2350
|
{ color: theme.colors.textSecondary, textAlign: "center" }
|
|
2244
2351
|
]
|
|
2245
2352
|
},
|
|
2246
2353
|
"Please add a walletConnectProjectId to KryptosConnectProvider to enable wallet connections."
|
|
2247
|
-
), /* @__PURE__ */
|
|
2354
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2248
2355
|
Button,
|
|
2249
2356
|
{
|
|
2250
2357
|
variant: "outline",
|
|
2251
2358
|
size: "sm",
|
|
2252
2359
|
onPress: () => setAddIntegrationMode(null),
|
|
2253
|
-
style:
|
|
2360
|
+
style: styles14.emptyStateButton
|
|
2254
2361
|
},
|
|
2255
2362
|
"Go back"
|
|
2256
2363
|
))));
|
|
2257
2364
|
}
|
|
2258
|
-
return /* @__PURE__ */
|
|
2365
|
+
return /* @__PURE__ */ React32.createElement(wallet_connect_default, null, /* @__PURE__ */ React32.createElement(
|
|
2259
2366
|
ConnectButton,
|
|
2260
2367
|
{
|
|
2261
2368
|
integration,
|
|
@@ -2264,7 +2371,9 @@ var WalletConnectComponent = ({
|
|
|
2264
2371
|
handleClose,
|
|
2265
2372
|
modalOpen,
|
|
2266
2373
|
setAddIntegrationMode,
|
|
2267
|
-
providersList
|
|
2374
|
+
providersList,
|
|
2375
|
+
errorMessage,
|
|
2376
|
+
showBackButton
|
|
2268
2377
|
}
|
|
2269
2378
|
));
|
|
2270
2379
|
};
|
|
@@ -2274,7 +2383,9 @@ function ConnectButton({
|
|
|
2274
2383
|
handleClose,
|
|
2275
2384
|
modalOpen,
|
|
2276
2385
|
setAddIntegrationMode,
|
|
2277
|
-
providersList
|
|
2386
|
+
providersList,
|
|
2387
|
+
errorMessage: errorMessageProp,
|
|
2388
|
+
showBackButton
|
|
2278
2389
|
}) {
|
|
2279
2390
|
const theme = useTheme();
|
|
2280
2391
|
const { open, disconnect } = useAppKit();
|
|
@@ -2291,11 +2402,17 @@ function ConnectButton({
|
|
|
2291
2402
|
return userUsedChains;
|
|
2292
2403
|
}
|
|
2293
2404
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2294
|
-
return integration.walletSupportedChains
|
|
2405
|
+
return integration.walletSupportedChains.filter((supportedChain) => {
|
|
2406
|
+
const provider = providersList.find(
|
|
2407
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2408
|
+
(p) => p.id === supportedChain.id
|
|
2409
|
+
);
|
|
2410
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2411
|
+
});
|
|
2295
2412
|
}
|
|
2296
2413
|
return [];
|
|
2297
|
-
}, [userUsedChains, integration.walletSupportedChains]);
|
|
2298
|
-
|
|
2414
|
+
}, [userUsedChains, integration.walletSupportedChains, providersList]);
|
|
2415
|
+
useEffect4(() => {
|
|
2299
2416
|
if (!isConnected || !address || !address.trim()) {
|
|
2300
2417
|
setUserUsedChains([]);
|
|
2301
2418
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2314,7 +2431,16 @@ function ConnectButton({
|
|
|
2314
2431
|
}
|
|
2315
2432
|
}
|
|
2316
2433
|
if (chains.length === 0 && integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2317
|
-
chains = integration.walletSupportedChains
|
|
2434
|
+
chains = integration.walletSupportedChains.filter(
|
|
2435
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2436
|
+
(supportedChain) => {
|
|
2437
|
+
const provider = providersList.find(
|
|
2438
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2439
|
+
(p) => p.id === supportedChain.id
|
|
2440
|
+
);
|
|
2441
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2442
|
+
}
|
|
2443
|
+
);
|
|
2318
2444
|
}
|
|
2319
2445
|
if (chains.length > 0) {
|
|
2320
2446
|
setUserUsedChains(chains);
|
|
@@ -2326,11 +2452,21 @@ function ConnectButton({
|
|
|
2326
2452
|
} catch (error) {
|
|
2327
2453
|
console.error("Failed to fetch user chains:", error);
|
|
2328
2454
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2329
|
-
|
|
2455
|
+
const validChains = integration.walletSupportedChains.filter(
|
|
2456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2457
|
+
(supportedChain) => {
|
|
2458
|
+
const provider = providersList.find(
|
|
2459
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2460
|
+
(p) => p.id === supportedChain.id
|
|
2461
|
+
);
|
|
2462
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2463
|
+
}
|
|
2464
|
+
);
|
|
2465
|
+
setUserUsedChains(validChains);
|
|
2330
2466
|
setSelectedChains(
|
|
2331
2467
|
new Set(
|
|
2332
2468
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2333
|
-
|
|
2469
|
+
validChains.map((chain) => chain.id)
|
|
2334
2470
|
)
|
|
2335
2471
|
);
|
|
2336
2472
|
} else {
|
|
@@ -2350,7 +2486,8 @@ function ConnectButton({
|
|
|
2350
2486
|
address,
|
|
2351
2487
|
isConnected,
|
|
2352
2488
|
integration.isEvmWallet,
|
|
2353
|
-
integration.walletSupportedChains
|
|
2489
|
+
integration.walletSupportedChains,
|
|
2490
|
+
providersList
|
|
2354
2491
|
]);
|
|
2355
2492
|
const validateForm = () => {
|
|
2356
2493
|
if (!address) {
|
|
@@ -2387,11 +2524,11 @@ function ConnectButton({
|
|
|
2387
2524
|
source: provider?.id,
|
|
2388
2525
|
credential: {
|
|
2389
2526
|
address,
|
|
2390
|
-
userId: user?.user_id || "
|
|
2527
|
+
userId: user?.user_id || "",
|
|
2391
2528
|
projectId: provider?.projectId,
|
|
2392
|
-
apiKey: "
|
|
2393
|
-
secret: "
|
|
2394
|
-
privateKey: "
|
|
2529
|
+
apiKey: "",
|
|
2530
|
+
secret: "",
|
|
2531
|
+
privateKey: "",
|
|
2395
2532
|
alias,
|
|
2396
2533
|
walletId,
|
|
2397
2534
|
exchange: provider?.id
|
|
@@ -2430,10 +2567,9 @@ function ConnectButton({
|
|
|
2430
2567
|
default_chain_logo: integration?.logo || "",
|
|
2431
2568
|
type: provider.type || "",
|
|
2432
2569
|
isNftSupported: provider?.isEvmWallet || provider?.nftSupport || false,
|
|
2570
|
+
isCustomWallet: false,
|
|
2433
2571
|
chainId: provider?.community_id,
|
|
2434
|
-
|
|
2435
|
-
address
|
|
2436
|
-
}
|
|
2572
|
+
address: address?.trim()
|
|
2437
2573
|
};
|
|
2438
2574
|
integrationsToAdd.push(data);
|
|
2439
2575
|
} else {
|
|
@@ -2452,7 +2588,7 @@ function ConnectButton({
|
|
|
2452
2588
|
return;
|
|
2453
2589
|
}
|
|
2454
2590
|
if (integrationsToAdd.length > 0) {
|
|
2455
|
-
onAddHandle(integrationsToAdd);
|
|
2591
|
+
await onAddHandle(integrationsToAdd);
|
|
2456
2592
|
if (isConnected) {
|
|
2457
2593
|
disconnect();
|
|
2458
2594
|
}
|
|
@@ -2465,7 +2601,7 @@ function ConnectButton({
|
|
|
2465
2601
|
const err = error;
|
|
2466
2602
|
console.error(error);
|
|
2467
2603
|
setErrorMessage(
|
|
2468
|
-
err?.response?.data?.message || "Failed to add
|
|
2604
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to add integrations"
|
|
2469
2605
|
);
|
|
2470
2606
|
} finally {
|
|
2471
2607
|
setIsLoading(false);
|
|
@@ -2485,7 +2621,13 @@ function ConnectButton({
|
|
|
2485
2621
|
setChainErrors(newErrors);
|
|
2486
2622
|
}
|
|
2487
2623
|
};
|
|
2488
|
-
|
|
2624
|
+
const onClose = () => {
|
|
2625
|
+
if (isConnected) {
|
|
2626
|
+
disconnect();
|
|
2627
|
+
}
|
|
2628
|
+
handleClose();
|
|
2629
|
+
};
|
|
2630
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, showBackButton && /* @__PURE__ */ React32.createElement(
|
|
2489
2631
|
TouchableOpacity4,
|
|
2490
2632
|
{
|
|
2491
2633
|
onPress: () => {
|
|
@@ -2494,26 +2636,26 @@ function ConnectButton({
|
|
|
2494
2636
|
disconnect();
|
|
2495
2637
|
}
|
|
2496
2638
|
},
|
|
2497
|
-
style:
|
|
2639
|
+
style: styles14.backButton
|
|
2498
2640
|
},
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
), /* @__PURE__ */
|
|
2641
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2642
|
+
), /* @__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(
|
|
2501
2643
|
Image2,
|
|
2502
2644
|
{
|
|
2503
2645
|
source: { uri: integration.logo },
|
|
2504
|
-
style:
|
|
2646
|
+
style: styles14.logo,
|
|
2505
2647
|
resizeMode: "contain"
|
|
2506
2648
|
}
|
|
2507
|
-
) : /* @__PURE__ */
|
|
2508
|
-
|
|
2649
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2650
|
+
View14,
|
|
2509
2651
|
{
|
|
2510
2652
|
style: [
|
|
2511
|
-
|
|
2653
|
+
styles14.logoPlaceholder,
|
|
2512
2654
|
{ backgroundColor: theme.colors.surface }
|
|
2513
2655
|
]
|
|
2514
2656
|
},
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
), /* @__PURE__ */
|
|
2657
|
+
/* @__PURE__ */ React32.createElement(Text12, { style: { color: theme.colors.text } }, integration.name?.charAt(0) || "?")
|
|
2658
|
+
), /* @__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(
|
|
2517
2659
|
Button,
|
|
2518
2660
|
{
|
|
2519
2661
|
variant: "primary",
|
|
@@ -2521,111 +2663,132 @@ function ConnectButton({
|
|
|
2521
2663
|
onPress: () => open({ view: "Connect" })
|
|
2522
2664
|
},
|
|
2523
2665
|
"Connect Wallet"
|
|
2524
|
-
)) : /* @__PURE__ */
|
|
2525
|
-
|
|
2666
|
+
)) : /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedHeader }, /* @__PURE__ */ React32.createElement(
|
|
2667
|
+
Text12,
|
|
2526
2668
|
{
|
|
2527
|
-
style: [
|
|
2669
|
+
style: [styles14.connectedTitle, { color: theme.colors.text }]
|
|
2528
2670
|
},
|
|
2529
2671
|
"Wallet Connected"
|
|
2530
|
-
), /* @__PURE__ */
|
|
2531
|
-
|
|
2672
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2673
|
+
Text12,
|
|
2532
2674
|
{
|
|
2533
|
-
style: [
|
|
2675
|
+
style: [styles14.connectedText, { color: theme.colors.text }]
|
|
2534
2676
|
},
|
|
2535
2677
|
"Address: ",
|
|
2536
2678
|
address
|
|
2537
|
-
), /* @__PURE__ */
|
|
2538
|
-
|
|
2679
|
+
), /* @__PURE__ */ React32.createElement(Button, { variant: "ghost", size: "sm", onPress: () => disconnect() }, "Disconnect Wallet"), isFetchingChains ? /* @__PURE__ */ React32.createElement(
|
|
2680
|
+
Text12,
|
|
2539
2681
|
{
|
|
2540
|
-
style: [
|
|
2682
|
+
style: [styles14.fetchingText, { color: theme.colors.text }]
|
|
2541
2683
|
},
|
|
2542
2684
|
"Fetching chains..."
|
|
2543
|
-
) : null), availableChains.length > 0 && address && /* @__PURE__ */
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
return /* @__PURE__ */ React30.createElement(
|
|
2556
|
-
TouchableOpacity4,
|
|
2685
|
+
) : 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) => {
|
|
2686
|
+
const isSelected = selectedChains.has(chain.id);
|
|
2687
|
+
const hasError = chainErrors[chain.id];
|
|
2688
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2689
|
+
TouchableOpacity4,
|
|
2690
|
+
{
|
|
2691
|
+
onPress: () => toggleChainSelection(chain.id),
|
|
2692
|
+
style: styles14.chainButton,
|
|
2693
|
+
key: chain.id
|
|
2694
|
+
},
|
|
2695
|
+
/* @__PURE__ */ React32.createElement(
|
|
2696
|
+
View14,
|
|
2557
2697
|
{
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2698
|
+
style: [
|
|
2699
|
+
styles14.chainChip,
|
|
2700
|
+
{
|
|
2701
|
+
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
2702
|
+
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2703
|
+
}
|
|
2704
|
+
]
|
|
2561
2705
|
},
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
|
|
2706
|
+
/* @__PURE__ */ React32.createElement(
|
|
2707
|
+
Text12,
|
|
2564
2708
|
{
|
|
2565
2709
|
style: [
|
|
2566
|
-
|
|
2710
|
+
styles14.chainName,
|
|
2567
2711
|
{
|
|
2568
|
-
|
|
2569
|
-
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2712
|
+
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
2570
2713
|
}
|
|
2571
2714
|
]
|
|
2572
2715
|
},
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
{
|
|
2588
|
-
size: 12,
|
|
2589
|
-
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2590
|
-
}
|
|
2591
|
-
) : /* @__PURE__ */ React30.createElement(
|
|
2592
|
-
PlusIcon,
|
|
2593
|
-
{
|
|
2594
|
-
size: 12,
|
|
2595
|
-
color: theme.colors.textSecondary
|
|
2596
|
-
}
|
|
2597
|
-
)
|
|
2716
|
+
chain.name || chain?.id
|
|
2717
|
+
),
|
|
2718
|
+
isSelected ? /* @__PURE__ */ React32.createElement(
|
|
2719
|
+
CloseIcon,
|
|
2720
|
+
{
|
|
2721
|
+
size: 12,
|
|
2722
|
+
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2723
|
+
}
|
|
2724
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2725
|
+
PlusIcon,
|
|
2726
|
+
{
|
|
2727
|
+
size: 12,
|
|
2728
|
+
color: theme.colors.textSecondary
|
|
2729
|
+
}
|
|
2598
2730
|
)
|
|
2599
|
-
)
|
|
2600
|
-
|
|
2601
|
-
|
|
2731
|
+
)
|
|
2732
|
+
);
|
|
2733
|
+
})), selectedChains.size > 0 && availableChains.length > 0 && /* @__PURE__ */ React32.createElement(
|
|
2734
|
+
TouchableOpacity4,
|
|
2735
|
+
{
|
|
2736
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
2737
|
+
style: styles14.chainButton,
|
|
2738
|
+
activeOpacity: 0.7
|
|
2739
|
+
},
|
|
2740
|
+
/* @__PURE__ */ React32.createElement(
|
|
2741
|
+
View14,
|
|
2602
2742
|
{
|
|
2603
2743
|
style: [
|
|
2604
|
-
|
|
2605
|
-
|
|
2744
|
+
styles14.chainChip,
|
|
2745
|
+
styles14.chainChipRemoveAll,
|
|
2746
|
+
{
|
|
2747
|
+
borderWidth: 0,
|
|
2748
|
+
backgroundColor: "transparent"
|
|
2749
|
+
}
|
|
2606
2750
|
]
|
|
2607
2751
|
},
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
const chain = availableChains.find(
|
|
2611
|
-
(c) => c.id === chainId
|
|
2612
|
-
);
|
|
2613
|
-
return /* @__PURE__ */ React30.createElement(
|
|
2614
|
-
Text11,
|
|
2752
|
+
/* @__PURE__ */ React32.createElement(
|
|
2753
|
+
Text12,
|
|
2615
2754
|
{
|
|
2616
|
-
key: chainId,
|
|
2617
2755
|
style: [
|
|
2618
|
-
|
|
2619
|
-
{ color: theme.colors.
|
|
2756
|
+
styles14.chainName,
|
|
2757
|
+
{ color: theme.colors.primary }
|
|
2620
2758
|
]
|
|
2621
2759
|
},
|
|
2622
|
-
"
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2760
|
+
"Remove All Chains"
|
|
2761
|
+
),
|
|
2762
|
+
/* @__PURE__ */ React32.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
2763
|
+
)
|
|
2764
|
+
), Object.keys(chainErrors || {}).length > 0 && /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainErrorsContainer }, /* @__PURE__ */ React32.createElement(
|
|
2765
|
+
Text12,
|
|
2766
|
+
{
|
|
2767
|
+
style: [
|
|
2768
|
+
styles14.chainErrorsTitle,
|
|
2769
|
+
{ color: theme.colors.error }
|
|
2770
|
+
]
|
|
2771
|
+
},
|
|
2772
|
+
"Errors:"
|
|
2773
|
+
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
2774
|
+
const chain = availableChains.find(
|
|
2775
|
+
(c) => c.id === chainId
|
|
2776
|
+
);
|
|
2777
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2778
|
+
Text12,
|
|
2779
|
+
{
|
|
2780
|
+
key: chainId,
|
|
2781
|
+
style: [
|
|
2782
|
+
styles14.chainErrorItem,
|
|
2783
|
+
{ color: theme.colors.error }
|
|
2784
|
+
]
|
|
2785
|
+
},
|
|
2786
|
+
"\u2022 ",
|
|
2787
|
+
chain?.name ?? chainId,
|
|
2788
|
+
": ",
|
|
2789
|
+
String(error)
|
|
2790
|
+
);
|
|
2791
|
+
})))), 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(
|
|
2629
2792
|
Button,
|
|
2630
2793
|
{
|
|
2631
2794
|
variant: "outline",
|
|
@@ -2633,14 +2796,20 @@ function ConnectButton({
|
|
|
2633
2796
|
onPress: onSubmitWalletConnect,
|
|
2634
2797
|
loading: isLoading,
|
|
2635
2798
|
disabled: isLoading || !!address && availableChains.length > 0 && selectedChains.size === 0,
|
|
2636
|
-
style:
|
|
2799
|
+
style: styles14.button
|
|
2637
2800
|
},
|
|
2638
2801
|
selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size > 1 ? "s" : ""}` : "Add Integration"
|
|
2639
|
-
), /* @__PURE__ */
|
|
2802
|
+
), /* @__PURE__ */ React32.createElement(Footer, null)));
|
|
2640
2803
|
}
|
|
2641
|
-
var
|
|
2804
|
+
var styles14 = StyleSheet14.create({
|
|
2642
2805
|
connectedContainer: {
|
|
2643
|
-
|
|
2806
|
+
flexShrink: 0
|
|
2807
|
+
},
|
|
2808
|
+
chainListWrapper: {
|
|
2809
|
+
marginTop: 8
|
|
2810
|
+
},
|
|
2811
|
+
chainListContent: {
|
|
2812
|
+
paddingBottom: 8
|
|
2644
2813
|
},
|
|
2645
2814
|
connectedHeader: {
|
|
2646
2815
|
marginBottom: 8
|
|
@@ -2654,13 +2823,6 @@ var styles13 = StyleSheet13.create({
|
|
|
2654
2823
|
marginBottom: 8,
|
|
2655
2824
|
textAlign: "center"
|
|
2656
2825
|
},
|
|
2657
|
-
scrollView: {
|
|
2658
|
-
flex: 1
|
|
2659
|
-
},
|
|
2660
|
-
scrollViewContent: {
|
|
2661
|
-
paddingBottom: 40,
|
|
2662
|
-
flexGrow: 1
|
|
2663
|
-
},
|
|
2664
2826
|
errorMessageContainer: {
|
|
2665
2827
|
marginTop: 16
|
|
2666
2828
|
},
|
|
@@ -2684,10 +2846,8 @@ var styles13 = StyleSheet13.create({
|
|
|
2684
2846
|
// theme.spacing.xl
|
|
2685
2847
|
paddingBottom: 20,
|
|
2686
2848
|
width: "100%",
|
|
2687
|
-
overflow: "hidden",
|
|
2688
2849
|
alignSelf: "center",
|
|
2689
|
-
flexDirection: "column"
|
|
2690
|
-
flex: 1
|
|
2850
|
+
flexDirection: "column"
|
|
2691
2851
|
},
|
|
2692
2852
|
chainTitle: {
|
|
2693
2853
|
fontSize: 14,
|
|
@@ -2713,6 +2873,11 @@ var styles13 = StyleSheet13.create({
|
|
|
2713
2873
|
// theme.borderRadius.md
|
|
2714
2874
|
borderWidth: 1
|
|
2715
2875
|
},
|
|
2876
|
+
chainChipRemoveAll: {
|
|
2877
|
+
marginTop: 6,
|
|
2878
|
+
// theme.spacing.sm - separate from chain list
|
|
2879
|
+
width: "auto"
|
|
2880
|
+
},
|
|
2716
2881
|
chainName: {
|
|
2717
2882
|
fontSize: 12,
|
|
2718
2883
|
fontWeight: "500",
|
|
@@ -2787,44 +2952,320 @@ var styles13 = StyleSheet13.create({
|
|
|
2787
2952
|
});
|
|
2788
2953
|
|
|
2789
2954
|
// src/molecules/IntegrationForm.tsx
|
|
2790
|
-
import
|
|
2955
|
+
import React34 from "react";
|
|
2956
|
+
import { Image as Image3, StyleSheet as StyleSheet16, Text as Text14, TouchableOpacity as TouchableOpacity6, View as View16 } from "react-native";
|
|
2957
|
+
|
|
2958
|
+
// src/molecules/IntegrationInfo.tsx
|
|
2959
|
+
import React33, { useMemo as useMemo2, useState as useState3 } from "react";
|
|
2791
2960
|
import {
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
Text as Text12,
|
|
2961
|
+
Linking as Linking3,
|
|
2962
|
+
StyleSheet as StyleSheet15,
|
|
2963
|
+
Text as Text13,
|
|
2796
2964
|
TouchableOpacity as TouchableOpacity5,
|
|
2797
|
-
View as
|
|
2965
|
+
View as View15
|
|
2798
2966
|
} from "react-native";
|
|
2967
|
+
var ChevronDown = ({ isOpen, color }) => /* @__PURE__ */ React33.createElement(Text13, { style: [styles15.chevron, { color }] }, isOpen ? "\u25BC" : "\u25B6");
|
|
2968
|
+
var IntegrationInfo = ({
|
|
2969
|
+
content,
|
|
2970
|
+
type,
|
|
2971
|
+
import_guide
|
|
2972
|
+
}) => {
|
|
2973
|
+
const theme = useTheme();
|
|
2974
|
+
const instructionsData = useMemo2(
|
|
2975
|
+
() => content?.instructions?.[type] || null,
|
|
2976
|
+
[content, type]
|
|
2977
|
+
);
|
|
2978
|
+
const featuresData = useMemo2(
|
|
2979
|
+
() => content?.features?.[type] || [],
|
|
2980
|
+
[content, type]
|
|
2981
|
+
);
|
|
2982
|
+
const gtkData = useMemo2(() => content?.gtk?.[type] || [], [content, type]);
|
|
2983
|
+
const hasInstructions = instructionsData && (instructionsData?.content?.length ?? 0) > 0;
|
|
2984
|
+
const hasFeatures = (featuresData?.length ?? 0) > 0;
|
|
2985
|
+
const hasGtk = (gtkData?.length ?? 0) > 0;
|
|
2986
|
+
const defaultSection = hasInstructions ? "instructions" : hasGtk ? "good-to-know" : hasFeatures ? "supported-features" : null;
|
|
2987
|
+
const [openSection, setOpenSection] = useState3(defaultSection);
|
|
2988
|
+
const toggleSection = (value) => {
|
|
2989
|
+
setOpenSection((prev) => prev === value ? null : value);
|
|
2990
|
+
};
|
|
2991
|
+
const handleImportGuidePress = () => {
|
|
2992
|
+
if (import_guide) Linking3.openURL(import_guide);
|
|
2993
|
+
};
|
|
2994
|
+
if (!hasInstructions && !hasFeatures && !hasGtk && !import_guide) {
|
|
2995
|
+
return null;
|
|
2996
|
+
}
|
|
2997
|
+
return /* @__PURE__ */ React33.createElement(View15, { style: styles15.container }, import_guide && /* @__PURE__ */ React33.createElement(
|
|
2998
|
+
TouchableOpacity5,
|
|
2999
|
+
{
|
|
3000
|
+
onPress: handleImportGuidePress,
|
|
3001
|
+
style: [styles15.importGuide, { borderColor: theme.colors.primary }],
|
|
3002
|
+
activeOpacity: 0.7
|
|
3003
|
+
},
|
|
3004
|
+
/* @__PURE__ */ React33.createElement(
|
|
3005
|
+
Text13,
|
|
3006
|
+
{
|
|
3007
|
+
style: [styles15.importGuideText, { color: theme.colors.primary }]
|
|
3008
|
+
},
|
|
3009
|
+
"Import Guide"
|
|
3010
|
+
),
|
|
3011
|
+
/* @__PURE__ */ React33.createElement(RedirectIcon, { width: 14, height: 14, color: theme.colors.primary })
|
|
3012
|
+
), hasInstructions && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3013
|
+
TouchableOpacity5,
|
|
3014
|
+
{
|
|
3015
|
+
onPress: () => toggleSection("instructions"),
|
|
3016
|
+
style: [
|
|
3017
|
+
styles15.trigger,
|
|
3018
|
+
{
|
|
3019
|
+
borderBottomColor: theme.colors.border,
|
|
3020
|
+
backgroundColor: theme.colors.surface
|
|
3021
|
+
}
|
|
3022
|
+
],
|
|
3023
|
+
activeOpacity: 0.7
|
|
3024
|
+
},
|
|
3025
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Instructions"),
|
|
3026
|
+
/* @__PURE__ */ React33.createElement(
|
|
3027
|
+
ChevronDown,
|
|
3028
|
+
{
|
|
3029
|
+
isOpen: openSection === "instructions",
|
|
3030
|
+
color: theme.colors.textSecondary
|
|
3031
|
+
}
|
|
3032
|
+
)
|
|
3033
|
+
), openSection === "instructions" && /* @__PURE__ */ React33.createElement(
|
|
3034
|
+
View15,
|
|
3035
|
+
{
|
|
3036
|
+
style: [
|
|
3037
|
+
styles15.content,
|
|
3038
|
+
{
|
|
3039
|
+
backgroundColor: theme.colors.background,
|
|
3040
|
+
borderBottomColor: theme.colors.border
|
|
3041
|
+
}
|
|
3042
|
+
]
|
|
3043
|
+
},
|
|
3044
|
+
instructionsData?.content && /* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, instructionsData.content.map(
|
|
3045
|
+
(step, index) => /* @__PURE__ */ React33.createElement(
|
|
3046
|
+
Text13,
|
|
3047
|
+
{
|
|
3048
|
+
key: index,
|
|
3049
|
+
style: [
|
|
3050
|
+
styles15.listItem,
|
|
3051
|
+
styles15.orderedItem,
|
|
3052
|
+
{ color: theme.colors.textSecondary }
|
|
3053
|
+
]
|
|
3054
|
+
},
|
|
3055
|
+
index + 1,
|
|
3056
|
+
". ",
|
|
3057
|
+
step
|
|
3058
|
+
)
|
|
3059
|
+
)),
|
|
3060
|
+
instructionsData?.videoLink && /* @__PURE__ */ React33.createElement(
|
|
3061
|
+
TouchableOpacity5,
|
|
3062
|
+
{
|
|
3063
|
+
onPress: () => Linking3.openURL(instructionsData.videoLink),
|
|
3064
|
+
style: styles15.videoLink,
|
|
3065
|
+
activeOpacity: 0.7
|
|
3066
|
+
},
|
|
3067
|
+
/* @__PURE__ */ React33.createElement(
|
|
3068
|
+
Text13,
|
|
3069
|
+
{
|
|
3070
|
+
style: [
|
|
3071
|
+
styles15.videoLinkText,
|
|
3072
|
+
{ color: theme.colors.primary }
|
|
3073
|
+
]
|
|
3074
|
+
},
|
|
3075
|
+
"\u25B6 Watch Video Tutorial"
|
|
3076
|
+
)
|
|
3077
|
+
)
|
|
3078
|
+
)), hasGtk && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3079
|
+
TouchableOpacity5,
|
|
3080
|
+
{
|
|
3081
|
+
onPress: () => toggleSection("good-to-know"),
|
|
3082
|
+
style: [
|
|
3083
|
+
styles15.trigger,
|
|
3084
|
+
{
|
|
3085
|
+
borderBottomColor: theme.colors.border,
|
|
3086
|
+
backgroundColor: theme.colors.surface
|
|
3087
|
+
}
|
|
3088
|
+
],
|
|
3089
|
+
activeOpacity: 0.7
|
|
3090
|
+
},
|
|
3091
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Good to know"),
|
|
3092
|
+
/* @__PURE__ */ React33.createElement(
|
|
3093
|
+
ChevronDown,
|
|
3094
|
+
{
|
|
3095
|
+
isOpen: openSection === "good-to-know",
|
|
3096
|
+
color: theme.colors.textSecondary
|
|
3097
|
+
}
|
|
3098
|
+
)
|
|
3099
|
+
), openSection === "good-to-know" && /* @__PURE__ */ React33.createElement(
|
|
3100
|
+
View15,
|
|
3101
|
+
{
|
|
3102
|
+
style: [
|
|
3103
|
+
styles15.content,
|
|
3104
|
+
{
|
|
3105
|
+
backgroundColor: theme.colors.background,
|
|
3106
|
+
borderBottomColor: theme.colors.border
|
|
3107
|
+
}
|
|
3108
|
+
]
|
|
3109
|
+
},
|
|
3110
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, gtkData.map((item, index) => /* @__PURE__ */ React33.createElement(
|
|
3111
|
+
Text13,
|
|
3112
|
+
{
|
|
3113
|
+
key: index,
|
|
3114
|
+
style: [
|
|
3115
|
+
styles15.listItem,
|
|
3116
|
+
styles15.bulletItem,
|
|
3117
|
+
{ color: theme.colors.textSecondary }
|
|
3118
|
+
]
|
|
3119
|
+
},
|
|
3120
|
+
"\u2022 ",
|
|
3121
|
+
item
|
|
3122
|
+
)))
|
|
3123
|
+
)), hasFeatures && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3124
|
+
TouchableOpacity5,
|
|
3125
|
+
{
|
|
3126
|
+
onPress: () => toggleSection("supported-features"),
|
|
3127
|
+
style: [
|
|
3128
|
+
styles15.trigger,
|
|
3129
|
+
{
|
|
3130
|
+
borderBottomColor: theme.colors.border,
|
|
3131
|
+
backgroundColor: theme.colors.surface
|
|
3132
|
+
}
|
|
3133
|
+
],
|
|
3134
|
+
activeOpacity: 0.7
|
|
3135
|
+
},
|
|
3136
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Supported Features"),
|
|
3137
|
+
/* @__PURE__ */ React33.createElement(
|
|
3138
|
+
ChevronDown,
|
|
3139
|
+
{
|
|
3140
|
+
isOpen: openSection === "supported-features",
|
|
3141
|
+
color: theme.colors.textSecondary
|
|
3142
|
+
}
|
|
3143
|
+
)
|
|
3144
|
+
), openSection === "supported-features" && /* @__PURE__ */ React33.createElement(
|
|
3145
|
+
View15,
|
|
3146
|
+
{
|
|
3147
|
+
style: [
|
|
3148
|
+
styles15.content,
|
|
3149
|
+
{
|
|
3150
|
+
backgroundColor: theme.colors.background,
|
|
3151
|
+
borderBottomColor: theme.colors.border
|
|
3152
|
+
}
|
|
3153
|
+
]
|
|
3154
|
+
},
|
|
3155
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, featuresData.map((feature, index) => /* @__PURE__ */ React33.createElement(
|
|
3156
|
+
Text13,
|
|
3157
|
+
{
|
|
3158
|
+
key: index,
|
|
3159
|
+
style: [
|
|
3160
|
+
styles15.listItem,
|
|
3161
|
+
styles15.bulletItem,
|
|
3162
|
+
{ color: theme.colors.textSecondary }
|
|
3163
|
+
]
|
|
3164
|
+
},
|
|
3165
|
+
"\u2022 ",
|
|
3166
|
+
feature
|
|
3167
|
+
)))
|
|
3168
|
+
)));
|
|
3169
|
+
};
|
|
3170
|
+
var styles15 = StyleSheet15.create({
|
|
3171
|
+
container: {
|
|
3172
|
+
marginTop: 8
|
|
3173
|
+
},
|
|
3174
|
+
importGuide: {
|
|
3175
|
+
flexDirection: "row",
|
|
3176
|
+
alignItems: "center",
|
|
3177
|
+
alignSelf: "flex-end",
|
|
3178
|
+
gap: 4,
|
|
3179
|
+
paddingVertical: 6,
|
|
3180
|
+
paddingHorizontal: 8,
|
|
3181
|
+
marginBottom: 8
|
|
3182
|
+
},
|
|
3183
|
+
importGuideText: {
|
|
3184
|
+
fontSize: 14,
|
|
3185
|
+
fontWeight: "500"
|
|
3186
|
+
},
|
|
3187
|
+
accordionItem: {
|
|
3188
|
+
marginBottom: 4,
|
|
3189
|
+
borderRadius: 8,
|
|
3190
|
+
overflow: "hidden"
|
|
3191
|
+
},
|
|
3192
|
+
trigger: {
|
|
3193
|
+
flexDirection: "row",
|
|
3194
|
+
alignItems: "center",
|
|
3195
|
+
justifyContent: "space-between",
|
|
3196
|
+
paddingVertical: 12,
|
|
3197
|
+
paddingHorizontal: 16,
|
|
3198
|
+
borderBottomWidth: 1
|
|
3199
|
+
},
|
|
3200
|
+
triggerText: {
|
|
3201
|
+
fontSize: 14,
|
|
3202
|
+
fontWeight: "600"
|
|
3203
|
+
},
|
|
3204
|
+
chevron: {
|
|
3205
|
+
fontSize: 12
|
|
3206
|
+
},
|
|
3207
|
+
content: {
|
|
3208
|
+
paddingVertical: 12,
|
|
3209
|
+
paddingHorizontal: 16,
|
|
3210
|
+
borderBottomWidth: 1
|
|
3211
|
+
},
|
|
3212
|
+
list: {
|
|
3213
|
+
paddingLeft: 4
|
|
3214
|
+
},
|
|
3215
|
+
listItem: {
|
|
3216
|
+
fontSize: 13,
|
|
3217
|
+
lineHeight: 20,
|
|
3218
|
+
marginBottom: 6
|
|
3219
|
+
},
|
|
3220
|
+
orderedItem: {
|
|
3221
|
+
marginLeft: 0
|
|
3222
|
+
},
|
|
3223
|
+
bulletItem: {
|
|
3224
|
+
marginLeft: 0
|
|
3225
|
+
},
|
|
3226
|
+
videoLink: {
|
|
3227
|
+
marginTop: 8,
|
|
3228
|
+
paddingVertical: 8,
|
|
3229
|
+
paddingHorizontal: 12
|
|
3230
|
+
},
|
|
3231
|
+
videoLinkText: {
|
|
3232
|
+
fontSize: 13,
|
|
3233
|
+
fontWeight: "500"
|
|
3234
|
+
}
|
|
3235
|
+
});
|
|
3236
|
+
|
|
3237
|
+
// src/molecules/IntegrationForm.tsx
|
|
2799
3238
|
var IntegrationForm = ({
|
|
2800
3239
|
metadata,
|
|
2801
3240
|
onAddHandle,
|
|
2802
3241
|
open,
|
|
2803
3242
|
setAddIntegrationMode,
|
|
2804
3243
|
handleClose,
|
|
2805
|
-
providersList
|
|
3244
|
+
providersList,
|
|
3245
|
+
errorMessage: errorMessageProp,
|
|
3246
|
+
showBackButton = true
|
|
2806
3247
|
}) => {
|
|
2807
3248
|
const { clientId, linkToken, user } = useKryptosConnect();
|
|
2808
3249
|
const theme = useTheme();
|
|
2809
|
-
const [isLoading, setIsLoading] =
|
|
2810
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
2811
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2812
|
-
const [selectedChains, setSelectedChains] =
|
|
3250
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
3251
|
+
const [isFetchingChains, setIsFetchingChains] = React34.useState(false);
|
|
3252
|
+
const [userUsedChains, setUserUsedChains] = React34.useState([]);
|
|
3253
|
+
const [selectedChains, setSelectedChains] = React34.useState(
|
|
2813
3254
|
/* @__PURE__ */ new Set()
|
|
2814
3255
|
);
|
|
2815
|
-
const [chainErrors, setChainErrors] =
|
|
3256
|
+
const [chainErrors, setChainErrors] = React34.useState(
|
|
2816
3257
|
{}
|
|
2817
3258
|
);
|
|
2818
|
-
const [errorMessage, setErrorMessage] =
|
|
2819
|
-
const [formValues, setFormValues] =
|
|
3259
|
+
const [errorMessage, setErrorMessage] = React34.useState("");
|
|
3260
|
+
const [formValues, setFormValues] = React34.useState({
|
|
2820
3261
|
address: "",
|
|
2821
3262
|
account_name: "",
|
|
2822
3263
|
api_key: "",
|
|
2823
3264
|
secret_key: "",
|
|
2824
3265
|
password: ""
|
|
2825
3266
|
});
|
|
2826
|
-
const [formErrors, setFormErrors] =
|
|
2827
|
-
|
|
3267
|
+
const [formErrors, setFormErrors] = React34.useState({});
|
|
3268
|
+
React34.useEffect(() => {
|
|
2828
3269
|
if (!formValues.address || !formValues.address.trim()) {
|
|
2829
3270
|
setUserUsedChains([]);
|
|
2830
3271
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2907,18 +3348,18 @@ var IntegrationForm = ({
|
|
|
2907
3348
|
const credentialTestsData = chainsToProcess.map((chain) => {
|
|
2908
3349
|
const walletId = generateUUID();
|
|
2909
3350
|
const displaySuffix = primaryField.length >= 8 ? `${primaryField.slice(0, 4)}...${primaryField.slice(-4)}` : primaryField;
|
|
2910
|
-
const alias = `${metadata.id} - ${chain
|
|
3351
|
+
const alias = `${metadata.id} - ${chain?.name || ""} (${displaySuffix})`;
|
|
2911
3352
|
const credential = {
|
|
2912
3353
|
source: metadata.id,
|
|
2913
3354
|
credential: {
|
|
2914
|
-
apiKey: formValues.api_key?.trim() || "
|
|
2915
|
-
secret: formValues.secret_key?.trim() || "
|
|
2916
|
-
accountName: formValues.account_name?.trim() || "
|
|
2917
|
-
address: formValues.address?.trim() || "
|
|
2918
|
-
password: formValues.password?.trim() || "
|
|
2919
|
-
userId: user?.user_id || "
|
|
2920
|
-
projectId: metadata?.projectId || "
|
|
2921
|
-
privateKey: "
|
|
3355
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3356
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3357
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3358
|
+
address: formValues.address?.trim() || "",
|
|
3359
|
+
password: formValues.password?.trim() || "",
|
|
3360
|
+
userId: user?.user_id || "",
|
|
3361
|
+
projectId: metadata?.projectId || "",
|
|
3362
|
+
privateKey: "",
|
|
2922
3363
|
alias,
|
|
2923
3364
|
walletId,
|
|
2924
3365
|
exchange: metadata.id
|
|
@@ -2952,11 +3393,12 @@ var IntegrationForm = ({
|
|
|
2952
3393
|
},
|
|
2953
3394
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2954
3395
|
default_chain: chain.name,
|
|
2955
|
-
default_chain_logo:
|
|
3396
|
+
default_chain_logo: "",
|
|
2956
3397
|
type: metadata.type,
|
|
2957
3398
|
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
2958
3399
|
chainId: chain?.community_id || "",
|
|
2959
|
-
address: formValues.address
|
|
3400
|
+
address: formValues.address,
|
|
3401
|
+
isCustomWallet: false
|
|
2960
3402
|
};
|
|
2961
3403
|
if (formValues.account_name)
|
|
2962
3404
|
data.accountName = formValues.account_name;
|
|
@@ -2966,10 +3408,9 @@ var IntegrationForm = ({
|
|
|
2966
3408
|
integrationsToAdd.push(data);
|
|
2967
3409
|
} else {
|
|
2968
3410
|
if (result.status === "rejected") {
|
|
2969
|
-
|
|
2970
|
-
errors[chain.id] = reason?.response?.data?.message || "Failed to process chain";
|
|
3411
|
+
errors[chain.id] = result.reason?.response?.data?.message || "Failed to process chain";
|
|
2971
3412
|
} else if (result.status === "fulfilled") {
|
|
2972
|
-
errors[chain.id] = result.value?.
|
|
3413
|
+
errors[chain.id] = result.value?.message || "Failed to verify chain";
|
|
2973
3414
|
}
|
|
2974
3415
|
}
|
|
2975
3416
|
});
|
|
@@ -2987,14 +3428,14 @@ var IntegrationForm = ({
|
|
|
2987
3428
|
const credential = {
|
|
2988
3429
|
source: metadata.id,
|
|
2989
3430
|
credential: {
|
|
2990
|
-
apiKey: formValues.api_key?.trim() || "
|
|
2991
|
-
secret: formValues.secret_key?.trim() || "
|
|
2992
|
-
accountName: formValues.account_name?.trim() || "
|
|
2993
|
-
address: formValues.address?.trim() || "
|
|
2994
|
-
password: formValues.password?.trim() || "
|
|
2995
|
-
userId: user?.user_id || "
|
|
2996
|
-
projectId: metadata?.projectId || "
|
|
2997
|
-
privateKey: "
|
|
3431
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3432
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3433
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3434
|
+
address: formValues.address?.trim() || "",
|
|
3435
|
+
password: formValues.password?.trim() || "",
|
|
3436
|
+
userId: user?.user_id || "",
|
|
3437
|
+
projectId: metadata?.projectId || "",
|
|
3438
|
+
privateKey: "",
|
|
2998
3439
|
alias,
|
|
2999
3440
|
walletId,
|
|
3000
3441
|
exchange: metadata.id
|
|
@@ -3002,9 +3443,7 @@ var IntegrationForm = ({
|
|
|
3002
3443
|
};
|
|
3003
3444
|
const testResult = await testCredentials(linkToken, { ...credential });
|
|
3004
3445
|
if (!testResult?.valid) {
|
|
3005
|
-
setErrorMessage(
|
|
3006
|
-
testResult?.value?.message || "Credentials are invalid"
|
|
3007
|
-
);
|
|
3446
|
+
setErrorMessage(testResult?.message || "Credentials are invalid");
|
|
3008
3447
|
return;
|
|
3009
3448
|
}
|
|
3010
3449
|
const data = {
|
|
@@ -3023,14 +3462,12 @@ var IntegrationForm = ({
|
|
|
3023
3462
|
clientId,
|
|
3024
3463
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3025
3464
|
},
|
|
3026
|
-
metadata: {
|
|
3027
|
-
environment: "sandbox"
|
|
3028
|
-
},
|
|
3029
3465
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
3030
3466
|
default_chain: metadata.id,
|
|
3031
|
-
default_chain_logo:
|
|
3467
|
+
default_chain_logo: "",
|
|
3032
3468
|
type: metadata.type,
|
|
3033
|
-
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false
|
|
3469
|
+
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
3470
|
+
isCustomWallet: false
|
|
3034
3471
|
};
|
|
3035
3472
|
if (metadata.community_id) {
|
|
3036
3473
|
data.chainId = metadata.community_id;
|
|
@@ -3043,7 +3480,7 @@ var IntegrationForm = ({
|
|
|
3043
3480
|
integrationsToAdd.push(data);
|
|
3044
3481
|
}
|
|
3045
3482
|
if (integrationsToAdd.length > 0) {
|
|
3046
|
-
onAddHandle(integrationsToAdd);
|
|
3483
|
+
await onAddHandle(integrationsToAdd);
|
|
3047
3484
|
setFormErrors({});
|
|
3048
3485
|
setFormValues({
|
|
3049
3486
|
address: "",
|
|
@@ -3057,10 +3494,9 @@ var IntegrationForm = ({
|
|
|
3057
3494
|
setErrorMessage("No integrations could be added. Please try again.");
|
|
3058
3495
|
}
|
|
3059
3496
|
} catch (error) {
|
|
3060
|
-
const err = error;
|
|
3061
3497
|
console.error(error);
|
|
3062
3498
|
setErrorMessage(
|
|
3063
|
-
|
|
3499
|
+
error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations"
|
|
3064
3500
|
);
|
|
3065
3501
|
} finally {
|
|
3066
3502
|
setIsLoading(false);
|
|
@@ -3068,24 +3504,24 @@ var IntegrationForm = ({
|
|
|
3068
3504
|
};
|
|
3069
3505
|
const hasNoFields = !metadata.password && !metadata.secret_key && !metadata.api_key && !metadata.address && !metadata.account_name;
|
|
3070
3506
|
const shouldShowFormFields = metadata.password || metadata.secret_key || metadata.api_key || metadata.address || metadata.account_name;
|
|
3071
|
-
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */
|
|
3507
|
+
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */ React34.createElement(RemoteSvg, { uri: metadata.logo }) : /* @__PURE__ */ React34.createElement(
|
|
3072
3508
|
Image3,
|
|
3073
3509
|
{
|
|
3074
3510
|
source: { uri: metadata.logo },
|
|
3075
|
-
style:
|
|
3511
|
+
style: styles16.logo,
|
|
3076
3512
|
resizeMode: "contain"
|
|
3077
3513
|
}
|
|
3078
|
-
) : /* @__PURE__ */
|
|
3079
|
-
|
|
3514
|
+
) : /* @__PURE__ */ React34.createElement(
|
|
3515
|
+
View16,
|
|
3080
3516
|
{
|
|
3081
3517
|
style: [
|
|
3082
|
-
|
|
3518
|
+
styles16.logoPlaceholder,
|
|
3083
3519
|
{ backgroundColor: theme.colors.surface }
|
|
3084
3520
|
]
|
|
3085
3521
|
},
|
|
3086
|
-
/* @__PURE__ */
|
|
3522
|
+
/* @__PURE__ */ React34.createElement(Text14, { style: { color: theme.colors.text } }, metadata.name?.charAt(0) || "?")
|
|
3087
3523
|
);
|
|
3088
|
-
const renderInput = (key, props) => /* @__PURE__ */
|
|
3524
|
+
const renderInput = (key, props) => /* @__PURE__ */ React34.createElement(
|
|
3089
3525
|
Input,
|
|
3090
3526
|
{
|
|
3091
3527
|
placeholder: props.placeholder,
|
|
@@ -3097,33 +3533,33 @@ var IntegrationForm = ({
|
|
|
3097
3533
|
secureTextEntry: props.secureTextEntry
|
|
3098
3534
|
}
|
|
3099
3535
|
);
|
|
3100
|
-
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */
|
|
3101
|
-
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */
|
|
3536
|
+
const renderErrorAlert = () => errorMessage || errorMessageProp ? /* @__PURE__ */ React34.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React34.createElement(AlertDescription, null, errorMessage || errorMessageProp)) : null;
|
|
3537
|
+
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) => {
|
|
3102
3538
|
const isSelected = selectedChains.has(chain.id);
|
|
3103
3539
|
const hasError = chainErrors[chain.id];
|
|
3104
|
-
return /* @__PURE__ */
|
|
3105
|
-
|
|
3540
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3541
|
+
TouchableOpacity6,
|
|
3106
3542
|
{
|
|
3107
3543
|
onPress: () => toggleChainSelection(chain.id),
|
|
3108
|
-
style:
|
|
3544
|
+
style: styles16.chainButton,
|
|
3109
3545
|
key: chain.id
|
|
3110
3546
|
},
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
|
|
3547
|
+
/* @__PURE__ */ React34.createElement(
|
|
3548
|
+
View16,
|
|
3113
3549
|
{
|
|
3114
3550
|
style: [
|
|
3115
|
-
|
|
3551
|
+
styles16.chainChip,
|
|
3116
3552
|
{
|
|
3117
3553
|
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
3118
3554
|
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
3119
3555
|
}
|
|
3120
3556
|
]
|
|
3121
3557
|
},
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
|
|
3558
|
+
/* @__PURE__ */ React34.createElement(
|
|
3559
|
+
Text14,
|
|
3124
3560
|
{
|
|
3125
3561
|
style: [
|
|
3126
|
-
|
|
3562
|
+
styles16.chainName,
|
|
3127
3563
|
{
|
|
3128
3564
|
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
3129
3565
|
}
|
|
@@ -3131,28 +3567,55 @@ var IntegrationForm = ({
|
|
|
3131
3567
|
},
|
|
3132
3568
|
chain.name
|
|
3133
3569
|
),
|
|
3134
|
-
isSelected ? /* @__PURE__ */
|
|
3570
|
+
isSelected ? /* @__PURE__ */ React34.createElement(
|
|
3135
3571
|
CloseIcon,
|
|
3136
3572
|
{
|
|
3137
3573
|
size: 12,
|
|
3138
3574
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
3139
3575
|
}
|
|
3140
|
-
) : /* @__PURE__ */
|
|
3576
|
+
) : /* @__PURE__ */ React34.createElement(PlusIcon, { size: 12, color: theme.colors.textSecondary })
|
|
3141
3577
|
)
|
|
3142
3578
|
);
|
|
3143
|
-
}))
|
|
3144
|
-
|
|
3579
|
+
})), selectedChains.size > 0 && userUsedChains.length > 0 && /* @__PURE__ */ React34.createElement(
|
|
3580
|
+
TouchableOpacity6,
|
|
3581
|
+
{
|
|
3582
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
3583
|
+
style: styles16.chainButton,
|
|
3584
|
+
activeOpacity: 0.7
|
|
3585
|
+
},
|
|
3586
|
+
/* @__PURE__ */ React34.createElement(
|
|
3587
|
+
View16,
|
|
3588
|
+
{
|
|
3589
|
+
style: [
|
|
3590
|
+
styles16.chainChip,
|
|
3591
|
+
styles16.chainChipRemoveAll,
|
|
3592
|
+
{
|
|
3593
|
+
borderWidth: 0
|
|
3594
|
+
}
|
|
3595
|
+
]
|
|
3596
|
+
},
|
|
3597
|
+
/* @__PURE__ */ React34.createElement(
|
|
3598
|
+
Text14,
|
|
3599
|
+
{
|
|
3600
|
+
style: [styles16.chainName, { color: theme.colors.primary }]
|
|
3601
|
+
},
|
|
3602
|
+
"Remove All Chains"
|
|
3603
|
+
),
|
|
3604
|
+
/* @__PURE__ */ React34.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
3605
|
+
)
|
|
3606
|
+
)), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainErrorsContainer }, /* @__PURE__ */ React34.createElement(
|
|
3607
|
+
Text14,
|
|
3145
3608
|
{
|
|
3146
|
-
style: [
|
|
3609
|
+
style: [styles16.chainErrorsTitle, { color: theme.colors.error }]
|
|
3147
3610
|
},
|
|
3148
3611
|
"Errors:"
|
|
3149
3612
|
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
3150
3613
|
const chain = userUsedChains.find((c) => c.id === chainId);
|
|
3151
|
-
return /* @__PURE__ */
|
|
3152
|
-
|
|
3614
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3615
|
+
Text14,
|
|
3153
3616
|
{
|
|
3154
3617
|
key: chainId,
|
|
3155
|
-
style: [
|
|
3618
|
+
style: [styles16.chainErrorItem, { color: theme.colors.error }]
|
|
3156
3619
|
},
|
|
3157
3620
|
"\u2022 ",
|
|
3158
3621
|
chain?.name,
|
|
@@ -3160,7 +3623,7 @@ var IntegrationForm = ({
|
|
|
3160
3623
|
error
|
|
3161
3624
|
);
|
|
3162
3625
|
})));
|
|
3163
|
-
const renderFormBlock = () => /* @__PURE__ */
|
|
3626
|
+
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", {
|
|
3164
3627
|
placeholder: "Enter address",
|
|
3165
3628
|
autoCapitalize: "none",
|
|
3166
3629
|
autoCorrect: false
|
|
@@ -3176,16 +3639,23 @@ var IntegrationForm = ({
|
|
|
3176
3639
|
}), metadata.password && renderInput("password", {
|
|
3177
3640
|
placeholder: "Enter Password",
|
|
3178
3641
|
secureTextEntry: true
|
|
3179
|
-
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */
|
|
3642
|
+
})), 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.")));
|
|
3180
3643
|
const addIntegrationLabel = formValues.address && userUsedChains.length > 0 && selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size !== 1 ? "s" : ""}` : "Add Integration";
|
|
3181
|
-
return /* @__PURE__ */
|
|
3182
|
-
|
|
3644
|
+
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(
|
|
3645
|
+
TouchableOpacity6,
|
|
3183
3646
|
{
|
|
3184
3647
|
onPress: () => setAddIntegrationMode(null),
|
|
3185
|
-
style:
|
|
3648
|
+
style: styles16.backButton
|
|
3186
3649
|
},
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
), /* @__PURE__ */
|
|
3650
|
+
/* @__PURE__ */ React34.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3651
|
+
), /* @__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(
|
|
3652
|
+
IntegrationInfo,
|
|
3653
|
+
{
|
|
3654
|
+
content: metadata.walletLimitations,
|
|
3655
|
+
type: "api",
|
|
3656
|
+
import_guide: metadata.import_guide
|
|
3657
|
+
}
|
|
3658
|
+
)), !hasNoFields && /* @__PURE__ */ React34.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React34.createElement(
|
|
3189
3659
|
Button,
|
|
3190
3660
|
{
|
|
3191
3661
|
variant: "outline",
|
|
@@ -3193,10 +3663,10 @@ var IntegrationForm = ({
|
|
|
3193
3663
|
onPress: handleSubmit,
|
|
3194
3664
|
loading: isLoading,
|
|
3195
3665
|
disabled: isLoading || isFetchingChains || !!formValues.address && userUsedChains.length > 0 && selectedChains.size === 0,
|
|
3196
|
-
style:
|
|
3666
|
+
style: styles16.button
|
|
3197
3667
|
},
|
|
3198
3668
|
addIntegrationLabel
|
|
3199
|
-
), /* @__PURE__ */
|
|
3669
|
+
), /* @__PURE__ */ React34.createElement(Footer, null))) : /* @__PURE__ */ React34.createElement(
|
|
3200
3670
|
WalletConnectComponent,
|
|
3201
3671
|
{
|
|
3202
3672
|
integration: metadata,
|
|
@@ -3205,14 +3675,15 @@ var IntegrationForm = ({
|
|
|
3205
3675
|
modalOpen: open,
|
|
3206
3676
|
setAddIntegrationMode,
|
|
3207
3677
|
handleClose,
|
|
3208
|
-
providersList
|
|
3678
|
+
providersList,
|
|
3679
|
+
errorMessage: errorMessageProp,
|
|
3680
|
+
showBackButton
|
|
3209
3681
|
}
|
|
3210
3682
|
));
|
|
3211
3683
|
};
|
|
3212
|
-
var
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
paddingBottom: 100
|
|
3684
|
+
var styles16 = StyleSheet16.create({
|
|
3685
|
+
chainListContent: {
|
|
3686
|
+
paddingBottom: 8
|
|
3216
3687
|
},
|
|
3217
3688
|
headerContent: {
|
|
3218
3689
|
flexDirection: "row",
|
|
@@ -3237,10 +3708,8 @@ var styles14 = StyleSheet14.create({
|
|
|
3237
3708
|
// theme.spacing.xl
|
|
3238
3709
|
paddingBottom: 40,
|
|
3239
3710
|
width: "100%",
|
|
3240
|
-
overflow: "hidden",
|
|
3241
3711
|
alignSelf: "center",
|
|
3242
|
-
flexDirection: "column"
|
|
3243
|
-
flex: 1
|
|
3712
|
+
flexDirection: "column"
|
|
3244
3713
|
},
|
|
3245
3714
|
header: {
|
|
3246
3715
|
flexDirection: "row",
|
|
@@ -3272,7 +3741,7 @@ var styles14 = StyleSheet14.create({
|
|
|
3272
3741
|
textTransform: "capitalize"
|
|
3273
3742
|
},
|
|
3274
3743
|
chainSelection: {
|
|
3275
|
-
marginBottom:
|
|
3744
|
+
marginBottom: 8
|
|
3276
3745
|
// theme.spacing.lg
|
|
3277
3746
|
},
|
|
3278
3747
|
chainTitle: {
|
|
@@ -3299,6 +3768,11 @@ var styles14 = StyleSheet14.create({
|
|
|
3299
3768
|
// theme.borderRadius.md
|
|
3300
3769
|
borderWidth: 1
|
|
3301
3770
|
},
|
|
3771
|
+
chainChipRemoveAll: {
|
|
3772
|
+
marginTop: 6,
|
|
3773
|
+
// theme.spacing.sm - separate from chain list
|
|
3774
|
+
width: "auto"
|
|
3775
|
+
},
|
|
3302
3776
|
chainName: {
|
|
3303
3777
|
fontSize: 12,
|
|
3304
3778
|
fontWeight: "500",
|
|
@@ -3334,18 +3808,23 @@ var styles14 = StyleSheet14.create({
|
|
|
3334
3808
|
var Integration = ({
|
|
3335
3809
|
open,
|
|
3336
3810
|
onSuccess,
|
|
3337
|
-
onClose
|
|
3811
|
+
onClose,
|
|
3812
|
+
integrationDetails
|
|
3338
3813
|
}) => {
|
|
3339
3814
|
const { appName, linkToken } = useKryptosConnect();
|
|
3340
3815
|
const theme = useTheme();
|
|
3341
|
-
const [addIntegrationMode, setAddIntegrationMode] =
|
|
3342
|
-
const [query, setQuery] =
|
|
3343
|
-
const [activeTab, setActiveTab] =
|
|
3344
|
-
const [supportedProviders, setSupportedProviders] =
|
|
3345
|
-
const [
|
|
3346
|
-
const [
|
|
3347
|
-
const [
|
|
3348
|
-
|
|
3816
|
+
const [addIntegrationMode, setAddIntegrationMode] = React35.useState(integrationDetails || null);
|
|
3817
|
+
const [query, setQuery] = React35.useState("");
|
|
3818
|
+
const [activeTab, setActiveTab] = React35.useState("all");
|
|
3819
|
+
const [supportedProviders, setSupportedProviders] = React35.useState([]);
|
|
3820
|
+
const [existingIntegrations, setExistingIntegrations] = React35.useState([]);
|
|
3821
|
+
const [isLoading, setIsLoading] = React35.useState(false);
|
|
3822
|
+
const [errorMessage, setErrorMessage] = React35.useState("");
|
|
3823
|
+
React35.useEffect(() => {
|
|
3824
|
+
if (integrationDetails) {
|
|
3825
|
+
setAddIntegrationMode(integrationDetails);
|
|
3826
|
+
}
|
|
3827
|
+
}, [integrationDetails]);
|
|
3349
3828
|
const handleClose = () => {
|
|
3350
3829
|
onClose();
|
|
3351
3830
|
};
|
|
@@ -3356,7 +3835,7 @@ var Integration = ({
|
|
|
3356
3835
|
} catch (error) {
|
|
3357
3836
|
const err = error;
|
|
3358
3837
|
setErrorMessage(
|
|
3359
|
-
err?.response?.data?.message || "Failed to fetch existing integrations"
|
|
3838
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch existing integrations"
|
|
3360
3839
|
);
|
|
3361
3840
|
console.error(error);
|
|
3362
3841
|
}
|
|
@@ -3369,38 +3848,38 @@ var Integration = ({
|
|
|
3369
3848
|
} catch (error) {
|
|
3370
3849
|
const err = error;
|
|
3371
3850
|
setErrorMessage(
|
|
3372
|
-
err?.response?.data?.message || "Failed to fetch supported providers"
|
|
3851
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch supported providers"
|
|
3373
3852
|
);
|
|
3374
3853
|
console.error(error);
|
|
3375
3854
|
} finally {
|
|
3376
3855
|
setIsLoading(false);
|
|
3377
3856
|
}
|
|
3378
3857
|
};
|
|
3379
|
-
|
|
3858
|
+
React35.useEffect(() => {
|
|
3380
3859
|
if (linkToken) {
|
|
3381
3860
|
fetchSupportedProviders();
|
|
3382
3861
|
fetchExistingIntegrations();
|
|
3383
3862
|
}
|
|
3384
3863
|
}, [linkToken]);
|
|
3385
|
-
const isIntegrationAdded =
|
|
3864
|
+
const isIntegrationAdded = useCallback(
|
|
3386
3865
|
(publicName) => {
|
|
3387
|
-
const integrations = [...
|
|
3866
|
+
const integrations = [...existingIntegrations];
|
|
3388
3867
|
return integrations.some(
|
|
3389
3868
|
(integration) => integration.public_name === publicName
|
|
3390
3869
|
);
|
|
3391
3870
|
},
|
|
3392
|
-
[
|
|
3871
|
+
[existingIntegrations]
|
|
3393
3872
|
);
|
|
3394
|
-
const getIntegrationCount =
|
|
3873
|
+
const getIntegrationCount = useCallback(
|
|
3395
3874
|
(publicName) => {
|
|
3396
|
-
const integrations = [...
|
|
3875
|
+
const integrations = [...existingIntegrations];
|
|
3397
3876
|
return integrations.filter(
|
|
3398
3877
|
(integration) => integration.public_name === publicName
|
|
3399
3878
|
).length;
|
|
3400
3879
|
},
|
|
3401
|
-
[
|
|
3880
|
+
[existingIntegrations]
|
|
3402
3881
|
);
|
|
3403
|
-
const filteredResults =
|
|
3882
|
+
const filteredResults = React35.useMemo(() => {
|
|
3404
3883
|
let filtered = supportedProviders;
|
|
3405
3884
|
if (activeTab !== "all") {
|
|
3406
3885
|
filtered = filtered.filter((provider) => provider.type === activeTab);
|
|
@@ -3418,33 +3897,41 @@ var Integration = ({
|
|
|
3418
3897
|
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
3419
3898
|
});
|
|
3420
3899
|
}, [query, supportedProviders, getIntegrationCount, activeTab]);
|
|
3421
|
-
const handleAddIntegration = async () => {
|
|
3900
|
+
const handleAddIntegration = async (integrationsList) => {
|
|
3422
3901
|
try {
|
|
3423
3902
|
setIsLoading(true);
|
|
3424
|
-
const integrations = [...
|
|
3903
|
+
const integrations = integrationsList ? integrationsList : [...existingIntegrations];
|
|
3425
3904
|
if (integrations.length === 0) {
|
|
3426
3905
|
setErrorMessage("Please add at least one integration");
|
|
3427
|
-
} else if (addedIntegrations.length === 0) {
|
|
3428
|
-
onSuccess();
|
|
3429
3906
|
} else {
|
|
3430
|
-
await addUserIntegration(linkToken,
|
|
3431
|
-
|
|
3907
|
+
await addUserIntegration(linkToken, integrations);
|
|
3908
|
+
if (integrationDetails) {
|
|
3909
|
+
onSuccess();
|
|
3910
|
+
}
|
|
3432
3911
|
}
|
|
3912
|
+
await fetchExistingIntegrations();
|
|
3913
|
+
setAddIntegrationMode(null);
|
|
3433
3914
|
} catch (error) {
|
|
3434
|
-
const
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
err?.response?.data?.message || "Failed to add integrations"
|
|
3438
|
-
);
|
|
3915
|
+
const message = error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations";
|
|
3916
|
+
setErrorMessage(message);
|
|
3917
|
+
throw error;
|
|
3439
3918
|
} finally {
|
|
3440
3919
|
setIsLoading(false);
|
|
3441
3920
|
}
|
|
3442
3921
|
};
|
|
3443
|
-
const
|
|
3444
|
-
|
|
3922
|
+
const handleContinue = () => {
|
|
3923
|
+
const integrations = [...existingIntegrations];
|
|
3924
|
+
if (integrations.length === 0) {
|
|
3925
|
+
setErrorMessage("Please add at least one integration");
|
|
3926
|
+
return;
|
|
3927
|
+
}
|
|
3928
|
+
onSuccess();
|
|
3929
|
+
};
|
|
3930
|
+
const renderProviderItem = ({ item }) => /* @__PURE__ */ React35.createElement(
|
|
3931
|
+
TouchableOpacity7,
|
|
3445
3932
|
{
|
|
3446
3933
|
style: [
|
|
3447
|
-
|
|
3934
|
+
styles17.providerItem,
|
|
3448
3935
|
{
|
|
3449
3936
|
backgroundColor: theme.colors.surface,
|
|
3450
3937
|
borderColor: theme.colors.border
|
|
@@ -3453,44 +3940,44 @@ var Integration = ({
|
|
|
3453
3940
|
onPress: () => setAddIntegrationMode(item),
|
|
3454
3941
|
activeOpacity: 0.7
|
|
3455
3942
|
},
|
|
3456
|
-
/* @__PURE__ */
|
|
3943
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.providerInfo }, item?.logo ? isSvgUrl(item?.logo) ? /* @__PURE__ */ React35.createElement(RemoteSvg, { uri: item?.logo }) : /* @__PURE__ */ React35.createElement(
|
|
3457
3944
|
Image4,
|
|
3458
3945
|
{
|
|
3459
3946
|
source: { uri: item?.logo },
|
|
3460
|
-
style:
|
|
3947
|
+
style: styles17.providerLogo,
|
|
3461
3948
|
resizeMode: "contain"
|
|
3462
3949
|
}
|
|
3463
|
-
) : /* @__PURE__ */
|
|
3464
|
-
|
|
3950
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
3951
|
+
View17,
|
|
3465
3952
|
{
|
|
3466
3953
|
style: [
|
|
3467
|
-
|
|
3954
|
+
styles17.providerLogoPlaceholder,
|
|
3468
3955
|
{ backgroundColor: theme.colors.surfaceSecondary }
|
|
3469
3956
|
]
|
|
3470
3957
|
},
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
), /* @__PURE__ */
|
|
3473
|
-
isIntegrationAdded(item?.public_name) && /* @__PURE__ */
|
|
3474
|
-
|
|
3958
|
+
/* @__PURE__ */ React35.createElement(Text15, { style: { color: theme.colors.text } }, item?.name?.charAt(0) || "?")
|
|
3959
|
+
), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.providerName, { color: theme.colors.text }] }, item?.name + "\u200B")),
|
|
3960
|
+
isIntegrationAdded(item?.public_name) && /* @__PURE__ */ React35.createElement(View17, { style: styles17.providerStatus }, /* @__PURE__ */ React35.createElement(CheckCircleIcon, { size: 18, color: theme.colors.success }), /* @__PURE__ */ React35.createElement(
|
|
3961
|
+
Text15,
|
|
3475
3962
|
{
|
|
3476
3963
|
style: [
|
|
3477
|
-
|
|
3964
|
+
styles17.providerCount,
|
|
3478
3965
|
{ color: theme.colors.textSecondary }
|
|
3479
3966
|
]
|
|
3480
3967
|
},
|
|
3481
3968
|
getIntegrationCount(item?.public_name)
|
|
3482
3969
|
))
|
|
3483
3970
|
);
|
|
3484
|
-
const renderSkeletonItem = () => /* @__PURE__ */
|
|
3485
|
-
return /* @__PURE__ */
|
|
3486
|
-
|
|
3971
|
+
const renderSkeletonItem = () => /* @__PURE__ */ React35.createElement(SkeletonItem_default, null);
|
|
3972
|
+
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(
|
|
3973
|
+
TouchableOpacity7,
|
|
3487
3974
|
{
|
|
3488
3975
|
onPress: () => setAddIntegrationMode(null),
|
|
3489
|
-
style:
|
|
3976
|
+
style: styles17.backButton
|
|
3490
3977
|
},
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
), /* @__PURE__ */
|
|
3493
|
-
|
|
3978
|
+
/* @__PURE__ */ React35.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3979
|
+
), /* @__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(
|
|
3980
|
+
View17,
|
|
3494
3981
|
{
|
|
3495
3982
|
style: {
|
|
3496
3983
|
paddingHorizontal: theme.spacing.xl,
|
|
@@ -3499,26 +3986,26 @@ var Integration = ({
|
|
|
3499
3986
|
zIndex: 10
|
|
3500
3987
|
}
|
|
3501
3988
|
},
|
|
3502
|
-
/* @__PURE__ */
|
|
3989
|
+
/* @__PURE__ */ React35.createElement(
|
|
3503
3990
|
Input,
|
|
3504
3991
|
{
|
|
3505
3992
|
value: query,
|
|
3506
3993
|
onChangeText: setQuery,
|
|
3507
3994
|
placeholder: "Search Integrations...",
|
|
3508
|
-
containerStyle:
|
|
3995
|
+
containerStyle: styles17.searchInput
|
|
3509
3996
|
}
|
|
3510
3997
|
),
|
|
3511
|
-
/* @__PURE__ */
|
|
3998
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.tabsContainer }, [
|
|
3512
3999
|
{ label: "All", value: "all" },
|
|
3513
4000
|
{ label: "Exchanges", value: "exchange" },
|
|
3514
4001
|
{ label: "Blockchains", value: "blockchain" },
|
|
3515
4002
|
{ label: "Wallets", value: "wallet" }
|
|
3516
|
-
].map((tab) => /* @__PURE__ */
|
|
3517
|
-
|
|
4003
|
+
].map((tab) => /* @__PURE__ */ React35.createElement(
|
|
4004
|
+
TouchableOpacity7,
|
|
3518
4005
|
{
|
|
3519
4006
|
key: tab.value,
|
|
3520
4007
|
style: [
|
|
3521
|
-
|
|
4008
|
+
styles17.tab,
|
|
3522
4009
|
{
|
|
3523
4010
|
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
3524
4011
|
borderColor: theme.colors.border
|
|
@@ -3530,11 +4017,11 @@ var Integration = ({
|
|
|
3530
4017
|
);
|
|
3531
4018
|
}
|
|
3532
4019
|
},
|
|
3533
|
-
/* @__PURE__ */
|
|
3534
|
-
|
|
4020
|
+
/* @__PURE__ */ React35.createElement(
|
|
4021
|
+
Text15,
|
|
3535
4022
|
{
|
|
3536
4023
|
style: [
|
|
3537
|
-
|
|
4024
|
+
styles17.tabText,
|
|
3538
4025
|
{
|
|
3539
4026
|
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
3540
4027
|
}
|
|
@@ -3543,7 +4030,7 @@ var Integration = ({
|
|
|
3543
4030
|
tab.label
|
|
3544
4031
|
)
|
|
3545
4032
|
)))
|
|
3546
|
-
), /* @__PURE__ */
|
|
4033
|
+
), /* @__PURE__ */ React35.createElement(
|
|
3547
4034
|
FlatList,
|
|
3548
4035
|
{
|
|
3549
4036
|
data: isLoading ? Array.from({ length: 8 }, (_, i) => ({
|
|
@@ -3554,50 +4041,53 @@ var Integration = ({
|
|
|
3554
4041
|
})) : filteredResults,
|
|
3555
4042
|
keyExtractor: (item, index) => isLoading ? item.id : `provider-${item.id}-${index}`,
|
|
3556
4043
|
renderItem: isLoading ? renderSkeletonItem : renderProviderItem,
|
|
3557
|
-
style:
|
|
4044
|
+
style: styles17.list,
|
|
3558
4045
|
contentContainerStyle: [
|
|
3559
|
-
|
|
4046
|
+
styles17.listContent,
|
|
3560
4047
|
{ paddingHorizontal: theme.spacing.xl }
|
|
3561
4048
|
],
|
|
3562
4049
|
showsVerticalScrollIndicator: false,
|
|
3563
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
3564
|
-
|
|
4050
|
+
ListEmptyComponent: /* @__PURE__ */ React35.createElement(View17, { style: styles17.emptyContainer }, !isLoading && /* @__PURE__ */ React35.createElement(
|
|
4051
|
+
Text15,
|
|
3565
4052
|
{
|
|
3566
4053
|
style: [
|
|
3567
|
-
|
|
4054
|
+
styles17.emptyText,
|
|
3568
4055
|
{ color: theme.colors.textSecondary }
|
|
3569
4056
|
]
|
|
3570
4057
|
},
|
|
3571
4058
|
query ? "No search results found" : "No supported integrations found"
|
|
3572
|
-
))
|
|
4059
|
+
)),
|
|
4060
|
+
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
|
|
3573
4061
|
}
|
|
3574
|
-
),
|
|
4062
|
+
))), /* @__PURE__ */ React35.createElement(ModalFooter, { style: { paddingVertical: 8 } }, filteredResults && filteredResults.length > 0 && /* @__PURE__ */ React35.createElement(
|
|
3575
4063
|
Button,
|
|
3576
4064
|
{
|
|
3577
4065
|
variant: "outline",
|
|
3578
4066
|
size: "lg",
|
|
3579
|
-
onPress:
|
|
4067
|
+
onPress: handleContinue,
|
|
3580
4068
|
loading: isLoading,
|
|
3581
4069
|
disabled: isLoading,
|
|
3582
|
-
style:
|
|
4070
|
+
style: styles17.continueButton
|
|
3583
4071
|
},
|
|
3584
4072
|
"Continue"
|
|
3585
|
-
), /* @__PURE__ */
|
|
4073
|
+
), /* @__PURE__ */ React35.createElement(Footer, null))) : /* @__PURE__ */ React35.createElement(
|
|
3586
4074
|
IntegrationForm,
|
|
3587
4075
|
{
|
|
3588
4076
|
metadata: addIntegrationMode,
|
|
3589
|
-
onAddHandle: (
|
|
3590
|
-
|
|
3591
|
-
|
|
4077
|
+
onAddHandle: async (int) => {
|
|
4078
|
+
const integrationsList = [...int];
|
|
4079
|
+
await handleAddIntegration(integrationsList);
|
|
3592
4080
|
},
|
|
3593
4081
|
open: !!addIntegrationMode,
|
|
3594
4082
|
setAddIntegrationMode,
|
|
3595
4083
|
handleClose,
|
|
3596
|
-
providersList: supportedProviders
|
|
4084
|
+
providersList: supportedProviders,
|
|
4085
|
+
errorMessage,
|
|
4086
|
+
showBackButton: !integrationDetails
|
|
3597
4087
|
}
|
|
3598
4088
|
));
|
|
3599
4089
|
};
|
|
3600
|
-
var
|
|
4090
|
+
var styles17 = StyleSheet17.create({
|
|
3601
4091
|
headerContent: {
|
|
3602
4092
|
flexDirection: "row",
|
|
3603
4093
|
alignItems: "center"
|
|
@@ -3708,12 +4198,12 @@ var styles15 = StyleSheet15.create({
|
|
|
3708
4198
|
width: "100%"
|
|
3709
4199
|
},
|
|
3710
4200
|
errorContainer: {
|
|
3711
|
-
paddingHorizontal: 20
|
|
4201
|
+
paddingHorizontal: 20,
|
|
3712
4202
|
// theme.spacing.xl
|
|
4203
|
+
marginBottom: 12
|
|
3713
4204
|
},
|
|
3714
4205
|
errorAlert: {
|
|
3715
|
-
marginTop:
|
|
3716
|
-
// theme.spacing.lg - consistent alert spacing
|
|
4206
|
+
marginTop: 8
|
|
3717
4207
|
},
|
|
3718
4208
|
tabsContainer: {
|
|
3719
4209
|
flexDirection: "row",
|
|
@@ -3740,21 +4230,21 @@ var styles15 = StyleSheet15.create({
|
|
|
3740
4230
|
});
|
|
3741
4231
|
|
|
3742
4232
|
// src/molecules/OTPVerify.tsx
|
|
3743
|
-
import
|
|
3744
|
-
import { StyleSheet as
|
|
4233
|
+
import React36 from "react";
|
|
4234
|
+
import { StyleSheet as StyleSheet18, Text as Text16, TouchableOpacity as TouchableOpacity8, View as View18 } from "react-native";
|
|
3745
4235
|
var OTPVerify = ({
|
|
3746
4236
|
open,
|
|
3747
4237
|
onSuccess,
|
|
3748
4238
|
onClose
|
|
3749
4239
|
}) => {
|
|
3750
4240
|
const theme = useTheme();
|
|
3751
|
-
const [otp, setOtp] =
|
|
4241
|
+
const [otp, setOtp] = React36.useState("");
|
|
3752
4242
|
const { linkToken, clientId, email, setUser } = useKryptosConnect();
|
|
3753
|
-
const [isLoading, setIsLoading] =
|
|
3754
|
-
const [isResending, setIsResending] =
|
|
3755
|
-
const [resendCooldown, setResendCooldown] =
|
|
3756
|
-
const [errorMessage, setErrorMessage] =
|
|
3757
|
-
const [successMessage, setSuccessMessage] =
|
|
4243
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
4244
|
+
const [isResending, setIsResending] = React36.useState(false);
|
|
4245
|
+
const [resendCooldown, setResendCooldown] = React36.useState(0);
|
|
4246
|
+
const [errorMessage, setErrorMessage] = React36.useState("");
|
|
4247
|
+
const [successMessage, setSuccessMessage] = React36.useState("");
|
|
3758
4248
|
const handleSubmit = async () => {
|
|
3759
4249
|
if (otp.length !== 6) return;
|
|
3760
4250
|
setIsLoading(true);
|
|
@@ -3805,7 +4295,7 @@ var OTPVerify = ({
|
|
|
3805
4295
|
setSuccessMessage("");
|
|
3806
4296
|
setOtp("");
|
|
3807
4297
|
};
|
|
3808
|
-
|
|
4298
|
+
React36.useEffect(() => {
|
|
3809
4299
|
if (resendCooldown > 0) {
|
|
3810
4300
|
const timer = setTimeout(() => {
|
|
3811
4301
|
setResendCooldown(resendCooldown - 1);
|
|
@@ -3814,20 +4304,20 @@ var OTPVerify = ({
|
|
|
3814
4304
|
}
|
|
3815
4305
|
return void 0;
|
|
3816
4306
|
}, [resendCooldown]);
|
|
3817
|
-
return /* @__PURE__ */
|
|
3818
|
-
|
|
4307
|
+
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(
|
|
4308
|
+
Text16,
|
|
3819
4309
|
{
|
|
3820
|
-
style: [
|
|
4310
|
+
style: [styles18.infoText, { color: theme.colors.textSecondary }]
|
|
3821
4311
|
},
|
|
3822
4312
|
"We have sent a verification code to"
|
|
3823
|
-
), /* @__PURE__ */
|
|
4313
|
+
), /* @__PURE__ */ React36.createElement(Text16, { style: [styles18.emailText, { color: theme.colors.text }] }, email)), /* @__PURE__ */ React36.createElement(
|
|
3824
4314
|
OTP,
|
|
3825
4315
|
{
|
|
3826
4316
|
onComplete: handleOtpComplete,
|
|
3827
4317
|
length: 6,
|
|
3828
4318
|
setErrorMessage
|
|
3829
4319
|
}
|
|
3830
|
-
), errorMessage ? /* @__PURE__ */
|
|
4320
|
+
), 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(
|
|
3831
4321
|
Button,
|
|
3832
4322
|
{
|
|
3833
4323
|
variant: "outline",
|
|
@@ -3835,44 +4325,44 @@ var OTPVerify = ({
|
|
|
3835
4325
|
onPress: handleSubmit,
|
|
3836
4326
|
loading: isLoading,
|
|
3837
4327
|
disabled: otp.length !== 6 || isLoading,
|
|
3838
|
-
style:
|
|
4328
|
+
style: styles18.button
|
|
3839
4329
|
},
|
|
3840
4330
|
"Continue"
|
|
3841
|
-
), /* @__PURE__ */
|
|
3842
|
-
|
|
4331
|
+
), /* @__PURE__ */ React36.createElement(
|
|
4332
|
+
TouchableOpacity8,
|
|
3843
4333
|
{
|
|
3844
4334
|
onPress: handleResendOtp,
|
|
3845
4335
|
disabled: resendCooldown > 0 || isResending,
|
|
3846
|
-
style:
|
|
4336
|
+
style: styles18.resendContainer
|
|
3847
4337
|
},
|
|
3848
|
-
isResending ? /* @__PURE__ */
|
|
3849
|
-
|
|
4338
|
+
isResending ? /* @__PURE__ */ React36.createElement(View18, { style: styles18.resendLoading }, /* @__PURE__ */ React36.createElement(LoaderIcon, { size: 16, color: theme.colors.primary }), /* @__PURE__ */ React36.createElement(
|
|
4339
|
+
Text16,
|
|
3850
4340
|
{
|
|
3851
|
-
style: [
|
|
4341
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3852
4342
|
},
|
|
3853
4343
|
" ",
|
|
3854
4344
|
"Sending..."
|
|
3855
|
-
)) : resendCooldown > 0 ? /* @__PURE__ */
|
|
3856
|
-
|
|
4345
|
+
)) : resendCooldown > 0 ? /* @__PURE__ */ React36.createElement(
|
|
4346
|
+
Text16,
|
|
3857
4347
|
{
|
|
3858
4348
|
style: [
|
|
3859
|
-
|
|
4349
|
+
styles18.resendText,
|
|
3860
4350
|
{ color: theme.colors.textSecondary }
|
|
3861
4351
|
]
|
|
3862
4352
|
},
|
|
3863
4353
|
"Resend OTP in ",
|
|
3864
4354
|
resendCooldown,
|
|
3865
4355
|
"s"
|
|
3866
|
-
) : /* @__PURE__ */
|
|
3867
|
-
|
|
4356
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
4357
|
+
Text16,
|
|
3868
4358
|
{
|
|
3869
|
-
style: [
|
|
4359
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3870
4360
|
},
|
|
3871
4361
|
"Resend OTP"
|
|
3872
4362
|
)
|
|
3873
|
-
))), /* @__PURE__ */
|
|
4363
|
+
))), /* @__PURE__ */ React36.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
3874
4364
|
};
|
|
3875
|
-
var
|
|
4365
|
+
var styles18 = StyleSheet18.create({
|
|
3876
4366
|
headerContent: {
|
|
3877
4367
|
flexDirection: "row",
|
|
3878
4368
|
alignItems: "center"
|
|
@@ -3931,8 +4421,8 @@ var styles16 = StyleSheet16.create({
|
|
|
3931
4421
|
});
|
|
3932
4422
|
|
|
3933
4423
|
// src/molecules/Permissions.tsx
|
|
3934
|
-
import
|
|
3935
|
-
import { StyleSheet as
|
|
4424
|
+
import React37 from "react";
|
|
4425
|
+
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
3936
4426
|
var Permissions = ({
|
|
3937
4427
|
open,
|
|
3938
4428
|
onClose,
|
|
@@ -3940,8 +4430,8 @@ var Permissions = ({
|
|
|
3940
4430
|
}) => {
|
|
3941
4431
|
const { appName, linkToken, setUserConsent } = useKryptosConnect();
|
|
3942
4432
|
const theme = useTheme();
|
|
3943
|
-
const [isLoading, setIsLoading] =
|
|
3944
|
-
const [errorMessage, setErrorMessage] =
|
|
4433
|
+
const [isLoading, setIsLoading] = React37.useState(false);
|
|
4434
|
+
const [errorMessage, setErrorMessage] = React37.useState("");
|
|
3945
4435
|
const handleConsentClick = async () => {
|
|
3946
4436
|
try {
|
|
3947
4437
|
setIsLoading(true);
|
|
@@ -3964,42 +4454,42 @@ var Permissions = ({
|
|
|
3964
4454
|
"Access your transaction history and trading activity",
|
|
3965
4455
|
"Keep this data updated and accessible when you're offline"
|
|
3966
4456
|
];
|
|
3967
|
-
return /* @__PURE__ */
|
|
3968
|
-
|
|
4457
|
+
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(
|
|
4458
|
+
Text17,
|
|
3969
4459
|
{
|
|
3970
|
-
style: [
|
|
4460
|
+
style: [styles19.subtitle, { color: theme.colors.textSecondary }]
|
|
3971
4461
|
},
|
|
3972
4462
|
"Allow ",
|
|
3973
4463
|
appName,
|
|
3974
4464
|
" to:"
|
|
3975
|
-
), permissionItems.map((item, index) => /* @__PURE__ */
|
|
3976
|
-
|
|
4465
|
+
), 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(
|
|
4466
|
+
Text17,
|
|
3977
4467
|
{
|
|
3978
|
-
style: [
|
|
4468
|
+
style: [styles19.permissionText, { color: theme.colors.text }]
|
|
3979
4469
|
},
|
|
3980
4470
|
item
|
|
3981
|
-
)))), /* @__PURE__ */
|
|
3982
|
-
|
|
4471
|
+
)))), /* @__PURE__ */ React37.createElement(
|
|
4472
|
+
View19,
|
|
3983
4473
|
{
|
|
3984
4474
|
style: [
|
|
3985
|
-
|
|
4475
|
+
styles19.infoBox,
|
|
3986
4476
|
{
|
|
3987
4477
|
backgroundColor: theme.colors.surface,
|
|
3988
4478
|
borderColor: theme.colors.border
|
|
3989
4479
|
}
|
|
3990
4480
|
]
|
|
3991
4481
|
},
|
|
3992
|
-
/* @__PURE__ */
|
|
3993
|
-
|
|
4482
|
+
/* @__PURE__ */ React37.createElement(
|
|
4483
|
+
Text17,
|
|
3994
4484
|
{
|
|
3995
|
-
style: [
|
|
4485
|
+
style: [styles19.infoText, { color: theme.colors.textSecondary }]
|
|
3996
4486
|
},
|
|
3997
4487
|
"By selecting",
|
|
3998
4488
|
" ",
|
|
3999
|
-
/* @__PURE__ */
|
|
4489
|
+
/* @__PURE__ */ React37.createElement(Text17, { style: { fontWeight: "600", color: theme.colors.text } }, "'Allow'"),
|
|
4000
4490
|
", you agree to share this information and keep it updated."
|
|
4001
4491
|
)
|
|
4002
|
-
))), /* @__PURE__ */
|
|
4492
|
+
))), /* @__PURE__ */ React37.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React37.createElement(
|
|
4003
4493
|
Button,
|
|
4004
4494
|
{
|
|
4005
4495
|
variant: "outline",
|
|
@@ -4007,12 +4497,12 @@ var Permissions = ({
|
|
|
4007
4497
|
onPress: handleConsentClick,
|
|
4008
4498
|
loading: isLoading,
|
|
4009
4499
|
disabled: isLoading,
|
|
4010
|
-
style:
|
|
4500
|
+
style: styles19.button
|
|
4011
4501
|
},
|
|
4012
4502
|
"Allow"
|
|
4013
|
-
), /* @__PURE__ */
|
|
4503
|
+
), /* @__PURE__ */ React37.createElement(Footer, null)));
|
|
4014
4504
|
};
|
|
4015
|
-
var
|
|
4505
|
+
var styles19 = StyleSheet19.create({
|
|
4016
4506
|
container: {
|
|
4017
4507
|
flex: 1
|
|
4018
4508
|
},
|
|
@@ -4070,8 +4560,8 @@ var styles17 = StyleSheet17.create({
|
|
|
4070
4560
|
});
|
|
4071
4561
|
|
|
4072
4562
|
// src/molecules/StatusModal.tsx
|
|
4073
|
-
import
|
|
4074
|
-
import { StyleSheet as
|
|
4563
|
+
import React38 from "react";
|
|
4564
|
+
import { StyleSheet as StyleSheet20, Text as Text18, View as View20 } from "react-native";
|
|
4075
4565
|
var StatusModal = ({
|
|
4076
4566
|
open,
|
|
4077
4567
|
onClose,
|
|
@@ -4088,18 +4578,18 @@ var StatusModal = ({
|
|
|
4088
4578
|
}
|
|
4089
4579
|
onClose();
|
|
4090
4580
|
};
|
|
4091
|
-
return /* @__PURE__ */
|
|
4581
|
+
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(
|
|
4092
4582
|
Button,
|
|
4093
4583
|
{
|
|
4094
4584
|
variant: "outline",
|
|
4095
4585
|
size: "lg",
|
|
4096
4586
|
onPress: status === "success" ? onSuccess : onError,
|
|
4097
|
-
style:
|
|
4587
|
+
style: styles20.button
|
|
4098
4588
|
},
|
|
4099
4589
|
status === "success" ? "Continue" : "Try again later"
|
|
4100
|
-
), /* @__PURE__ */
|
|
4590
|
+
), /* @__PURE__ */ React38.createElement(Footer, null)));
|
|
4101
4591
|
};
|
|
4102
|
-
var
|
|
4592
|
+
var styles20 = StyleSheet20.create({
|
|
4103
4593
|
container: {
|
|
4104
4594
|
flex: 1,
|
|
4105
4595
|
alignItems: "center",
|
|
@@ -4123,64 +4613,6 @@ var styles18 = StyleSheet18.create({
|
|
|
4123
4613
|
}
|
|
4124
4614
|
});
|
|
4125
4615
|
|
|
4126
|
-
// src/molecules/EndModal.tsx
|
|
4127
|
-
import React36, { useEffect as useEffect4 } from "react";
|
|
4128
|
-
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
4129
|
-
var EndModal = ({ open, onClose }) => {
|
|
4130
|
-
const theme = useTheme();
|
|
4131
|
-
useEffect4(() => {
|
|
4132
|
-
if (!open) return;
|
|
4133
|
-
const timer = setTimeout(() => {
|
|
4134
|
-
onClose();
|
|
4135
|
-
}, 5e3);
|
|
4136
|
-
return () => clearTimeout(timer);
|
|
4137
|
-
}, []);
|
|
4138
|
-
return /* @__PURE__ */ React36.createElement(Modal, { isOpen: open, onClose, size: "md" }, /* @__PURE__ */ React36.createElement(ModalHeader, { onClose }, ""), /* @__PURE__ */ React36.createElement(ModalBody, null, /* @__PURE__ */ React36.createElement(View19, { style: styles19.container }, /* @__PURE__ */ React36.createElement(
|
|
4139
|
-
View19,
|
|
4140
|
-
{
|
|
4141
|
-
style: [
|
|
4142
|
-
styles19.iconContainer,
|
|
4143
|
-
{ backgroundColor: theme.colors.successLight }
|
|
4144
|
-
]
|
|
4145
|
-
},
|
|
4146
|
-
/* @__PURE__ */ React36.createElement(SuccessIcon, { size: 80 })
|
|
4147
|
-
), /* @__PURE__ */ React36.createElement(Text17, { style: [styles19.message, { color: theme.colors.text }] }, `All set! We're redirecting you back to the app. If it takes longer
|
|
4148
|
-
than expected, tap the button below to continue.`))), /* @__PURE__ */ React36.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React36.createElement(
|
|
4149
|
-
Button,
|
|
4150
|
-
{
|
|
4151
|
-
variant: "primary",
|
|
4152
|
-
size: "lg",
|
|
4153
|
-
onPress: onClose,
|
|
4154
|
-
style: styles19.button
|
|
4155
|
-
},
|
|
4156
|
-
"Continue to App"
|
|
4157
|
-
), /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
4158
|
-
};
|
|
4159
|
-
var styles19 = StyleSheet19.create({
|
|
4160
|
-
container: {
|
|
4161
|
-
alignItems: "center",
|
|
4162
|
-
paddingVertical: 20
|
|
4163
|
-
},
|
|
4164
|
-
iconContainer: {
|
|
4165
|
-
width: 80,
|
|
4166
|
-
height: 80,
|
|
4167
|
-
borderRadius: 40,
|
|
4168
|
-
alignItems: "center",
|
|
4169
|
-
justifyContent: "center",
|
|
4170
|
-
marginBottom: 20
|
|
4171
|
-
},
|
|
4172
|
-
message: {
|
|
4173
|
-
fontSize: 14,
|
|
4174
|
-
textAlign: "center",
|
|
4175
|
-
lineHeight: 20,
|
|
4176
|
-
marginBottom: 24,
|
|
4177
|
-
paddingHorizontal: 20
|
|
4178
|
-
},
|
|
4179
|
-
button: {
|
|
4180
|
-
width: "100%"
|
|
4181
|
-
}
|
|
4182
|
-
});
|
|
4183
|
-
|
|
4184
4616
|
// src/KryptosConnectButton.tsx
|
|
4185
4617
|
var KryptosConnectButton = ({
|
|
4186
4618
|
children,
|
|
@@ -4188,17 +4620,18 @@ var KryptosConnectButton = ({
|
|
|
4188
4620
|
onError,
|
|
4189
4621
|
generateLinkToken,
|
|
4190
4622
|
style,
|
|
4191
|
-
textStyle
|
|
4623
|
+
textStyle,
|
|
4624
|
+
integrationName
|
|
4192
4625
|
}) => {
|
|
4193
4626
|
const { theme: themeName } = useKryptosConnect();
|
|
4194
|
-
const [open, setOpen] =
|
|
4627
|
+
const [open, setOpen] = React39.useState(false);
|
|
4195
4628
|
const theme = useTheme();
|
|
4196
|
-
return /* @__PURE__ */
|
|
4197
|
-
|
|
4629
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, children ? /* @__PURE__ */ React39.createElement(TouchableOpacity9, { onPress: () => setOpen(true), style }, children) : /* @__PURE__ */ React39.createElement(
|
|
4630
|
+
TouchableOpacity9,
|
|
4198
4631
|
{
|
|
4199
4632
|
onPress: () => setOpen(true),
|
|
4200
4633
|
style: [
|
|
4201
|
-
|
|
4634
|
+
styles21.defaultButton,
|
|
4202
4635
|
themeName === "light" ? {
|
|
4203
4636
|
backgroundColor: theme.colors.white,
|
|
4204
4637
|
borderRadius: theme.borderRadius.md,
|
|
@@ -4212,11 +4645,11 @@ var KryptosConnectButton = ({
|
|
|
4212
4645
|
],
|
|
4213
4646
|
activeOpacity: 0.8
|
|
4214
4647
|
},
|
|
4215
|
-
/* @__PURE__ */
|
|
4216
|
-
|
|
4648
|
+
/* @__PURE__ */ React39.createElement(
|
|
4649
|
+
Text19,
|
|
4217
4650
|
{
|
|
4218
4651
|
style: [
|
|
4219
|
-
|
|
4652
|
+
styles21.buttonText,
|
|
4220
4653
|
{
|
|
4221
4654
|
color: themeName === "light" ? theme.colors.primary : theme.colors.white,
|
|
4222
4655
|
fontSize: theme.fontSize.lg
|
|
@@ -4224,18 +4657,17 @@ var KryptosConnectButton = ({
|
|
|
4224
4657
|
textStyle
|
|
4225
4658
|
]
|
|
4226
4659
|
},
|
|
4227
|
-
"Connect
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
/* @__PURE__ */ React37.createElement(LogoIcon, { size: 24 })
|
|
4231
|
-
), /* @__PURE__ */ React37.createElement(
|
|
4660
|
+
integrationName ? `Connect ${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)} Account` : "Connect With Kryptos"
|
|
4661
|
+
)
|
|
4662
|
+
), open && /* @__PURE__ */ React39.createElement(
|
|
4232
4663
|
KryptosConnectModal,
|
|
4233
4664
|
{
|
|
4234
4665
|
open,
|
|
4235
4666
|
setOpen,
|
|
4236
4667
|
onSuccess,
|
|
4237
4668
|
onError,
|
|
4238
|
-
generateLinkToken
|
|
4669
|
+
generateLinkToken,
|
|
4670
|
+
integrationName
|
|
4239
4671
|
}
|
|
4240
4672
|
));
|
|
4241
4673
|
};
|
|
@@ -4244,7 +4676,8 @@ var KryptosConnectModal = ({
|
|
|
4244
4676
|
setOpen,
|
|
4245
4677
|
onSuccess,
|
|
4246
4678
|
onError,
|
|
4247
|
-
generateLinkToken
|
|
4679
|
+
generateLinkToken,
|
|
4680
|
+
integrationName
|
|
4248
4681
|
}) => {
|
|
4249
4682
|
const {
|
|
4250
4683
|
setIsInitialized,
|
|
@@ -4256,7 +4689,20 @@ var KryptosConnectModal = ({
|
|
|
4256
4689
|
isAuthorized,
|
|
4257
4690
|
linkToken
|
|
4258
4691
|
} = useKryptosConnect();
|
|
4259
|
-
const [step, setStep] =
|
|
4692
|
+
const [step, setStep] = React39.useState("INIT" /* INIT */);
|
|
4693
|
+
const [integrationDetails, setIntegrationDetails] = useState4(null);
|
|
4694
|
+
useEffect5(() => {
|
|
4695
|
+
if (integrationName && linkToken) {
|
|
4696
|
+
const fetchIntegrationDetails = async () => {
|
|
4697
|
+
const integrationDetails2 = await getSupportedProviders(
|
|
4698
|
+
linkToken,
|
|
4699
|
+
integrationName
|
|
4700
|
+
);
|
|
4701
|
+
setIntegrationDetails(integrationDetails2?.providers?.[0]);
|
|
4702
|
+
};
|
|
4703
|
+
fetchIntegrationDetails();
|
|
4704
|
+
}
|
|
4705
|
+
}, [integrationName, linkToken]);
|
|
4260
4706
|
const handleClose = () => {
|
|
4261
4707
|
setOpen(false);
|
|
4262
4708
|
setIsInitialized(false);
|
|
@@ -4292,7 +4738,7 @@ var KryptosConnectModal = ({
|
|
|
4292
4738
|
handleClose();
|
|
4293
4739
|
};
|
|
4294
4740
|
if (!open) return null;
|
|
4295
|
-
return /* @__PURE__ */
|
|
4741
|
+
return /* @__PURE__ */ React39.createElement(View21, { style: styles21.container }, step === "INIT" /* INIT */ && /* @__PURE__ */ React39.createElement(
|
|
4296
4742
|
Init,
|
|
4297
4743
|
{
|
|
4298
4744
|
open,
|
|
@@ -4306,7 +4752,7 @@ var KryptosConnectModal = ({
|
|
|
4306
4752
|
},
|
|
4307
4753
|
onClose: handleAbort
|
|
4308
4754
|
}
|
|
4309
|
-
), step === "AUTH" /* AUTH */ && /* @__PURE__ */
|
|
4755
|
+
), step === "AUTH" /* AUTH */ && /* @__PURE__ */ React39.createElement(
|
|
4310
4756
|
Auth,
|
|
4311
4757
|
{
|
|
4312
4758
|
open,
|
|
@@ -4314,28 +4760,29 @@ var KryptosConnectModal = ({
|
|
|
4314
4760
|
onGuestSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4315
4761
|
onClose: handleAbort
|
|
4316
4762
|
}
|
|
4317
|
-
), step === "OTP" /* OTP */ && /* @__PURE__ */
|
|
4763
|
+
), step === "OTP" /* OTP */ && /* @__PURE__ */ React39.createElement(
|
|
4318
4764
|
OTPVerify,
|
|
4319
4765
|
{
|
|
4320
4766
|
open,
|
|
4321
4767
|
onSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4322
4768
|
onClose: handleAbort
|
|
4323
4769
|
}
|
|
4324
|
-
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */
|
|
4770
|
+
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */ React39.createElement(
|
|
4325
4771
|
Integration,
|
|
4326
4772
|
{
|
|
4327
4773
|
open,
|
|
4328
4774
|
onSuccess: handleConsentClick,
|
|
4329
|
-
onClose: handleAbort
|
|
4775
|
+
onClose: handleAbort,
|
|
4776
|
+
integrationDetails
|
|
4330
4777
|
}
|
|
4331
|
-
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */
|
|
4778
|
+
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */ React39.createElement(
|
|
4332
4779
|
Permissions,
|
|
4333
4780
|
{
|
|
4334
4781
|
open,
|
|
4335
4782
|
onClose: handleAbort,
|
|
4336
4783
|
onSuccess: () => setStep("STATUS" /* STATUS */)
|
|
4337
4784
|
}
|
|
4338
|
-
), step === "STATUS" /* STATUS */ && /* @__PURE__ */
|
|
4785
|
+
), step === "STATUS" /* STATUS */ && /* @__PURE__ */ React39.createElement(
|
|
4339
4786
|
StatusModal,
|
|
4340
4787
|
{
|
|
4341
4788
|
open,
|
|
@@ -4344,7 +4791,7 @@ var KryptosConnectModal = ({
|
|
|
4344
4791
|
onError: handleError,
|
|
4345
4792
|
status: userConsent?.public_token ? "success" : "error"
|
|
4346
4793
|
}
|
|
4347
|
-
), step === "END" /* END */ && /* @__PURE__ */
|
|
4794
|
+
), step === "END" /* END */ && /* @__PURE__ */ React39.createElement(
|
|
4348
4795
|
EndModal,
|
|
4349
4796
|
{
|
|
4350
4797
|
open,
|
|
@@ -4356,7 +4803,7 @@ var KryptosConnectModal = ({
|
|
|
4356
4803
|
}
|
|
4357
4804
|
));
|
|
4358
4805
|
};
|
|
4359
|
-
var
|
|
4806
|
+
var styles21 = StyleSheet21.create({
|
|
4360
4807
|
defaultButton: {
|
|
4361
4808
|
flexDirection: "row",
|
|
4362
4809
|
alignItems: "center",
|