@kryptos_connect/mobile-sdk 1.0.4 → 1.0.6-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -6
- package/dist/index.d.ts +9 -6
- package/dist/index.js +1098 -642
- package/dist/index.mjs +1094 -651
- 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 = () => {
|
|
@@ -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,48 @@ var WalletConnectComponent = ({
|
|
|
2215
2320
|
handleClose,
|
|
2216
2321
|
modalOpen,
|
|
2217
2322
|
setAddIntegrationMode,
|
|
2218
|
-
providersList
|
|
2323
|
+
providersList,
|
|
2324
|
+
errorMessage
|
|
2219
2325
|
}) => {
|
|
2220
2326
|
const { walletConnectProjectId } = useKryptosConnect();
|
|
2221
2327
|
const theme = useTheme();
|
|
2222
2328
|
if (!walletConnectProjectId) {
|
|
2223
|
-
return /* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose: handleClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, /* @__PURE__ */ React32.createElement(
|
|
2224
2330
|
TouchableOpacity4,
|
|
2225
2331
|
{
|
|
2226
2332
|
onPress: () => {
|
|
2227
2333
|
setAddIntegrationMode(null);
|
|
2228
2334
|
},
|
|
2229
|
-
style:
|
|
2335
|
+
style: styles14.backButton
|
|
2230
2336
|
},
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
), /* @__PURE__ */
|
|
2233
|
-
|
|
2337
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2338
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React32.createElement(ModalBody, { scrollable: true, style: styles14.contentContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.emptyState }, /* @__PURE__ */ React32.createElement(
|
|
2339
|
+
Text12,
|
|
2234
2340
|
{
|
|
2235
|
-
style: [
|
|
2341
|
+
style: [styles14.emptyStateTitle, { color: theme.colors.text }]
|
|
2236
2342
|
},
|
|
2237
2343
|
"WalletConnect is not configured"
|
|
2238
|
-
), /* @__PURE__ */
|
|
2239
|
-
|
|
2344
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2345
|
+
Text12,
|
|
2240
2346
|
{
|
|
2241
2347
|
style: [
|
|
2242
|
-
|
|
2348
|
+
styles14.infoText,
|
|
2243
2349
|
{ color: theme.colors.textSecondary, textAlign: "center" }
|
|
2244
2350
|
]
|
|
2245
2351
|
},
|
|
2246
2352
|
"Please add a walletConnectProjectId to KryptosConnectProvider to enable wallet connections."
|
|
2247
|
-
), /* @__PURE__ */
|
|
2353
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2248
2354
|
Button,
|
|
2249
2355
|
{
|
|
2250
2356
|
variant: "outline",
|
|
2251
2357
|
size: "sm",
|
|
2252
2358
|
onPress: () => setAddIntegrationMode(null),
|
|
2253
|
-
style:
|
|
2359
|
+
style: styles14.emptyStateButton
|
|
2254
2360
|
},
|
|
2255
2361
|
"Go back"
|
|
2256
2362
|
))));
|
|
2257
2363
|
}
|
|
2258
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ React32.createElement(wallet_connect_default, null, /* @__PURE__ */ React32.createElement(
|
|
2259
2365
|
ConnectButton,
|
|
2260
2366
|
{
|
|
2261
2367
|
integration,
|
|
@@ -2264,7 +2370,8 @@ var WalletConnectComponent = ({
|
|
|
2264
2370
|
handleClose,
|
|
2265
2371
|
modalOpen,
|
|
2266
2372
|
setAddIntegrationMode,
|
|
2267
|
-
providersList
|
|
2373
|
+
providersList,
|
|
2374
|
+
errorMessage
|
|
2268
2375
|
}
|
|
2269
2376
|
));
|
|
2270
2377
|
};
|
|
@@ -2274,7 +2381,8 @@ function ConnectButton({
|
|
|
2274
2381
|
handleClose,
|
|
2275
2382
|
modalOpen,
|
|
2276
2383
|
setAddIntegrationMode,
|
|
2277
|
-
providersList
|
|
2384
|
+
providersList,
|
|
2385
|
+
errorMessage: errorMessageProp
|
|
2278
2386
|
}) {
|
|
2279
2387
|
const theme = useTheme();
|
|
2280
2388
|
const { open, disconnect } = useAppKit();
|
|
@@ -2291,11 +2399,17 @@ function ConnectButton({
|
|
|
2291
2399
|
return userUsedChains;
|
|
2292
2400
|
}
|
|
2293
2401
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2294
|
-
return integration.walletSupportedChains
|
|
2402
|
+
return integration.walletSupportedChains.filter((supportedChain) => {
|
|
2403
|
+
const provider = providersList.find(
|
|
2404
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2405
|
+
(p) => p.id === supportedChain.id
|
|
2406
|
+
);
|
|
2407
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2408
|
+
});
|
|
2295
2409
|
}
|
|
2296
2410
|
return [];
|
|
2297
|
-
}, [userUsedChains, integration.walletSupportedChains]);
|
|
2298
|
-
|
|
2411
|
+
}, [userUsedChains, integration.walletSupportedChains, providersList]);
|
|
2412
|
+
useEffect4(() => {
|
|
2299
2413
|
if (!isConnected || !address || !address.trim()) {
|
|
2300
2414
|
setUserUsedChains([]);
|
|
2301
2415
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2314,7 +2428,16 @@ function ConnectButton({
|
|
|
2314
2428
|
}
|
|
2315
2429
|
}
|
|
2316
2430
|
if (chains.length === 0 && integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2317
|
-
chains = integration.walletSupportedChains
|
|
2431
|
+
chains = integration.walletSupportedChains.filter(
|
|
2432
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2433
|
+
(supportedChain) => {
|
|
2434
|
+
const provider = providersList.find(
|
|
2435
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2436
|
+
(p) => p.id === supportedChain.id
|
|
2437
|
+
);
|
|
2438
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2439
|
+
}
|
|
2440
|
+
);
|
|
2318
2441
|
}
|
|
2319
2442
|
if (chains.length > 0) {
|
|
2320
2443
|
setUserUsedChains(chains);
|
|
@@ -2326,11 +2449,21 @@ function ConnectButton({
|
|
|
2326
2449
|
} catch (error) {
|
|
2327
2450
|
console.error("Failed to fetch user chains:", error);
|
|
2328
2451
|
if (integration.walletSupportedChains && integration.walletSupportedChains.length > 0) {
|
|
2329
|
-
|
|
2452
|
+
const validChains = integration.walletSupportedChains.filter(
|
|
2453
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2454
|
+
(supportedChain) => {
|
|
2455
|
+
const provider = providersList.find(
|
|
2456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2457
|
+
(p) => p.id === supportedChain.id
|
|
2458
|
+
);
|
|
2459
|
+
return provider && provider.is_working === true && provider.isEvmWallet === true;
|
|
2460
|
+
}
|
|
2461
|
+
);
|
|
2462
|
+
setUserUsedChains(validChains);
|
|
2330
2463
|
setSelectedChains(
|
|
2331
2464
|
new Set(
|
|
2332
2465
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2333
|
-
|
|
2466
|
+
validChains.map((chain) => chain.id)
|
|
2334
2467
|
)
|
|
2335
2468
|
);
|
|
2336
2469
|
} else {
|
|
@@ -2350,7 +2483,8 @@ function ConnectButton({
|
|
|
2350
2483
|
address,
|
|
2351
2484
|
isConnected,
|
|
2352
2485
|
integration.isEvmWallet,
|
|
2353
|
-
integration.walletSupportedChains
|
|
2486
|
+
integration.walletSupportedChains,
|
|
2487
|
+
providersList
|
|
2354
2488
|
]);
|
|
2355
2489
|
const validateForm = () => {
|
|
2356
2490
|
if (!address) {
|
|
@@ -2387,11 +2521,11 @@ function ConnectButton({
|
|
|
2387
2521
|
source: provider?.id,
|
|
2388
2522
|
credential: {
|
|
2389
2523
|
address,
|
|
2390
|
-
userId: user?.user_id || "
|
|
2524
|
+
userId: user?.user_id || "",
|
|
2391
2525
|
projectId: provider?.projectId,
|
|
2392
|
-
apiKey: "
|
|
2393
|
-
secret: "
|
|
2394
|
-
privateKey: "
|
|
2526
|
+
apiKey: "",
|
|
2527
|
+
secret: "",
|
|
2528
|
+
privateKey: "",
|
|
2395
2529
|
alias,
|
|
2396
2530
|
walletId,
|
|
2397
2531
|
exchange: provider?.id
|
|
@@ -2430,10 +2564,9 @@ function ConnectButton({
|
|
|
2430
2564
|
default_chain_logo: integration?.logo || "",
|
|
2431
2565
|
type: provider.type || "",
|
|
2432
2566
|
isNftSupported: provider?.isEvmWallet || provider?.nftSupport || false,
|
|
2567
|
+
isCustomWallet: false,
|
|
2433
2568
|
chainId: provider?.community_id,
|
|
2434
|
-
|
|
2435
|
-
address
|
|
2436
|
-
}
|
|
2569
|
+
address: address?.trim()
|
|
2437
2570
|
};
|
|
2438
2571
|
integrationsToAdd.push(data);
|
|
2439
2572
|
} else {
|
|
@@ -2452,7 +2585,7 @@ function ConnectButton({
|
|
|
2452
2585
|
return;
|
|
2453
2586
|
}
|
|
2454
2587
|
if (integrationsToAdd.length > 0) {
|
|
2455
|
-
onAddHandle(integrationsToAdd);
|
|
2588
|
+
await onAddHandle(integrationsToAdd);
|
|
2456
2589
|
if (isConnected) {
|
|
2457
2590
|
disconnect();
|
|
2458
2591
|
}
|
|
@@ -2465,7 +2598,7 @@ function ConnectButton({
|
|
|
2465
2598
|
const err = error;
|
|
2466
2599
|
console.error(error);
|
|
2467
2600
|
setErrorMessage(
|
|
2468
|
-
err?.response?.data?.message || "Failed to add
|
|
2601
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to add integrations"
|
|
2469
2602
|
);
|
|
2470
2603
|
} finally {
|
|
2471
2604
|
setIsLoading(false);
|
|
@@ -2485,7 +2618,13 @@ function ConnectButton({
|
|
|
2485
2618
|
setChainErrors(newErrors);
|
|
2486
2619
|
}
|
|
2487
2620
|
};
|
|
2488
|
-
|
|
2621
|
+
const onClose = () => {
|
|
2622
|
+
if (isConnected) {
|
|
2623
|
+
disconnect();
|
|
2624
|
+
}
|
|
2625
|
+
handleClose();
|
|
2626
|
+
};
|
|
2627
|
+
return /* @__PURE__ */ React32.createElement(Modal, { isOpen: modalOpen, onClose, size: "full" }, /* @__PURE__ */ React32.createElement(ModalHeader, { onClose }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.headerContent }, /* @__PURE__ */ React32.createElement(
|
|
2489
2628
|
TouchableOpacity4,
|
|
2490
2629
|
{
|
|
2491
2630
|
onPress: () => {
|
|
@@ -2494,26 +2633,26 @@ function ConnectButton({
|
|
|
2494
2633
|
disconnect();
|
|
2495
2634
|
}
|
|
2496
2635
|
},
|
|
2497
|
-
style:
|
|
2636
|
+
style: styles14.backButton
|
|
2498
2637
|
},
|
|
2499
|
-
/* @__PURE__ */
|
|
2500
|
-
), /* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ React32.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
2639
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React32.createElement(ModalBody, { scrollable: true, style: styles14.contentContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.header }, integration.logo ? isSvgUrl(integration.logo) ? /* @__PURE__ */ React32.createElement(RemoteSvg, { uri: integration.logo }) : /* @__PURE__ */ React32.createElement(
|
|
2501
2640
|
Image2,
|
|
2502
2641
|
{
|
|
2503
2642
|
source: { uri: integration.logo },
|
|
2504
|
-
style:
|
|
2643
|
+
style: styles14.logo,
|
|
2505
2644
|
resizeMode: "contain"
|
|
2506
2645
|
}
|
|
2507
|
-
) : /* @__PURE__ */
|
|
2508
|
-
|
|
2646
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2647
|
+
View14,
|
|
2509
2648
|
{
|
|
2510
2649
|
style: [
|
|
2511
|
-
|
|
2650
|
+
styles14.logoPlaceholder,
|
|
2512
2651
|
{ backgroundColor: theme.colors.surface }
|
|
2513
2652
|
]
|
|
2514
2653
|
},
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
), /* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ React32.createElement(Text12, { style: { color: theme.colors.text } }, integration.name?.charAt(0) || "?")
|
|
2655
|
+
), /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.name, { color: theme.colors.text }] }, integration.name)), !isConnected ? /* @__PURE__ */ React32.createElement(View14, null, /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.infoText, { color: theme.colors.text }] }, "Connect your wallet to continue"), /* @__PURE__ */ React32.createElement(
|
|
2517
2656
|
Button,
|
|
2518
2657
|
{
|
|
2519
2658
|
variant: "primary",
|
|
@@ -2521,111 +2660,132 @@ function ConnectButton({
|
|
|
2521
2660
|
onPress: () => open({ view: "Connect" })
|
|
2522
2661
|
},
|
|
2523
2662
|
"Connect Wallet"
|
|
2524
|
-
)) : /* @__PURE__ */
|
|
2525
|
-
|
|
2663
|
+
)) : /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedContainer }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.connectedHeader }, /* @__PURE__ */ React32.createElement(
|
|
2664
|
+
Text12,
|
|
2526
2665
|
{
|
|
2527
|
-
style: [
|
|
2666
|
+
style: [styles14.connectedTitle, { color: theme.colors.text }]
|
|
2528
2667
|
},
|
|
2529
2668
|
"Wallet Connected"
|
|
2530
|
-
), /* @__PURE__ */
|
|
2531
|
-
|
|
2669
|
+
), /* @__PURE__ */ React32.createElement(
|
|
2670
|
+
Text12,
|
|
2532
2671
|
{
|
|
2533
|
-
style: [
|
|
2672
|
+
style: [styles14.connectedText, { color: theme.colors.text }]
|
|
2534
2673
|
},
|
|
2535
2674
|
"Address: ",
|
|
2536
2675
|
address
|
|
2537
|
-
), /* @__PURE__ */
|
|
2538
|
-
|
|
2676
|
+
), /* @__PURE__ */ React32.createElement(Button, { variant: "ghost", size: "sm", onPress: () => disconnect() }, "Disconnect Wallet"), isFetchingChains ? /* @__PURE__ */ React32.createElement(
|
|
2677
|
+
Text12,
|
|
2539
2678
|
{
|
|
2540
|
-
style: [
|
|
2679
|
+
style: [styles14.fetchingText, { color: theme.colors.text }]
|
|
2541
2680
|
},
|
|
2542
2681
|
"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,
|
|
2682
|
+
) : null), availableChains.length > 0 && address && /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainListWrapper }, /* @__PURE__ */ React32.createElement(Text12, { style: [styles14.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"), /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainListContent }, /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainChips }, availableChains.map((chain) => {
|
|
2683
|
+
const isSelected = selectedChains.has(chain.id);
|
|
2684
|
+
const hasError = chainErrors[chain.id];
|
|
2685
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2686
|
+
TouchableOpacity4,
|
|
2687
|
+
{
|
|
2688
|
+
onPress: () => toggleChainSelection(chain.id),
|
|
2689
|
+
style: styles14.chainButton,
|
|
2690
|
+
key: chain.id
|
|
2691
|
+
},
|
|
2692
|
+
/* @__PURE__ */ React32.createElement(
|
|
2693
|
+
View14,
|
|
2557
2694
|
{
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2695
|
+
style: [
|
|
2696
|
+
styles14.chainChip,
|
|
2697
|
+
{
|
|
2698
|
+
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
2699
|
+
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2700
|
+
}
|
|
2701
|
+
]
|
|
2561
2702
|
},
|
|
2562
|
-
/* @__PURE__ */
|
|
2563
|
-
|
|
2703
|
+
/* @__PURE__ */ React32.createElement(
|
|
2704
|
+
Text12,
|
|
2564
2705
|
{
|
|
2565
2706
|
style: [
|
|
2566
|
-
|
|
2707
|
+
styles14.chainName,
|
|
2567
2708
|
{
|
|
2568
|
-
|
|
2569
|
-
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
2709
|
+
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
2570
2710
|
}
|
|
2571
2711
|
]
|
|
2572
2712
|
},
|
|
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
|
-
)
|
|
2713
|
+
chain.name || chain?.id
|
|
2714
|
+
),
|
|
2715
|
+
isSelected ? /* @__PURE__ */ React32.createElement(
|
|
2716
|
+
CloseIcon,
|
|
2717
|
+
{
|
|
2718
|
+
size: 12,
|
|
2719
|
+
color: hasError ? theme.colors.error : theme.colors.primary
|
|
2720
|
+
}
|
|
2721
|
+
) : /* @__PURE__ */ React32.createElement(
|
|
2722
|
+
PlusIcon,
|
|
2723
|
+
{
|
|
2724
|
+
size: 12,
|
|
2725
|
+
color: theme.colors.textSecondary
|
|
2726
|
+
}
|
|
2598
2727
|
)
|
|
2599
|
-
)
|
|
2600
|
-
|
|
2601
|
-
|
|
2728
|
+
)
|
|
2729
|
+
);
|
|
2730
|
+
})), selectedChains.size > 0 && availableChains.length > 0 && /* @__PURE__ */ React32.createElement(
|
|
2731
|
+
TouchableOpacity4,
|
|
2732
|
+
{
|
|
2733
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
2734
|
+
style: styles14.chainButton,
|
|
2735
|
+
activeOpacity: 0.7
|
|
2736
|
+
},
|
|
2737
|
+
/* @__PURE__ */ React32.createElement(
|
|
2738
|
+
View14,
|
|
2602
2739
|
{
|
|
2603
2740
|
style: [
|
|
2604
|
-
|
|
2605
|
-
|
|
2741
|
+
styles14.chainChip,
|
|
2742
|
+
styles14.chainChipRemoveAll,
|
|
2743
|
+
{
|
|
2744
|
+
borderWidth: 0,
|
|
2745
|
+
backgroundColor: "transparent"
|
|
2746
|
+
}
|
|
2606
2747
|
]
|
|
2607
2748
|
},
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
const chain = availableChains.find(
|
|
2611
|
-
(c) => c.id === chainId
|
|
2612
|
-
);
|
|
2613
|
-
return /* @__PURE__ */ React30.createElement(
|
|
2614
|
-
Text11,
|
|
2749
|
+
/* @__PURE__ */ React32.createElement(
|
|
2750
|
+
Text12,
|
|
2615
2751
|
{
|
|
2616
|
-
key: chainId,
|
|
2617
2752
|
style: [
|
|
2618
|
-
|
|
2619
|
-
{ color: theme.colors.
|
|
2753
|
+
styles14.chainName,
|
|
2754
|
+
{ color: theme.colors.primary }
|
|
2620
2755
|
]
|
|
2621
2756
|
},
|
|
2622
|
-
"
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2757
|
+
"Remove All Chains"
|
|
2758
|
+
),
|
|
2759
|
+
/* @__PURE__ */ React32.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
2760
|
+
)
|
|
2761
|
+
), Object.keys(chainErrors || {}).length > 0 && /* @__PURE__ */ React32.createElement(View14, { style: styles14.chainErrorsContainer }, /* @__PURE__ */ React32.createElement(
|
|
2762
|
+
Text12,
|
|
2763
|
+
{
|
|
2764
|
+
style: [
|
|
2765
|
+
styles14.chainErrorsTitle,
|
|
2766
|
+
{ color: theme.colors.error }
|
|
2767
|
+
]
|
|
2768
|
+
},
|
|
2769
|
+
"Errors:"
|
|
2770
|
+
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
2771
|
+
const chain = availableChains.find(
|
|
2772
|
+
(c) => c.id === chainId
|
|
2773
|
+
);
|
|
2774
|
+
return /* @__PURE__ */ React32.createElement(
|
|
2775
|
+
Text12,
|
|
2776
|
+
{
|
|
2777
|
+
key: chainId,
|
|
2778
|
+
style: [
|
|
2779
|
+
styles14.chainErrorItem,
|
|
2780
|
+
{ color: theme.colors.error }
|
|
2781
|
+
]
|
|
2782
|
+
},
|
|
2783
|
+
"\u2022 ",
|
|
2784
|
+
chain?.name ?? chainId,
|
|
2785
|
+
": ",
|
|
2786
|
+
String(error)
|
|
2787
|
+
);
|
|
2788
|
+
})))), errorMessage || errorMessageProp ? /* @__PURE__ */ React32.createElement(View14, { style: styles14.errorMessageContainer }, /* @__PURE__ */ React32.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React32.createElement(AlertDescription, null, errorMessage || errorMessageProp))) : null)), /* @__PURE__ */ React32.createElement(ModalFooter, { style: { paddingVertical: 8 } }, availableChains.length > 0 && address && /* @__PURE__ */ React32.createElement(
|
|
2629
2789
|
Button,
|
|
2630
2790
|
{
|
|
2631
2791
|
variant: "outline",
|
|
@@ -2633,14 +2793,20 @@ function ConnectButton({
|
|
|
2633
2793
|
onPress: onSubmitWalletConnect,
|
|
2634
2794
|
loading: isLoading,
|
|
2635
2795
|
disabled: isLoading || !!address && availableChains.length > 0 && selectedChains.size === 0,
|
|
2636
|
-
style:
|
|
2796
|
+
style: styles14.button
|
|
2637
2797
|
},
|
|
2638
2798
|
selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size > 1 ? "s" : ""}` : "Add Integration"
|
|
2639
|
-
), /* @__PURE__ */
|
|
2799
|
+
), /* @__PURE__ */ React32.createElement(Footer, null)));
|
|
2640
2800
|
}
|
|
2641
|
-
var
|
|
2801
|
+
var styles14 = StyleSheet14.create({
|
|
2642
2802
|
connectedContainer: {
|
|
2643
|
-
|
|
2803
|
+
flexShrink: 0
|
|
2804
|
+
},
|
|
2805
|
+
chainListWrapper: {
|
|
2806
|
+
marginTop: 8
|
|
2807
|
+
},
|
|
2808
|
+
chainListContent: {
|
|
2809
|
+
paddingBottom: 8
|
|
2644
2810
|
},
|
|
2645
2811
|
connectedHeader: {
|
|
2646
2812
|
marginBottom: 8
|
|
@@ -2654,13 +2820,6 @@ var styles13 = StyleSheet13.create({
|
|
|
2654
2820
|
marginBottom: 8,
|
|
2655
2821
|
textAlign: "center"
|
|
2656
2822
|
},
|
|
2657
|
-
scrollView: {
|
|
2658
|
-
flex: 1
|
|
2659
|
-
},
|
|
2660
|
-
scrollViewContent: {
|
|
2661
|
-
paddingBottom: 40,
|
|
2662
|
-
flexGrow: 1
|
|
2663
|
-
},
|
|
2664
2823
|
errorMessageContainer: {
|
|
2665
2824
|
marginTop: 16
|
|
2666
2825
|
},
|
|
@@ -2684,10 +2843,8 @@ var styles13 = StyleSheet13.create({
|
|
|
2684
2843
|
// theme.spacing.xl
|
|
2685
2844
|
paddingBottom: 20,
|
|
2686
2845
|
width: "100%",
|
|
2687
|
-
overflow: "hidden",
|
|
2688
2846
|
alignSelf: "center",
|
|
2689
|
-
flexDirection: "column"
|
|
2690
|
-
flex: 1
|
|
2847
|
+
flexDirection: "column"
|
|
2691
2848
|
},
|
|
2692
2849
|
chainTitle: {
|
|
2693
2850
|
fontSize: 14,
|
|
@@ -2713,6 +2870,11 @@ var styles13 = StyleSheet13.create({
|
|
|
2713
2870
|
// theme.borderRadius.md
|
|
2714
2871
|
borderWidth: 1
|
|
2715
2872
|
},
|
|
2873
|
+
chainChipRemoveAll: {
|
|
2874
|
+
marginTop: 6,
|
|
2875
|
+
// theme.spacing.sm - separate from chain list
|
|
2876
|
+
width: "auto"
|
|
2877
|
+
},
|
|
2716
2878
|
chainName: {
|
|
2717
2879
|
fontSize: 12,
|
|
2718
2880
|
fontWeight: "500",
|
|
@@ -2787,44 +2949,320 @@ var styles13 = StyleSheet13.create({
|
|
|
2787
2949
|
});
|
|
2788
2950
|
|
|
2789
2951
|
// src/molecules/IntegrationForm.tsx
|
|
2790
|
-
import
|
|
2952
|
+
import React34 from "react";
|
|
2953
|
+
import { Image as Image3, StyleSheet as StyleSheet16, Text as Text14, TouchableOpacity as TouchableOpacity6, View as View16 } from "react-native";
|
|
2954
|
+
|
|
2955
|
+
// src/molecules/IntegrationInfo.tsx
|
|
2956
|
+
import React33, { useMemo as useMemo2, useState as useState3 } from "react";
|
|
2791
2957
|
import {
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
Text as Text12,
|
|
2958
|
+
Linking as Linking3,
|
|
2959
|
+
StyleSheet as StyleSheet15,
|
|
2960
|
+
Text as Text13,
|
|
2796
2961
|
TouchableOpacity as TouchableOpacity5,
|
|
2797
|
-
View as
|
|
2962
|
+
View as View15
|
|
2798
2963
|
} from "react-native";
|
|
2964
|
+
var ChevronDown = ({ isOpen, color }) => /* @__PURE__ */ React33.createElement(Text13, { style: [styles15.chevron, { color }] }, isOpen ? "\u25BC" : "\u25B6");
|
|
2965
|
+
var IntegrationInfo = ({
|
|
2966
|
+
content,
|
|
2967
|
+
type,
|
|
2968
|
+
import_guide
|
|
2969
|
+
}) => {
|
|
2970
|
+
const theme = useTheme();
|
|
2971
|
+
const instructionsData = useMemo2(
|
|
2972
|
+
() => content?.instructions?.[type] || null,
|
|
2973
|
+
[content, type]
|
|
2974
|
+
);
|
|
2975
|
+
const featuresData = useMemo2(
|
|
2976
|
+
() => content?.features?.[type] || [],
|
|
2977
|
+
[content, type]
|
|
2978
|
+
);
|
|
2979
|
+
const gtkData = useMemo2(() => content?.gtk?.[type] || [], [content, type]);
|
|
2980
|
+
const hasInstructions = instructionsData && (instructionsData?.content?.length ?? 0) > 0;
|
|
2981
|
+
const hasFeatures = (featuresData?.length ?? 0) > 0;
|
|
2982
|
+
const hasGtk = (gtkData?.length ?? 0) > 0;
|
|
2983
|
+
const defaultSection = hasInstructions ? "instructions" : hasGtk ? "good-to-know" : hasFeatures ? "supported-features" : null;
|
|
2984
|
+
const [openSection, setOpenSection] = useState3(defaultSection);
|
|
2985
|
+
const toggleSection = (value) => {
|
|
2986
|
+
setOpenSection((prev) => prev === value ? null : value);
|
|
2987
|
+
};
|
|
2988
|
+
const handleImportGuidePress = () => {
|
|
2989
|
+
if (import_guide) Linking3.openURL(import_guide);
|
|
2990
|
+
};
|
|
2991
|
+
if (!hasInstructions && !hasFeatures && !hasGtk && !import_guide) {
|
|
2992
|
+
return null;
|
|
2993
|
+
}
|
|
2994
|
+
return /* @__PURE__ */ React33.createElement(View15, { style: styles15.container }, import_guide && /* @__PURE__ */ React33.createElement(
|
|
2995
|
+
TouchableOpacity5,
|
|
2996
|
+
{
|
|
2997
|
+
onPress: handleImportGuidePress,
|
|
2998
|
+
style: [styles15.importGuide, { borderColor: theme.colors.primary }],
|
|
2999
|
+
activeOpacity: 0.7
|
|
3000
|
+
},
|
|
3001
|
+
/* @__PURE__ */ React33.createElement(
|
|
3002
|
+
Text13,
|
|
3003
|
+
{
|
|
3004
|
+
style: [styles15.importGuideText, { color: theme.colors.primary }]
|
|
3005
|
+
},
|
|
3006
|
+
"Import Guide"
|
|
3007
|
+
),
|
|
3008
|
+
/* @__PURE__ */ React33.createElement(RedirectIcon, { width: 14, height: 14, color: theme.colors.primary })
|
|
3009
|
+
), hasInstructions && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3010
|
+
TouchableOpacity5,
|
|
3011
|
+
{
|
|
3012
|
+
onPress: () => toggleSection("instructions"),
|
|
3013
|
+
style: [
|
|
3014
|
+
styles15.trigger,
|
|
3015
|
+
{
|
|
3016
|
+
borderBottomColor: theme.colors.border,
|
|
3017
|
+
backgroundColor: theme.colors.surface
|
|
3018
|
+
}
|
|
3019
|
+
],
|
|
3020
|
+
activeOpacity: 0.7
|
|
3021
|
+
},
|
|
3022
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Instructions"),
|
|
3023
|
+
/* @__PURE__ */ React33.createElement(
|
|
3024
|
+
ChevronDown,
|
|
3025
|
+
{
|
|
3026
|
+
isOpen: openSection === "instructions",
|
|
3027
|
+
color: theme.colors.textSecondary
|
|
3028
|
+
}
|
|
3029
|
+
)
|
|
3030
|
+
), openSection === "instructions" && /* @__PURE__ */ React33.createElement(
|
|
3031
|
+
View15,
|
|
3032
|
+
{
|
|
3033
|
+
style: [
|
|
3034
|
+
styles15.content,
|
|
3035
|
+
{
|
|
3036
|
+
backgroundColor: theme.colors.background,
|
|
3037
|
+
borderBottomColor: theme.colors.border
|
|
3038
|
+
}
|
|
3039
|
+
]
|
|
3040
|
+
},
|
|
3041
|
+
instructionsData?.content && /* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, instructionsData.content.map(
|
|
3042
|
+
(step, index) => /* @__PURE__ */ React33.createElement(
|
|
3043
|
+
Text13,
|
|
3044
|
+
{
|
|
3045
|
+
key: index,
|
|
3046
|
+
style: [
|
|
3047
|
+
styles15.listItem,
|
|
3048
|
+
styles15.orderedItem,
|
|
3049
|
+
{ color: theme.colors.textSecondary }
|
|
3050
|
+
]
|
|
3051
|
+
},
|
|
3052
|
+
index + 1,
|
|
3053
|
+
". ",
|
|
3054
|
+
step
|
|
3055
|
+
)
|
|
3056
|
+
)),
|
|
3057
|
+
instructionsData?.videoLink && /* @__PURE__ */ React33.createElement(
|
|
3058
|
+
TouchableOpacity5,
|
|
3059
|
+
{
|
|
3060
|
+
onPress: () => Linking3.openURL(instructionsData.videoLink),
|
|
3061
|
+
style: styles15.videoLink,
|
|
3062
|
+
activeOpacity: 0.7
|
|
3063
|
+
},
|
|
3064
|
+
/* @__PURE__ */ React33.createElement(
|
|
3065
|
+
Text13,
|
|
3066
|
+
{
|
|
3067
|
+
style: [
|
|
3068
|
+
styles15.videoLinkText,
|
|
3069
|
+
{ color: theme.colors.primary }
|
|
3070
|
+
]
|
|
3071
|
+
},
|
|
3072
|
+
"\u25B6 Watch Video Tutorial"
|
|
3073
|
+
)
|
|
3074
|
+
)
|
|
3075
|
+
)), hasGtk && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3076
|
+
TouchableOpacity5,
|
|
3077
|
+
{
|
|
3078
|
+
onPress: () => toggleSection("good-to-know"),
|
|
3079
|
+
style: [
|
|
3080
|
+
styles15.trigger,
|
|
3081
|
+
{
|
|
3082
|
+
borderBottomColor: theme.colors.border,
|
|
3083
|
+
backgroundColor: theme.colors.surface
|
|
3084
|
+
}
|
|
3085
|
+
],
|
|
3086
|
+
activeOpacity: 0.7
|
|
3087
|
+
},
|
|
3088
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Good to know"),
|
|
3089
|
+
/* @__PURE__ */ React33.createElement(
|
|
3090
|
+
ChevronDown,
|
|
3091
|
+
{
|
|
3092
|
+
isOpen: openSection === "good-to-know",
|
|
3093
|
+
color: theme.colors.textSecondary
|
|
3094
|
+
}
|
|
3095
|
+
)
|
|
3096
|
+
), openSection === "good-to-know" && /* @__PURE__ */ React33.createElement(
|
|
3097
|
+
View15,
|
|
3098
|
+
{
|
|
3099
|
+
style: [
|
|
3100
|
+
styles15.content,
|
|
3101
|
+
{
|
|
3102
|
+
backgroundColor: theme.colors.background,
|
|
3103
|
+
borderBottomColor: theme.colors.border
|
|
3104
|
+
}
|
|
3105
|
+
]
|
|
3106
|
+
},
|
|
3107
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, gtkData.map((item, index) => /* @__PURE__ */ React33.createElement(
|
|
3108
|
+
Text13,
|
|
3109
|
+
{
|
|
3110
|
+
key: index,
|
|
3111
|
+
style: [
|
|
3112
|
+
styles15.listItem,
|
|
3113
|
+
styles15.bulletItem,
|
|
3114
|
+
{ color: theme.colors.textSecondary }
|
|
3115
|
+
]
|
|
3116
|
+
},
|
|
3117
|
+
"\u2022 ",
|
|
3118
|
+
item
|
|
3119
|
+
)))
|
|
3120
|
+
)), hasFeatures && /* @__PURE__ */ React33.createElement(View15, { style: styles15.accordionItem }, /* @__PURE__ */ React33.createElement(
|
|
3121
|
+
TouchableOpacity5,
|
|
3122
|
+
{
|
|
3123
|
+
onPress: () => toggleSection("supported-features"),
|
|
3124
|
+
style: [
|
|
3125
|
+
styles15.trigger,
|
|
3126
|
+
{
|
|
3127
|
+
borderBottomColor: theme.colors.border,
|
|
3128
|
+
backgroundColor: theme.colors.surface
|
|
3129
|
+
}
|
|
3130
|
+
],
|
|
3131
|
+
activeOpacity: 0.7
|
|
3132
|
+
},
|
|
3133
|
+
/* @__PURE__ */ React33.createElement(Text13, { style: [styles15.triggerText, { color: theme.colors.text }] }, "Supported Features"),
|
|
3134
|
+
/* @__PURE__ */ React33.createElement(
|
|
3135
|
+
ChevronDown,
|
|
3136
|
+
{
|
|
3137
|
+
isOpen: openSection === "supported-features",
|
|
3138
|
+
color: theme.colors.textSecondary
|
|
3139
|
+
}
|
|
3140
|
+
)
|
|
3141
|
+
), openSection === "supported-features" && /* @__PURE__ */ React33.createElement(
|
|
3142
|
+
View15,
|
|
3143
|
+
{
|
|
3144
|
+
style: [
|
|
3145
|
+
styles15.content,
|
|
3146
|
+
{
|
|
3147
|
+
backgroundColor: theme.colors.background,
|
|
3148
|
+
borderBottomColor: theme.colors.border
|
|
3149
|
+
}
|
|
3150
|
+
]
|
|
3151
|
+
},
|
|
3152
|
+
/* @__PURE__ */ React33.createElement(View15, { style: styles15.list }, featuresData.map((feature, index) => /* @__PURE__ */ React33.createElement(
|
|
3153
|
+
Text13,
|
|
3154
|
+
{
|
|
3155
|
+
key: index,
|
|
3156
|
+
style: [
|
|
3157
|
+
styles15.listItem,
|
|
3158
|
+
styles15.bulletItem,
|
|
3159
|
+
{ color: theme.colors.textSecondary }
|
|
3160
|
+
]
|
|
3161
|
+
},
|
|
3162
|
+
"\u2022 ",
|
|
3163
|
+
feature
|
|
3164
|
+
)))
|
|
3165
|
+
)));
|
|
3166
|
+
};
|
|
3167
|
+
var styles15 = StyleSheet15.create({
|
|
3168
|
+
container: {
|
|
3169
|
+
marginTop: 8
|
|
3170
|
+
},
|
|
3171
|
+
importGuide: {
|
|
3172
|
+
flexDirection: "row",
|
|
3173
|
+
alignItems: "center",
|
|
3174
|
+
alignSelf: "flex-end",
|
|
3175
|
+
gap: 4,
|
|
3176
|
+
paddingVertical: 6,
|
|
3177
|
+
paddingHorizontal: 8,
|
|
3178
|
+
marginBottom: 8
|
|
3179
|
+
},
|
|
3180
|
+
importGuideText: {
|
|
3181
|
+
fontSize: 14,
|
|
3182
|
+
fontWeight: "500"
|
|
3183
|
+
},
|
|
3184
|
+
accordionItem: {
|
|
3185
|
+
marginBottom: 4,
|
|
3186
|
+
borderRadius: 8,
|
|
3187
|
+
overflow: "hidden"
|
|
3188
|
+
},
|
|
3189
|
+
trigger: {
|
|
3190
|
+
flexDirection: "row",
|
|
3191
|
+
alignItems: "center",
|
|
3192
|
+
justifyContent: "space-between",
|
|
3193
|
+
paddingVertical: 12,
|
|
3194
|
+
paddingHorizontal: 16,
|
|
3195
|
+
borderBottomWidth: 1
|
|
3196
|
+
},
|
|
3197
|
+
triggerText: {
|
|
3198
|
+
fontSize: 14,
|
|
3199
|
+
fontWeight: "600"
|
|
3200
|
+
},
|
|
3201
|
+
chevron: {
|
|
3202
|
+
fontSize: 12
|
|
3203
|
+
},
|
|
3204
|
+
content: {
|
|
3205
|
+
paddingVertical: 12,
|
|
3206
|
+
paddingHorizontal: 16,
|
|
3207
|
+
borderBottomWidth: 1
|
|
3208
|
+
},
|
|
3209
|
+
list: {
|
|
3210
|
+
paddingLeft: 4
|
|
3211
|
+
},
|
|
3212
|
+
listItem: {
|
|
3213
|
+
fontSize: 13,
|
|
3214
|
+
lineHeight: 20,
|
|
3215
|
+
marginBottom: 6
|
|
3216
|
+
},
|
|
3217
|
+
orderedItem: {
|
|
3218
|
+
marginLeft: 0
|
|
3219
|
+
},
|
|
3220
|
+
bulletItem: {
|
|
3221
|
+
marginLeft: 0
|
|
3222
|
+
},
|
|
3223
|
+
videoLink: {
|
|
3224
|
+
marginTop: 8,
|
|
3225
|
+
paddingVertical: 8,
|
|
3226
|
+
paddingHorizontal: 12
|
|
3227
|
+
},
|
|
3228
|
+
videoLinkText: {
|
|
3229
|
+
fontSize: 13,
|
|
3230
|
+
fontWeight: "500"
|
|
3231
|
+
}
|
|
3232
|
+
});
|
|
3233
|
+
|
|
3234
|
+
// src/molecules/IntegrationForm.tsx
|
|
2799
3235
|
var IntegrationForm = ({
|
|
2800
3236
|
metadata,
|
|
2801
3237
|
onAddHandle,
|
|
2802
3238
|
open,
|
|
2803
3239
|
setAddIntegrationMode,
|
|
2804
3240
|
handleClose,
|
|
2805
|
-
providersList
|
|
3241
|
+
providersList,
|
|
3242
|
+
errorMessage: errorMessageProp,
|
|
3243
|
+
showBackButton = true
|
|
2806
3244
|
}) => {
|
|
2807
3245
|
const { clientId, linkToken, user } = useKryptosConnect();
|
|
2808
3246
|
const theme = useTheme();
|
|
2809
|
-
const [isLoading, setIsLoading] =
|
|
2810
|
-
const [isFetchingChains, setIsFetchingChains] =
|
|
2811
|
-
const [userUsedChains, setUserUsedChains] =
|
|
2812
|
-
const [selectedChains, setSelectedChains] =
|
|
3247
|
+
const [isLoading, setIsLoading] = React34.useState(false);
|
|
3248
|
+
const [isFetchingChains, setIsFetchingChains] = React34.useState(false);
|
|
3249
|
+
const [userUsedChains, setUserUsedChains] = React34.useState([]);
|
|
3250
|
+
const [selectedChains, setSelectedChains] = React34.useState(
|
|
2813
3251
|
/* @__PURE__ */ new Set()
|
|
2814
3252
|
);
|
|
2815
|
-
const [chainErrors, setChainErrors] =
|
|
3253
|
+
const [chainErrors, setChainErrors] = React34.useState(
|
|
2816
3254
|
{}
|
|
2817
3255
|
);
|
|
2818
|
-
const [errorMessage, setErrorMessage] =
|
|
2819
|
-
const [formValues, setFormValues] =
|
|
3256
|
+
const [errorMessage, setErrorMessage] = React34.useState("");
|
|
3257
|
+
const [formValues, setFormValues] = React34.useState({
|
|
2820
3258
|
address: "",
|
|
2821
3259
|
account_name: "",
|
|
2822
3260
|
api_key: "",
|
|
2823
3261
|
secret_key: "",
|
|
2824
3262
|
password: ""
|
|
2825
3263
|
});
|
|
2826
|
-
const [formErrors, setFormErrors] =
|
|
2827
|
-
|
|
3264
|
+
const [formErrors, setFormErrors] = React34.useState({});
|
|
3265
|
+
React34.useEffect(() => {
|
|
2828
3266
|
if (!formValues.address || !formValues.address.trim()) {
|
|
2829
3267
|
setUserUsedChains([]);
|
|
2830
3268
|
setSelectedChains(/* @__PURE__ */ new Set());
|
|
@@ -2907,18 +3345,18 @@ var IntegrationForm = ({
|
|
|
2907
3345
|
const credentialTestsData = chainsToProcess.map((chain) => {
|
|
2908
3346
|
const walletId = generateUUID();
|
|
2909
3347
|
const displaySuffix = primaryField.length >= 8 ? `${primaryField.slice(0, 4)}...${primaryField.slice(-4)}` : primaryField;
|
|
2910
|
-
const alias = `${metadata.id} - ${chain
|
|
3348
|
+
const alias = `${metadata.id} - ${chain?.name || ""} (${displaySuffix})`;
|
|
2911
3349
|
const credential = {
|
|
2912
3350
|
source: metadata.id,
|
|
2913
3351
|
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: "
|
|
3352
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3353
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3354
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3355
|
+
address: formValues.address?.trim() || "",
|
|
3356
|
+
password: formValues.password?.trim() || "",
|
|
3357
|
+
userId: user?.user_id || "",
|
|
3358
|
+
projectId: metadata?.projectId || "",
|
|
3359
|
+
privateKey: "",
|
|
2922
3360
|
alias,
|
|
2923
3361
|
walletId,
|
|
2924
3362
|
exchange: metadata.id
|
|
@@ -2952,11 +3390,12 @@ var IntegrationForm = ({
|
|
|
2952
3390
|
},
|
|
2953
3391
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
2954
3392
|
default_chain: chain.name,
|
|
2955
|
-
default_chain_logo:
|
|
3393
|
+
default_chain_logo: "",
|
|
2956
3394
|
type: metadata.type,
|
|
2957
3395
|
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
2958
3396
|
chainId: chain?.community_id || "",
|
|
2959
|
-
address: formValues.address
|
|
3397
|
+
address: formValues.address,
|
|
3398
|
+
isCustomWallet: false
|
|
2960
3399
|
};
|
|
2961
3400
|
if (formValues.account_name)
|
|
2962
3401
|
data.accountName = formValues.account_name;
|
|
@@ -2966,10 +3405,9 @@ var IntegrationForm = ({
|
|
|
2966
3405
|
integrationsToAdd.push(data);
|
|
2967
3406
|
} else {
|
|
2968
3407
|
if (result.status === "rejected") {
|
|
2969
|
-
|
|
2970
|
-
errors[chain.id] = reason?.response?.data?.message || "Failed to process chain";
|
|
3408
|
+
errors[chain.id] = result.reason?.response?.data?.message || "Failed to process chain";
|
|
2971
3409
|
} else if (result.status === "fulfilled") {
|
|
2972
|
-
errors[chain.id] = result.value?.
|
|
3410
|
+
errors[chain.id] = result.value?.message || "Failed to verify chain";
|
|
2973
3411
|
}
|
|
2974
3412
|
}
|
|
2975
3413
|
});
|
|
@@ -2987,14 +3425,14 @@ var IntegrationForm = ({
|
|
|
2987
3425
|
const credential = {
|
|
2988
3426
|
source: metadata.id,
|
|
2989
3427
|
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: "
|
|
3428
|
+
apiKey: formValues.api_key?.trim() || "",
|
|
3429
|
+
secret: formValues.secret_key?.trim() || "",
|
|
3430
|
+
accountName: formValues.account_name?.trim() || "",
|
|
3431
|
+
address: formValues.address?.trim() || "",
|
|
3432
|
+
password: formValues.password?.trim() || "",
|
|
3433
|
+
userId: user?.user_id || "",
|
|
3434
|
+
projectId: metadata?.projectId || "",
|
|
3435
|
+
privateKey: "",
|
|
2998
3436
|
alias,
|
|
2999
3437
|
walletId,
|
|
3000
3438
|
exchange: metadata.id
|
|
@@ -3002,9 +3440,7 @@ var IntegrationForm = ({
|
|
|
3002
3440
|
};
|
|
3003
3441
|
const testResult = await testCredentials(linkToken, { ...credential });
|
|
3004
3442
|
if (!testResult?.valid) {
|
|
3005
|
-
setErrorMessage(
|
|
3006
|
-
testResult?.value?.message || "Credentials are invalid"
|
|
3007
|
-
);
|
|
3443
|
+
setErrorMessage(testResult?.message || "Credentials are invalid");
|
|
3008
3444
|
return;
|
|
3009
3445
|
}
|
|
3010
3446
|
const data = {
|
|
@@ -3023,14 +3459,12 @@ var IntegrationForm = ({
|
|
|
3023
3459
|
clientId,
|
|
3024
3460
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3025
3461
|
},
|
|
3026
|
-
metadata: {
|
|
3027
|
-
environment: "sandbox"
|
|
3028
|
-
},
|
|
3029
3462
|
addedOn: (/* @__PURE__ */ new Date()).getTime(),
|
|
3030
3463
|
default_chain: metadata.id,
|
|
3031
|
-
default_chain_logo:
|
|
3464
|
+
default_chain_logo: "",
|
|
3032
3465
|
type: metadata.type,
|
|
3033
|
-
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false
|
|
3466
|
+
isNftSupported: metadata.isEvmWallet || metadata.nftSupport || false,
|
|
3467
|
+
isCustomWallet: false
|
|
3034
3468
|
};
|
|
3035
3469
|
if (metadata.community_id) {
|
|
3036
3470
|
data.chainId = metadata.community_id;
|
|
@@ -3043,7 +3477,7 @@ var IntegrationForm = ({
|
|
|
3043
3477
|
integrationsToAdd.push(data);
|
|
3044
3478
|
}
|
|
3045
3479
|
if (integrationsToAdd.length > 0) {
|
|
3046
|
-
onAddHandle(integrationsToAdd);
|
|
3480
|
+
await onAddHandle(integrationsToAdd);
|
|
3047
3481
|
setFormErrors({});
|
|
3048
3482
|
setFormValues({
|
|
3049
3483
|
address: "",
|
|
@@ -3057,10 +3491,9 @@ var IntegrationForm = ({
|
|
|
3057
3491
|
setErrorMessage("No integrations could be added. Please try again.");
|
|
3058
3492
|
}
|
|
3059
3493
|
} catch (error) {
|
|
3060
|
-
const err = error;
|
|
3061
3494
|
console.error(error);
|
|
3062
3495
|
setErrorMessage(
|
|
3063
|
-
|
|
3496
|
+
error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations"
|
|
3064
3497
|
);
|
|
3065
3498
|
} finally {
|
|
3066
3499
|
setIsLoading(false);
|
|
@@ -3068,24 +3501,24 @@ var IntegrationForm = ({
|
|
|
3068
3501
|
};
|
|
3069
3502
|
const hasNoFields = !metadata.password && !metadata.secret_key && !metadata.api_key && !metadata.address && !metadata.account_name;
|
|
3070
3503
|
const shouldShowFormFields = metadata.password || metadata.secret_key || metadata.api_key || metadata.address || metadata.account_name;
|
|
3071
|
-
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */
|
|
3504
|
+
const renderLogo = () => metadata.logo ? isSvgUrl(metadata.logo) ? /* @__PURE__ */ React34.createElement(RemoteSvg, { uri: metadata.logo }) : /* @__PURE__ */ React34.createElement(
|
|
3072
3505
|
Image3,
|
|
3073
3506
|
{
|
|
3074
3507
|
source: { uri: metadata.logo },
|
|
3075
|
-
style:
|
|
3508
|
+
style: styles16.logo,
|
|
3076
3509
|
resizeMode: "contain"
|
|
3077
3510
|
}
|
|
3078
|
-
) : /* @__PURE__ */
|
|
3079
|
-
|
|
3511
|
+
) : /* @__PURE__ */ React34.createElement(
|
|
3512
|
+
View16,
|
|
3080
3513
|
{
|
|
3081
3514
|
style: [
|
|
3082
|
-
|
|
3515
|
+
styles16.logoPlaceholder,
|
|
3083
3516
|
{ backgroundColor: theme.colors.surface }
|
|
3084
3517
|
]
|
|
3085
3518
|
},
|
|
3086
|
-
/* @__PURE__ */
|
|
3519
|
+
/* @__PURE__ */ React34.createElement(Text14, { style: { color: theme.colors.text } }, metadata.name?.charAt(0) || "?")
|
|
3087
3520
|
);
|
|
3088
|
-
const renderInput = (key, props) => /* @__PURE__ */
|
|
3521
|
+
const renderInput = (key, props) => /* @__PURE__ */ React34.createElement(
|
|
3089
3522
|
Input,
|
|
3090
3523
|
{
|
|
3091
3524
|
placeholder: props.placeholder,
|
|
@@ -3097,33 +3530,33 @@ var IntegrationForm = ({
|
|
|
3097
3530
|
secureTextEntry: props.secureTextEntry
|
|
3098
3531
|
}
|
|
3099
3532
|
);
|
|
3100
|
-
const renderErrorAlert = () => errorMessage ? /* @__PURE__ */
|
|
3101
|
-
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */
|
|
3533
|
+
const renderErrorAlert = () => errorMessage || errorMessageProp ? /* @__PURE__ */ React34.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React34.createElement(AlertDescription, null, errorMessage || errorMessageProp)) : null;
|
|
3534
|
+
const renderChainSelection = () => userUsedChains.length > 0 && formValues.address && /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainSelection }, /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.chainTitle, { color: theme.colors.text }] }, "Select Chains to Add:"), /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainListContent }, /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainChips }, userUsedChains.map((chain) => {
|
|
3102
3535
|
const isSelected = selectedChains.has(chain.id);
|
|
3103
3536
|
const hasError = chainErrors[chain.id];
|
|
3104
|
-
return /* @__PURE__ */
|
|
3105
|
-
|
|
3537
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3538
|
+
TouchableOpacity6,
|
|
3106
3539
|
{
|
|
3107
3540
|
onPress: () => toggleChainSelection(chain.id),
|
|
3108
|
-
style:
|
|
3541
|
+
style: styles16.chainButton,
|
|
3109
3542
|
key: chain.id
|
|
3110
3543
|
},
|
|
3111
|
-
/* @__PURE__ */
|
|
3112
|
-
|
|
3544
|
+
/* @__PURE__ */ React34.createElement(
|
|
3545
|
+
View16,
|
|
3113
3546
|
{
|
|
3114
3547
|
style: [
|
|
3115
|
-
|
|
3548
|
+
styles16.chainChip,
|
|
3116
3549
|
{
|
|
3117
3550
|
backgroundColor: hasError ? theme.colors.errorLight : isSelected ? theme.colors.primary + "20" : theme.colors.surface,
|
|
3118
3551
|
borderColor: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.border
|
|
3119
3552
|
}
|
|
3120
3553
|
]
|
|
3121
3554
|
},
|
|
3122
|
-
/* @__PURE__ */
|
|
3123
|
-
|
|
3555
|
+
/* @__PURE__ */ React34.createElement(
|
|
3556
|
+
Text14,
|
|
3124
3557
|
{
|
|
3125
3558
|
style: [
|
|
3126
|
-
|
|
3559
|
+
styles16.chainName,
|
|
3127
3560
|
{
|
|
3128
3561
|
color: hasError ? theme.colors.error : isSelected ? theme.colors.primary : theme.colors.text
|
|
3129
3562
|
}
|
|
@@ -3131,28 +3564,55 @@ var IntegrationForm = ({
|
|
|
3131
3564
|
},
|
|
3132
3565
|
chain.name
|
|
3133
3566
|
),
|
|
3134
|
-
isSelected ? /* @__PURE__ */
|
|
3567
|
+
isSelected ? /* @__PURE__ */ React34.createElement(
|
|
3135
3568
|
CloseIcon,
|
|
3136
3569
|
{
|
|
3137
3570
|
size: 12,
|
|
3138
3571
|
color: hasError ? theme.colors.error : theme.colors.primary
|
|
3139
3572
|
}
|
|
3140
|
-
) : /* @__PURE__ */
|
|
3573
|
+
) : /* @__PURE__ */ React34.createElement(PlusIcon, { size: 12, color: theme.colors.textSecondary })
|
|
3141
3574
|
)
|
|
3142
3575
|
);
|
|
3143
|
-
}))
|
|
3144
|
-
|
|
3576
|
+
})), selectedChains.size > 0 && userUsedChains.length > 0 && /* @__PURE__ */ React34.createElement(
|
|
3577
|
+
TouchableOpacity6,
|
|
3578
|
+
{
|
|
3579
|
+
onPress: () => setSelectedChains(/* @__PURE__ */ new Set()),
|
|
3580
|
+
style: styles16.chainButton,
|
|
3581
|
+
activeOpacity: 0.7
|
|
3582
|
+
},
|
|
3583
|
+
/* @__PURE__ */ React34.createElement(
|
|
3584
|
+
View16,
|
|
3585
|
+
{
|
|
3586
|
+
style: [
|
|
3587
|
+
styles16.chainChip,
|
|
3588
|
+
styles16.chainChipRemoveAll,
|
|
3589
|
+
{
|
|
3590
|
+
borderWidth: 0
|
|
3591
|
+
}
|
|
3592
|
+
]
|
|
3593
|
+
},
|
|
3594
|
+
/* @__PURE__ */ React34.createElement(
|
|
3595
|
+
Text14,
|
|
3596
|
+
{
|
|
3597
|
+
style: [styles16.chainName, { color: theme.colors.primary }]
|
|
3598
|
+
},
|
|
3599
|
+
"Remove All Chains"
|
|
3600
|
+
),
|
|
3601
|
+
/* @__PURE__ */ React34.createElement(CloseIcon, { size: 12, color: theme.colors.primary })
|
|
3602
|
+
)
|
|
3603
|
+
)), Object.keys(chainErrors).length > 0 && /* @__PURE__ */ React34.createElement(View16, { style: styles16.chainErrorsContainer }, /* @__PURE__ */ React34.createElement(
|
|
3604
|
+
Text14,
|
|
3145
3605
|
{
|
|
3146
|
-
style: [
|
|
3606
|
+
style: [styles16.chainErrorsTitle, { color: theme.colors.error }]
|
|
3147
3607
|
},
|
|
3148
3608
|
"Errors:"
|
|
3149
3609
|
), Object.entries(chainErrors).map(([chainId, error]) => {
|
|
3150
3610
|
const chain = userUsedChains.find((c) => c.id === chainId);
|
|
3151
|
-
return /* @__PURE__ */
|
|
3152
|
-
|
|
3611
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3612
|
+
Text14,
|
|
3153
3613
|
{
|
|
3154
3614
|
key: chainId,
|
|
3155
|
-
style: [
|
|
3615
|
+
style: [styles16.chainErrorItem, { color: theme.colors.error }]
|
|
3156
3616
|
},
|
|
3157
3617
|
"\u2022 ",
|
|
3158
3618
|
chain?.name,
|
|
@@ -3160,7 +3620,7 @@ var IntegrationForm = ({
|
|
|
3160
3620
|
error
|
|
3161
3621
|
);
|
|
3162
3622
|
})));
|
|
3163
|
-
const renderFormBlock = () => /* @__PURE__ */
|
|
3623
|
+
const renderFormBlock = () => /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(View16, { style: styles16.header }, renderLogo(), /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.name, { color: theme.colors.text }] }, metadata.name)), shouldShowFormFields && /* @__PURE__ */ React34.createElement(React34.Fragment, null, metadata.address && /* @__PURE__ */ React34.createElement(React34.Fragment, null, renderInput("address", {
|
|
3164
3624
|
placeholder: "Enter address",
|
|
3165
3625
|
autoCapitalize: "none",
|
|
3166
3626
|
autoCorrect: false
|
|
@@ -3176,16 +3636,23 @@ var IntegrationForm = ({
|
|
|
3176
3636
|
}), metadata.password && renderInput("password", {
|
|
3177
3637
|
placeholder: "Enter Password",
|
|
3178
3638
|
secureTextEntry: true
|
|
3179
|
-
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */
|
|
3639
|
+
})), hasNoFields && !metadata?.isWalletConnectSupported && /* @__PURE__ */ React34.createElement(Alert, { variant: "default", style: { marginTop: 12 } }, /* @__PURE__ */ React34.createElement(AlertDescription, null, "This integration is not supported here yet \u2014 try using it through our Kryptos Platform.")));
|
|
3180
3640
|
const addIntegrationLabel = formValues.address && userUsedChains.length > 0 && selectedChains.size > 0 ? `Add ${selectedChains.size} Chain${selectedChains.size !== 1 ? "s" : ""}` : "Add Integration";
|
|
3181
|
-
return /* @__PURE__ */
|
|
3182
|
-
|
|
3641
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, !metadata?.isWalletConnectSupported ? /* @__PURE__ */ React34.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React34.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React34.createElement(View16, { style: styles16.headerContent }, showBackButton && /* @__PURE__ */ React34.createElement(
|
|
3642
|
+
TouchableOpacity6,
|
|
3183
3643
|
{
|
|
3184
3644
|
onPress: () => setAddIntegrationMode(null),
|
|
3185
|
-
style:
|
|
3645
|
+
style: styles16.backButton
|
|
3186
3646
|
},
|
|
3187
|
-
/* @__PURE__ */
|
|
3188
|
-
), /* @__PURE__ */
|
|
3647
|
+
/* @__PURE__ */ React34.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3648
|
+
), /* @__PURE__ */ React34.createElement(Text14, { style: [styles16.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React34.createElement(ModalBody, { scrollable: true, style: styles16.contentContainer }, renderFormBlock(), renderErrorAlert(), !metadata?.isWalletConnectSupported && metadata?.walletLimitations && /* @__PURE__ */ React34.createElement(
|
|
3649
|
+
IntegrationInfo,
|
|
3650
|
+
{
|
|
3651
|
+
content: metadata.walletLimitations,
|
|
3652
|
+
type: "api",
|
|
3653
|
+
import_guide: metadata.import_guide
|
|
3654
|
+
}
|
|
3655
|
+
)), !hasNoFields && /* @__PURE__ */ React34.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React34.createElement(
|
|
3189
3656
|
Button,
|
|
3190
3657
|
{
|
|
3191
3658
|
variant: "outline",
|
|
@@ -3193,10 +3660,10 @@ var IntegrationForm = ({
|
|
|
3193
3660
|
onPress: handleSubmit,
|
|
3194
3661
|
loading: isLoading,
|
|
3195
3662
|
disabled: isLoading || isFetchingChains || !!formValues.address && userUsedChains.length > 0 && selectedChains.size === 0,
|
|
3196
|
-
style:
|
|
3663
|
+
style: styles16.button
|
|
3197
3664
|
},
|
|
3198
3665
|
addIntegrationLabel
|
|
3199
|
-
), /* @__PURE__ */
|
|
3666
|
+
), /* @__PURE__ */ React34.createElement(Footer, null))) : /* @__PURE__ */ React34.createElement(
|
|
3200
3667
|
WalletConnectComponent,
|
|
3201
3668
|
{
|
|
3202
3669
|
integration: metadata,
|
|
@@ -3205,14 +3672,14 @@ var IntegrationForm = ({
|
|
|
3205
3672
|
modalOpen: open,
|
|
3206
3673
|
setAddIntegrationMode,
|
|
3207
3674
|
handleClose,
|
|
3208
|
-
providersList
|
|
3675
|
+
providersList,
|
|
3676
|
+
errorMessage: errorMessageProp
|
|
3209
3677
|
}
|
|
3210
3678
|
));
|
|
3211
3679
|
};
|
|
3212
|
-
var
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
paddingBottom: 100
|
|
3680
|
+
var styles16 = StyleSheet16.create({
|
|
3681
|
+
chainListContent: {
|
|
3682
|
+
paddingBottom: 8
|
|
3216
3683
|
},
|
|
3217
3684
|
headerContent: {
|
|
3218
3685
|
flexDirection: "row",
|
|
@@ -3237,10 +3704,8 @@ var styles14 = StyleSheet14.create({
|
|
|
3237
3704
|
// theme.spacing.xl
|
|
3238
3705
|
paddingBottom: 40,
|
|
3239
3706
|
width: "100%",
|
|
3240
|
-
overflow: "hidden",
|
|
3241
3707
|
alignSelf: "center",
|
|
3242
|
-
flexDirection: "column"
|
|
3243
|
-
flex: 1
|
|
3708
|
+
flexDirection: "column"
|
|
3244
3709
|
},
|
|
3245
3710
|
header: {
|
|
3246
3711
|
flexDirection: "row",
|
|
@@ -3272,7 +3737,7 @@ var styles14 = StyleSheet14.create({
|
|
|
3272
3737
|
textTransform: "capitalize"
|
|
3273
3738
|
},
|
|
3274
3739
|
chainSelection: {
|
|
3275
|
-
marginBottom:
|
|
3740
|
+
marginBottom: 8
|
|
3276
3741
|
// theme.spacing.lg
|
|
3277
3742
|
},
|
|
3278
3743
|
chainTitle: {
|
|
@@ -3299,6 +3764,11 @@ var styles14 = StyleSheet14.create({
|
|
|
3299
3764
|
// theme.borderRadius.md
|
|
3300
3765
|
borderWidth: 1
|
|
3301
3766
|
},
|
|
3767
|
+
chainChipRemoveAll: {
|
|
3768
|
+
marginTop: 6,
|
|
3769
|
+
// theme.spacing.sm - separate from chain list
|
|
3770
|
+
width: "auto"
|
|
3771
|
+
},
|
|
3302
3772
|
chainName: {
|
|
3303
3773
|
fontSize: 12,
|
|
3304
3774
|
fontWeight: "500",
|
|
@@ -3334,18 +3804,23 @@ var styles14 = StyleSheet14.create({
|
|
|
3334
3804
|
var Integration = ({
|
|
3335
3805
|
open,
|
|
3336
3806
|
onSuccess,
|
|
3337
|
-
onClose
|
|
3807
|
+
onClose,
|
|
3808
|
+
integrationDetails
|
|
3338
3809
|
}) => {
|
|
3339
3810
|
const { appName, linkToken } = useKryptosConnect();
|
|
3340
3811
|
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
|
-
|
|
3812
|
+
const [addIntegrationMode, setAddIntegrationMode] = React35.useState(integrationDetails || null);
|
|
3813
|
+
const [query, setQuery] = React35.useState("");
|
|
3814
|
+
const [activeTab, setActiveTab] = React35.useState("all");
|
|
3815
|
+
const [supportedProviders, setSupportedProviders] = React35.useState([]);
|
|
3816
|
+
const [existingIntegrations, setExistingIntegrations] = React35.useState([]);
|
|
3817
|
+
const [isLoading, setIsLoading] = React35.useState(false);
|
|
3818
|
+
const [errorMessage, setErrorMessage] = React35.useState("");
|
|
3819
|
+
React35.useEffect(() => {
|
|
3820
|
+
if (integrationDetails) {
|
|
3821
|
+
setAddIntegrationMode(integrationDetails);
|
|
3822
|
+
}
|
|
3823
|
+
}, [integrationDetails]);
|
|
3349
3824
|
const handleClose = () => {
|
|
3350
3825
|
onClose();
|
|
3351
3826
|
};
|
|
@@ -3356,7 +3831,7 @@ var Integration = ({
|
|
|
3356
3831
|
} catch (error) {
|
|
3357
3832
|
const err = error;
|
|
3358
3833
|
setErrorMessage(
|
|
3359
|
-
err?.response?.data?.message || "Failed to fetch existing integrations"
|
|
3834
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch existing integrations"
|
|
3360
3835
|
);
|
|
3361
3836
|
console.error(error);
|
|
3362
3837
|
}
|
|
@@ -3369,38 +3844,38 @@ var Integration = ({
|
|
|
3369
3844
|
} catch (error) {
|
|
3370
3845
|
const err = error;
|
|
3371
3846
|
setErrorMessage(
|
|
3372
|
-
err?.response?.data?.message || "Failed to fetch supported providers"
|
|
3847
|
+
err?.response?.data?.message || err?.response?.data?.error || "Failed to fetch supported providers"
|
|
3373
3848
|
);
|
|
3374
3849
|
console.error(error);
|
|
3375
3850
|
} finally {
|
|
3376
3851
|
setIsLoading(false);
|
|
3377
3852
|
}
|
|
3378
3853
|
};
|
|
3379
|
-
|
|
3854
|
+
React35.useEffect(() => {
|
|
3380
3855
|
if (linkToken) {
|
|
3381
3856
|
fetchSupportedProviders();
|
|
3382
3857
|
fetchExistingIntegrations();
|
|
3383
3858
|
}
|
|
3384
3859
|
}, [linkToken]);
|
|
3385
|
-
const isIntegrationAdded =
|
|
3860
|
+
const isIntegrationAdded = useCallback(
|
|
3386
3861
|
(publicName) => {
|
|
3387
|
-
const integrations = [...
|
|
3862
|
+
const integrations = [...existingIntegrations];
|
|
3388
3863
|
return integrations.some(
|
|
3389
3864
|
(integration) => integration.public_name === publicName
|
|
3390
3865
|
);
|
|
3391
3866
|
},
|
|
3392
|
-
[
|
|
3867
|
+
[existingIntegrations]
|
|
3393
3868
|
);
|
|
3394
|
-
const getIntegrationCount =
|
|
3869
|
+
const getIntegrationCount = useCallback(
|
|
3395
3870
|
(publicName) => {
|
|
3396
|
-
const integrations = [...
|
|
3871
|
+
const integrations = [...existingIntegrations];
|
|
3397
3872
|
return integrations.filter(
|
|
3398
3873
|
(integration) => integration.public_name === publicName
|
|
3399
3874
|
).length;
|
|
3400
3875
|
},
|
|
3401
|
-
[
|
|
3876
|
+
[existingIntegrations]
|
|
3402
3877
|
);
|
|
3403
|
-
const filteredResults =
|
|
3878
|
+
const filteredResults = React35.useMemo(() => {
|
|
3404
3879
|
let filtered = supportedProviders;
|
|
3405
3880
|
if (activeTab !== "all") {
|
|
3406
3881
|
filtered = filtered.filter((provider) => provider.type === activeTab);
|
|
@@ -3418,33 +3893,41 @@ var Integration = ({
|
|
|
3418
3893
|
return (a.name ?? "").localeCompare(b.name ?? "");
|
|
3419
3894
|
});
|
|
3420
3895
|
}, [query, supportedProviders, getIntegrationCount, activeTab]);
|
|
3421
|
-
const handleAddIntegration = async () => {
|
|
3896
|
+
const handleAddIntegration = async (integrationsList) => {
|
|
3422
3897
|
try {
|
|
3423
3898
|
setIsLoading(true);
|
|
3424
|
-
const integrations = [...
|
|
3899
|
+
const integrations = integrationsList ? integrationsList : [...existingIntegrations];
|
|
3425
3900
|
if (integrations.length === 0) {
|
|
3426
3901
|
setErrorMessage("Please add at least one integration");
|
|
3427
|
-
} else if (addedIntegrations.length === 0) {
|
|
3428
|
-
onSuccess();
|
|
3429
3902
|
} else {
|
|
3430
|
-
await addUserIntegration(linkToken,
|
|
3431
|
-
|
|
3903
|
+
await addUserIntegration(linkToken, integrations);
|
|
3904
|
+
if (integrationDetails) {
|
|
3905
|
+
onSuccess();
|
|
3906
|
+
}
|
|
3432
3907
|
}
|
|
3908
|
+
await fetchExistingIntegrations();
|
|
3909
|
+
setAddIntegrationMode(null);
|
|
3433
3910
|
} catch (error) {
|
|
3434
|
-
const
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
err?.response?.data?.message || "Failed to add integrations"
|
|
3438
|
-
);
|
|
3911
|
+
const message = error?.response?.data?.message || error?.response?.data?.error || "Failed to add integrations";
|
|
3912
|
+
setErrorMessage(message);
|
|
3913
|
+
throw error;
|
|
3439
3914
|
} finally {
|
|
3440
3915
|
setIsLoading(false);
|
|
3441
3916
|
}
|
|
3442
3917
|
};
|
|
3443
|
-
const
|
|
3444
|
-
|
|
3918
|
+
const handleContinue = () => {
|
|
3919
|
+
const integrations = [...existingIntegrations];
|
|
3920
|
+
if (integrations.length === 0) {
|
|
3921
|
+
setErrorMessage("Please add at least one integration");
|
|
3922
|
+
return;
|
|
3923
|
+
}
|
|
3924
|
+
onSuccess();
|
|
3925
|
+
};
|
|
3926
|
+
const renderProviderItem = ({ item }) => /* @__PURE__ */ React35.createElement(
|
|
3927
|
+
TouchableOpacity7,
|
|
3445
3928
|
{
|
|
3446
3929
|
style: [
|
|
3447
|
-
|
|
3930
|
+
styles17.providerItem,
|
|
3448
3931
|
{
|
|
3449
3932
|
backgroundColor: theme.colors.surface,
|
|
3450
3933
|
borderColor: theme.colors.border
|
|
@@ -3453,44 +3936,44 @@ var Integration = ({
|
|
|
3453
3936
|
onPress: () => setAddIntegrationMode(item),
|
|
3454
3937
|
activeOpacity: 0.7
|
|
3455
3938
|
},
|
|
3456
|
-
/* @__PURE__ */
|
|
3939
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.providerInfo }, item?.logo ? isSvgUrl(item?.logo) ? /* @__PURE__ */ React35.createElement(RemoteSvg, { uri: item?.logo }) : /* @__PURE__ */ React35.createElement(
|
|
3457
3940
|
Image4,
|
|
3458
3941
|
{
|
|
3459
3942
|
source: { uri: item?.logo },
|
|
3460
|
-
style:
|
|
3943
|
+
style: styles17.providerLogo,
|
|
3461
3944
|
resizeMode: "contain"
|
|
3462
3945
|
}
|
|
3463
|
-
) : /* @__PURE__ */
|
|
3464
|
-
|
|
3946
|
+
) : /* @__PURE__ */ React35.createElement(
|
|
3947
|
+
View17,
|
|
3465
3948
|
{
|
|
3466
3949
|
style: [
|
|
3467
|
-
|
|
3950
|
+
styles17.providerLogoPlaceholder,
|
|
3468
3951
|
{ backgroundColor: theme.colors.surfaceSecondary }
|
|
3469
3952
|
]
|
|
3470
3953
|
},
|
|
3471
|
-
/* @__PURE__ */
|
|
3472
|
-
), /* @__PURE__ */
|
|
3473
|
-
isIntegrationAdded(item?.public_name) && /* @__PURE__ */
|
|
3474
|
-
|
|
3954
|
+
/* @__PURE__ */ React35.createElement(Text15, { style: { color: theme.colors.text } }, item?.name?.charAt(0) || "?")
|
|
3955
|
+
), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.providerName, { color: theme.colors.text }] }, item?.name + "\u200B")),
|
|
3956
|
+
isIntegrationAdded(item?.public_name) && /* @__PURE__ */ React35.createElement(View17, { style: styles17.providerStatus }, /* @__PURE__ */ React35.createElement(CheckCircleIcon, { size: 18, color: theme.colors.success }), /* @__PURE__ */ React35.createElement(
|
|
3957
|
+
Text15,
|
|
3475
3958
|
{
|
|
3476
3959
|
style: [
|
|
3477
|
-
|
|
3960
|
+
styles17.providerCount,
|
|
3478
3961
|
{ color: theme.colors.textSecondary }
|
|
3479
3962
|
]
|
|
3480
3963
|
},
|
|
3481
3964
|
getIntegrationCount(item?.public_name)
|
|
3482
3965
|
))
|
|
3483
3966
|
);
|
|
3484
|
-
const renderSkeletonItem = () => /* @__PURE__ */
|
|
3485
|
-
return /* @__PURE__ */
|
|
3486
|
-
|
|
3967
|
+
const renderSkeletonItem = () => /* @__PURE__ */ React35.createElement(SkeletonItem_default, null);
|
|
3968
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, !addIntegrationMode ? /* @__PURE__ */ React35.createElement(Modal, { isOpen: open, onClose: handleClose, size: "full" }, /* @__PURE__ */ React35.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.headerContent }, addIntegrationMode && /* @__PURE__ */ React35.createElement(
|
|
3969
|
+
TouchableOpacity7,
|
|
3487
3970
|
{
|
|
3488
3971
|
onPress: () => setAddIntegrationMode(null),
|
|
3489
|
-
style:
|
|
3972
|
+
style: styles17.backButton
|
|
3490
3973
|
},
|
|
3491
|
-
/* @__PURE__ */
|
|
3492
|
-
), /* @__PURE__ */
|
|
3493
|
-
|
|
3974
|
+
/* @__PURE__ */ React35.createElement(ArrowLeftIcon, { size: 20, color: theme.colors.text })
|
|
3975
|
+
), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.headerTitle, { color: theme.colors.text }] }, "Integration"))), /* @__PURE__ */ React35.createElement(ModalBody, { scrollable: false, style: styles17.noPadding }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.container }, /* @__PURE__ */ React35.createElement(View17, { style: styles17.headerSection }, /* @__PURE__ */ React35.createElement(ConnectLogo, null), /* @__PURE__ */ React35.createElement(Text15, { style: [styles17.title, { color: theme.colors.text }] }, "Select an account to link to ", appName)), /* @__PURE__ */ React35.createElement(
|
|
3976
|
+
View17,
|
|
3494
3977
|
{
|
|
3495
3978
|
style: {
|
|
3496
3979
|
paddingHorizontal: theme.spacing.xl,
|
|
@@ -3499,26 +3982,26 @@ var Integration = ({
|
|
|
3499
3982
|
zIndex: 10
|
|
3500
3983
|
}
|
|
3501
3984
|
},
|
|
3502
|
-
/* @__PURE__ */
|
|
3985
|
+
/* @__PURE__ */ React35.createElement(
|
|
3503
3986
|
Input,
|
|
3504
3987
|
{
|
|
3505
3988
|
value: query,
|
|
3506
3989
|
onChangeText: setQuery,
|
|
3507
3990
|
placeholder: "Search Integrations...",
|
|
3508
|
-
containerStyle:
|
|
3991
|
+
containerStyle: styles17.searchInput
|
|
3509
3992
|
}
|
|
3510
3993
|
),
|
|
3511
|
-
/* @__PURE__ */
|
|
3994
|
+
/* @__PURE__ */ React35.createElement(View17, { style: styles17.tabsContainer }, [
|
|
3512
3995
|
{ label: "All", value: "all" },
|
|
3513
3996
|
{ label: "Exchanges", value: "exchange" },
|
|
3514
3997
|
{ label: "Blockchains", value: "blockchain" },
|
|
3515
3998
|
{ label: "Wallets", value: "wallet" }
|
|
3516
|
-
].map((tab) => /* @__PURE__ */
|
|
3517
|
-
|
|
3999
|
+
].map((tab) => /* @__PURE__ */ React35.createElement(
|
|
4000
|
+
TouchableOpacity7,
|
|
3518
4001
|
{
|
|
3519
4002
|
key: tab.value,
|
|
3520
4003
|
style: [
|
|
3521
|
-
|
|
4004
|
+
styles17.tab,
|
|
3522
4005
|
{
|
|
3523
4006
|
backgroundColor: activeTab === tab.value ? theme.colors.primary : theme.colors.surface,
|
|
3524
4007
|
borderColor: theme.colors.border
|
|
@@ -3530,11 +4013,11 @@ var Integration = ({
|
|
|
3530
4013
|
);
|
|
3531
4014
|
}
|
|
3532
4015
|
},
|
|
3533
|
-
/* @__PURE__ */
|
|
3534
|
-
|
|
4016
|
+
/* @__PURE__ */ React35.createElement(
|
|
4017
|
+
Text15,
|
|
3535
4018
|
{
|
|
3536
4019
|
style: [
|
|
3537
|
-
|
|
4020
|
+
styles17.tabText,
|
|
3538
4021
|
{
|
|
3539
4022
|
color: activeTab === tab.value ? theme.colors.white : theme.colors.text
|
|
3540
4023
|
}
|
|
@@ -3543,7 +4026,7 @@ var Integration = ({
|
|
|
3543
4026
|
tab.label
|
|
3544
4027
|
)
|
|
3545
4028
|
)))
|
|
3546
|
-
), /* @__PURE__ */
|
|
4029
|
+
), /* @__PURE__ */ React35.createElement(
|
|
3547
4030
|
FlatList,
|
|
3548
4031
|
{
|
|
3549
4032
|
data: isLoading ? Array.from({ length: 8 }, (_, i) => ({
|
|
@@ -3554,50 +4037,53 @@ var Integration = ({
|
|
|
3554
4037
|
})) : filteredResults,
|
|
3555
4038
|
keyExtractor: (item, index) => isLoading ? item.id : `provider-${item.id}-${index}`,
|
|
3556
4039
|
renderItem: isLoading ? renderSkeletonItem : renderProviderItem,
|
|
3557
|
-
style:
|
|
4040
|
+
style: styles17.list,
|
|
3558
4041
|
contentContainerStyle: [
|
|
3559
|
-
|
|
4042
|
+
styles17.listContent,
|
|
3560
4043
|
{ paddingHorizontal: theme.spacing.xl }
|
|
3561
4044
|
],
|
|
3562
4045
|
showsVerticalScrollIndicator: false,
|
|
3563
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
3564
|
-
|
|
4046
|
+
ListEmptyComponent: /* @__PURE__ */ React35.createElement(View17, { style: styles17.emptyContainer }, !isLoading && /* @__PURE__ */ React35.createElement(
|
|
4047
|
+
Text15,
|
|
3565
4048
|
{
|
|
3566
4049
|
style: [
|
|
3567
|
-
|
|
4050
|
+
styles17.emptyText,
|
|
3568
4051
|
{ color: theme.colors.textSecondary }
|
|
3569
4052
|
]
|
|
3570
4053
|
},
|
|
3571
4054
|
query ? "No search results found" : "No supported integrations found"
|
|
3572
|
-
))
|
|
4055
|
+
)),
|
|
4056
|
+
ListFooterComponent: errorMessage ? /* @__PURE__ */ React35.createElement(View17, { style: styles17.errorContainer }, /* @__PURE__ */ React35.createElement(Alert, { variant: "destructive", style: styles17.errorAlert }, /* @__PURE__ */ React35.createElement(AlertDescription, null, errorMessage))) : null
|
|
3573
4057
|
}
|
|
3574
|
-
),
|
|
4058
|
+
))), /* @__PURE__ */ React35.createElement(ModalFooter, { style: { paddingVertical: 8 } }, filteredResults && filteredResults.length > 0 && /* @__PURE__ */ React35.createElement(
|
|
3575
4059
|
Button,
|
|
3576
4060
|
{
|
|
3577
4061
|
variant: "outline",
|
|
3578
4062
|
size: "lg",
|
|
3579
|
-
onPress:
|
|
4063
|
+
onPress: handleContinue,
|
|
3580
4064
|
loading: isLoading,
|
|
3581
4065
|
disabled: isLoading,
|
|
3582
|
-
style:
|
|
4066
|
+
style: styles17.continueButton
|
|
3583
4067
|
},
|
|
3584
4068
|
"Continue"
|
|
3585
|
-
), /* @__PURE__ */
|
|
4069
|
+
), /* @__PURE__ */ React35.createElement(Footer, null))) : /* @__PURE__ */ React35.createElement(
|
|
3586
4070
|
IntegrationForm,
|
|
3587
4071
|
{
|
|
3588
4072
|
metadata: addIntegrationMode,
|
|
3589
|
-
onAddHandle: (
|
|
3590
|
-
|
|
3591
|
-
|
|
4073
|
+
onAddHandle: async (int) => {
|
|
4074
|
+
const integrationsList = [...int];
|
|
4075
|
+
await handleAddIntegration(integrationsList);
|
|
3592
4076
|
},
|
|
3593
4077
|
open: !!addIntegrationMode,
|
|
3594
4078
|
setAddIntegrationMode,
|
|
3595
4079
|
handleClose,
|
|
3596
|
-
providersList: supportedProviders
|
|
4080
|
+
providersList: supportedProviders,
|
|
4081
|
+
errorMessage,
|
|
4082
|
+
showBackButton: !integrationDetails
|
|
3597
4083
|
}
|
|
3598
4084
|
));
|
|
3599
4085
|
};
|
|
3600
|
-
var
|
|
4086
|
+
var styles17 = StyleSheet17.create({
|
|
3601
4087
|
headerContent: {
|
|
3602
4088
|
flexDirection: "row",
|
|
3603
4089
|
alignItems: "center"
|
|
@@ -3708,12 +4194,12 @@ var styles15 = StyleSheet15.create({
|
|
|
3708
4194
|
width: "100%"
|
|
3709
4195
|
},
|
|
3710
4196
|
errorContainer: {
|
|
3711
|
-
paddingHorizontal: 20
|
|
4197
|
+
paddingHorizontal: 20,
|
|
3712
4198
|
// theme.spacing.xl
|
|
4199
|
+
marginBottom: 12
|
|
3713
4200
|
},
|
|
3714
4201
|
errorAlert: {
|
|
3715
|
-
marginTop:
|
|
3716
|
-
// theme.spacing.lg - consistent alert spacing
|
|
4202
|
+
marginTop: 8
|
|
3717
4203
|
},
|
|
3718
4204
|
tabsContainer: {
|
|
3719
4205
|
flexDirection: "row",
|
|
@@ -3740,21 +4226,21 @@ var styles15 = StyleSheet15.create({
|
|
|
3740
4226
|
});
|
|
3741
4227
|
|
|
3742
4228
|
// src/molecules/OTPVerify.tsx
|
|
3743
|
-
import
|
|
3744
|
-
import { StyleSheet as
|
|
4229
|
+
import React36 from "react";
|
|
4230
|
+
import { StyleSheet as StyleSheet18, Text as Text16, TouchableOpacity as TouchableOpacity8, View as View18 } from "react-native";
|
|
3745
4231
|
var OTPVerify = ({
|
|
3746
4232
|
open,
|
|
3747
4233
|
onSuccess,
|
|
3748
4234
|
onClose
|
|
3749
4235
|
}) => {
|
|
3750
4236
|
const theme = useTheme();
|
|
3751
|
-
const [otp, setOtp] =
|
|
4237
|
+
const [otp, setOtp] = React36.useState("");
|
|
3752
4238
|
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] =
|
|
4239
|
+
const [isLoading, setIsLoading] = React36.useState(false);
|
|
4240
|
+
const [isResending, setIsResending] = React36.useState(false);
|
|
4241
|
+
const [resendCooldown, setResendCooldown] = React36.useState(0);
|
|
4242
|
+
const [errorMessage, setErrorMessage] = React36.useState("");
|
|
4243
|
+
const [successMessage, setSuccessMessage] = React36.useState("");
|
|
3758
4244
|
const handleSubmit = async () => {
|
|
3759
4245
|
if (otp.length !== 6) return;
|
|
3760
4246
|
setIsLoading(true);
|
|
@@ -3805,7 +4291,7 @@ var OTPVerify = ({
|
|
|
3805
4291
|
setSuccessMessage("");
|
|
3806
4292
|
setOtp("");
|
|
3807
4293
|
};
|
|
3808
|
-
|
|
4294
|
+
React36.useEffect(() => {
|
|
3809
4295
|
if (resendCooldown > 0) {
|
|
3810
4296
|
const timer = setTimeout(() => {
|
|
3811
4297
|
setResendCooldown(resendCooldown - 1);
|
|
@@ -3814,20 +4300,20 @@ var OTPVerify = ({
|
|
|
3814
4300
|
}
|
|
3815
4301
|
return void 0;
|
|
3816
4302
|
}, [resendCooldown]);
|
|
3817
|
-
return /* @__PURE__ */
|
|
3818
|
-
|
|
4303
|
+
return /* @__PURE__ */ React36.createElement(Modal, { isOpen: open, onClose: handleClose, size: "lg" }, /* @__PURE__ */ React36.createElement(ModalHeader, { onClose: handleClose }, /* @__PURE__ */ React36.createElement(View18, { style: styles18.headerContent }, /* @__PURE__ */ React36.createElement(Text16, { style: [styles18.headerTitle, { color: theme.colors.text }] }, "OTP Verification"))), /* @__PURE__ */ React36.createElement(ModalBody, null, /* @__PURE__ */ React36.createElement(View18, { style: styles18.container }, /* @__PURE__ */ React36.createElement(ConnectLogo, null), /* @__PURE__ */ React36.createElement(View18, { style: styles18.emailInfo }, /* @__PURE__ */ React36.createElement(
|
|
4304
|
+
Text16,
|
|
3819
4305
|
{
|
|
3820
|
-
style: [
|
|
4306
|
+
style: [styles18.infoText, { color: theme.colors.textSecondary }]
|
|
3821
4307
|
},
|
|
3822
4308
|
"We have sent a verification code to"
|
|
3823
|
-
), /* @__PURE__ */
|
|
4309
|
+
), /* @__PURE__ */ React36.createElement(Text16, { style: [styles18.emailText, { color: theme.colors.text }] }, email)), /* @__PURE__ */ React36.createElement(
|
|
3824
4310
|
OTP,
|
|
3825
4311
|
{
|
|
3826
4312
|
onComplete: handleOtpComplete,
|
|
3827
4313
|
length: 6,
|
|
3828
4314
|
setErrorMessage
|
|
3829
4315
|
}
|
|
3830
|
-
), errorMessage ? /* @__PURE__ */
|
|
4316
|
+
), errorMessage ? /* @__PURE__ */ React36.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React36.createElement(AlertDescription, null, errorMessage)) : null, successMessage ? /* @__PURE__ */ React36.createElement(Alert, { variant: "default" }, /* @__PURE__ */ React36.createElement(AlertDescription, null, successMessage)) : null, /* @__PURE__ */ React36.createElement(
|
|
3831
4317
|
Button,
|
|
3832
4318
|
{
|
|
3833
4319
|
variant: "outline",
|
|
@@ -3835,44 +4321,44 @@ var OTPVerify = ({
|
|
|
3835
4321
|
onPress: handleSubmit,
|
|
3836
4322
|
loading: isLoading,
|
|
3837
4323
|
disabled: otp.length !== 6 || isLoading,
|
|
3838
|
-
style:
|
|
4324
|
+
style: styles18.button
|
|
3839
4325
|
},
|
|
3840
4326
|
"Continue"
|
|
3841
|
-
), /* @__PURE__ */
|
|
3842
|
-
|
|
4327
|
+
), /* @__PURE__ */ React36.createElement(
|
|
4328
|
+
TouchableOpacity8,
|
|
3843
4329
|
{
|
|
3844
4330
|
onPress: handleResendOtp,
|
|
3845
4331
|
disabled: resendCooldown > 0 || isResending,
|
|
3846
|
-
style:
|
|
4332
|
+
style: styles18.resendContainer
|
|
3847
4333
|
},
|
|
3848
|
-
isResending ? /* @__PURE__ */
|
|
3849
|
-
|
|
4334
|
+
isResending ? /* @__PURE__ */ React36.createElement(View18, { style: styles18.resendLoading }, /* @__PURE__ */ React36.createElement(LoaderIcon, { size: 16, color: theme.colors.primary }), /* @__PURE__ */ React36.createElement(
|
|
4335
|
+
Text16,
|
|
3850
4336
|
{
|
|
3851
|
-
style: [
|
|
4337
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3852
4338
|
},
|
|
3853
4339
|
" ",
|
|
3854
4340
|
"Sending..."
|
|
3855
|
-
)) : resendCooldown > 0 ? /* @__PURE__ */
|
|
3856
|
-
|
|
4341
|
+
)) : resendCooldown > 0 ? /* @__PURE__ */ React36.createElement(
|
|
4342
|
+
Text16,
|
|
3857
4343
|
{
|
|
3858
4344
|
style: [
|
|
3859
|
-
|
|
4345
|
+
styles18.resendText,
|
|
3860
4346
|
{ color: theme.colors.textSecondary }
|
|
3861
4347
|
]
|
|
3862
4348
|
},
|
|
3863
4349
|
"Resend OTP in ",
|
|
3864
4350
|
resendCooldown,
|
|
3865
4351
|
"s"
|
|
3866
|
-
) : /* @__PURE__ */
|
|
3867
|
-
|
|
4352
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
4353
|
+
Text16,
|
|
3868
4354
|
{
|
|
3869
|
-
style: [
|
|
4355
|
+
style: [styles18.resendText, { color: theme.colors.primary }]
|
|
3870
4356
|
},
|
|
3871
4357
|
"Resend OTP"
|
|
3872
4358
|
)
|
|
3873
|
-
))), /* @__PURE__ */
|
|
4359
|
+
))), /* @__PURE__ */ React36.createElement(ModalFooter, { style: { paddingVertical: 0 } }, /* @__PURE__ */ React36.createElement(Footer, null)));
|
|
3874
4360
|
};
|
|
3875
|
-
var
|
|
4361
|
+
var styles18 = StyleSheet18.create({
|
|
3876
4362
|
headerContent: {
|
|
3877
4363
|
flexDirection: "row",
|
|
3878
4364
|
alignItems: "center"
|
|
@@ -3931,8 +4417,8 @@ var styles16 = StyleSheet16.create({
|
|
|
3931
4417
|
});
|
|
3932
4418
|
|
|
3933
4419
|
// src/molecules/Permissions.tsx
|
|
3934
|
-
import
|
|
3935
|
-
import { StyleSheet as
|
|
4420
|
+
import React37 from "react";
|
|
4421
|
+
import { StyleSheet as StyleSheet19, Text as Text17, View as View19 } from "react-native";
|
|
3936
4422
|
var Permissions = ({
|
|
3937
4423
|
open,
|
|
3938
4424
|
onClose,
|
|
@@ -3940,8 +4426,8 @@ var Permissions = ({
|
|
|
3940
4426
|
}) => {
|
|
3941
4427
|
const { appName, linkToken, setUserConsent } = useKryptosConnect();
|
|
3942
4428
|
const theme = useTheme();
|
|
3943
|
-
const [isLoading, setIsLoading] =
|
|
3944
|
-
const [errorMessage, setErrorMessage] =
|
|
4429
|
+
const [isLoading, setIsLoading] = React37.useState(false);
|
|
4430
|
+
const [errorMessage, setErrorMessage] = React37.useState("");
|
|
3945
4431
|
const handleConsentClick = async () => {
|
|
3946
4432
|
try {
|
|
3947
4433
|
setIsLoading(true);
|
|
@@ -3964,42 +4450,42 @@ var Permissions = ({
|
|
|
3964
4450
|
"Access your transaction history and trading activity",
|
|
3965
4451
|
"Keep this data updated and accessible when you're offline"
|
|
3966
4452
|
];
|
|
3967
|
-
return /* @__PURE__ */
|
|
3968
|
-
|
|
4453
|
+
return /* @__PURE__ */ React37.createElement(Modal, { isOpen: open, onClose, size: "xl" }, /* @__PURE__ */ React37.createElement(ModalHeader, { onClose }, "Permissions"), /* @__PURE__ */ React37.createElement(ModalBody, null, /* @__PURE__ */ React37.createElement(View19, { style: styles19.container }, /* @__PURE__ */ React37.createElement(ConnectLogo, null), errorMessage ? /* @__PURE__ */ React37.createElement(Alert, { variant: "destructive" }, /* @__PURE__ */ React37.createElement(AlertDescription, null, errorMessage)) : null, /* @__PURE__ */ React37.createElement(View19, { style: styles19.permissionsList }, /* @__PURE__ */ React37.createElement(
|
|
4454
|
+
Text17,
|
|
3969
4455
|
{
|
|
3970
|
-
style: [
|
|
4456
|
+
style: [styles19.subtitle, { color: theme.colors.textSecondary }]
|
|
3971
4457
|
},
|
|
3972
4458
|
"Allow ",
|
|
3973
4459
|
appName,
|
|
3974
4460
|
" to:"
|
|
3975
|
-
), permissionItems.map((item, index) => /* @__PURE__ */
|
|
3976
|
-
|
|
4461
|
+
), permissionItems.map((item, index) => /* @__PURE__ */ React37.createElement(View19, { key: `permission-${index}`, style: styles19.permissionItem }, /* @__PURE__ */ React37.createElement(Text17, { style: [styles19.bullet, { color: theme.colors.primary }] }, index + 1, "."), /* @__PURE__ */ React37.createElement(
|
|
4462
|
+
Text17,
|
|
3977
4463
|
{
|
|
3978
|
-
style: [
|
|
4464
|
+
style: [styles19.permissionText, { color: theme.colors.text }]
|
|
3979
4465
|
},
|
|
3980
4466
|
item
|
|
3981
|
-
)))), /* @__PURE__ */
|
|
3982
|
-
|
|
4467
|
+
)))), /* @__PURE__ */ React37.createElement(
|
|
4468
|
+
View19,
|
|
3983
4469
|
{
|
|
3984
4470
|
style: [
|
|
3985
|
-
|
|
4471
|
+
styles19.infoBox,
|
|
3986
4472
|
{
|
|
3987
4473
|
backgroundColor: theme.colors.surface,
|
|
3988
4474
|
borderColor: theme.colors.border
|
|
3989
4475
|
}
|
|
3990
4476
|
]
|
|
3991
4477
|
},
|
|
3992
|
-
/* @__PURE__ */
|
|
3993
|
-
|
|
4478
|
+
/* @__PURE__ */ React37.createElement(
|
|
4479
|
+
Text17,
|
|
3994
4480
|
{
|
|
3995
|
-
style: [
|
|
4481
|
+
style: [styles19.infoText, { color: theme.colors.textSecondary }]
|
|
3996
4482
|
},
|
|
3997
4483
|
"By selecting",
|
|
3998
4484
|
" ",
|
|
3999
|
-
/* @__PURE__ */
|
|
4485
|
+
/* @__PURE__ */ React37.createElement(Text17, { style: { fontWeight: "600", color: theme.colors.text } }, "'Allow'"),
|
|
4000
4486
|
", you agree to share this information and keep it updated."
|
|
4001
4487
|
)
|
|
4002
|
-
))), /* @__PURE__ */
|
|
4488
|
+
))), /* @__PURE__ */ React37.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React37.createElement(
|
|
4003
4489
|
Button,
|
|
4004
4490
|
{
|
|
4005
4491
|
variant: "outline",
|
|
@@ -4007,12 +4493,12 @@ var Permissions = ({
|
|
|
4007
4493
|
onPress: handleConsentClick,
|
|
4008
4494
|
loading: isLoading,
|
|
4009
4495
|
disabled: isLoading,
|
|
4010
|
-
style:
|
|
4496
|
+
style: styles19.button
|
|
4011
4497
|
},
|
|
4012
4498
|
"Allow"
|
|
4013
|
-
), /* @__PURE__ */
|
|
4499
|
+
), /* @__PURE__ */ React37.createElement(Footer, null)));
|
|
4014
4500
|
};
|
|
4015
|
-
var
|
|
4501
|
+
var styles19 = StyleSheet19.create({
|
|
4016
4502
|
container: {
|
|
4017
4503
|
flex: 1
|
|
4018
4504
|
},
|
|
@@ -4070,8 +4556,8 @@ var styles17 = StyleSheet17.create({
|
|
|
4070
4556
|
});
|
|
4071
4557
|
|
|
4072
4558
|
// src/molecules/StatusModal.tsx
|
|
4073
|
-
import
|
|
4074
|
-
import { StyleSheet as
|
|
4559
|
+
import React38 from "react";
|
|
4560
|
+
import { StyleSheet as StyleSheet20, Text as Text18, View as View20 } from "react-native";
|
|
4075
4561
|
var StatusModal = ({
|
|
4076
4562
|
open,
|
|
4077
4563
|
onClose,
|
|
@@ -4088,18 +4574,18 @@ var StatusModal = ({
|
|
|
4088
4574
|
}
|
|
4089
4575
|
onClose();
|
|
4090
4576
|
};
|
|
4091
|
-
return /* @__PURE__ */
|
|
4577
|
+
return /* @__PURE__ */ React38.createElement(Modal, { isOpen: open, onClose: handleClose, size: "xl" }, /* @__PURE__ */ React38.createElement(ModalHeader, { showCloseButton: false, onClose: handleClose }, ""), /* @__PURE__ */ React38.createElement(ModalBody, null, /* @__PURE__ */ React38.createElement(View20, { style: styles20.container }, /* @__PURE__ */ React38.createElement(View20, { style: styles20.iconContainer }, status === "success" ? /* @__PURE__ */ React38.createElement(SuccessIcon, { size: 80 }) : /* @__PURE__ */ React38.createElement(ErrorIcon, { size: 80 })), /* @__PURE__ */ React38.createElement(Text18, { style: [styles20.message, { color: theme.colors.text }] }, status === "success" ? "Connection successful" : "Connection failed"), /* @__PURE__ */ React38.createElement(Alert, null, /* @__PURE__ */ React38.createElement(AlertTitle, null, "Sync in Progress"), /* @__PURE__ */ React38.createElement(AlertDescription, null, "The syncing process might take a moment. Please wait, and your data will be updated soon.")))), /* @__PURE__ */ React38.createElement(ModalFooter, { style: { paddingVertical: 8 } }, /* @__PURE__ */ React38.createElement(
|
|
4092
4578
|
Button,
|
|
4093
4579
|
{
|
|
4094
4580
|
variant: "outline",
|
|
4095
4581
|
size: "lg",
|
|
4096
4582
|
onPress: status === "success" ? onSuccess : onError,
|
|
4097
|
-
style:
|
|
4583
|
+
style: styles20.button
|
|
4098
4584
|
},
|
|
4099
4585
|
status === "success" ? "Continue" : "Try again later"
|
|
4100
|
-
), /* @__PURE__ */
|
|
4586
|
+
), /* @__PURE__ */ React38.createElement(Footer, null)));
|
|
4101
4587
|
};
|
|
4102
|
-
var
|
|
4588
|
+
var styles20 = StyleSheet20.create({
|
|
4103
4589
|
container: {
|
|
4104
4590
|
flex: 1,
|
|
4105
4591
|
alignItems: "center",
|
|
@@ -4123,64 +4609,6 @@ var styles18 = StyleSheet18.create({
|
|
|
4123
4609
|
}
|
|
4124
4610
|
});
|
|
4125
4611
|
|
|
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
4612
|
// src/KryptosConnectButton.tsx
|
|
4185
4613
|
var KryptosConnectButton = ({
|
|
4186
4614
|
children,
|
|
@@ -4188,17 +4616,18 @@ var KryptosConnectButton = ({
|
|
|
4188
4616
|
onError,
|
|
4189
4617
|
generateLinkToken,
|
|
4190
4618
|
style,
|
|
4191
|
-
textStyle
|
|
4619
|
+
textStyle,
|
|
4620
|
+
integrationName
|
|
4192
4621
|
}) => {
|
|
4193
4622
|
const { theme: themeName } = useKryptosConnect();
|
|
4194
|
-
const [open, setOpen] =
|
|
4623
|
+
const [open, setOpen] = React39.useState(false);
|
|
4195
4624
|
const theme = useTheme();
|
|
4196
|
-
return /* @__PURE__ */
|
|
4197
|
-
|
|
4625
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, children ? /* @__PURE__ */ React39.createElement(TouchableOpacity9, { onPress: () => setOpen(true), style }, children) : /* @__PURE__ */ React39.createElement(
|
|
4626
|
+
TouchableOpacity9,
|
|
4198
4627
|
{
|
|
4199
4628
|
onPress: () => setOpen(true),
|
|
4200
4629
|
style: [
|
|
4201
|
-
|
|
4630
|
+
styles21.defaultButton,
|
|
4202
4631
|
themeName === "light" ? {
|
|
4203
4632
|
backgroundColor: theme.colors.white,
|
|
4204
4633
|
borderRadius: theme.borderRadius.md,
|
|
@@ -4212,11 +4641,11 @@ var KryptosConnectButton = ({
|
|
|
4212
4641
|
],
|
|
4213
4642
|
activeOpacity: 0.8
|
|
4214
4643
|
},
|
|
4215
|
-
/* @__PURE__ */
|
|
4216
|
-
|
|
4644
|
+
/* @__PURE__ */ React39.createElement(
|
|
4645
|
+
Text19,
|
|
4217
4646
|
{
|
|
4218
4647
|
style: [
|
|
4219
|
-
|
|
4648
|
+
styles21.buttonText,
|
|
4220
4649
|
{
|
|
4221
4650
|
color: themeName === "light" ? theme.colors.primary : theme.colors.white,
|
|
4222
4651
|
fontSize: theme.fontSize.lg
|
|
@@ -4224,18 +4653,17 @@ var KryptosConnectButton = ({
|
|
|
4224
4653
|
textStyle
|
|
4225
4654
|
]
|
|
4226
4655
|
},
|
|
4227
|
-
"Connect
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
/* @__PURE__ */ React37.createElement(LogoIcon, { size: 24 })
|
|
4231
|
-
), /* @__PURE__ */ React37.createElement(
|
|
4656
|
+
integrationName ? `Connect ${integrationName.charAt(0).toUpperCase() + integrationName.slice(1)} Account` : "Connect With Kryptos"
|
|
4657
|
+
)
|
|
4658
|
+
), open && /* @__PURE__ */ React39.createElement(
|
|
4232
4659
|
KryptosConnectModal,
|
|
4233
4660
|
{
|
|
4234
4661
|
open,
|
|
4235
4662
|
setOpen,
|
|
4236
4663
|
onSuccess,
|
|
4237
4664
|
onError,
|
|
4238
|
-
generateLinkToken
|
|
4665
|
+
generateLinkToken,
|
|
4666
|
+
integrationName
|
|
4239
4667
|
}
|
|
4240
4668
|
));
|
|
4241
4669
|
};
|
|
@@ -4244,7 +4672,8 @@ var KryptosConnectModal = ({
|
|
|
4244
4672
|
setOpen,
|
|
4245
4673
|
onSuccess,
|
|
4246
4674
|
onError,
|
|
4247
|
-
generateLinkToken
|
|
4675
|
+
generateLinkToken,
|
|
4676
|
+
integrationName
|
|
4248
4677
|
}) => {
|
|
4249
4678
|
const {
|
|
4250
4679
|
setIsInitialized,
|
|
@@ -4256,7 +4685,20 @@ var KryptosConnectModal = ({
|
|
|
4256
4685
|
isAuthorized,
|
|
4257
4686
|
linkToken
|
|
4258
4687
|
} = useKryptosConnect();
|
|
4259
|
-
const [step, setStep] =
|
|
4688
|
+
const [step, setStep] = React39.useState("INIT" /* INIT */);
|
|
4689
|
+
const [integrationDetails, setIntegrationDetails] = useState4(null);
|
|
4690
|
+
useEffect5(() => {
|
|
4691
|
+
if (integrationName && linkToken) {
|
|
4692
|
+
const fetchIntegrationDetails = async () => {
|
|
4693
|
+
const integrationDetails2 = await getSupportedProviders(
|
|
4694
|
+
linkToken,
|
|
4695
|
+
integrationName
|
|
4696
|
+
);
|
|
4697
|
+
setIntegrationDetails(integrationDetails2?.providers?.[0]);
|
|
4698
|
+
};
|
|
4699
|
+
fetchIntegrationDetails();
|
|
4700
|
+
}
|
|
4701
|
+
}, [integrationName, linkToken]);
|
|
4260
4702
|
const handleClose = () => {
|
|
4261
4703
|
setOpen(false);
|
|
4262
4704
|
setIsInitialized(false);
|
|
@@ -4292,7 +4734,7 @@ var KryptosConnectModal = ({
|
|
|
4292
4734
|
handleClose();
|
|
4293
4735
|
};
|
|
4294
4736
|
if (!open) return null;
|
|
4295
|
-
return /* @__PURE__ */
|
|
4737
|
+
return /* @__PURE__ */ React39.createElement(View21, { style: styles21.container }, step === "INIT" /* INIT */ && /* @__PURE__ */ React39.createElement(
|
|
4296
4738
|
Init,
|
|
4297
4739
|
{
|
|
4298
4740
|
open,
|
|
@@ -4306,7 +4748,7 @@ var KryptosConnectModal = ({
|
|
|
4306
4748
|
},
|
|
4307
4749
|
onClose: handleAbort
|
|
4308
4750
|
}
|
|
4309
|
-
), step === "AUTH" /* AUTH */ && /* @__PURE__ */
|
|
4751
|
+
), step === "AUTH" /* AUTH */ && /* @__PURE__ */ React39.createElement(
|
|
4310
4752
|
Auth,
|
|
4311
4753
|
{
|
|
4312
4754
|
open,
|
|
@@ -4314,28 +4756,29 @@ var KryptosConnectModal = ({
|
|
|
4314
4756
|
onGuestSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4315
4757
|
onClose: handleAbort
|
|
4316
4758
|
}
|
|
4317
|
-
), step === "OTP" /* OTP */ && /* @__PURE__ */
|
|
4759
|
+
), step === "OTP" /* OTP */ && /* @__PURE__ */ React39.createElement(
|
|
4318
4760
|
OTPVerify,
|
|
4319
4761
|
{
|
|
4320
4762
|
open,
|
|
4321
4763
|
onSuccess: () => setStep("INTEGRATION" /* INTEGRATION */),
|
|
4322
4764
|
onClose: handleAbort
|
|
4323
4765
|
}
|
|
4324
|
-
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */
|
|
4766
|
+
), step === "INTEGRATION" /* INTEGRATION */ && /* @__PURE__ */ React39.createElement(
|
|
4325
4767
|
Integration,
|
|
4326
4768
|
{
|
|
4327
4769
|
open,
|
|
4328
4770
|
onSuccess: handleConsentClick,
|
|
4329
|
-
onClose: handleAbort
|
|
4771
|
+
onClose: handleAbort,
|
|
4772
|
+
integrationDetails
|
|
4330
4773
|
}
|
|
4331
|
-
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */
|
|
4774
|
+
), step === "PERMISSIONS" /* PERMISSIONS */ && /* @__PURE__ */ React39.createElement(
|
|
4332
4775
|
Permissions,
|
|
4333
4776
|
{
|
|
4334
4777
|
open,
|
|
4335
4778
|
onClose: handleAbort,
|
|
4336
4779
|
onSuccess: () => setStep("STATUS" /* STATUS */)
|
|
4337
4780
|
}
|
|
4338
|
-
), step === "STATUS" /* STATUS */ && /* @__PURE__ */
|
|
4781
|
+
), step === "STATUS" /* STATUS */ && /* @__PURE__ */ React39.createElement(
|
|
4339
4782
|
StatusModal,
|
|
4340
4783
|
{
|
|
4341
4784
|
open,
|
|
@@ -4344,7 +4787,7 @@ var KryptosConnectModal = ({
|
|
|
4344
4787
|
onError: handleError,
|
|
4345
4788
|
status: userConsent?.public_token ? "success" : "error"
|
|
4346
4789
|
}
|
|
4347
|
-
), step === "END" /* END */ && /* @__PURE__ */
|
|
4790
|
+
), step === "END" /* END */ && /* @__PURE__ */ React39.createElement(
|
|
4348
4791
|
EndModal,
|
|
4349
4792
|
{
|
|
4350
4793
|
open,
|
|
@@ -4356,7 +4799,7 @@ var KryptosConnectModal = ({
|
|
|
4356
4799
|
}
|
|
4357
4800
|
));
|
|
4358
4801
|
};
|
|
4359
|
-
var
|
|
4802
|
+
var styles21 = StyleSheet21.create({
|
|
4360
4803
|
defaultButton: {
|
|
4361
4804
|
flexDirection: "row",
|
|
4362
4805
|
alignItems: "center",
|