@funkit/connect-rn 2.0.0 → 3.0.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/CHANGELOG.md +72 -0
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1988 -860
- package/dist/index.js.map +4 -4
- package/dist/src/flow/AddressCopiedToast.d.ts +4 -3
- package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -1
- package/dist/src/flow/FunkitFlowProvider.d.ts +3 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
- package/dist/src/flow/withdrawalFlowConfig.d.ts +68 -0
- package/dist/src/flow/withdrawalFlowConfig.d.ts.map +1 -0
- package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -1
- package/dist/src/geo/useUserIpInfo.d.ts +2 -21
- package/dist/src/geo/useUserIpInfo.d.ts.map +1 -1
- package/dist/src/hooks/useScreenSize.d.ts +4 -0
- package/dist/src/hooks/useScreenSize.d.ts.map +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -1
- package/dist/src/icons/FunIcon.d.ts.map +1 -1
- package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -1
- package/dist/src/icons/StatusIcon.d.ts +2 -0
- package/dist/src/icons/StatusIcon.d.ts.map +1 -0
- package/dist/src/icons/TokenChainIcon.d.ts.map +1 -1
- package/dist/src/identity/IdentityContext.d.ts.map +1 -1
- package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
- package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
- package/dist/src/providers/useFunkitCheckout.d.ts +9 -3
- package/dist/src/providers/useFunkitCheckout.d.ts.map +1 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts +2 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -1
- package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -1
- package/dist/src/screens/NetworkSelector.d.ts.map +1 -1
- package/dist/src/screens/QrCodeScreen.d.ts +10 -10
- package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
- package/dist/src/screens/SelectMethodScreen.d.ts.map +1 -1
- package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
- package/dist/src/screens/WithdrawMethodScreen.d.ts +30 -0
- package/dist/src/screens/WithdrawMethodScreen.d.ts.map +1 -0
- package/dist/src/statsig/useDynamicConfig.d.ts +6 -0
- package/dist/src/statsig/useDynamicConfig.d.ts.map +1 -0
- package/dist/src/swapped/SwappedScreen.d.ts +6 -14
- package/dist/src/swapped/SwappedScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedScreenShell.d.ts +24 -0
- package/dist/src/swapped/SwappedScreenShell.d.ts.map +1 -0
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts +20 -0
- package/dist/src/swapped/SwappedWithdrawScreen.d.ts.map +1 -0
- package/dist/src/swapped/buildSwappedTheme.d.ts +7 -4
- package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -1
- package/dist/src/swapped/webViewSwappedTransport.d.ts +8 -7
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -1
- package/dist/src/theme/buildFunkitTheme.d.ts +192 -0
- package/dist/src/theme/buildFunkitTheme.d.ts.map +1 -0
- package/dist/src/theme/restyle.d.ts +2818 -2224
- package/dist/src/theme/restyle.d.ts.map +1 -1
- package/dist/src/theme/themes.d.ts +34 -0
- package/dist/src/theme/themes.d.ts.map +1 -0
- package/dist/src/theme/toRestyleTheme.d.ts +257 -205
- package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
- package/dist/src/theme/tokens.d.ts +162 -139
- package/dist/src/theme/tokens.d.ts.map +1 -1
- package/dist/src/transfer/fops.d.ts +8 -0
- package/dist/src/transfer/fops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts +11 -0
- package/dist/src/transfer/hooks/useFiatExchangeRates.d.ts.map +1 -0
- package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useTokenTransfer.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useUDAParams.d.ts +1 -1
- package/dist/src/transfer/hooks/useUDAParams.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts +39 -0
- package/dist/src/transfer/hooks/useWithdrawalFops.d.ts.map +1 -0
- package/dist/src/utils/customers.d.ts +2 -0
- package/dist/src/utils/customers.d.ts.map +1 -0
- package/dist/src/withdrawal/publicClient.d.ts +10 -0
- package/dist/src/withdrawal/publicClient.d.ts.map +1 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts +21 -0
- package/dist/src/withdrawal/useWithdrawalExecution.d.ts.map +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,306 +1,306 @@
|
|
|
1
1
|
// src/theme/tokens.ts
|
|
2
|
-
|
|
3
|
-
family
|
|
4
|
-
weights: {
|
|
5
|
-
base: { cssWeight: "400" },
|
|
6
|
-
medium: { cssWeight: "500" }
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
function fontFamilyForWeight(fonts, weight) {
|
|
10
|
-
const { familySuffix } = fonts.weights[weight];
|
|
11
|
-
return familySuffix ? `${fonts.family}-${familySuffix}` : fonts.family;
|
|
2
|
+
function fontFamilyForWeight(family, styleName) {
|
|
3
|
+
return `${family}-${styleName}`;
|
|
12
4
|
}
|
|
5
|
+
var FONT_STYLE_CSS_WEIGHT = {
|
|
6
|
+
Regular: "400",
|
|
7
|
+
Medium: "500"
|
|
8
|
+
};
|
|
13
9
|
var lightTokens = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
textSuccess: "#52A300",
|
|
50
|
-
textError: "#F34126",
|
|
51
|
-
textHyperlink: "#0F0F0F",
|
|
52
|
-
textWarning: "#F97316",
|
|
53
|
-
onBtnPrimary: "#FFFFFF",
|
|
54
|
-
onBtnPrimaryLoading: "#FFFFFF",
|
|
55
|
-
onBtnSecondary: "#0F0F0F",
|
|
56
|
-
onBtnSecondaryLoading: "#000000",
|
|
57
|
-
onBtnTertiary: "#0F0F0F",
|
|
58
|
-
onBtnIcon: "#6C6C6C",
|
|
59
|
-
onBtnDestructive: "#FFFFFF",
|
|
60
|
-
onBtnDestructiveLoading: "#FFFFFF",
|
|
61
|
-
borderModal: "#FFFFFF",
|
|
62
|
-
borderDefault: "#EFEFEF",
|
|
63
|
-
borderFocused: "#BEBEBE",
|
|
64
|
-
borderSelected: "#0F0F0F",
|
|
65
|
-
borderBtnPrimary: "#0F0F0F",
|
|
66
|
-
borderBtnSecondary: "#F9F9F9",
|
|
67
|
-
brandPrimary: "#0F0F0F"
|
|
10
|
+
background: {
|
|
11
|
+
modal: "#FFFFFF",
|
|
12
|
+
secondary: "#F9F9F9",
|
|
13
|
+
button: {
|
|
14
|
+
primary: { default: "#0F0F0F", pressed: "#1B1B1B" },
|
|
15
|
+
secondary: { default: "#F9F9F9", pressed: "#DDDDDD" },
|
|
16
|
+
tertiary: { default: "#FFFFFF", pressed: "#EFEFEF" },
|
|
17
|
+
icon: { default: "#FFFFFF", pressed: "#EFEFEF" },
|
|
18
|
+
destructive: {
|
|
19
|
+
default: "#F34126",
|
|
20
|
+
pressed: "#C2341E",
|
|
21
|
+
disabled: "#F34126"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
pill: { default: "#FFFFFF", pressed: "#EFEFEF", disabled: "#FFFFFF" }
|
|
25
|
+
},
|
|
26
|
+
opacity: {
|
|
27
|
+
disabled: 40
|
|
28
|
+
},
|
|
29
|
+
content: {
|
|
30
|
+
elements: {
|
|
31
|
+
primary: "#0F0F0F",
|
|
32
|
+
secondary: "#6C6C6C",
|
|
33
|
+
success: "#52A300",
|
|
34
|
+
error: "#F34126",
|
|
35
|
+
hyperlink: "#0F0F0F",
|
|
36
|
+
warning: "#F97316"
|
|
37
|
+
},
|
|
38
|
+
button: {
|
|
39
|
+
primary: { default: "#FFFFFF", loadingAlpha: "#FFFFFF4D" },
|
|
40
|
+
secondary: { default: "#0F0F0F", loadingAlpha: "#0000004D" },
|
|
41
|
+
tertiary: { default: "#0F0F0F" },
|
|
42
|
+
icon: { default: "#6C6C6C" },
|
|
43
|
+
destructive: { default: "#FFFFFF", loadingAlpha: "#FFFFFF80" }
|
|
44
|
+
}
|
|
68
45
|
},
|
|
69
|
-
|
|
70
|
-
modal: 24,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
46
|
+
border: {
|
|
47
|
+
radius: { modal: 24, element: 12, elementInner: 8, button: 999 },
|
|
48
|
+
modal: { default: "#FFFFFF", weight: 1 },
|
|
49
|
+
elements: {
|
|
50
|
+
default: { color: "#EFEFEF", weight: 1 },
|
|
51
|
+
selected: { color: "#0F0F0F", weight: 1 }
|
|
52
|
+
},
|
|
53
|
+
button: { primary: "#0F0F0F", secondary: "#F9F9F9", weight: 0 }
|
|
75
54
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
55
|
+
font: {
|
|
56
|
+
body: {
|
|
57
|
+
family: "Inter",
|
|
58
|
+
weight: { base: "Regular", medium: "Medium" },
|
|
59
|
+
size: { base: 16, detail: 14 },
|
|
60
|
+
leading: { base: 22, detail: 20 }
|
|
61
|
+
},
|
|
62
|
+
header: {
|
|
63
|
+
family: "Inter",
|
|
64
|
+
weight: "Medium",
|
|
65
|
+
alignment: "Center",
|
|
66
|
+
size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 }
|
|
67
|
+
}
|
|
82
68
|
},
|
|
83
69
|
spacing: {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
topBar: 56,
|
|
90
|
-
buttonHeight: 42,
|
|
91
|
-
buttonXs: 32,
|
|
92
|
-
buttonSm: 36,
|
|
93
|
-
buttonMd: 40,
|
|
94
|
-
buttonLg: 48,
|
|
95
|
-
iconXs: 16,
|
|
96
|
-
iconSm: 16,
|
|
97
|
-
iconMd: 20,
|
|
98
|
-
iconLg: 20
|
|
70
|
+
padding: {
|
|
71
|
+
elements: { horizontal: 12 },
|
|
72
|
+
modal: { horizontal: 16 }
|
|
73
|
+
},
|
|
74
|
+
heights: { topBar: 56, button: 42 }
|
|
99
75
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
bodyBase: 16,
|
|
103
|
-
bodyDetail: 14,
|
|
104
|
-
headerTitle: 13,
|
|
105
|
-
headerSubtitle: 15,
|
|
106
|
-
amountInput: 48,
|
|
107
|
-
amountSummary: 48
|
|
76
|
+
brand: {
|
|
77
|
+
primary: "#0F0F0F"
|
|
108
78
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
79
|
+
button: {
|
|
80
|
+
icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },
|
|
81
|
+
size: { xs: 36, sm: 40, md: 48, lg: 56 }
|
|
112
82
|
}
|
|
113
83
|
};
|
|
114
84
|
var darkTokens = {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
btnIcon: "#0F0F0F",
|
|
134
|
-
btnIconHover: "#1B1B1B",
|
|
135
|
-
btnIconPressed: "#2D2D2D",
|
|
136
|
-
btnIconFocused: "#0F0F0F",
|
|
137
|
-
btnIconDisabled: "#0F0F0F",
|
|
138
|
-
btnDestructive: "#DB3B22",
|
|
139
|
-
btnDestructiveHover: "#F34126",
|
|
140
|
-
btnDestructivePressed: "#F88877",
|
|
141
|
-
btnDestructiveFocused: "#DB3B22",
|
|
142
|
-
btnDestructiveDisabled: "#DB3B22",
|
|
143
|
-
pill: "#0F0F0F",
|
|
144
|
-
pillHover: "#1B1B1B",
|
|
145
|
-
pillPressed: "#2D2D2D",
|
|
146
|
-
pillFocused: "#0F0F0F",
|
|
147
|
-
pillDisabled: "#0F0F0F",
|
|
148
|
-
textPrimary: "#FFFFFF",
|
|
149
|
-
textSecondary: "#929292",
|
|
150
|
-
textSuccess: "#52A300",
|
|
151
|
-
textError: "#F34126",
|
|
152
|
-
textHyperlink: "#4971F0",
|
|
153
|
-
textWarning: "#F97316",
|
|
154
|
-
onBtnPrimary: "#000000",
|
|
155
|
-
onBtnPrimaryLoading: "#000000",
|
|
156
|
-
onBtnSecondary: "#F9F9F9",
|
|
157
|
-
onBtnSecondaryLoading: "#FFFFFF",
|
|
158
|
-
onBtnTertiary: "#F9F9F9",
|
|
159
|
-
onBtnIcon: "#929292",
|
|
160
|
-
onBtnDestructive: "#FFFFFF",
|
|
161
|
-
onBtnDestructiveLoading: "#FFFFFF",
|
|
162
|
-
borderModal: "#1B1B1B",
|
|
163
|
-
borderDefault: "#2D2D2D",
|
|
164
|
-
borderFocused: "#464646",
|
|
165
|
-
borderSelected: "#F9F9F9",
|
|
166
|
-
borderBtnPrimary: "#F9F9F9",
|
|
167
|
-
borderBtnSecondary: "#1B1B1B",
|
|
168
|
-
brandPrimary: "#FFFFFF"
|
|
85
|
+
background: {
|
|
86
|
+
modal: "#0F0F0F",
|
|
87
|
+
secondary: "#1B1B1B",
|
|
88
|
+
button: {
|
|
89
|
+
primary: { default: "#FFFFFF", pressed: "#F9F9F9" },
|
|
90
|
+
secondary: { default: "#1B1B1B", pressed: "#2D2D2D" },
|
|
91
|
+
tertiary: { default: "#1B1B1B", pressed: "#2D2D2D" },
|
|
92
|
+
icon: { default: "#0F0F0F", pressed: "#1B1B1B" },
|
|
93
|
+
destructive: {
|
|
94
|
+
default: "#DB3B22",
|
|
95
|
+
pressed: "#F34126",
|
|
96
|
+
disabled: "#DB3B22"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
pill: { default: "#0F0F0F", pressed: "#1B1B1B", disabled: "#0F0F0F" }
|
|
100
|
+
},
|
|
101
|
+
opacity: {
|
|
102
|
+
disabled: 40
|
|
169
103
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
104
|
+
content: {
|
|
105
|
+
elements: {
|
|
106
|
+
primary: "#FFFFFF",
|
|
107
|
+
secondary: "#929292",
|
|
108
|
+
success: "#52A300",
|
|
109
|
+
error: "#F34126",
|
|
110
|
+
hyperlink: "#FFFFFF",
|
|
111
|
+
warning: "#F97316"
|
|
112
|
+
},
|
|
113
|
+
button: {
|
|
114
|
+
primary: { default: "#000000", loadingAlpha: "#0000004D" },
|
|
115
|
+
secondary: { default: "#F9F9F9", loadingAlpha: "#FFFFFF4D" },
|
|
116
|
+
tertiary: { default: "#F9F9F9" },
|
|
117
|
+
icon: { default: "#929292" },
|
|
118
|
+
destructive: { default: "#FFFFFF", loadingAlpha: "#FFFFFF80" }
|
|
119
|
+
}
|
|
176
120
|
},
|
|
177
|
-
|
|
178
|
-
modal:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
121
|
+
border: {
|
|
122
|
+
radius: { modal: 24, element: 12, elementInner: 8, button: 999 },
|
|
123
|
+
modal: { default: "#1B1B1B", weight: 1 },
|
|
124
|
+
elements: {
|
|
125
|
+
default: { color: "#2D2D2D", weight: 1 },
|
|
126
|
+
selected: { color: "#FFFFFF", weight: 1 }
|
|
127
|
+
},
|
|
128
|
+
button: { primary: "#FFFFFF", secondary: "#1B1B1B", weight: 0 }
|
|
183
129
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
130
|
+
font: {
|
|
131
|
+
body: {
|
|
132
|
+
family: "Inter",
|
|
133
|
+
weight: { base: "Regular", medium: "Medium" },
|
|
134
|
+
size: { base: 16, detail: 14 },
|
|
135
|
+
leading: { base: 22, detail: 20 }
|
|
136
|
+
},
|
|
137
|
+
header: {
|
|
138
|
+
family: "Inter",
|
|
139
|
+
weight: "Medium",
|
|
140
|
+
alignment: "Center",
|
|
141
|
+
size: { title: 18, subtitle: 16, amountInput: 48, amountSummary: 48 }
|
|
142
|
+
}
|
|
188
143
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
buttonLg: 48,
|
|
196
|
-
iconXs: 16,
|
|
197
|
-
iconSm: 16,
|
|
198
|
-
iconMd: 20,
|
|
199
|
-
iconLg: 20
|
|
144
|
+
spacing: {
|
|
145
|
+
padding: {
|
|
146
|
+
elements: { horizontal: 12 },
|
|
147
|
+
modal: { horizontal: 16 }
|
|
148
|
+
},
|
|
149
|
+
heights: { topBar: 56, button: 42 }
|
|
200
150
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
bodyBase: 16,
|
|
204
|
-
bodyDetail: 14,
|
|
205
|
-
headerTitle: 13,
|
|
206
|
-
headerSubtitle: 15,
|
|
207
|
-
amountInput: 32,
|
|
208
|
-
amountSummary: 40
|
|
151
|
+
brand: {
|
|
152
|
+
primary: "#0F0F0F"
|
|
209
153
|
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
154
|
+
button: {
|
|
155
|
+
icon: { size: { xs: 16, sm: 16, md: 20, lg: 20 } },
|
|
156
|
+
size: { xs: 36, sm: 40, md: 48, lg: 56 }
|
|
213
157
|
}
|
|
214
158
|
};
|
|
215
159
|
|
|
216
160
|
// src/theme/toRestyleTheme.ts
|
|
217
161
|
import { createTheme } from "@shopify/restyle";
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
fontFamily: fontFamilyForWeight(
|
|
223
|
-
fontWeight:
|
|
224
|
-
};
|
|
225
|
-
const medium = {
|
|
226
|
-
fontFamily: fontFamilyForWeight(tokens.fonts, "medium"),
|
|
227
|
-
fontWeight: tokens.fonts.weights.medium.cssWeight
|
|
162
|
+
|
|
163
|
+
// src/theme/buildFunkitTheme.ts
|
|
164
|
+
function cut(family, styleName) {
|
|
165
|
+
return {
|
|
166
|
+
fontFamily: fontFamilyForWeight(family, styleName),
|
|
167
|
+
fontWeight: FONT_STYLE_CSS_WEIGHT[styleName]
|
|
228
168
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
169
|
+
}
|
|
170
|
+
function buildFunkitTheme(tokens) {
|
|
171
|
+
const { font } = tokens;
|
|
172
|
+
const base = cut(font.body.family, font.body.weight.base);
|
|
173
|
+
const medium = cut(font.body.family, font.body.weight.medium);
|
|
174
|
+
const header = cut(font.header.family, font.header.weight);
|
|
175
|
+
const headerAlign = font.header.alignment.toLowerCase();
|
|
176
|
+
return {
|
|
177
|
+
// Restyle's BaseTheme requires `colors`; intentionally empty — see above.
|
|
178
|
+
colors: {},
|
|
179
|
+
// ── Figma variable groups, verbatim ───────────────────────────────
|
|
180
|
+
background: tokens.background,
|
|
181
|
+
content: tokens.content,
|
|
182
|
+
border: tokens.border,
|
|
183
|
+
brand: tokens.brand,
|
|
184
|
+
opacity: tokens.opacity,
|
|
185
|
+
font: tokens.font,
|
|
186
|
+
// ── Non-color numeric buckets projected onto Restyle's reserved keys ─
|
|
187
|
+
spacing: {
|
|
188
|
+
none: 0,
|
|
189
|
+
elementsHorizontal: tokens.spacing.padding.elements.horizontal,
|
|
190
|
+
modalHorizontal: tokens.spacing.padding.modal.horizontal
|
|
191
|
+
},
|
|
192
|
+
borderRadii: {
|
|
193
|
+
modal: tokens.border.radius.modal,
|
|
194
|
+
element: tokens.border.radius.element,
|
|
195
|
+
elementInner: tokens.border.radius.elementInner,
|
|
196
|
+
button: tokens.border.radius.button,
|
|
197
|
+
// Structural (no Figma token): fully-circular avatars / icon wells.
|
|
198
|
+
rounded: 999
|
|
199
|
+
},
|
|
200
|
+
borderWidths: {
|
|
201
|
+
modal: tokens.border.modal.weight,
|
|
202
|
+
elementsDefault: tokens.border.elements.default.weight,
|
|
203
|
+
elementsSelected: tokens.border.elements.selected.weight,
|
|
204
|
+
button: tokens.border.button.weight
|
|
205
|
+
},
|
|
206
|
+
sizes: {
|
|
207
|
+
topBar: tokens.spacing.heights.topBar,
|
|
208
|
+
buttonHeight: tokens.spacing.heights.button,
|
|
209
|
+
buttonXs: tokens.button.size.xs,
|
|
210
|
+
buttonSm: tokens.button.size.sm,
|
|
211
|
+
buttonMd: tokens.button.size.md,
|
|
212
|
+
buttonLg: tokens.button.size.lg,
|
|
213
|
+
iconXs: tokens.button.icon.size.xs,
|
|
214
|
+
iconSm: tokens.button.icon.size.sm,
|
|
215
|
+
iconMd: tokens.button.icon.size.md,
|
|
216
|
+
iconLg: tokens.button.icon.size.lg
|
|
233
217
|
},
|
|
234
|
-
spacing: tokens.spacing,
|
|
235
|
-
borderRadii: tokens.radii,
|
|
236
|
-
borderWidths: tokens.borderWidths,
|
|
237
|
-
sizes: tokens.sizes,
|
|
238
218
|
breakpoints: {
|
|
239
219
|
phone: 0,
|
|
240
220
|
tablet: 768
|
|
241
221
|
},
|
|
222
|
+
// Text variants carry no `color` (Restyle colors is unused); the `Text`
|
|
223
|
+
// component defaults the color from `content/elements/*` and callers
|
|
224
|
+
// override per-node via `style`.
|
|
242
225
|
textVariants: {
|
|
243
226
|
defaults: {
|
|
244
227
|
...base,
|
|
245
|
-
fontSize:
|
|
246
|
-
lineHeight:
|
|
247
|
-
color: "textPrimary"
|
|
228
|
+
fontSize: font.body.size.base,
|
|
229
|
+
lineHeight: font.body.leading.base
|
|
248
230
|
},
|
|
249
231
|
body: {
|
|
250
232
|
...base,
|
|
251
|
-
fontSize:
|
|
252
|
-
lineHeight:
|
|
253
|
-
color: "textPrimary"
|
|
233
|
+
fontSize: font.body.size.base,
|
|
234
|
+
lineHeight: font.body.leading.base
|
|
254
235
|
},
|
|
255
236
|
bodyMedium: {
|
|
256
237
|
...medium,
|
|
257
|
-
fontSize:
|
|
258
|
-
lineHeight:
|
|
259
|
-
color: "textPrimary"
|
|
238
|
+
fontSize: font.body.size.base,
|
|
239
|
+
lineHeight: font.body.leading.base
|
|
260
240
|
},
|
|
261
241
|
detail: {
|
|
262
242
|
...base,
|
|
263
|
-
fontSize:
|
|
264
|
-
lineHeight:
|
|
265
|
-
color: "textSecondary"
|
|
243
|
+
fontSize: font.body.size.detail,
|
|
244
|
+
lineHeight: font.body.leading.detail
|
|
266
245
|
},
|
|
267
246
|
headerTitle: {
|
|
268
|
-
...
|
|
269
|
-
fontSize:
|
|
270
|
-
|
|
271
|
-
textAlign: "center"
|
|
247
|
+
...header,
|
|
248
|
+
fontSize: font.header.size.title,
|
|
249
|
+
textAlign: headerAlign
|
|
272
250
|
},
|
|
273
251
|
headerSubtitle: {
|
|
274
|
-
...
|
|
275
|
-
fontSize:
|
|
276
|
-
|
|
277
|
-
textAlign: "center"
|
|
252
|
+
...header,
|
|
253
|
+
fontSize: font.header.size.subtitle,
|
|
254
|
+
textAlign: headerAlign
|
|
278
255
|
},
|
|
279
256
|
amountInput: {
|
|
280
257
|
...medium,
|
|
281
|
-
fontSize:
|
|
282
|
-
color: "textPrimary"
|
|
258
|
+
fontSize: font.header.size.amountInput
|
|
283
259
|
},
|
|
284
260
|
amountSummary: {
|
|
285
261
|
...medium,
|
|
286
|
-
fontSize:
|
|
287
|
-
color: "textPrimary"
|
|
262
|
+
fontSize: font.header.size.amountSummary
|
|
288
263
|
}
|
|
289
264
|
},
|
|
290
265
|
// Per-weight `{ fontFamily, fontWeight }` the `Text` `weight` prop applies on
|
|
291
|
-
// top of any variant
|
|
292
|
-
// `fontFamilyForWeight`)
|
|
293
|
-
// variants use — letting a node override only its weight (e.g.
|
|
294
|
-
// `variant="detail" weight="medium"`) without a `*Medium` twin per variant.
|
|
266
|
+
// top of any variant (both are required for custom fonts — see
|
|
267
|
+
// `fontFamilyForWeight`).
|
|
295
268
|
textWeights: {
|
|
296
269
|
base,
|
|
297
270
|
medium
|
|
298
271
|
}
|
|
299
|
-
}
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// src/theme/toRestyleTheme.ts
|
|
276
|
+
function toRestyleTheme(tokens) {
|
|
277
|
+
return createTheme(buildFunkitTheme(tokens));
|
|
300
278
|
}
|
|
301
279
|
var defaultLightTheme = toRestyleTheme(lightTokens);
|
|
302
280
|
var defaultDarkTheme = toRestyleTheme(darkTokens);
|
|
303
281
|
|
|
282
|
+
// src/theme/themes.ts
|
|
283
|
+
function isPlainObject(value) {
|
|
284
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
285
|
+
}
|
|
286
|
+
function deepMerge(base, override) {
|
|
287
|
+
if (!isPlainObject(base)) {
|
|
288
|
+
return override === void 0 ? base : override;
|
|
289
|
+
}
|
|
290
|
+
const source = isPlainObject(override) ? override : {};
|
|
291
|
+
const cloned = {};
|
|
292
|
+
for (const key of Object.keys(base)) {
|
|
293
|
+
cloned[key] = deepMerge(base[key], source[key]);
|
|
294
|
+
}
|
|
295
|
+
return cloned;
|
|
296
|
+
}
|
|
297
|
+
function lightTheme(override) {
|
|
298
|
+
return toRestyleTheme(deepMerge(lightTokens, override));
|
|
299
|
+
}
|
|
300
|
+
function darkTheme(override) {
|
|
301
|
+
return toRestyleTheme(deepMerge(darkTokens, override));
|
|
302
|
+
}
|
|
303
|
+
|
|
304
304
|
// src/theme/useColorScheme.ts
|
|
305
305
|
import { useEffect, useState } from "react";
|
|
306
306
|
import { Appearance } from "react-native";
|
|
@@ -334,12 +334,12 @@ var DEFAULT_THEME_SET = {
|
|
|
334
334
|
};
|
|
335
335
|
function selectTheme(themeSet, scheme) {
|
|
336
336
|
const primary = scheme === "dark" ? themeSet.dark : themeSet.light;
|
|
337
|
-
const
|
|
337
|
+
const fallback2 = scheme === "dark" ? themeSet.light : themeSet.dark;
|
|
338
338
|
if (primary) {
|
|
339
339
|
return primary;
|
|
340
340
|
}
|
|
341
|
-
if (
|
|
342
|
-
return
|
|
341
|
+
if (fallback2) {
|
|
342
|
+
return fallback2;
|
|
343
343
|
}
|
|
344
344
|
throw new Error(
|
|
345
345
|
"FunkitProvider: `themes` must include at least one of { light, dark }"
|
|
@@ -366,12 +366,16 @@ import {
|
|
|
366
366
|
var Box = createBox();
|
|
367
367
|
var RestyleText = createText();
|
|
368
368
|
var Text = forwardRef(
|
|
369
|
-
function Text2({ weight, style, ...rest }, ref) {
|
|
369
|
+
function Text2({ weight, variant, style, ...rest }, ref) {
|
|
370
370
|
const theme = useRestyleTheme();
|
|
371
371
|
const weightStyle = weight ? theme.textWeights?.[weight] : void 0;
|
|
372
|
+
const elements = theme.content?.elements;
|
|
373
|
+
const secondary = variant === "detail" || variant === "headerSubtitle";
|
|
374
|
+
const colorStyle = elements ? { color: secondary ? elements.secondary : elements.primary } : void 0;
|
|
372
375
|
return createElement(RestyleText, {
|
|
373
376
|
ref,
|
|
374
|
-
|
|
377
|
+
variant,
|
|
378
|
+
style: [colorStyle, weightStyle, style],
|
|
375
379
|
...rest
|
|
376
380
|
});
|
|
377
381
|
}
|
|
@@ -379,7 +383,7 @@ var Text = forwardRef(
|
|
|
379
383
|
var useTheme = () => useRestyleTheme();
|
|
380
384
|
|
|
381
385
|
// src/flow/AddressCopiedToast.tsx
|
|
382
|
-
import { StyleSheet
|
|
386
|
+
import { StyleSheet } from "react-native";
|
|
383
387
|
import Animated, { Easing, FadeOutUp, Keyframe } from "react-native-reanimated";
|
|
384
388
|
|
|
385
389
|
// src/icons/FigmaSystemIcons.tsx
|
|
@@ -387,7 +391,7 @@ import { SvgXml } from "react-native-svg";
|
|
|
387
391
|
import { jsx } from "react/jsx-runtime";
|
|
388
392
|
function useIconColor(color) {
|
|
389
393
|
const theme = useTheme();
|
|
390
|
-
return color ?? theme.
|
|
394
|
+
return color ?? theme.content.elements.primary;
|
|
391
395
|
}
|
|
392
396
|
function renderIcon(svg, size, color) {
|
|
393
397
|
return /* @__PURE__ */ jsx(
|
|
@@ -399,7 +403,6 @@ function renderIcon(svg, size, color) {
|
|
|
399
403
|
}
|
|
400
404
|
);
|
|
401
405
|
}
|
|
402
|
-
var CLOSE_SVG = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.41291 3.08709C4.0468 2.72097 3.4532 2.72097 3.08709 3.08709C2.72097 3.4532 2.72097 4.0468 3.08709 4.41291L8.67417 10L3.08709 15.5871C2.72097 15.9532 2.72097 16.5468 3.08709 16.9129C3.4532 17.279 4.0468 17.279 4.41291 16.9129L10 11.3258L15.5871 16.9129C15.9532 17.279 16.5468 17.279 16.9129 16.9129C17.279 16.5468 17.279 15.9532 16.9129 15.5871L11.3258 10L16.9129 4.41291C17.279 4.0468 17.279 3.4532 16.9129 3.08709C16.5468 2.72097 15.9532 2.72097 15.5871 3.08709L10 8.67417L4.41291 3.08709Z" fill="currentColor"/></svg>';
|
|
403
406
|
var QR_SCAN_SVG = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.83333 9.99935H10V14.166M2.50833 9.99935H2.5M6.675 14.166H6.66667M10.0083 17.4993H10M17.5083 9.99935H17.5M2.5 14.166H3.75M12.9167 9.99935H14.5833M2.5 17.4993H6.66667M10 1.66602V6.66602M14.6667 17.4993H16.1667C16.6334 17.4993 16.8667 17.4993 17.045 17.4085C17.2018 17.3286 17.3293 17.2011 17.4092 17.0443C17.5 16.8661 17.5 16.6327 17.5 16.166V14.666C17.5 14.1993 17.5 13.966 17.4092 13.7877C17.3293 13.6309 17.2018 13.5034 17.045 13.4235C16.8667 13.3327 16.6334 13.3327 16.1667 13.3327H14.6667C14.2 13.3327 13.9666 13.3327 13.7883 13.4235C13.6315 13.5034 13.5041 13.6309 13.4242 13.7877C13.3333 13.966 13.3333 14.1993 13.3333 14.666V16.166C13.3333 16.6327 13.3333 16.8661 13.4242 17.0443C13.5041 17.2011 13.6315 17.3286 13.7883 17.4085C13.9666 17.4993 14.2 17.4993 14.6667 17.4993ZM14.6667 6.66602H16.1667C16.6334 6.66602 16.8667 6.66602 17.045 6.57519C17.2018 6.49529 17.3293 6.36781 17.4092 6.21101C17.5 6.03275 17.5 5.79939 17.5 5.33268V3.83268C17.5 3.36597 17.5 3.13262 17.4092 2.95436C17.3293 2.79756 17.2018 2.67007 17.045 2.59018C16.8667 2.49935 16.6334 2.49935 16.1667 2.49935H14.6667C14.2 2.49935 13.9666 2.49935 13.7883 2.59018C13.6315 2.67007 13.5041 2.79756 13.4242 2.95436C13.3333 3.13262 13.3333 3.36597 13.3333 3.83268V5.33268C13.3333 5.79939 13.3333 6.03275 13.4242 6.21101C13.5041 6.36781 13.6315 6.49529 13.7883 6.57519C13.9666 6.66602 14.2 6.66602 14.6667 6.66602ZM3.83333 6.66602H5.33333C5.80004 6.66602 6.0334 6.66602 6.21166 6.57519C6.36846 6.49529 6.49594 6.36781 6.57584 6.21101C6.66667 6.03275 6.66667 5.79939 6.66667 5.33268V3.83268C6.66667 3.36597 6.66667 3.13262 6.57584 2.95436C6.49594 2.79756 6.36846 2.67007 6.21166 2.59018C6.0334 2.49935 5.80004 2.49935 5.33333 2.49935H3.83333C3.36662 2.49935 3.13327 2.49935 2.95501 2.59018C2.79821 2.67007 2.67072 2.79756 2.59083 2.95436C2.5 3.13262 2.5 3.36597 2.5 3.83268V5.33268C2.5 5.79939 2.5 6.03275 2.59083 6.21101C2.67072 6.36781 2.79821 6.49529 2.95501 6.57519C3.13327 6.66602 3.36662 6.66602 3.83333 6.66602Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
404
407
|
var COPY_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.6 10.4V12.08C5.6 12.7521 5.6 13.0881 5.73079 13.3448C5.84584 13.5706 6.02942 13.7542 6.25521 13.8692C6.51191 14 6.84794 14 7.52 14H12.08C12.7521 14 13.0881 14 13.3448 13.8692C13.5706 13.7542 13.7542 13.5706 13.8692 13.3448C14 13.0881 14 12.7521 14 12.08V7.52C14 6.84794 14 6.51191 13.8692 6.25521C13.7542 6.02942 13.5706 5.84584 13.3448 5.73079C13.0881 5.6 12.7521 5.6 12.08 5.6H10.4M3.92 10.4H8.48C9.15206 10.4 9.48809 10.4 9.74479 10.2692C9.97058 10.1542 10.1542 9.97058 10.2692 9.74479C10.4 9.48809 10.4 9.15206 10.4 8.48V3.92C10.4 3.24794 10.4 2.91191 10.2692 2.65521C10.1542 2.42942 9.97058 2.24584 9.74479 2.13079C9.48809 2 9.15206 2 8.48 2H3.92C3.24794 2 2.91191 2 2.65521 2.13079C2.42942 2.24584 2.24584 2.42942 2.13079 2.65521C2 2.91191 2 3.24794 2 3.92V8.48C2 9.15206 2 9.48809 2.13079 9.74479C2.24584 9.97058 2.42942 10.1542 2.65521 10.2692C2.91191 10.4 3.24794 10.4 3.92 10.4Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
405
408
|
var SHARE_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14 8V10.8C14 11.9201 14 12.4802 13.782 12.908C13.5903 13.2843 13.2843 13.5903 12.908 13.782C12.4802 14 11.9201 14 10.8 14H5.2C4.07989 14 3.51984 14 3.09202 13.782C2.71569 13.5903 2.40973 13.2843 2.21799 12.908C2 12.4802 2 11.9201 2 10.8V8M5.33333 4.66667L8 2L10.6667 4.66667M8 2V10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
@@ -408,9 +411,6 @@ var CHEVRON_LEFT_SVG = '<svg width="20" height="20" viewBox="0 0 20 20" fill="no
|
|
|
408
411
|
var SUCCESS_CHECK_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 8.5L7 10L10.5 6.5M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8Z" stroke="#52A300" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
409
412
|
var CHEVRON_DOWN_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.46967 5.71967C3.76256 5.42678 4.23744 5.42678 4.53033 5.71967L8 9.18934L11.4697 5.71967C11.7626 5.42678 12.2374 5.42678 12.5303 5.71967C12.8232 6.01256 12.8232 6.48744 12.5303 6.78033L8.53033 10.7803C8.23744 11.0732 7.76256 11.0732 7.46967 10.7803L3.46967 6.78033C3.17678 6.48744 3.17678 6.01256 3.46967 5.71967Z" fill="currentColor"/></svg>';
|
|
410
413
|
var CHECK_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M13.8047 4.19526C14.0651 4.45561 14.0651 4.87772 13.8047 5.13807L6.80474 12.1381C6.54439 12.3984 6.12228 12.3984 5.86193 12.1381L2.5286 8.80474C2.26825 8.54439 2.26825 8.12228 2.5286 7.86193C2.78895 7.60158 3.21106 7.60158 3.4714 7.86193L6.33333 10.7239L12.8619 4.19526C13.1223 3.93491 13.5444 3.93491 13.8047 4.19526Z" fill="currentColor"/></svg>';
|
|
411
|
-
function FigmaCloseIcon({ size = 20, color }) {
|
|
412
|
-
return renderIcon(CLOSE_SVG, size, useIconColor(color));
|
|
413
|
-
}
|
|
414
414
|
function FigmaQrScanIcon({ size = 20, color }) {
|
|
415
415
|
return renderIcon(QR_SCAN_SVG, size, useIconColor(color));
|
|
416
416
|
}
|
|
@@ -435,14 +435,14 @@ function FigmaChevronDownIcon({ size = 16, color }) {
|
|
|
435
435
|
function FigmaCheckIcon({ size = 16, color }) {
|
|
436
436
|
return renderIcon(CHECK_SVG, size, useIconColor(color));
|
|
437
437
|
}
|
|
438
|
-
var INFO_CIRCLE_SVG = '<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10 9.16667V13.3333M10 6.66667H10.0083M17.5 10C17.5 14.1421 14.1421 17.5 10 17.5C5.85786 17.5 2.5 14.1421 2.5 10C2.5 5.85786 5.85786 2.5 10 2.5C14.1421 2.5 17.5 5.85786 17.5 10Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
439
|
-
function FigmaInfoCircleIcon({ size = 20, color }) {
|
|
440
|
-
return renderIcon(INFO_CIRCLE_SVG, size, useIconColor(color));
|
|
441
|
-
}
|
|
442
438
|
var PLUS_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.20833 5V11.4167M5 8.20833H11.4167" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
443
439
|
function FigmaPlusIcon({ size = 16, color }) {
|
|
444
440
|
return renderIcon(PLUS_SVG, size, useIconColor(color));
|
|
445
441
|
}
|
|
442
|
+
var ALERT_CIRCLE_SVG = '<svg width="20" height="20" viewBox="0 0 22.21 22.19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.0993 22.1908C9.5667 22.1908 8.1308 21.9008 6.7916 21.3207C5.4524 20.7478 4.2744 19.9529 3.2575 18.9359C2.2405 17.919 1.442 16.741 0.862 15.4018C0.289 14.0626 0.0026 12.6267 0.0026 11.0941C0.0026 9.5616 0.289 8.1257 0.862 6.7865C1.442 5.4402 2.2405 4.2621 3.2575 3.2523C4.2744 2.2354 5.4524 1.4405 6.7916 0.8676C8.1308 0.2875 9.5667 -0.0025 11.0993 -0.0025C12.6318 -0.0025 14.0677 0.2875 15.4069 0.8676C16.7532 1.4405 17.9349 2.2354 18.9518 3.2523C19.9687 4.2621 20.7636 5.4402 21.3366 6.7865C21.9166 8.1257 22.2067 9.5616 22.2067 11.0941C22.2067 12.6267 21.9166 14.0626 21.3366 15.4018C20.7636 16.741 19.9687 17.919 18.9518 18.9359C17.9349 19.9529 16.7532 20.7478 15.4069 21.3207C14.0677 21.9008 12.6318 22.1908 11.0993 22.1908ZM11.11 12.9525C11.7474 12.9525 12.0732 12.6195 12.0875 11.9535L12.2594 6.5609C12.2737 6.2315 12.1699 5.963 11.9479 5.7553C11.7259 5.5404 11.443 5.433 11.0993 5.433C10.7483 5.433 10.4655 5.5404 10.2506 5.7553C10.0358 5.963 9.9355 6.2279 9.9498 6.5502L10.1002 11.9643C10.1217 12.6231 10.4583 12.9525 11.11 12.9525ZM11.11 16.6479C11.4681 16.6479 11.776 16.5333 12.0338 16.3041C12.2916 16.0749 12.4205 15.7813 12.4205 15.4232C12.4205 15.0723 12.2916 14.7787 12.0338 14.5424C11.776 14.3061 11.4681 14.1879 11.11 14.1879C10.7448 14.1879 10.4332 14.3061 10.1754 14.5424C9.9176 14.7787 9.7887 15.0723 9.7887 15.4232C9.7887 15.7813 9.9176 16.0749 10.1754 16.3041C10.4404 16.5333 10.7519 16.6479 11.11 16.6479Z" fill="currentColor"/></svg>';
|
|
443
|
+
function FigmaAlertCircleIcon({ size = 22, color }) {
|
|
444
|
+
return renderIcon(ALERT_CIRCLE_SVG, size, useIconColor(color));
|
|
445
|
+
}
|
|
446
446
|
|
|
447
447
|
// src/flow/AddressCopiedToast.tsx
|
|
448
448
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
@@ -459,18 +459,19 @@ var enterAnimation = new Keyframe({
|
|
|
459
459
|
}).duration(450);
|
|
460
460
|
var exitAnimation = FadeOutUp.duration(350);
|
|
461
461
|
function AddressCopiedToast({
|
|
462
|
-
label
|
|
462
|
+
label = "Address copied"
|
|
463
463
|
}) {
|
|
464
|
+
const theme = useTheme();
|
|
464
465
|
return /* @__PURE__ */ jsxs(
|
|
465
466
|
Animated.View,
|
|
466
467
|
{
|
|
467
468
|
entering: enterAnimation,
|
|
468
469
|
exiting: exitAnimation,
|
|
469
|
-
style: styles.pill,
|
|
470
|
+
style: [styles.pill, { backgroundColor: theme.background.pill.default }],
|
|
470
471
|
accessibilityRole: "alert",
|
|
471
|
-
accessibilityLabel:
|
|
472
|
+
accessibilityLabel: label,
|
|
472
473
|
children: [
|
|
473
|
-
/* @__PURE__ */ jsx2(
|
|
474
|
+
/* @__PURE__ */ jsx2(Text, { variant: "bodyMedium", children: label }),
|
|
474
475
|
/* @__PURE__ */ jsx2(FigmaSuccessCheckIcon, { size: 16 })
|
|
475
476
|
]
|
|
476
477
|
}
|
|
@@ -480,7 +481,6 @@ var pill = {
|
|
|
480
481
|
height: 42,
|
|
481
482
|
paddingHorizontal: 16,
|
|
482
483
|
borderRadius: 999,
|
|
483
|
-
backgroundColor: "#ffffff",
|
|
484
484
|
flexDirection: "row",
|
|
485
485
|
alignItems: "center",
|
|
486
486
|
gap: 6,
|
|
@@ -489,12 +489,7 @@ var pill = {
|
|
|
489
489
|
shadowOffset: { width: 0, height: 4 },
|
|
490
490
|
shadowRadius: 12
|
|
491
491
|
};
|
|
492
|
-
var
|
|
493
|
-
color: "#111111",
|
|
494
|
-
fontSize: 16,
|
|
495
|
-
fontWeight: "500"
|
|
496
|
-
};
|
|
497
|
-
var styles = StyleSheet.create({ pill, label });
|
|
492
|
+
var styles = StyleSheet.create({ pill });
|
|
498
493
|
|
|
499
494
|
// src/theme/FunkitThemeProvider.tsx
|
|
500
495
|
import { ThemeProvider } from "@shopify/restyle";
|
|
@@ -554,26 +549,23 @@ function useFunkitColorScheme() {
|
|
|
554
549
|
|
|
555
550
|
// src/providers/FunkitProvider.tsx
|
|
556
551
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
557
|
-
import { useEffect as useEffect12, useMemo as
|
|
552
|
+
import { useEffect as useEffect12, useMemo as useMemo11, useRef as useRef8 } from "react";
|
|
558
553
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
559
554
|
|
|
560
555
|
// src/flow/FunkitFlowProvider.tsx
|
|
561
|
-
import { useDynamicConfig as useDynamicConfig6 } from "@funkit/connect-core";
|
|
562
556
|
import {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
useMemo as useMemo8,
|
|
568
|
-
useRef as useRef6,
|
|
569
|
-
useState as useState9
|
|
570
|
-
} from "react";
|
|
571
|
-
import { Share, StyleSheet as StyleSheet3, View as View3 } from "react-native";
|
|
572
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
557
|
+
BottomSheetBackdrop as BottomSheetBackdrop2,
|
|
558
|
+
BottomSheetModal as BottomSheetModal2,
|
|
559
|
+
BottomSheetView as BottomSheetView2
|
|
560
|
+
} from "@gorhom/bottom-sheet";
|
|
573
561
|
|
|
574
|
-
// src/
|
|
575
|
-
import {
|
|
576
|
-
|
|
562
|
+
// src/statsig/useDynamicConfig.ts
|
|
563
|
+
import {
|
|
564
|
+
useDynamicConfig as useCoreDynamicConfig
|
|
565
|
+
} from "@funkit/connect-core";
|
|
566
|
+
|
|
567
|
+
// src/geo/useUserIpInfo.ts
|
|
568
|
+
import { useUserIpInfo as useCoreUserIpInfo } from "@funkit/connect-core";
|
|
577
569
|
|
|
578
570
|
// src/logging/logger.ts
|
|
579
571
|
import { FunLogger } from "@funkit/connect-core";
|
|
@@ -649,7 +641,13 @@ var DatadogHttpLogTransport = class {
|
|
|
649
641
|
fetch(this.intakeUrl, {
|
|
650
642
|
method: "POST",
|
|
651
643
|
headers: { "Content-Type": "application/json" },
|
|
652
|
-
|
|
644
|
+
// BigInt-safe: log context may carry bigints (relay-sdk quote/step
|
|
645
|
+
// amounts) that plain JSON.stringify throws on — and flush() can run
|
|
646
|
+
// synchronously inside a caller's log(). Coerce bigints to strings.
|
|
647
|
+
body: JSON.stringify(
|
|
648
|
+
batch,
|
|
649
|
+
(_key, value) => typeof value === "bigint" ? value.toString() : value
|
|
650
|
+
)
|
|
653
651
|
}).catch(() => {
|
|
654
652
|
});
|
|
655
653
|
}
|
|
@@ -679,6 +677,43 @@ var logger = new FunLogger(
|
|
|
679
677
|
})
|
|
680
678
|
);
|
|
681
679
|
|
|
680
|
+
// src/geo/useUserIpInfo.ts
|
|
681
|
+
function useUserIpInfo() {
|
|
682
|
+
return useCoreUserIpInfo({
|
|
683
|
+
logger,
|
|
684
|
+
enabled: true,
|
|
685
|
+
staleTime: Number.POSITIVE_INFINITY
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
// src/statsig/useDynamicConfig.ts
|
|
690
|
+
var useDynamicConfig = (name, options) => {
|
|
691
|
+
const { userIpInfo } = useUserIpInfo();
|
|
692
|
+
return useCoreDynamicConfig(name, {
|
|
693
|
+
bypassCountryCode: options?.bypassCountryCode,
|
|
694
|
+
countryCode: userIpInfo?.alpha2
|
|
695
|
+
});
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// src/flow/FunkitFlowProvider.tsx
|
|
699
|
+
import { useStatsigClient as useStatsigClient2 } from "@statsig/react-bindings";
|
|
700
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
701
|
+
import {
|
|
702
|
+
createContext as createContext3,
|
|
703
|
+
useCallback as useCallback8,
|
|
704
|
+
useContext as useContext3,
|
|
705
|
+
useEffect as useEffect11,
|
|
706
|
+
useMemo as useMemo9,
|
|
707
|
+
useRef as useRef7,
|
|
708
|
+
useState as useState9
|
|
709
|
+
} from "react";
|
|
710
|
+
import { Share, StyleSheet as StyleSheet4, View as View3 } from "react-native";
|
|
711
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
712
|
+
|
|
713
|
+
// src/geo/useCheckoutBlocked.ts
|
|
714
|
+
import { useEffect as useEffect2, useMemo as useMemo3 } from "react";
|
|
715
|
+
import { useEffectEvent } from "@funkit/connect-core";
|
|
716
|
+
|
|
682
717
|
// src/geo/isCountryBlocked.ts
|
|
683
718
|
var ALL_MATCH = "*";
|
|
684
719
|
function isCountryBlocked(blockedList, userIpInfo) {
|
|
@@ -695,58 +730,6 @@ function isCountryBlocked(blockedList, userIpInfo) {
|
|
|
695
730
|
return isBlocked;
|
|
696
731
|
}
|
|
697
732
|
|
|
698
|
-
// src/geo/useUserIpInfo.ts
|
|
699
|
-
import { useQuery } from "@tanstack/react-query";
|
|
700
|
-
var MOONPAY_LIVE_API_KEY = "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO";
|
|
701
|
-
function errData(error) {
|
|
702
|
-
return { error: error instanceof Error ? error.message : String(error) };
|
|
703
|
-
}
|
|
704
|
-
async function getIpViaMoonpay() {
|
|
705
|
-
const res = await fetch(
|
|
706
|
-
`https://api.moonpay.com/v3/ip_address?apiKey=${MOONPAY_LIVE_API_KEY}`
|
|
707
|
-
);
|
|
708
|
-
if (!res.ok) {
|
|
709
|
-
throw new Error(res.statusText);
|
|
710
|
-
}
|
|
711
|
-
const data = await res.json();
|
|
712
|
-
return { alpha2: data.alpha2, state: data.state };
|
|
713
|
-
}
|
|
714
|
-
async function getIpViaIpApi() {
|
|
715
|
-
const res = await fetch("https://ipapi.co/json");
|
|
716
|
-
if (!res.ok) {
|
|
717
|
-
throw new Error(res.statusText);
|
|
718
|
-
}
|
|
719
|
-
const data = await res.json();
|
|
720
|
-
return { alpha2: data.country_code, state: data.region_code };
|
|
721
|
-
}
|
|
722
|
-
function useUserIpInfo() {
|
|
723
|
-
const { data: userIpInfo, isLoading: isLoadingGeoCheck } = useQuery({
|
|
724
|
-
queryKey: ["getUserIpInfo"],
|
|
725
|
-
queryFn: async () => {
|
|
726
|
-
try {
|
|
727
|
-
return await getIpViaMoonpay();
|
|
728
|
-
} catch (moonpayError) {
|
|
729
|
-
logger.warn(
|
|
730
|
-
"connect-rn:getUserIpViaMoonpay:error",
|
|
731
|
-
errData(moonpayError)
|
|
732
|
-
);
|
|
733
|
-
try {
|
|
734
|
-
return await getIpViaIpApi();
|
|
735
|
-
} catch (ipApiError) {
|
|
736
|
-
logger.warn("connect-rn:getUserIpViaIpApi:error", errData(ipApiError));
|
|
737
|
-
throw ipApiError;
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
},
|
|
741
|
-
// Location is stable within a session; don't refetch aggressively.
|
|
742
|
-
staleTime: Number.POSITIVE_INFINITY,
|
|
743
|
-
refetchOnMount: false,
|
|
744
|
-
refetchOnReconnect: true,
|
|
745
|
-
refetchOnWindowFocus: false
|
|
746
|
-
});
|
|
747
|
-
return { userIpInfo, isLoadingGeoCheck };
|
|
748
|
-
}
|
|
749
|
-
|
|
750
733
|
// src/geo/useCheckoutBlocked.ts
|
|
751
734
|
function useCheckoutBlocked(params) {
|
|
752
735
|
const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo();
|
|
@@ -881,7 +864,7 @@ function CryptoBitcoinIcon({ size = 28 }) {
|
|
|
881
864
|
xml: CIRCLE_BITCOIN_SVG,
|
|
882
865
|
width: size,
|
|
883
866
|
height: size,
|
|
884
|
-
color: theme.
|
|
867
|
+
color: theme.content.elements.primary
|
|
885
868
|
}
|
|
886
869
|
);
|
|
887
870
|
}
|
|
@@ -910,6 +893,7 @@ function FunIcon({ uri, size = 32, fallbackUri }) {
|
|
|
910
893
|
() => svgCache.get(currentUri) ?? null
|
|
911
894
|
);
|
|
912
895
|
const [rasterLoaded, setRasterLoaded] = useState3(false);
|
|
896
|
+
const theme = useTheme();
|
|
913
897
|
useEffect3(() => {
|
|
914
898
|
setCurrentUri(uri);
|
|
915
899
|
setRasterLoaded(false);
|
|
@@ -963,8 +947,10 @@ function FunIcon({ uri, size = 32, fallbackUri }) {
|
|
|
963
947
|
width: size,
|
|
964
948
|
height: size,
|
|
965
949
|
borderRadius: "rounded",
|
|
966
|
-
|
|
967
|
-
|
|
950
|
+
style: [
|
|
951
|
+
clip,
|
|
952
|
+
{ backgroundColor: ready ? void 0 : theme.background.secondary }
|
|
953
|
+
],
|
|
968
954
|
children: isSvg ? xml != null ? /* @__PURE__ */ jsx5(SvgXml3, { xml, width: size, height: size }) : null : /* @__PURE__ */ jsx5(
|
|
969
955
|
Image,
|
|
970
956
|
{
|
|
@@ -1051,14 +1037,24 @@ function SourceTokenCluster({
|
|
|
1051
1037
|
const visible = icons.slice(0, maxVisible);
|
|
1052
1038
|
const overflow = icons.length - visible.length;
|
|
1053
1039
|
return /* @__PURE__ */ jsxs2(Box, { flexDirection: "row", alignItems: "center", style: { gap }, children: [
|
|
1054
|
-
visible.map((icon) => /* @__PURE__ */ jsx7(
|
|
1055
|
-
|
|
1040
|
+
visible.map((icon) => /* @__PURE__ */ jsx7(
|
|
1041
|
+
Box,
|
|
1056
1042
|
{
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1043
|
+
style: [
|
|
1044
|
+
iconRing(size),
|
|
1045
|
+
{ backgroundColor: theme.background.secondary }
|
|
1046
|
+
],
|
|
1047
|
+
children: /* @__PURE__ */ jsx7(
|
|
1048
|
+
FunIcon,
|
|
1049
|
+
{
|
|
1050
|
+
uri: toIconUri2(icon),
|
|
1051
|
+
size,
|
|
1052
|
+
fallbackUri: FALLBACK_ASSET_LOGO
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
},
|
|
1056
|
+
icon
|
|
1057
|
+
)),
|
|
1062
1058
|
overflow > 0 ? (
|
|
1063
1059
|
// Both chips are a fixed `size`×`size` circle (Figma). The "+" glyph sits
|
|
1064
1060
|
// on `bgSecondary` (Add money `crypto2`); the "+N" count on `pillPressed`
|
|
@@ -1066,19 +1062,31 @@ function SourceTokenCluster({
|
|
|
1066
1062
|
/* @__PURE__ */ jsx7(
|
|
1067
1063
|
Box,
|
|
1068
1064
|
{
|
|
1069
|
-
backgroundColor: overflowMode === "plus" ? "bgSecondary" : "pillPressed",
|
|
1070
1065
|
alignItems: "center",
|
|
1071
1066
|
justifyContent: "center",
|
|
1072
|
-
style:
|
|
1067
|
+
style: [
|
|
1068
|
+
overflowCircle(size),
|
|
1069
|
+
{
|
|
1070
|
+
backgroundColor: overflowMode === "plus" ? theme.background.secondary : theme.background.pill.pressed
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
1073
|
children: overflowMode === "plus" ? (
|
|
1074
1074
|
// The geometric "+" glyph centers cleanly; the text "+" did not.
|
|
1075
|
-
/* @__PURE__ */ jsx7(
|
|
1075
|
+
/* @__PURE__ */ jsx7(
|
|
1076
|
+
FigmaPlusIcon,
|
|
1077
|
+
{
|
|
1078
|
+
size,
|
|
1079
|
+
color: theme.content.elements.secondary
|
|
1080
|
+
}
|
|
1081
|
+
)
|
|
1076
1082
|
) : /* @__PURE__ */ jsx7(
|
|
1077
1083
|
Text,
|
|
1078
1084
|
{
|
|
1079
1085
|
variant: "bodyMedium",
|
|
1080
|
-
|
|
1081
|
-
|
|
1086
|
+
style: [
|
|
1087
|
+
overflowText(size),
|
|
1088
|
+
{ color: theme.content.elements.secondary }
|
|
1089
|
+
],
|
|
1082
1090
|
children: `+${overflow}`
|
|
1083
1091
|
}
|
|
1084
1092
|
)
|
|
@@ -1117,6 +1125,7 @@ function TokenChainIcon({
|
|
|
1117
1125
|
chainKey,
|
|
1118
1126
|
size = 24
|
|
1119
1127
|
}) {
|
|
1128
|
+
const theme = useTheme();
|
|
1120
1129
|
const badge = Math.round(size * 0.5);
|
|
1121
1130
|
return /* @__PURE__ */ jsxs3(Box, { width: size, height: size, children: [
|
|
1122
1131
|
/* @__PURE__ */ jsx8(
|
|
@@ -1130,11 +1139,13 @@ function TokenChainIcon({
|
|
|
1130
1139
|
chainKey ? /* @__PURE__ */ jsx8(
|
|
1131
1140
|
Box,
|
|
1132
1141
|
{
|
|
1133
|
-
backgroundColor: "bgModal",
|
|
1134
1142
|
borderRadius: "rounded",
|
|
1135
1143
|
alignItems: "center",
|
|
1136
1144
|
justifyContent: "center",
|
|
1137
|
-
style:
|
|
1145
|
+
style: [
|
|
1146
|
+
badgeRing(badge),
|
|
1147
|
+
{ backgroundColor: theme.background.modal }
|
|
1148
|
+
],
|
|
1138
1149
|
children: /* @__PURE__ */ jsx8(
|
|
1139
1150
|
FunIcon,
|
|
1140
1151
|
{
|
|
@@ -1165,7 +1176,35 @@ import Reanimated, {
|
|
|
1165
1176
|
useSharedValue,
|
|
1166
1177
|
withTiming
|
|
1167
1178
|
} from "react-native-reanimated";
|
|
1168
|
-
|
|
1179
|
+
|
|
1180
|
+
// src/icons/StatusIcon.tsx
|
|
1181
|
+
import { StyleSheet as StyleSheet2 } from "react-native";
|
|
1182
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1183
|
+
function StatusIcon() {
|
|
1184
|
+
const theme = useTheme();
|
|
1185
|
+
return /* @__PURE__ */ jsx9(
|
|
1186
|
+
Box,
|
|
1187
|
+
{
|
|
1188
|
+
borderRadius: "rounded",
|
|
1189
|
+
alignItems: "center",
|
|
1190
|
+
justifyContent: "center",
|
|
1191
|
+
style: [styles2.circle, { backgroundColor: theme.background.secondary }],
|
|
1192
|
+
children: /* @__PURE__ */ jsx9(
|
|
1193
|
+
FigmaAlertCircleIcon,
|
|
1194
|
+
{
|
|
1195
|
+
size: 20,
|
|
1196
|
+
color: theme.content.button.icon.default
|
|
1197
|
+
}
|
|
1198
|
+
)
|
|
1199
|
+
}
|
|
1200
|
+
);
|
|
1201
|
+
}
|
|
1202
|
+
var styles2 = StyleSheet2.create({
|
|
1203
|
+
circle: { width: 48, height: 48 }
|
|
1204
|
+
});
|
|
1205
|
+
|
|
1206
|
+
// src/screens/SelectMethodScreen.tsx
|
|
1207
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1169
1208
|
var DROPDOWN_OPEN_DURATION = 250;
|
|
1170
1209
|
var DROPDOWN_CLOSE_DURATION = 150;
|
|
1171
1210
|
var DROPDOWN_EASING = Easing2.bezier(0.22, 1, 0.36, 1);
|
|
@@ -1229,6 +1268,7 @@ function SelectMethodScreen({
|
|
|
1229
1268
|
payWithLabel = "Pay with",
|
|
1230
1269
|
initialDropdownOpen = false
|
|
1231
1270
|
}) {
|
|
1271
|
+
const theme = useTheme();
|
|
1232
1272
|
const selected = receiveTokens?.find((t) => t.id === selectedReceiveTokenId);
|
|
1233
1273
|
const showDropdown = receiveTokens && receiveTokens.length > 0 && selected;
|
|
1234
1274
|
const [dropdownOpen, setDropdownOpen] = useState4(initialDropdownOpen);
|
|
@@ -1236,15 +1276,30 @@ function SelectMethodScreen({
|
|
|
1236
1276
|
return /* @__PURE__ */ jsxs4(
|
|
1237
1277
|
Box,
|
|
1238
1278
|
{
|
|
1239
|
-
backgroundColor: "bgModal",
|
|
1240
1279
|
borderTopLeftRadius: "modal",
|
|
1241
1280
|
borderTopRightRadius: "modal",
|
|
1281
|
+
style: { backgroundColor: theme.background.modal },
|
|
1242
1282
|
children: [
|
|
1243
1283
|
/* @__PURE__ */ jsxs4(Box, { alignItems: "center", style: topBar, children: [
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
-
|
|
1284
|
+
/* @__PURE__ */ jsx10(
|
|
1285
|
+
Box,
|
|
1286
|
+
{
|
|
1287
|
+
style: [
|
|
1288
|
+
grabber,
|
|
1289
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
1290
|
+
]
|
|
1291
|
+
}
|
|
1292
|
+
),
|
|
1293
|
+
/* @__PURE__ */ jsx10(
|
|
1294
|
+
Text,
|
|
1295
|
+
{
|
|
1296
|
+
variant: "bodyMedium",
|
|
1297
|
+
style: { color: theme.content.elements.primary },
|
|
1298
|
+
children: title
|
|
1299
|
+
}
|
|
1300
|
+
)
|
|
1246
1301
|
] }),
|
|
1247
|
-
error ? /* @__PURE__ */
|
|
1302
|
+
error ? /* @__PURE__ */ jsx10(
|
|
1248
1303
|
SelectMethodError,
|
|
1249
1304
|
{
|
|
1250
1305
|
title: errorTitle,
|
|
@@ -1252,7 +1307,7 @@ function SelectMethodScreen({
|
|
|
1252
1307
|
retryLabel,
|
|
1253
1308
|
onRetry
|
|
1254
1309
|
}
|
|
1255
|
-
) : loading ? /* @__PURE__ */
|
|
1310
|
+
) : loading ? /* @__PURE__ */ jsx10(
|
|
1256
1311
|
SelectMethodLoading,
|
|
1257
1312
|
{
|
|
1258
1313
|
count: skeletonCount,
|
|
@@ -1262,8 +1317,16 @@ function SelectMethodScreen({
|
|
|
1262
1317
|
}
|
|
1263
1318
|
) : /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1264
1319
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: depositSection, children: [
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
|
|
1320
|
+
/* @__PURE__ */ jsx10(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx10(
|
|
1321
|
+
Text,
|
|
1322
|
+
{
|
|
1323
|
+
variant: "detail",
|
|
1324
|
+
weight: "medium",
|
|
1325
|
+
style: { color: theme.content.elements.secondary },
|
|
1326
|
+
children: depositToLabel
|
|
1327
|
+
}
|
|
1328
|
+
) }),
|
|
1329
|
+
/* @__PURE__ */ jsx10(
|
|
1267
1330
|
ReceiveTokenDropdown,
|
|
1268
1331
|
{
|
|
1269
1332
|
tokens: receiveTokens,
|
|
@@ -1281,24 +1344,36 @@ function SelectMethodScreen({
|
|
|
1281
1344
|
// "Pay with" section: a labeled, bordered card wrapping the method
|
|
1282
1345
|
// rows with hairline dividers between them (Figma node 11202:8282).
|
|
1283
1346
|
/* @__PURE__ */ jsxs4(Box, { style: payWithSection, children: [
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
|
|
1347
|
+
/* @__PURE__ */ jsx10(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx10(
|
|
1348
|
+
Text,
|
|
1349
|
+
{
|
|
1350
|
+
variant: "detail",
|
|
1351
|
+
weight: "medium",
|
|
1352
|
+
style: { color: theme.content.elements.secondary },
|
|
1353
|
+
children: payWithLabel
|
|
1354
|
+
}
|
|
1355
|
+
) }),
|
|
1356
|
+
/* @__PURE__ */ jsx10(
|
|
1286
1357
|
Box,
|
|
1287
1358
|
{
|
|
1288
|
-
backgroundColor: "bgModal",
|
|
1289
|
-
borderColor: "borderDefault",
|
|
1290
1359
|
borderWidth: 1,
|
|
1291
1360
|
borderRadius: "element",
|
|
1292
|
-
style:
|
|
1361
|
+
style: [
|
|
1362
|
+
methodsCard,
|
|
1363
|
+
{
|
|
1364
|
+
backgroundColor: theme.background.modal,
|
|
1365
|
+
borderColor: theme.border.elements.default.color
|
|
1366
|
+
}
|
|
1367
|
+
],
|
|
1293
1368
|
children: methods.map((method, i) => /* @__PURE__ */ jsxs4(Box, { children: [
|
|
1294
|
-
i > 0 ? /* @__PURE__ */
|
|
1295
|
-
/* @__PURE__ */
|
|
1369
|
+
i > 0 ? /* @__PURE__ */ jsx10(MethodDivider, {}) : null,
|
|
1370
|
+
/* @__PURE__ */ jsx10(
|
|
1296
1371
|
Pressable,
|
|
1297
1372
|
{
|
|
1298
1373
|
onPress: () => onSelectMethod(method.id),
|
|
1299
1374
|
accessibilityRole: "button",
|
|
1300
1375
|
accessibilityLabel: method.title,
|
|
1301
|
-
children: /* @__PURE__ */
|
|
1376
|
+
children: /* @__PURE__ */ jsx10(PaymentMethodRow, { method })
|
|
1302
1377
|
}
|
|
1303
1378
|
)
|
|
1304
1379
|
] }, method.id))
|
|
@@ -1308,20 +1383,20 @@ function SelectMethodScreen({
|
|
|
1308
1383
|
) : (
|
|
1309
1384
|
// Methods-only: bare rows with full-width hairline dividers, no
|
|
1310
1385
|
// outer border (Figma node 11202:8632).
|
|
1311
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ jsx10(
|
|
1312
1387
|
ScrollView,
|
|
1313
1388
|
{
|
|
1314
1389
|
contentContainerStyle: listContent,
|
|
1315
1390
|
showsVerticalScrollIndicator: false,
|
|
1316
1391
|
children: methods.map((method, i) => /* @__PURE__ */ jsxs4(Box, { children: [
|
|
1317
|
-
i > 0 ? /* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1392
|
+
i > 0 ? /* @__PURE__ */ jsx10(MethodDivider, {}) : null,
|
|
1393
|
+
/* @__PURE__ */ jsx10(
|
|
1319
1394
|
Pressable,
|
|
1320
1395
|
{
|
|
1321
1396
|
onPress: () => onSelectMethod(method.id),
|
|
1322
1397
|
accessibilityRole: "button",
|
|
1323
1398
|
accessibilityLabel: method.title,
|
|
1324
|
-
children: /* @__PURE__ */
|
|
1399
|
+
children: /* @__PURE__ */ jsx10(PaymentMethodRow, { method })
|
|
1325
1400
|
}
|
|
1326
1401
|
)
|
|
1327
1402
|
] }, method.id))
|
|
@@ -1329,7 +1404,7 @@ function SelectMethodScreen({
|
|
|
1329
1404
|
)
|
|
1330
1405
|
)
|
|
1331
1406
|
] }),
|
|
1332
|
-
scrimVisible ? /* @__PURE__ */
|
|
1407
|
+
scrimVisible ? /* @__PURE__ */ jsx10(
|
|
1333
1408
|
AnimatedPressable,
|
|
1334
1409
|
{
|
|
1335
1410
|
entering: scrimEnter,
|
|
@@ -1350,26 +1425,54 @@ function SelectMethodError({
|
|
|
1350
1425
|
retryLabel,
|
|
1351
1426
|
onRetry
|
|
1352
1427
|
}) {
|
|
1428
|
+
const theme = useTheme();
|
|
1353
1429
|
return /* @__PURE__ */ jsxs4(Box, { alignItems: "center", justifyContent: "center", style: errorContainer, children: [
|
|
1430
|
+
/* @__PURE__ */ jsx10(StatusIcon, {}),
|
|
1354
1431
|
/* @__PURE__ */ jsxs4(Box, { alignItems: "center", style: errorText, children: [
|
|
1355
|
-
/* @__PURE__ */
|
|
1356
|
-
|
|
1432
|
+
/* @__PURE__ */ jsx10(
|
|
1433
|
+
Text,
|
|
1434
|
+
{
|
|
1435
|
+
variant: "bodyMedium",
|
|
1436
|
+
style: { color: theme.content.elements.primary },
|
|
1437
|
+
children: title
|
|
1438
|
+
}
|
|
1439
|
+
),
|
|
1440
|
+
/* @__PURE__ */ jsx10(
|
|
1441
|
+
Text,
|
|
1442
|
+
{
|
|
1443
|
+
variant: "detail",
|
|
1444
|
+
style: [
|
|
1445
|
+
errorMessageText,
|
|
1446
|
+
{ color: theme.content.elements.secondary }
|
|
1447
|
+
],
|
|
1448
|
+
children: message
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1357
1451
|
] }),
|
|
1358
|
-
onRetry ? /* @__PURE__ */
|
|
1452
|
+
onRetry ? /* @__PURE__ */ jsx10(
|
|
1359
1453
|
Pressable,
|
|
1360
1454
|
{
|
|
1361
1455
|
onPress: onRetry,
|
|
1362
1456
|
accessibilityRole: "button",
|
|
1363
1457
|
accessibilityLabel: retryLabel,
|
|
1364
|
-
children: /* @__PURE__ */
|
|
1458
|
+
children: /* @__PURE__ */ jsx10(
|
|
1365
1459
|
Box,
|
|
1366
1460
|
{
|
|
1367
|
-
|
|
1368
|
-
borderRadius: "rounded",
|
|
1461
|
+
borderRadius: "button",
|
|
1369
1462
|
alignItems: "center",
|
|
1370
1463
|
justifyContent: "center",
|
|
1371
|
-
style:
|
|
1372
|
-
|
|
1464
|
+
style: [
|
|
1465
|
+
retryButton,
|
|
1466
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
1467
|
+
],
|
|
1468
|
+
children: /* @__PURE__ */ jsx10(
|
|
1469
|
+
Text,
|
|
1470
|
+
{
|
|
1471
|
+
variant: "bodyMedium",
|
|
1472
|
+
style: { color: theme.content.button.primary.default },
|
|
1473
|
+
children: retryLabel
|
|
1474
|
+
}
|
|
1475
|
+
)
|
|
1373
1476
|
}
|
|
1374
1477
|
)
|
|
1375
1478
|
}
|
|
@@ -1377,6 +1480,7 @@ function SelectMethodError({
|
|
|
1377
1480
|
] });
|
|
1378
1481
|
}
|
|
1379
1482
|
function PaymentMethodRow({ method }) {
|
|
1483
|
+
const theme = useTheme();
|
|
1380
1484
|
return /* @__PURE__ */ jsxs4(
|
|
1381
1485
|
Box,
|
|
1382
1486
|
{
|
|
@@ -1385,21 +1489,35 @@ function PaymentMethodRow({ method }) {
|
|
|
1385
1489
|
gap: "elementsHorizontal",
|
|
1386
1490
|
style: row,
|
|
1387
1491
|
children: [
|
|
1388
|
-
/* @__PURE__ */
|
|
1492
|
+
/* @__PURE__ */ jsx10(
|
|
1389
1493
|
Box,
|
|
1390
1494
|
{
|
|
1391
1495
|
width: 48,
|
|
1392
1496
|
height: 48,
|
|
1393
1497
|
borderRadius: "rounded",
|
|
1394
|
-
backgroundColor: "bgSecondary",
|
|
1395
1498
|
alignItems: "center",
|
|
1396
1499
|
justifyContent: "center",
|
|
1500
|
+
style: { backgroundColor: theme.background.secondary },
|
|
1397
1501
|
children: method.icon
|
|
1398
1502
|
}
|
|
1399
1503
|
),
|
|
1400
1504
|
/* @__PURE__ */ jsxs4(Box, { flex: 1, style: details, children: [
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
|
|
1505
|
+
/* @__PURE__ */ jsx10(
|
|
1506
|
+
Text,
|
|
1507
|
+
{
|
|
1508
|
+
variant: "bodyMedium",
|
|
1509
|
+
style: { color: theme.content.elements.primary },
|
|
1510
|
+
children: method.title
|
|
1511
|
+
}
|
|
1512
|
+
),
|
|
1513
|
+
method.subtitle ? /* @__PURE__ */ jsx10(
|
|
1514
|
+
Text,
|
|
1515
|
+
{
|
|
1516
|
+
variant: "detail",
|
|
1517
|
+
style: { color: theme.content.elements.secondary },
|
|
1518
|
+
children: method.subtitle
|
|
1519
|
+
}
|
|
1520
|
+
) : null
|
|
1403
1521
|
] }),
|
|
1404
1522
|
method.trailing
|
|
1405
1523
|
]
|
|
@@ -1407,7 +1525,16 @@ function PaymentMethodRow({ method }) {
|
|
|
1407
1525
|
);
|
|
1408
1526
|
}
|
|
1409
1527
|
function MethodDivider() {
|
|
1410
|
-
|
|
1528
|
+
const theme = useTheme();
|
|
1529
|
+
return /* @__PURE__ */ jsx10(
|
|
1530
|
+
Box,
|
|
1531
|
+
{
|
|
1532
|
+
style: [
|
|
1533
|
+
divider,
|
|
1534
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
1535
|
+
]
|
|
1536
|
+
}
|
|
1537
|
+
);
|
|
1411
1538
|
}
|
|
1412
1539
|
function ReceiveTokenDropdown({
|
|
1413
1540
|
tokens,
|
|
@@ -1416,9 +1543,10 @@ function ReceiveTokenDropdown({
|
|
|
1416
1543
|
onToggle,
|
|
1417
1544
|
onSelect
|
|
1418
1545
|
}) {
|
|
1546
|
+
const theme = useTheme();
|
|
1419
1547
|
const selectable = tokens.length > 1;
|
|
1420
1548
|
return /* @__PURE__ */ jsxs4(Box, { style: dropdownAnchor, children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsx10(
|
|
1422
1550
|
Pressable,
|
|
1423
1551
|
{
|
|
1424
1552
|
onPress: selectable ? onToggle : void 0,
|
|
@@ -1430,44 +1558,46 @@ function ReceiveTokenDropdown({
|
|
|
1430
1558
|
flexDirection: "row",
|
|
1431
1559
|
alignItems: "center",
|
|
1432
1560
|
justifyContent: "space-between",
|
|
1433
|
-
backgroundColor: "bgModal",
|
|
1434
|
-
borderColor: "borderDefault",
|
|
1435
1561
|
borderWidth: 1,
|
|
1436
1562
|
borderRadius: "element",
|
|
1437
|
-
style:
|
|
1563
|
+
style: [
|
|
1564
|
+
dropdownTrigger,
|
|
1565
|
+
{
|
|
1566
|
+
backgroundColor: theme.background.modal,
|
|
1567
|
+
borderColor: theme.border.elements.default.color
|
|
1568
|
+
}
|
|
1569
|
+
],
|
|
1438
1570
|
children: [
|
|
1439
1571
|
/* @__PURE__ */ jsxs4(Box, { flexDirection: "row", alignItems: "center", style: triggerLeft, children: [
|
|
1440
|
-
selected.icon ?? /* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1572
|
+
selected.icon ?? /* @__PURE__ */ jsx10(ReceiveTokenIconFallback, {}),
|
|
1573
|
+
/* @__PURE__ */ jsx10(
|
|
1442
1574
|
Text,
|
|
1443
1575
|
{
|
|
1444
1576
|
variant: "bodyMedium",
|
|
1445
|
-
color: "textPrimary",
|
|
1446
1577
|
numberOfLines: 1,
|
|
1447
|
-
style: triggerLabel,
|
|
1578
|
+
style: [triggerLabel, { color: theme.content.elements.primary }],
|
|
1448
1579
|
children: selected.label
|
|
1449
1580
|
}
|
|
1450
1581
|
)
|
|
1451
1582
|
] }),
|
|
1452
|
-
selectable ? /* @__PURE__ */
|
|
1583
|
+
selectable ? /* @__PURE__ */ jsx10(AnimatedChevron, { open }) : null
|
|
1453
1584
|
]
|
|
1454
1585
|
}
|
|
1455
1586
|
)
|
|
1456
1587
|
}
|
|
1457
1588
|
),
|
|
1458
|
-
open && selectable ? /* @__PURE__ */
|
|
1589
|
+
open && selectable ? /* @__PURE__ */ jsx10(
|
|
1459
1590
|
Reanimated.View,
|
|
1460
1591
|
{
|
|
1461
1592
|
entering: menuEnter,
|
|
1462
1593
|
exiting: menuExit,
|
|
1463
1594
|
style: dropdownMenuOverlay,
|
|
1464
|
-
children: /* @__PURE__ */
|
|
1595
|
+
children: /* @__PURE__ */ jsx10(
|
|
1465
1596
|
Box,
|
|
1466
1597
|
{
|
|
1467
|
-
backgroundColor: "bgModal",
|
|
1468
1598
|
borderRadius: "element",
|
|
1469
|
-
style: dropdownMenu,
|
|
1470
|
-
children: tokens.map((token) => /* @__PURE__ */
|
|
1599
|
+
style: [dropdownMenu, { backgroundColor: theme.background.modal }],
|
|
1600
|
+
children: tokens.map((token) => /* @__PURE__ */ jsx10(
|
|
1471
1601
|
Pressable,
|
|
1472
1602
|
{
|
|
1473
1603
|
onPress: () => onSelect(token.id),
|
|
@@ -1488,12 +1618,19 @@ function ReceiveTokenDropdown({
|
|
|
1488
1618
|
alignItems: "center",
|
|
1489
1619
|
style: triggerLeft,
|
|
1490
1620
|
children: [
|
|
1491
|
-
token.icon ?? /* @__PURE__ */
|
|
1492
|
-
/* @__PURE__ */
|
|
1621
|
+
token.icon ?? /* @__PURE__ */ jsx10(ReceiveTokenIconFallback, {}),
|
|
1622
|
+
/* @__PURE__ */ jsx10(
|
|
1623
|
+
Text,
|
|
1624
|
+
{
|
|
1625
|
+
variant: "bodyMedium",
|
|
1626
|
+
style: { color: theme.content.elements.primary },
|
|
1627
|
+
children: token.label
|
|
1628
|
+
}
|
|
1629
|
+
)
|
|
1493
1630
|
]
|
|
1494
1631
|
}
|
|
1495
1632
|
),
|
|
1496
|
-
token.id === selected.id ? /* @__PURE__ */
|
|
1633
|
+
token.id === selected.id ? /* @__PURE__ */ jsx10(CheckIcon, {}) : null
|
|
1497
1634
|
]
|
|
1498
1635
|
}
|
|
1499
1636
|
)
|
|
@@ -1507,18 +1644,19 @@ function ReceiveTokenDropdown({
|
|
|
1507
1644
|
] });
|
|
1508
1645
|
}
|
|
1509
1646
|
function ReceiveTokenIconFallback() {
|
|
1510
|
-
|
|
1647
|
+
const theme = useTheme();
|
|
1648
|
+
return /* @__PURE__ */ jsx10(
|
|
1511
1649
|
Box,
|
|
1512
1650
|
{
|
|
1513
1651
|
width: 24,
|
|
1514
1652
|
height: 24,
|
|
1515
1653
|
borderRadius: "rounded",
|
|
1516
|
-
backgroundColor:
|
|
1654
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1517
1655
|
}
|
|
1518
1656
|
);
|
|
1519
1657
|
}
|
|
1520
1658
|
function ChevronDownIcon() {
|
|
1521
|
-
return /* @__PURE__ */
|
|
1659
|
+
return /* @__PURE__ */ jsx10(FigmaChevronDownIcon, { size: 16 });
|
|
1522
1660
|
}
|
|
1523
1661
|
function AnimatedChevron({ open }) {
|
|
1524
1662
|
const rotation = useSharedValue(open ? 1 : 0);
|
|
@@ -1531,10 +1669,10 @@ function AnimatedChevron({ open }) {
|
|
|
1531
1669
|
const style = useAnimatedStyle(() => ({
|
|
1532
1670
|
transform: [{ rotate: `${rotation.value * 180}deg` }]
|
|
1533
1671
|
}));
|
|
1534
|
-
return /* @__PURE__ */
|
|
1672
|
+
return /* @__PURE__ */ jsx10(Reanimated.View, { style, children: /* @__PURE__ */ jsx10(FigmaChevronDownIcon, { size: 16 }) });
|
|
1535
1673
|
}
|
|
1536
1674
|
function CheckIcon() {
|
|
1537
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ jsx10(FigmaCheckIcon, { size: 16 });
|
|
1538
1676
|
}
|
|
1539
1677
|
function SelectMethodLoading({
|
|
1540
1678
|
count,
|
|
@@ -1542,71 +1680,103 @@ function SelectMethodLoading({
|
|
|
1542
1680
|
depositToLabel,
|
|
1543
1681
|
payWithLabel
|
|
1544
1682
|
}) {
|
|
1683
|
+
const theme = useTheme();
|
|
1545
1684
|
const opacity = usePulse();
|
|
1546
1685
|
const rowCount = count ?? (showDropdown ? 5 : 6);
|
|
1547
1686
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1548
1687
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: depositSection, children: [
|
|
1549
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ jsx10(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx10(
|
|
1689
|
+
Text,
|
|
1690
|
+
{
|
|
1691
|
+
variant: "detail",
|
|
1692
|
+
style: { color: theme.content.elements.secondary },
|
|
1693
|
+
children: depositToLabel
|
|
1694
|
+
}
|
|
1695
|
+
) }),
|
|
1550
1696
|
/* @__PURE__ */ jsxs4(
|
|
1551
1697
|
Box,
|
|
1552
1698
|
{
|
|
1553
1699
|
flexDirection: "row",
|
|
1554
1700
|
alignItems: "center",
|
|
1555
1701
|
justifyContent: "space-between",
|
|
1556
|
-
backgroundColor: "bgModal",
|
|
1557
|
-
borderColor: "borderDefault",
|
|
1558
1702
|
borderWidth: 1,
|
|
1559
1703
|
borderRadius: "element",
|
|
1560
|
-
style:
|
|
1704
|
+
style: [
|
|
1705
|
+
dropdownTrigger,
|
|
1706
|
+
{
|
|
1707
|
+
backgroundColor: theme.background.modal,
|
|
1708
|
+
borderColor: theme.border.elements.default.color
|
|
1709
|
+
}
|
|
1710
|
+
],
|
|
1561
1711
|
children: [
|
|
1562
1712
|
/* @__PURE__ */ jsxs4(Animated2.View, { style: [loadingSelectorLeft, { opacity }], children: [
|
|
1563
|
-
/* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ jsx10(
|
|
1564
1714
|
Box,
|
|
1565
1715
|
{
|
|
1566
1716
|
width: 20,
|
|
1567
1717
|
height: 20,
|
|
1568
1718
|
borderRadius: "rounded",
|
|
1569
|
-
backgroundColor:
|
|
1719
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1570
1720
|
}
|
|
1571
1721
|
),
|
|
1572
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ jsx10(
|
|
1723
|
+
Box,
|
|
1724
|
+
{
|
|
1725
|
+
style: [
|
|
1726
|
+
skeletonTitleBar,
|
|
1727
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1728
|
+
]
|
|
1729
|
+
}
|
|
1730
|
+
)
|
|
1573
1731
|
] }),
|
|
1574
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsx10(ChevronDownIcon, {})
|
|
1575
1733
|
]
|
|
1576
1734
|
}
|
|
1577
1735
|
)
|
|
1578
1736
|
] }) : null,
|
|
1579
1737
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: payWithSection, children: [
|
|
1580
|
-
/* @__PURE__ */
|
|
1581
|
-
|
|
1738
|
+
/* @__PURE__ */ jsx10(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx10(
|
|
1739
|
+
Text,
|
|
1740
|
+
{
|
|
1741
|
+
variant: "detail",
|
|
1742
|
+
style: { color: theme.content.elements.secondary },
|
|
1743
|
+
children: payWithLabel
|
|
1744
|
+
}
|
|
1745
|
+
) }),
|
|
1746
|
+
/* @__PURE__ */ jsx10(
|
|
1582
1747
|
Box,
|
|
1583
1748
|
{
|
|
1584
|
-
backgroundColor: "bgModal",
|
|
1585
|
-
borderColor: "borderDefault",
|
|
1586
1749
|
borderWidth: 1,
|
|
1587
1750
|
borderRadius: "element",
|
|
1588
|
-
style:
|
|
1589
|
-
|
|
1751
|
+
style: [
|
|
1752
|
+
methodsCard,
|
|
1753
|
+
{
|
|
1754
|
+
backgroundColor: theme.background.modal,
|
|
1755
|
+
borderColor: theme.border.elements.default.color
|
|
1756
|
+
}
|
|
1757
|
+
],
|
|
1758
|
+
children: /* @__PURE__ */ jsx10(
|
|
1590
1759
|
Animated2.View,
|
|
1591
1760
|
{
|
|
1592
1761
|
style: { opacity },
|
|
1593
1762
|
accessibilityLabel: "Loading payment methods",
|
|
1594
|
-
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */
|
|
1763
|
+
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */ jsx10(PaymentMethodRowSkeleton, {}, i))
|
|
1595
1764
|
}
|
|
1596
1765
|
)
|
|
1597
1766
|
}
|
|
1598
1767
|
)
|
|
1599
|
-
] }) : /* @__PURE__ */
|
|
1768
|
+
] }) : /* @__PURE__ */ jsx10(Box, { style: skeletonListContent, children: /* @__PURE__ */ jsx10(
|
|
1600
1769
|
Animated2.View,
|
|
1601
1770
|
{
|
|
1602
1771
|
style: { opacity },
|
|
1603
1772
|
accessibilityLabel: "Loading payment methods",
|
|
1604
|
-
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */
|
|
1773
|
+
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */ jsx10(PaymentMethodRowSkeleton, {}, i))
|
|
1605
1774
|
}
|
|
1606
1775
|
) })
|
|
1607
1776
|
] });
|
|
1608
1777
|
}
|
|
1609
1778
|
function PaymentMethodRowSkeleton() {
|
|
1779
|
+
const theme = useTheme();
|
|
1610
1780
|
return /* @__PURE__ */ jsxs4(
|
|
1611
1781
|
Box,
|
|
1612
1782
|
{
|
|
@@ -1615,18 +1785,34 @@ function PaymentMethodRowSkeleton() {
|
|
|
1615
1785
|
gap: "elementsHorizontal",
|
|
1616
1786
|
style: skeletonRow,
|
|
1617
1787
|
children: [
|
|
1618
|
-
/* @__PURE__ */
|
|
1788
|
+
/* @__PURE__ */ jsx10(
|
|
1619
1789
|
Box,
|
|
1620
1790
|
{
|
|
1621
1791
|
width: 48,
|
|
1622
1792
|
height: 48,
|
|
1623
1793
|
borderRadius: "rounded",
|
|
1624
|
-
backgroundColor:
|
|
1794
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1625
1795
|
}
|
|
1626
1796
|
),
|
|
1627
1797
|
/* @__PURE__ */ jsxs4(Box, { flex: 1, style: skeletonDetails, children: [
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
|
|
1798
|
+
/* @__PURE__ */ jsx10(
|
|
1799
|
+
Box,
|
|
1800
|
+
{
|
|
1801
|
+
style: [
|
|
1802
|
+
skeletonTitleBar,
|
|
1803
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1804
|
+
]
|
|
1805
|
+
}
|
|
1806
|
+
),
|
|
1807
|
+
/* @__PURE__ */ jsx10(
|
|
1808
|
+
Box,
|
|
1809
|
+
{
|
|
1810
|
+
style: [
|
|
1811
|
+
skeletonSubtitleBar,
|
|
1812
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1813
|
+
]
|
|
1814
|
+
}
|
|
1815
|
+
)
|
|
1630
1816
|
] })
|
|
1631
1817
|
]
|
|
1632
1818
|
}
|
|
@@ -1742,52 +1928,51 @@ import {
|
|
|
1742
1928
|
ScrollView as ScrollView2,
|
|
1743
1929
|
useWindowDimensions
|
|
1744
1930
|
} from "react-native";
|
|
1745
|
-
import { jsx as
|
|
1931
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1746
1932
|
function AvailableChainsScreen({
|
|
1747
1933
|
networkLabel,
|
|
1748
1934
|
chains,
|
|
1749
1935
|
title = `Available ${networkLabel}`,
|
|
1936
|
+
gotItLabel = "Got it",
|
|
1750
1937
|
loading = false,
|
|
1751
1938
|
skeletonCount = 8,
|
|
1752
1939
|
onClose
|
|
1753
1940
|
}) {
|
|
1754
1941
|
const { height } = useWindowDimensions();
|
|
1942
|
+
const theme = useTheme();
|
|
1755
1943
|
return /* @__PURE__ */ jsxs5(
|
|
1756
1944
|
Box,
|
|
1757
1945
|
{
|
|
1758
|
-
backgroundColor: "bgModal",
|
|
1759
1946
|
borderTopLeftRadius: "modal",
|
|
1760
1947
|
borderTopRightRadius: "modal",
|
|
1761
|
-
style: sheet,
|
|
1948
|
+
style: [sheet, { backgroundColor: theme.background.modal }],
|
|
1762
1949
|
children: [
|
|
1763
1950
|
/* @__PURE__ */ jsxs5(Box, { flexDirection: "row", alignItems: "center", style: topBar2, children: [
|
|
1764
|
-
/* @__PURE__ */
|
|
1765
|
-
|
|
1951
|
+
/* @__PURE__ */ jsx11(Box, { style: topBarSpacer }),
|
|
1952
|
+
/* @__PURE__ */ jsx11(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx11(
|
|
1953
|
+
Text,
|
|
1766
1954
|
{
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
accessibilityLabel: "Close",
|
|
1771
|
-
children: /* @__PURE__ */ jsx10(Box, { alignItems: "center", justifyContent: "center", style: iconButton, children: /* @__PURE__ */ jsx10(FigmaCloseIcon, {}) })
|
|
1955
|
+
variant: "bodyMedium",
|
|
1956
|
+
style: { color: theme.content.elements.primary },
|
|
1957
|
+
children: title
|
|
1772
1958
|
}
|
|
1773
|
-
),
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
/* @__PURE__ */ jsx10(Box, { style: topBarSpacer })
|
|
1959
|
+
) }),
|
|
1960
|
+
/* @__PURE__ */ jsx11(Box, { style: topBarSpacer })
|
|
1776
1961
|
] }),
|
|
1777
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ jsx11(
|
|
1778
1963
|
ScrollView2,
|
|
1779
1964
|
{
|
|
1780
1965
|
style: [list, { maxHeight: height * 0.72 }],
|
|
1781
1966
|
showsVerticalScrollIndicator: false,
|
|
1782
|
-
contentContainerStyle:
|
|
1783
|
-
children: loading ? Array.from({ length: skeletonCount }, (_, index) => /* @__PURE__ */
|
|
1967
|
+
contentContainerStyle: listContent2,
|
|
1968
|
+
children: loading ? Array.from({ length: skeletonCount }, (_, index) => /* @__PURE__ */ jsx11(AvailableChainSkeleton, {}, index)) : chains.map((chain) => /* @__PURE__ */ jsxs5(
|
|
1784
1969
|
Box,
|
|
1785
1970
|
{
|
|
1786
1971
|
flexDirection: "row",
|
|
1787
1972
|
alignItems: "center",
|
|
1788
1973
|
style: row2,
|
|
1789
1974
|
children: [
|
|
1790
|
-
/* @__PURE__ */
|
|
1975
|
+
/* @__PURE__ */ jsx11(Box, { style: iconRing2, children: /* @__PURE__ */ jsx11(
|
|
1791
1976
|
FunIcon,
|
|
1792
1977
|
{
|
|
1793
1978
|
uri: chain.iconUri,
|
|
@@ -1795,35 +1980,104 @@ function AvailableChainsScreen({
|
|
|
1795
1980
|
fallbackUri: FALLBACK_ASSET_LOGO
|
|
1796
1981
|
}
|
|
1797
1982
|
) }),
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
|
|
1983
|
+
/* @__PURE__ */ jsx11(Box, { flex: 1, children: /* @__PURE__ */ jsx11(
|
|
1984
|
+
Text,
|
|
1985
|
+
{
|
|
1986
|
+
variant: "bodyMedium",
|
|
1987
|
+
style: { color: theme.content.elements.primary },
|
|
1988
|
+
children: chain.name
|
|
1989
|
+
}
|
|
1990
|
+
) }),
|
|
1991
|
+
chain.minLabel ? /* @__PURE__ */ jsx11(
|
|
1992
|
+
Text,
|
|
1993
|
+
{
|
|
1994
|
+
variant: "detail",
|
|
1995
|
+
style: { color: theme.content.elements.secondary },
|
|
1996
|
+
children: chain.minLabel
|
|
1997
|
+
}
|
|
1998
|
+
) : null
|
|
1800
1999
|
]
|
|
1801
2000
|
},
|
|
1802
2001
|
chain.id
|
|
1803
2002
|
))
|
|
1804
2003
|
}
|
|
1805
|
-
)
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
2004
|
+
),
|
|
2005
|
+
/* @__PURE__ */ jsx11(Box, { style: buttonContainer, children: /* @__PURE__ */ jsx11(
|
|
2006
|
+
Pressable2,
|
|
2007
|
+
{
|
|
2008
|
+
onPress: onClose,
|
|
2009
|
+
accessibilityRole: "button",
|
|
2010
|
+
accessibilityLabel: gotItLabel,
|
|
2011
|
+
children: /* @__PURE__ */ jsx11(
|
|
2012
|
+
Box,
|
|
2013
|
+
{
|
|
2014
|
+
flexDirection: "row",
|
|
2015
|
+
alignItems: "center",
|
|
2016
|
+
justifyContent: "center",
|
|
2017
|
+
borderRadius: "button",
|
|
2018
|
+
style: [
|
|
2019
|
+
gotItButton,
|
|
2020
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2021
|
+
],
|
|
2022
|
+
children: /* @__PURE__ */ jsx11(
|
|
2023
|
+
Text,
|
|
2024
|
+
{
|
|
2025
|
+
variant: "bodyMedium",
|
|
2026
|
+
style: { color: theme.content.button.primary.default },
|
|
2027
|
+
children: gotItLabel
|
|
2028
|
+
}
|
|
2029
|
+
)
|
|
2030
|
+
}
|
|
2031
|
+
)
|
|
2032
|
+
}
|
|
2033
|
+
) })
|
|
2034
|
+
]
|
|
2035
|
+
}
|
|
2036
|
+
);
|
|
2037
|
+
}
|
|
2038
|
+
function AvailableChainSkeleton() {
|
|
2039
|
+
const theme = useTheme();
|
|
2040
|
+
return /* @__PURE__ */ jsxs5(Box, { flexDirection: "row", alignItems: "center", style: row2, children: [
|
|
2041
|
+
/* @__PURE__ */ jsx11(
|
|
2042
|
+
Box,
|
|
2043
|
+
{
|
|
2044
|
+
style: [
|
|
2045
|
+
skeletonIcon,
|
|
2046
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
),
|
|
2050
|
+
/* @__PURE__ */ jsx11(Box, { flex: 1, children: /* @__PURE__ */ jsx11(
|
|
2051
|
+
Box,
|
|
2052
|
+
{
|
|
2053
|
+
style: [
|
|
2054
|
+
skeletonName,
|
|
2055
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2056
|
+
]
|
|
2057
|
+
}
|
|
2058
|
+
) }),
|
|
2059
|
+
/* @__PURE__ */ jsx11(
|
|
2060
|
+
Box,
|
|
2061
|
+
{
|
|
2062
|
+
style: [
|
|
2063
|
+
skeletonMin,
|
|
2064
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2065
|
+
]
|
|
2066
|
+
}
|
|
2067
|
+
)
|
|
1815
2068
|
] });
|
|
1816
2069
|
}
|
|
1817
|
-
var sheet = { paddingBottom:
|
|
2070
|
+
var sheet = { paddingBottom: 34 };
|
|
1818
2071
|
var topBar2 = {
|
|
1819
|
-
|
|
2072
|
+
paddingBottom: 12,
|
|
1820
2073
|
paddingHorizontal: 24,
|
|
1821
2074
|
gap: 4
|
|
1822
2075
|
};
|
|
1823
|
-
var iconButton = { width: 32, height: 32 };
|
|
1824
2076
|
var topBarSpacer = { width: 32, height: 32 };
|
|
1825
2077
|
var list = { width: "100%" };
|
|
1826
|
-
var
|
|
2078
|
+
var listContent2 = { paddingHorizontal: 20 };
|
|
2079
|
+
var buttonContainer = { paddingHorizontal: 20, paddingTop: 16 };
|
|
2080
|
+
var gotItButton = { height: 56, paddingHorizontal: 24 };
|
|
1827
2081
|
var row2 = { gap: 12, paddingVertical: 10 };
|
|
1828
2082
|
var skeletonIcon = { width: 36, height: 36, borderRadius: 999 };
|
|
1829
2083
|
var skeletonName = { width: 157, height: 16, borderRadius: 4 };
|
|
@@ -1840,48 +2094,86 @@ var iconRing2 = {
|
|
|
1840
2094
|
};
|
|
1841
2095
|
|
|
1842
2096
|
// src/screens/CheckoutBlockedScreen.tsx
|
|
1843
|
-
import { StyleSheet as
|
|
1844
|
-
import { jsx as
|
|
2097
|
+
import { Linking, Pressable as Pressable3, StyleSheet as StyleSheet3 } from "react-native";
|
|
2098
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2099
|
+
var FUN_REGIONAL_RESTRICTIONS_URL = "https://intercom.help/funxyz/en/articles/9827689-regional-restrictions";
|
|
1845
2100
|
function CheckoutBlockedScreen() {
|
|
2101
|
+
const theme = useTheme();
|
|
1846
2102
|
return /* @__PURE__ */ jsxs6(
|
|
1847
2103
|
Box,
|
|
1848
2104
|
{
|
|
1849
|
-
backgroundColor: "bgModal",
|
|
1850
2105
|
borderTopLeftRadius: "modal",
|
|
1851
2106
|
borderTopRightRadius: "modal",
|
|
2107
|
+
style: { backgroundColor: theme.background.modal },
|
|
1852
2108
|
children: [
|
|
1853
|
-
/* @__PURE__ */
|
|
1854
|
-
|
|
1855
|
-
/* @__PURE__ */ jsx11(
|
|
2109
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", style: styles3.topBar, children: [
|
|
2110
|
+
/* @__PURE__ */ jsx12(
|
|
1856
2111
|
Box,
|
|
1857
2112
|
{
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
style: styles2.iconCircle,
|
|
1863
|
-
children: /* @__PURE__ */ jsx11(FigmaInfoCircleIcon, { size: 24 })
|
|
2113
|
+
style: [
|
|
2114
|
+
styles3.grabber,
|
|
2115
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
2116
|
+
]
|
|
1864
2117
|
}
|
|
1865
2118
|
),
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
|
|
1868
|
-
|
|
2119
|
+
/* @__PURE__ */ jsx12(
|
|
2120
|
+
Text,
|
|
2121
|
+
{
|
|
2122
|
+
variant: "bodyMedium",
|
|
2123
|
+
style: { color: theme.content.elements.primary },
|
|
2124
|
+
children: "Add money"
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", justifyContent: "center", style: styles3.content, children: [
|
|
2129
|
+
/* @__PURE__ */ jsx12(StatusIcon, {}),
|
|
2130
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", style: styles3.textGroup, children: [
|
|
2131
|
+
/* @__PURE__ */ jsx12(
|
|
1869
2132
|
Text,
|
|
1870
2133
|
{
|
|
1871
|
-
variant: "
|
|
1872
|
-
color:
|
|
1873
|
-
|
|
1874
|
-
children: "This service is not available in your region."
|
|
2134
|
+
variant: "bodyMedium",
|
|
2135
|
+
style: { color: theme.content.elements.primary },
|
|
2136
|
+
children: "Not available"
|
|
1875
2137
|
}
|
|
1876
|
-
)
|
|
2138
|
+
),
|
|
2139
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", children: [
|
|
2140
|
+
/* @__PURE__ */ jsx12(
|
|
2141
|
+
Text,
|
|
2142
|
+
{
|
|
2143
|
+
variant: "detail",
|
|
2144
|
+
style: [
|
|
2145
|
+
styles3.descriptionText,
|
|
2146
|
+
{ color: theme.content.elements.secondary }
|
|
2147
|
+
],
|
|
2148
|
+
children: "This service is not available in your region."
|
|
2149
|
+
}
|
|
2150
|
+
),
|
|
2151
|
+
/* @__PURE__ */ jsx12(
|
|
2152
|
+
Pressable3,
|
|
2153
|
+
{
|
|
2154
|
+
onPress: () => Linking.openURL(FUN_REGIONAL_RESTRICTIONS_URL),
|
|
2155
|
+
children: /* @__PURE__ */ jsx12(
|
|
2156
|
+
Text,
|
|
2157
|
+
{
|
|
2158
|
+
variant: "detail",
|
|
2159
|
+
style: [
|
|
2160
|
+
styles3.linkText,
|
|
2161
|
+
{ color: theme.content.elements.secondary }
|
|
2162
|
+
],
|
|
2163
|
+
children: "View available regions."
|
|
2164
|
+
}
|
|
2165
|
+
)
|
|
2166
|
+
}
|
|
2167
|
+
)
|
|
2168
|
+
] })
|
|
1877
2169
|
] })
|
|
1878
2170
|
] })
|
|
1879
2171
|
]
|
|
1880
2172
|
}
|
|
1881
2173
|
);
|
|
1882
2174
|
}
|
|
1883
|
-
var
|
|
1884
|
-
topBar: { paddingTop:
|
|
2175
|
+
var styles3 = StyleSheet3.create({
|
|
2176
|
+
topBar: { height: 64, paddingTop: 25, paddingBottom: 12 },
|
|
1885
2177
|
grabber: {
|
|
1886
2178
|
position: "absolute",
|
|
1887
2179
|
top: 8,
|
|
@@ -1890,53 +2182,61 @@ var styles2 = StyleSheet2.create({
|
|
|
1890
2182
|
borderRadius: 999
|
|
1891
2183
|
},
|
|
1892
2184
|
content: {
|
|
1893
|
-
height:
|
|
1894
|
-
gap:
|
|
1895
|
-
paddingHorizontal: 16
|
|
2185
|
+
height: 390,
|
|
2186
|
+
gap: 24,
|
|
2187
|
+
paddingHorizontal: 16,
|
|
2188
|
+
paddingBottom: 34
|
|
1896
2189
|
},
|
|
1897
|
-
iconCircle: { width: 48, height: 48 },
|
|
1898
2190
|
textGroup: { gap: 8 },
|
|
1899
|
-
descriptionText: { textAlign: "center" }
|
|
2191
|
+
descriptionText: { textAlign: "center" },
|
|
2192
|
+
linkText: { textAlign: "center", textDecorationLine: "underline" }
|
|
1900
2193
|
});
|
|
1901
2194
|
|
|
1902
2195
|
// src/screens/QrCodeScreen.tsx
|
|
1903
2196
|
import { useEffect as useEffect5, useRef as useRef2, useState as useState5 } from "react";
|
|
1904
|
-
import {
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
} from "react-native";
|
|
2197
|
+
import { Pressable as Pressable4 } from "react-native";
|
|
2198
|
+
|
|
2199
|
+
// src/hooks/useScreenSize.ts
|
|
2200
|
+
import { useWindowDimensions as useWindowDimensions2 } from "react-native";
|
|
2201
|
+
function useScreenSize() {
|
|
2202
|
+
const { height } = useWindowDimensions2();
|
|
2203
|
+
const isShort = height < 700;
|
|
2204
|
+
return { isShort };
|
|
2205
|
+
}
|
|
1908
2206
|
|
|
1909
2207
|
// src/icons/CopyAddressIcon.tsx
|
|
1910
2208
|
import { SvgXml as SvgXml4 } from "react-native-svg";
|
|
1911
|
-
import { jsx as
|
|
2209
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1912
2210
|
var COPY_ADDRESS_SVG = `<svg viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.2 5.8V4.26C10.2 3.64394 10.2 3.33591 10.0801 3.10061C9.97465 2.89363 9.80637 2.72535 9.59939 2.61989C9.36409 2.5 9.05606 2.5 8.44 2.5H4.26C3.64394 2.5 3.33591 2.5 3.10061 2.61989C2.89363 2.72535 2.72535 2.89363 2.61989 3.10061C2.5 3.33591 2.5 3.64394 2.5 4.26V8.44C2.5 9.05606 2.5 9.36409 2.61989 9.59939C2.72535 9.80637 2.89363 9.97465 3.10061 10.0801C3.33591 10.2 3.64394 10.2 4.26 10.2H5.8M7.56 13.5H11.74C12.3561 13.5 12.6641 13.5 12.8994 13.3801C13.1064 13.2746 13.2746 13.1064 13.3801 12.8994C13.5 12.6641 13.5 12.3561 13.5 11.74V7.56C13.5 6.94394 13.5 6.63591 13.3801 6.40061C13.2746 6.19363 13.1064 6.02535 12.8994 5.91989C12.6641 5.8 12.3561 5.8 11.74 5.8H7.56C6.94394 5.8 6.63591 5.8 6.40061 5.91989C6.19363 6.02535 6.02535 6.19363 5.91989 6.40061C5.8 6.63591 5.8 6.94394 5.8 7.56V11.74C5.8 12.3561 5.8 12.6641 5.91989 12.8994C6.02535 13.1064 6.19363 13.2746 6.40061 13.3801C6.63591 13.5 6.94394 13.5 7.56 13.5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;
|
|
1913
2211
|
function CopyAddressIcon({ size = 16 }) {
|
|
1914
2212
|
const theme = useTheme();
|
|
1915
|
-
return /* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ jsx13(
|
|
1916
2214
|
SvgXml4,
|
|
1917
2215
|
{
|
|
1918
2216
|
xml: COPY_ADDRESS_SVG,
|
|
1919
2217
|
width: size,
|
|
1920
2218
|
height: size,
|
|
1921
|
-
color: theme.
|
|
2219
|
+
color: theme.content.button.secondary.default
|
|
1922
2220
|
}
|
|
1923
2221
|
);
|
|
1924
2222
|
}
|
|
1925
2223
|
|
|
1926
2224
|
// src/screens/QrCodeScreen.tsx
|
|
1927
|
-
import { jsx as
|
|
2225
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1928
2226
|
function QrCodeScreen({
|
|
1929
2227
|
qrCode,
|
|
1930
2228
|
centerIcon,
|
|
1931
2229
|
address,
|
|
1932
2230
|
title = "QR Code",
|
|
2231
|
+
doneLabel = "Done",
|
|
1933
2232
|
copyLabel = "Copy address",
|
|
1934
2233
|
copiedLabel = "Copied!",
|
|
1935
2234
|
copiedFeedbackMs = 1800,
|
|
1936
2235
|
onClose,
|
|
1937
2236
|
onCopyAddress
|
|
1938
2237
|
}) {
|
|
1939
|
-
const {
|
|
2238
|
+
const { isShort } = useScreenSize();
|
|
2239
|
+
const theme = useTheme();
|
|
1940
2240
|
const [copied, setCopied] = useState5(false);
|
|
1941
2241
|
const copyTimer = useRef2(void 0);
|
|
1942
2242
|
useEffect5(() => () => clearTimeout(copyTimer.current), []);
|
|
@@ -1950,106 +2250,152 @@ function QrCodeScreen({
|
|
|
1950
2250
|
return /* @__PURE__ */ jsxs7(
|
|
1951
2251
|
Box,
|
|
1952
2252
|
{
|
|
1953
|
-
backgroundColor: "bgModal",
|
|
1954
2253
|
borderTopLeftRadius: "modal",
|
|
1955
2254
|
borderTopRightRadius: "modal",
|
|
1956
|
-
style: sheet2,
|
|
2255
|
+
style: [sheet2, { backgroundColor: theme.background.modal }],
|
|
1957
2256
|
children: [
|
|
1958
2257
|
/* @__PURE__ */ jsxs7(Box, { flexDirection: "row", alignItems: "center", style: topBar3, children: [
|
|
1959
|
-
/* @__PURE__ */
|
|
1960
|
-
|
|
2258
|
+
/* @__PURE__ */ jsx14(Box, { style: topBarSpacer2 }),
|
|
2259
|
+
/* @__PURE__ */ jsx14(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx14(
|
|
2260
|
+
Text,
|
|
1961
2261
|
{
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
accessibilityLabel: "Close",
|
|
1966
|
-
children: /* @__PURE__ */ jsx13(Text, { color: "textPrimary", style: closeGlyph, children: "\u2715" })
|
|
2262
|
+
variant: "bodyMedium",
|
|
2263
|
+
style: { color: theme.content.elements.primary },
|
|
2264
|
+
children: title
|
|
1967
2265
|
}
|
|
1968
|
-
),
|
|
1969
|
-
/* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */ jsx13(Box, { style: topBarSpacer2 })
|
|
2266
|
+
) }),
|
|
2267
|
+
/* @__PURE__ */ jsx14(Box, { style: topBarSpacer2 })
|
|
1971
2268
|
] }),
|
|
1972
|
-
/* @__PURE__ */ jsxs7(
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2269
|
+
/* @__PURE__ */ jsxs7(Box, { style: { paddingVertical: isShort ? 0 : 16 }, children: [
|
|
2270
|
+
/* @__PURE__ */ jsxs7(
|
|
2271
|
+
Box,
|
|
2272
|
+
{
|
|
2273
|
+
alignItems: "center",
|
|
2274
|
+
justifyContent: "center",
|
|
2275
|
+
style: [content, { paddingVertical: isShort ? 24 : 82 }],
|
|
2276
|
+
children: [
|
|
2277
|
+
/* @__PURE__ */ jsxs7(
|
|
2278
|
+
Box,
|
|
2279
|
+
{
|
|
2280
|
+
borderWidth: 1.5,
|
|
2281
|
+
alignItems: "center",
|
|
2282
|
+
justifyContent: "center",
|
|
2283
|
+
style: [
|
|
2284
|
+
qrFrame,
|
|
2285
|
+
{
|
|
2286
|
+
backgroundColor: theme.background.modal,
|
|
2287
|
+
borderColor: theme.border.elements.default.color
|
|
2288
|
+
}
|
|
2289
|
+
],
|
|
2290
|
+
children: [
|
|
2291
|
+
qrCode,
|
|
2292
|
+
centerIcon ? /* @__PURE__ */ jsx14(
|
|
2293
|
+
Box,
|
|
2294
|
+
{
|
|
2295
|
+
alignItems: "center",
|
|
2296
|
+
justifyContent: "center",
|
|
2297
|
+
style: centerOverlay,
|
|
2298
|
+
children: centerIcon
|
|
2299
|
+
}
|
|
2300
|
+
) : null
|
|
2301
|
+
]
|
|
2302
|
+
}
|
|
2303
|
+
),
|
|
2304
|
+
address ? /* @__PURE__ */ jsxs7(Box, { alignItems: "center", style: addressGroup, children: [
|
|
2305
|
+
/* @__PURE__ */ jsx14(
|
|
2306
|
+
Text,
|
|
2307
|
+
{
|
|
2308
|
+
variant: "body",
|
|
2309
|
+
style: [
|
|
2310
|
+
addressText,
|
|
2311
|
+
{ color: theme.content.elements.secondary }
|
|
2312
|
+
],
|
|
2313
|
+
children: address
|
|
2314
|
+
}
|
|
2315
|
+
),
|
|
2316
|
+
onCopyAddress ? /* @__PURE__ */ jsx14(
|
|
2317
|
+
Pressable4,
|
|
2318
|
+
{
|
|
2319
|
+
onPress: handleCopy,
|
|
2320
|
+
accessibilityRole: "button",
|
|
2321
|
+
accessibilityLabel: copied ? "Address copied" : "Copy address",
|
|
2322
|
+
children: /* @__PURE__ */ jsxs7(
|
|
2323
|
+
Box,
|
|
2324
|
+
{
|
|
2325
|
+
flexDirection: "row",
|
|
2326
|
+
alignItems: "center",
|
|
2327
|
+
justifyContent: "center",
|
|
2328
|
+
borderWidth: 1,
|
|
2329
|
+
borderRadius: "element",
|
|
2330
|
+
style: [
|
|
2331
|
+
copyButton,
|
|
2332
|
+
{
|
|
2333
|
+
backgroundColor: theme.background.button.secondary.default,
|
|
2334
|
+
borderColor: theme.background.button.secondary.default
|
|
2335
|
+
}
|
|
2336
|
+
],
|
|
2337
|
+
children: [
|
|
2338
|
+
/* @__PURE__ */ jsx14(CopyAddressIcon, {}),
|
|
2339
|
+
/* @__PURE__ */ jsx14(
|
|
2340
|
+
Text,
|
|
2341
|
+
{
|
|
2342
|
+
variant: "bodyMedium",
|
|
2343
|
+
style: { color: theme.content.button.secondary.default },
|
|
2344
|
+
children: copied ? copiedLabel : copyLabel
|
|
2345
|
+
}
|
|
2346
|
+
)
|
|
2347
|
+
]
|
|
2348
|
+
}
|
|
2349
|
+
)
|
|
2350
|
+
}
|
|
2351
|
+
) : null
|
|
2352
|
+
] }) : null
|
|
2353
|
+
]
|
|
2354
|
+
}
|
|
2355
|
+
),
|
|
2356
|
+
/* @__PURE__ */ jsx14(Box, { style: buttonContainer2, children: /* @__PURE__ */ jsx14(
|
|
2357
|
+
Pressable4,
|
|
2358
|
+
{
|
|
2359
|
+
onPress: onClose,
|
|
2360
|
+
accessibilityRole: "button",
|
|
2361
|
+
accessibilityLabel: doneLabel,
|
|
2362
|
+
children: /* @__PURE__ */ jsx14(
|
|
1980
2363
|
Box,
|
|
1981
2364
|
{
|
|
1982
|
-
|
|
1983
|
-
borderColor: "borderDefault",
|
|
1984
|
-
borderWidth: 1.5,
|
|
2365
|
+
flexDirection: "row",
|
|
1985
2366
|
alignItems: "center",
|
|
1986
2367
|
justifyContent: "center",
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2368
|
+
borderRadius: "button",
|
|
2369
|
+
style: [
|
|
2370
|
+
doneButton,
|
|
2371
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2372
|
+
],
|
|
2373
|
+
children: /* @__PURE__ */ jsx14(
|
|
2374
|
+
Text,
|
|
2375
|
+
{
|
|
2376
|
+
variant: "bodyMedium",
|
|
2377
|
+
style: { color: theme.content.button.primary.default },
|
|
2378
|
+
children: doneLabel
|
|
2379
|
+
}
|
|
2380
|
+
)
|
|
2000
2381
|
}
|
|
2001
|
-
)
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
Pressable3,
|
|
2006
|
-
{
|
|
2007
|
-
onPress: handleCopy,
|
|
2008
|
-
accessibilityRole: "button",
|
|
2009
|
-
accessibilityLabel: copied ? "Address copied" : "Copy address",
|
|
2010
|
-
children: /* @__PURE__ */ jsxs7(
|
|
2011
|
-
Box,
|
|
2012
|
-
{
|
|
2013
|
-
flexDirection: "row",
|
|
2014
|
-
alignItems: "center",
|
|
2015
|
-
justifyContent: "center",
|
|
2016
|
-
backgroundColor: "btnSecondary",
|
|
2017
|
-
borderColor: "btnSecondary",
|
|
2018
|
-
borderWidth: 1,
|
|
2019
|
-
borderRadius: "element",
|
|
2020
|
-
style: copyButton,
|
|
2021
|
-
children: [
|
|
2022
|
-
/* @__PURE__ */ jsx13(CopyAddressIcon, {}),
|
|
2023
|
-
/* @__PURE__ */ jsx13(Text, { variant: "bodyMedium", color: "onBtnSecondary", children: copied ? copiedLabel : copyLabel })
|
|
2024
|
-
]
|
|
2025
|
-
}
|
|
2026
|
-
)
|
|
2027
|
-
}
|
|
2028
|
-
) : null
|
|
2029
|
-
] }) : null
|
|
2030
|
-
]
|
|
2031
|
-
}
|
|
2032
|
-
)
|
|
2382
|
+
)
|
|
2383
|
+
}
|
|
2384
|
+
) })
|
|
2385
|
+
] })
|
|
2033
2386
|
]
|
|
2034
2387
|
}
|
|
2035
2388
|
);
|
|
2036
2389
|
}
|
|
2037
|
-
var sheet2 = { paddingBottom:
|
|
2390
|
+
var sheet2 = { paddingBottom: 34 };
|
|
2038
2391
|
var topBar3 = {
|
|
2039
|
-
|
|
2392
|
+
paddingBottom: 12,
|
|
2040
2393
|
paddingHorizontal: 24,
|
|
2041
2394
|
gap: 4
|
|
2042
2395
|
};
|
|
2043
|
-
var closeGlyph = {
|
|
2044
|
-
fontSize: 20,
|
|
2045
|
-
lineHeight: 24,
|
|
2046
|
-
width: 32,
|
|
2047
|
-
textAlign: "center"
|
|
2048
|
-
};
|
|
2049
2396
|
var topBarSpacer2 = { width: 32, height: 32 };
|
|
2050
|
-
var
|
|
2397
|
+
var content = {
|
|
2051
2398
|
paddingHorizontal: 20,
|
|
2052
|
-
paddingVertical: 45,
|
|
2053
2399
|
gap: 40
|
|
2054
2400
|
};
|
|
2055
2401
|
var qrFrame = {
|
|
@@ -2079,21 +2425,23 @@ var copyButton = {
|
|
|
2079
2425
|
paddingHorizontal: 20,
|
|
2080
2426
|
gap: 8
|
|
2081
2427
|
};
|
|
2428
|
+
var buttonContainer2 = { paddingHorizontal: 20 };
|
|
2429
|
+
var doneButton = { height: 56, paddingHorizontal: 24 };
|
|
2082
2430
|
|
|
2083
2431
|
// src/screens/TransferCryptoScreen.tsx
|
|
2084
2432
|
import { useEffect as useEffect7, useRef as useRef3, useState as useState7 } from "react";
|
|
2085
|
-
import { Pressable as
|
|
2433
|
+
import { Pressable as Pressable6 } from "react-native";
|
|
2086
2434
|
|
|
2087
2435
|
// src/screens/NetworkSelector.tsx
|
|
2088
2436
|
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
2089
|
-
import { Pressable as
|
|
2437
|
+
import { Pressable as Pressable5 } from "react-native";
|
|
2090
2438
|
import Animated3, {
|
|
2091
2439
|
Easing as Easing3,
|
|
2092
2440
|
FadeIn,
|
|
2093
2441
|
FadeOut,
|
|
2094
2442
|
LinearTransition
|
|
2095
2443
|
} from "react-native-reanimated";
|
|
2096
|
-
import { jsx as
|
|
2444
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2097
2445
|
function toIconUri3(icon) {
|
|
2098
2446
|
return icon.startsWith("http") ? icon : chainIconUri(icon);
|
|
2099
2447
|
}
|
|
@@ -2104,19 +2452,24 @@ function NetworkSelector({
|
|
|
2104
2452
|
}) {
|
|
2105
2453
|
const [animate, setAnimate] = useState6(false);
|
|
2106
2454
|
useEffect6(() => setAnimate(true), []);
|
|
2107
|
-
|
|
2455
|
+
const theme = useTheme();
|
|
2456
|
+
return /* @__PURE__ */ jsx15(
|
|
2108
2457
|
Box,
|
|
2109
2458
|
{
|
|
2110
2459
|
flexDirection: "row",
|
|
2111
2460
|
alignItems: "center",
|
|
2112
|
-
backgroundColor: "bgSecondary",
|
|
2113
|
-
borderColor: "borderDefault",
|
|
2114
2461
|
borderWidth: 1,
|
|
2115
2462
|
borderRadius: "rounded",
|
|
2116
|
-
style:
|
|
2463
|
+
style: [
|
|
2464
|
+
track,
|
|
2465
|
+
{
|
|
2466
|
+
backgroundColor: theme.background.secondary,
|
|
2467
|
+
borderColor: theme.border.elements.default.color
|
|
2468
|
+
}
|
|
2469
|
+
],
|
|
2117
2470
|
children: networks.map((network) => {
|
|
2118
2471
|
const selected = network.id === selectedId;
|
|
2119
|
-
return /* @__PURE__ */
|
|
2472
|
+
return /* @__PURE__ */ jsx15(
|
|
2120
2473
|
AnimatedPressable2,
|
|
2121
2474
|
{
|
|
2122
2475
|
onPress: () => onSelect(network.id),
|
|
@@ -2125,7 +2478,7 @@ function NetworkSelector({
|
|
|
2125
2478
|
accessibilityLabel: network.label,
|
|
2126
2479
|
style: selected ? selectedPress : iconPress,
|
|
2127
2480
|
layout: animate ? segmentLayout : void 0,
|
|
2128
|
-
children: selected ? /* @__PURE__ */
|
|
2481
|
+
children: selected ? /* @__PURE__ */ jsx15(
|
|
2129
2482
|
Animated3.View,
|
|
2130
2483
|
{
|
|
2131
2484
|
entering: animate ? FadeIn.duration(SLIDE_MS) : void 0,
|
|
@@ -2137,19 +2490,30 @@ function NetworkSelector({
|
|
|
2137
2490
|
flexDirection: "row",
|
|
2138
2491
|
alignItems: "center",
|
|
2139
2492
|
justifyContent: "center",
|
|
2140
|
-
backgroundColor: "bgModal",
|
|
2141
|
-
borderColor: "borderDefault",
|
|
2142
2493
|
borderWidth: 1,
|
|
2143
2494
|
borderRadius: "rounded",
|
|
2144
|
-
style:
|
|
2495
|
+
style: [
|
|
2496
|
+
selectedPill,
|
|
2497
|
+
{
|
|
2498
|
+
backgroundColor: theme.background.modal,
|
|
2499
|
+
borderColor: theme.border.elements.default.color
|
|
2500
|
+
}
|
|
2501
|
+
],
|
|
2145
2502
|
children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
-
/* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx15(ChainGlyph, { iconKeys: network.iconKeys }),
|
|
2504
|
+
/* @__PURE__ */ jsx15(
|
|
2505
|
+
Text,
|
|
2506
|
+
{
|
|
2507
|
+
variant: "bodyMedium",
|
|
2508
|
+
style: { color: theme.content.elements.primary },
|
|
2509
|
+
children: network.label
|
|
2510
|
+
}
|
|
2511
|
+
)
|
|
2148
2512
|
]
|
|
2149
2513
|
}
|
|
2150
2514
|
)
|
|
2151
2515
|
}
|
|
2152
|
-
) : /* @__PURE__ */
|
|
2516
|
+
) : /* @__PURE__ */ jsx15(ChainGlyph, { iconKeys: network.iconKeys })
|
|
2153
2517
|
},
|
|
2154
2518
|
network.id
|
|
2155
2519
|
);
|
|
@@ -2157,7 +2521,7 @@ function NetworkSelector({
|
|
|
2157
2521
|
}
|
|
2158
2522
|
);
|
|
2159
2523
|
}
|
|
2160
|
-
var AnimatedPressable2 = Animated3.createAnimatedComponent(
|
|
2524
|
+
var AnimatedPressable2 = Animated3.createAnimatedComponent(Pressable5);
|
|
2161
2525
|
var SLIDE_MS = 250;
|
|
2162
2526
|
var COLLAPSE_MS = 150;
|
|
2163
2527
|
var segmentLayout = LinearTransition.duration(SLIDE_MS).easing(
|
|
@@ -2165,7 +2529,7 @@ var segmentLayout = LinearTransition.duration(SLIDE_MS).easing(
|
|
|
2165
2529
|
);
|
|
2166
2530
|
function ChainGlyph({ iconKeys }) {
|
|
2167
2531
|
if (iconKeys.length <= 1) {
|
|
2168
|
-
return /* @__PURE__ */
|
|
2532
|
+
return /* @__PURE__ */ jsx15(
|
|
2169
2533
|
FunIcon,
|
|
2170
2534
|
{
|
|
2171
2535
|
uri: toIconUri3(iconKeys[0] ?? ""),
|
|
@@ -2174,7 +2538,7 @@ function ChainGlyph({ iconKeys }) {
|
|
|
2174
2538
|
}
|
|
2175
2539
|
);
|
|
2176
2540
|
}
|
|
2177
|
-
return /* @__PURE__ */
|
|
2541
|
+
return /* @__PURE__ */ jsx15(Box, { width: 24, height: 24, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx15(Box, { flexDirection: "row", flexWrap: "wrap", style: miniGrid, children: iconKeys.slice(0, 4).map((key) => /* @__PURE__ */ jsx15(
|
|
2178
2542
|
FunIcon,
|
|
2179
2543
|
{
|
|
2180
2544
|
uri: toIconUri3(key),
|
|
@@ -2201,7 +2565,7 @@ var iconPress = {
|
|
|
2201
2565
|
var miniGrid = { width: 23.5, gap: 1.5 };
|
|
2202
2566
|
|
|
2203
2567
|
// src/screens/TransferCryptoScreen.tsx
|
|
2204
|
-
import { jsx as
|
|
2568
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2205
2569
|
function TransferCryptoScreen({
|
|
2206
2570
|
depositAddress,
|
|
2207
2571
|
networks,
|
|
@@ -2238,35 +2602,42 @@ function TransferCryptoScreen({
|
|
|
2238
2602
|
return /* @__PURE__ */ jsxs9(
|
|
2239
2603
|
Box,
|
|
2240
2604
|
{
|
|
2241
|
-
backgroundColor: "bgModal",
|
|
2242
2605
|
borderTopLeftRadius: "modal",
|
|
2243
2606
|
borderTopRightRadius: "modal",
|
|
2607
|
+
style: { backgroundColor: theme.background.modal },
|
|
2244
2608
|
children: [
|
|
2245
2609
|
/* @__PURE__ */ jsxs9(Box, { flexDirection: "row", alignItems: "center", style: topBar4, children: [
|
|
2246
|
-
/* @__PURE__ */
|
|
2247
|
-
|
|
2610
|
+
/* @__PURE__ */ jsx16(
|
|
2611
|
+
Pressable6,
|
|
2248
2612
|
{
|
|
2249
2613
|
onPress: onBack,
|
|
2250
2614
|
hitSlop: 12,
|
|
2251
2615
|
accessibilityRole: "button",
|
|
2252
2616
|
accessibilityLabel: "Back",
|
|
2253
|
-
children: /* @__PURE__ */
|
|
2617
|
+
children: /* @__PURE__ */ jsx16(Box, { alignItems: "center", justifyContent: "center", style: iconButton, children: /* @__PURE__ */ jsx16(FigmaChevronLeftIcon, {}) })
|
|
2254
2618
|
}
|
|
2255
2619
|
),
|
|
2256
|
-
/* @__PURE__ */
|
|
2257
|
-
|
|
2258
|
-
|
|
2620
|
+
/* @__PURE__ */ jsx16(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx16(
|
|
2621
|
+
Text,
|
|
2622
|
+
{
|
|
2623
|
+
variant: "bodyMedium",
|
|
2624
|
+
style: { color: theme.content.elements.primary },
|
|
2625
|
+
children: title
|
|
2626
|
+
}
|
|
2627
|
+
) }),
|
|
2628
|
+
/* @__PURE__ */ jsx16(
|
|
2629
|
+
Pressable6,
|
|
2259
2630
|
{
|
|
2260
2631
|
onPress: onShowQrCode,
|
|
2261
2632
|
hitSlop: 12,
|
|
2262
2633
|
accessibilityRole: "button",
|
|
2263
2634
|
accessibilityLabel: "Show QR code",
|
|
2264
|
-
children: /* @__PURE__ */
|
|
2635
|
+
children: /* @__PURE__ */ jsx16(Box, { alignItems: "center", justifyContent: "center", style: iconButton, children: /* @__PURE__ */ jsx16(FigmaQrScanIcon, {}) })
|
|
2265
2636
|
}
|
|
2266
2637
|
)
|
|
2267
2638
|
] }),
|
|
2268
|
-
/* @__PURE__ */ jsxs9(Box, { style:
|
|
2269
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ jsxs9(Box, { style: content2, children: [
|
|
2640
|
+
/* @__PURE__ */ jsx16(
|
|
2270
2641
|
NetworkSelector,
|
|
2271
2642
|
{
|
|
2272
2643
|
networks,
|
|
@@ -2281,32 +2652,45 @@ function TransferCryptoScreen({
|
|
|
2281
2652
|
justifyContent: "flex-end",
|
|
2282
2653
|
style: addressRegion,
|
|
2283
2654
|
children: [
|
|
2284
|
-
/* @__PURE__ */
|
|
2655
|
+
/* @__PURE__ */ jsx16(
|
|
2285
2656
|
Box,
|
|
2286
2657
|
{
|
|
2287
2658
|
flex: 1,
|
|
2288
2659
|
alignItems: "center",
|
|
2289
2660
|
justifyContent: "center",
|
|
2290
|
-
backgroundColor: "bgModal",
|
|
2291
|
-
borderColor: "borderDefault",
|
|
2292
2661
|
borderWidth: 1,
|
|
2293
2662
|
borderRadius: "element",
|
|
2294
|
-
style:
|
|
2663
|
+
style: [
|
|
2664
|
+
addressCard,
|
|
2665
|
+
{
|
|
2666
|
+
backgroundColor: theme.background.modal,
|
|
2667
|
+
borderColor: theme.border.elements.default.color
|
|
2668
|
+
}
|
|
2669
|
+
],
|
|
2295
2670
|
children: /* @__PURE__ */ jsxs9(Box, { alignItems: "center", style: addressColumn, children: [
|
|
2296
2671
|
/* @__PURE__ */ jsxs9(Box, { alignItems: "center", style: addressGroup2, children: [
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
|
|
2672
|
+
/* @__PURE__ */ jsx16(
|
|
2673
|
+
Text,
|
|
2674
|
+
{
|
|
2675
|
+
variant: "body",
|
|
2676
|
+
style: { color: theme.content.elements.secondary },
|
|
2677
|
+
children: depositAddressLabel
|
|
2678
|
+
}
|
|
2679
|
+
),
|
|
2680
|
+
/* @__PURE__ */ jsx16(
|
|
2299
2681
|
Text,
|
|
2300
2682
|
{
|
|
2301
2683
|
variant: "bodyMedium",
|
|
2302
|
-
|
|
2303
|
-
|
|
2684
|
+
style: [
|
|
2685
|
+
addressText2,
|
|
2686
|
+
{ color: theme.content.elements.primary }
|
|
2687
|
+
],
|
|
2304
2688
|
children: depositAddress
|
|
2305
2689
|
}
|
|
2306
2690
|
)
|
|
2307
2691
|
] }),
|
|
2308
|
-
showPreview ? /* @__PURE__ */
|
|
2309
|
-
|
|
2692
|
+
showPreview ? /* @__PURE__ */ jsx16(
|
|
2693
|
+
Pressable6,
|
|
2310
2694
|
{
|
|
2311
2695
|
onPress: onShowChains,
|
|
2312
2696
|
accessibilityRole: "button",
|
|
@@ -2316,10 +2700,12 @@ function TransferCryptoScreen({
|
|
|
2316
2700
|
{
|
|
2317
2701
|
flexDirection: "row",
|
|
2318
2702
|
alignItems: "center",
|
|
2319
|
-
|
|
2320
|
-
|
|
2703
|
+
style: [
|
|
2704
|
+
previewPill,
|
|
2705
|
+
{ backgroundColor: theme.background.secondary }
|
|
2706
|
+
],
|
|
2321
2707
|
children: [
|
|
2322
|
-
/* @__PURE__ */
|
|
2708
|
+
/* @__PURE__ */ jsx16(
|
|
2323
2709
|
SourceTokenCluster,
|
|
2324
2710
|
{
|
|
2325
2711
|
icons: supportedTokenIcons,
|
|
@@ -2327,18 +2713,18 @@ function TransferCryptoScreen({
|
|
|
2327
2713
|
gap: 4
|
|
2328
2714
|
}
|
|
2329
2715
|
),
|
|
2330
|
-
/* @__PURE__ */
|
|
2716
|
+
/* @__PURE__ */ jsx16(
|
|
2331
2717
|
FigmaChevronRightIcon,
|
|
2332
2718
|
{
|
|
2333
2719
|
size: 16,
|
|
2334
|
-
color: theme.
|
|
2720
|
+
color: theme.content.elements.secondary
|
|
2335
2721
|
}
|
|
2336
2722
|
)
|
|
2337
2723
|
]
|
|
2338
2724
|
}
|
|
2339
2725
|
)
|
|
2340
2726
|
}
|
|
2341
|
-
) : minimumDepositLabel ? /* @__PURE__ */
|
|
2727
|
+
) : minimumDepositLabel ? /* @__PURE__ */ jsx16(
|
|
2342
2728
|
MinimumDepositPill,
|
|
2343
2729
|
{
|
|
2344
2730
|
label: minimumDepositLabel,
|
|
@@ -2349,21 +2735,21 @@ function TransferCryptoScreen({
|
|
|
2349
2735
|
}
|
|
2350
2736
|
),
|
|
2351
2737
|
/* @__PURE__ */ jsxs9(Box, { flexDirection: "row", style: buttonsRow, children: [
|
|
2352
|
-
/* @__PURE__ */
|
|
2738
|
+
/* @__PURE__ */ jsx16(
|
|
2353
2739
|
PillButton,
|
|
2354
2740
|
{
|
|
2355
2741
|
label: copied ? copiedLabel : copyLabel,
|
|
2356
2742
|
accessibilityLabel: copied ? "Address copied" : "Copy address",
|
|
2357
|
-
icon: /* @__PURE__ */
|
|
2743
|
+
icon: /* @__PURE__ */ jsx16(FigmaCopyIcon, { color: theme.content.button.primary.default }),
|
|
2358
2744
|
onPress: handleCopy
|
|
2359
2745
|
}
|
|
2360
2746
|
),
|
|
2361
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx16(
|
|
2362
2748
|
PillButton,
|
|
2363
2749
|
{
|
|
2364
2750
|
label: shareLabel,
|
|
2365
2751
|
accessibilityLabel: "Share address",
|
|
2366
|
-
icon: /* @__PURE__ */
|
|
2752
|
+
icon: /* @__PURE__ */ jsx16(FigmaShareIcon, { color: theme.content.button.primary.default }),
|
|
2367
2753
|
onPress: onShareAddress
|
|
2368
2754
|
}
|
|
2369
2755
|
)
|
|
@@ -2377,11 +2763,12 @@ function TransferCryptoScreen({
|
|
|
2377
2763
|
);
|
|
2378
2764
|
}
|
|
2379
2765
|
function MinimumDepositPill({
|
|
2380
|
-
label
|
|
2766
|
+
label,
|
|
2381
2767
|
iconKey
|
|
2382
2768
|
}) {
|
|
2383
|
-
|
|
2384
|
-
|
|
2769
|
+
const theme = useTheme();
|
|
2770
|
+
return /* @__PURE__ */ jsx16(Box, { alignItems: "center", justifyContent: "flex-start", style: minimumPill, children: /* @__PURE__ */ jsxs9(Box, { flexDirection: "row", alignItems: "center", style: minimumPillRow, children: [
|
|
2771
|
+
iconKey ? /* @__PURE__ */ jsx16(
|
|
2385
2772
|
FunIcon,
|
|
2386
2773
|
{
|
|
2387
2774
|
uri: iconKey.startsWith("http") ? iconKey : chainIconUri(iconKey),
|
|
@@ -2389,17 +2776,25 @@ function MinimumDepositPill({
|
|
|
2389
2776
|
fallbackUri: FALLBACK_ASSET_LOGO
|
|
2390
2777
|
}
|
|
2391
2778
|
) : null,
|
|
2392
|
-
/* @__PURE__ */
|
|
2779
|
+
/* @__PURE__ */ jsx16(
|
|
2780
|
+
Text,
|
|
2781
|
+
{
|
|
2782
|
+
variant: "detail",
|
|
2783
|
+
style: { color: theme.content.elements.secondary },
|
|
2784
|
+
children: label
|
|
2785
|
+
}
|
|
2786
|
+
)
|
|
2393
2787
|
] }) });
|
|
2394
2788
|
}
|
|
2395
2789
|
function PillButton({
|
|
2396
|
-
label
|
|
2790
|
+
label,
|
|
2397
2791
|
accessibilityLabel,
|
|
2398
2792
|
icon,
|
|
2399
2793
|
onPress
|
|
2400
2794
|
}) {
|
|
2401
|
-
|
|
2402
|
-
|
|
2795
|
+
const theme = useTheme();
|
|
2796
|
+
return /* @__PURE__ */ jsx16(
|
|
2797
|
+
Pressable6,
|
|
2403
2798
|
{
|
|
2404
2799
|
onPress,
|
|
2405
2800
|
accessibilityRole: "button",
|
|
@@ -2411,12 +2806,21 @@ function PillButton({
|
|
|
2411
2806
|
flexDirection: "row",
|
|
2412
2807
|
alignItems: "center",
|
|
2413
2808
|
justifyContent: "center",
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2809
|
+
borderRadius: "button",
|
|
2810
|
+
style: [
|
|
2811
|
+
pillButton,
|
|
2812
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2813
|
+
],
|
|
2417
2814
|
children: [
|
|
2418
2815
|
icon,
|
|
2419
|
-
/* @__PURE__ */
|
|
2816
|
+
/* @__PURE__ */ jsx16(
|
|
2817
|
+
Text,
|
|
2818
|
+
{
|
|
2819
|
+
variant: "bodyMedium",
|
|
2820
|
+
style: { color: theme.content.button.primary.default },
|
|
2821
|
+
children: label
|
|
2822
|
+
}
|
|
2823
|
+
)
|
|
2420
2824
|
]
|
|
2421
2825
|
}
|
|
2422
2826
|
)
|
|
@@ -2429,8 +2833,8 @@ var topBar4 = {
|
|
|
2429
2833
|
paddingHorizontal: 24,
|
|
2430
2834
|
gap: 4
|
|
2431
2835
|
};
|
|
2432
|
-
var
|
|
2433
|
-
var
|
|
2836
|
+
var iconButton = { width: 32, height: 32 };
|
|
2837
|
+
var content2 = {
|
|
2434
2838
|
paddingHorizontal: 20,
|
|
2435
2839
|
// pb-16 in Figma + the iOS home-indicator space below the buttons, so the
|
|
2436
2840
|
// sheet bottom sits flush with the 874px frame bottom.
|
|
@@ -2468,113 +2872,179 @@ var buttonsRow = { gap: 10, width: "100%" };
|
|
|
2468
2872
|
var pillButtonPress = { flex: 1 };
|
|
2469
2873
|
var pillButton = { height: 56, paddingHorizontal: 24, gap: 8 };
|
|
2470
2874
|
|
|
2875
|
+
// src/screens/WithdrawMethodScreen.tsx
|
|
2876
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2877
|
+
var EMPTY_TITLE = "Withdrawals unavailable";
|
|
2878
|
+
var EMPTY_MESSAGE = "Cash withdrawals aren't available in your region right now.";
|
|
2879
|
+
var BELOW_MIN_TITLE = "Balance too low";
|
|
2880
|
+
var BELOW_MIN_MESSAGE = "Your balance is below the minimum for a cash withdrawal.";
|
|
2881
|
+
function getTerminalError(isBelowMinimum, isEmpty) {
|
|
2882
|
+
if (isBelowMinimum) {
|
|
2883
|
+
return { title: BELOW_MIN_TITLE, message: BELOW_MIN_MESSAGE };
|
|
2884
|
+
}
|
|
2885
|
+
if (isEmpty) {
|
|
2886
|
+
return { title: EMPTY_TITLE, message: EMPTY_MESSAGE };
|
|
2887
|
+
}
|
|
2888
|
+
return null;
|
|
2889
|
+
}
|
|
2890
|
+
function WithdrawMethodScreen({
|
|
2891
|
+
methods,
|
|
2892
|
+
onSelectMethod,
|
|
2893
|
+
title = "Withdraw",
|
|
2894
|
+
loading = false,
|
|
2895
|
+
hasError = false,
|
|
2896
|
+
onRetry,
|
|
2897
|
+
isEmpty = false,
|
|
2898
|
+
isBelowMinimum = false
|
|
2899
|
+
}) {
|
|
2900
|
+
const terminalError = getTerminalError(isBelowMinimum, isEmpty);
|
|
2901
|
+
if (terminalError && !hasError && !loading) {
|
|
2902
|
+
return /* @__PURE__ */ jsx17(
|
|
2903
|
+
SelectMethodScreen,
|
|
2904
|
+
{
|
|
2905
|
+
title,
|
|
2906
|
+
methods: [],
|
|
2907
|
+
onSelectMethod,
|
|
2908
|
+
error: true,
|
|
2909
|
+
errorTitle: terminalError.title,
|
|
2910
|
+
errorMessage: terminalError.message
|
|
2911
|
+
}
|
|
2912
|
+
);
|
|
2913
|
+
}
|
|
2914
|
+
return /* @__PURE__ */ jsx17(
|
|
2915
|
+
SelectMethodScreen,
|
|
2916
|
+
{
|
|
2917
|
+
title,
|
|
2918
|
+
methods,
|
|
2919
|
+
onSelectMethod,
|
|
2920
|
+
loading,
|
|
2921
|
+
error: hasError,
|
|
2922
|
+
onRetry
|
|
2923
|
+
}
|
|
2924
|
+
);
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2471
2927
|
// src/swapped/SwappedScreen.tsx
|
|
2928
|
+
import { useCallback as useCallback4 } from "react";
|
|
2929
|
+
|
|
2930
|
+
// src/swapped/SwappedScreenShell.tsx
|
|
2472
2931
|
import { useCallback as useCallback3 } from "react";
|
|
2473
2932
|
|
|
2474
2933
|
// src/swapped/SwappedWebView.tsx
|
|
2475
2934
|
import { useTheme as useTheme2 } from "@shopify/restyle";
|
|
2476
2935
|
import { useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo4, useRef as useRef4 } from "react";
|
|
2477
2936
|
import { ActivityIndicator, View } from "react-native";
|
|
2478
|
-
import {
|
|
2937
|
+
import {
|
|
2938
|
+
WebView
|
|
2939
|
+
} from "react-native-webview";
|
|
2479
2940
|
|
|
2480
2941
|
// src/swapped/buildSwappedTheme.ts
|
|
2481
2942
|
var px = (value) => `${value}px`;
|
|
2482
2943
|
var toRawHex = (color) => color.replace(/^#/, "");
|
|
2483
2944
|
function buildSwappedThemeQueryParamsRN(theme) {
|
|
2484
|
-
const {
|
|
2945
|
+
const { background, content: content3, border, borderRadii } = theme;
|
|
2485
2946
|
return {
|
|
2486
|
-
iframeBackground: toRawHex(
|
|
2487
|
-
widgetBackground: toRawHex(
|
|
2488
|
-
textColor: toRawHex(
|
|
2489
|
-
spinnerColor: toRawHex(
|
|
2947
|
+
iframeBackground: toRawHex(background.modal),
|
|
2948
|
+
widgetBackground: toRawHex(background.modal),
|
|
2949
|
+
textColor: toRawHex(content3.elements.primary),
|
|
2950
|
+
spinnerColor: toRawHex(content3.elements.primary),
|
|
2490
2951
|
modalRadii: px(borderRadii.modal),
|
|
2491
|
-
skeletonColor: toRawHex(
|
|
2492
|
-
skeletonSecondaryColor: toRawHex(
|
|
2952
|
+
skeletonColor: toRawHex(border.elements.default.color),
|
|
2953
|
+
skeletonSecondaryColor: toRawHex(background.secondary)
|
|
2493
2954
|
};
|
|
2494
2955
|
}
|
|
2495
2956
|
function buildSwappedThemeRN(theme, isDarkMode) {
|
|
2496
|
-
const {
|
|
2957
|
+
const {
|
|
2958
|
+
background,
|
|
2959
|
+
content: content3,
|
|
2960
|
+
border,
|
|
2961
|
+
brand,
|
|
2962
|
+
borderRadii,
|
|
2963
|
+
sizes,
|
|
2964
|
+
spacing,
|
|
2965
|
+
textVariants
|
|
2966
|
+
} = theme;
|
|
2497
2967
|
return {
|
|
2498
2968
|
colors: {
|
|
2499
2969
|
// ── Core text ─────────────────────────────────────────────────────
|
|
2500
|
-
primaryText:
|
|
2501
|
-
secondaryText:
|
|
2502
|
-
tertiaryText:
|
|
2970
|
+
primaryText: content3.elements.primary,
|
|
2971
|
+
secondaryText: content3.elements.secondary,
|
|
2972
|
+
tertiaryText: content3.elements.secondary,
|
|
2503
2973
|
// ── Surfaces ──────────────────────────────────────────────────────
|
|
2504
|
-
modalBackground:
|
|
2505
|
-
offBackground:
|
|
2506
|
-
hoverState:
|
|
2507
|
-
lightStroke:
|
|
2508
|
-
mediumStroke:
|
|
2509
|
-
heavyStroke:
|
|
2510
|
-
modalBorder:
|
|
2511
|
-
modalHeaderDivider:
|
|
2512
|
-
modalFooterDivider:
|
|
2974
|
+
modalBackground: background.modal,
|
|
2975
|
+
offBackground: background.secondary,
|
|
2976
|
+
hoverState: background.secondary,
|
|
2977
|
+
lightStroke: border.elements.default.color,
|
|
2978
|
+
mediumStroke: border.elements.default.color,
|
|
2979
|
+
heavyStroke: border.elements.default.color,
|
|
2980
|
+
modalBorder: border.modal.default,
|
|
2981
|
+
modalHeaderDivider: border.elements.default.color,
|
|
2982
|
+
modalFooterDivider: border.elements.default.color,
|
|
2513
2983
|
// ── Accent / brand ────────────────────────────────────────────────
|
|
2514
|
-
actionColor:
|
|
2515
|
-
accentColor:
|
|
2516
|
-
accentColorForeground:
|
|
2984
|
+
actionColor: brand.primary,
|
|
2985
|
+
accentColor: brand.primary,
|
|
2986
|
+
accentColorForeground: content3.button.primary.default,
|
|
2517
2987
|
// ── Status ────────────────────────────────────────────────────────
|
|
2518
|
-
error:
|
|
2519
|
-
success:
|
|
2988
|
+
error: content3.elements.error,
|
|
2989
|
+
success: content3.elements.success,
|
|
2520
2990
|
// ── Spinner ───────────────────────────────────────────────────────
|
|
2521
|
-
spinnerIndicator:
|
|
2522
|
-
spinnerBackground:
|
|
2523
|
-
// ── Primary button
|
|
2991
|
+
spinnerIndicator: content3.elements.primary,
|
|
2992
|
+
spinnerBackground: border.elements.default.color,
|
|
2993
|
+
// ── Primary button (hover ← pressed, disabled ← default fill) ─────
|
|
2524
2994
|
// web spreads both `buttonBackground*` (ThemeVars) and `buttonPrimary*`
|
|
2525
2995
|
// (widget aliases); the widget reads whichever is present.
|
|
2526
|
-
buttonBackground:
|
|
2527
|
-
buttonBackgroundHover:
|
|
2528
|
-
buttonBackgroundPressed:
|
|
2529
|
-
buttonBackgroundDisabled:
|
|
2530
|
-
buttonPrimary:
|
|
2531
|
-
buttonPrimaryHover:
|
|
2532
|
-
buttonDisabled:
|
|
2533
|
-
buttonTextPrimary:
|
|
2534
|
-
buttonTextHover:
|
|
2535
|
-
buttonTextDisabled:
|
|
2536
|
-
buttonTextSecondary:
|
|
2537
|
-
buttonTextSecondaryDisabled:
|
|
2996
|
+
buttonBackground: background.button.primary.default,
|
|
2997
|
+
buttonBackgroundHover: background.button.primary.pressed,
|
|
2998
|
+
buttonBackgroundPressed: background.button.primary.pressed,
|
|
2999
|
+
buttonBackgroundDisabled: background.button.primary.default,
|
|
3000
|
+
buttonPrimary: background.button.primary.default,
|
|
3001
|
+
buttonPrimaryHover: background.button.primary.pressed,
|
|
3002
|
+
buttonDisabled: background.button.primary.default,
|
|
3003
|
+
buttonTextPrimary: content3.button.primary.default,
|
|
3004
|
+
buttonTextHover: content3.button.primary.default,
|
|
3005
|
+
buttonTextDisabled: content3.button.primary.default,
|
|
3006
|
+
buttonTextSecondary: content3.button.secondary.default,
|
|
3007
|
+
buttonTextSecondaryDisabled: content3.button.secondary.default,
|
|
2538
3008
|
buttonFocusedOutline: "none",
|
|
2539
3009
|
buttonBorderGradient: "none",
|
|
2540
3010
|
buttonHoverBorderGradient: "none",
|
|
2541
3011
|
buttonDisabledBorderGradient: "none",
|
|
2542
|
-
// ── Tertiary button
|
|
2543
|
-
buttonBackgroundTertiary:
|
|
2544
|
-
buttonBackgroundHoverTertiary:
|
|
2545
|
-
buttonBackgroundDisabledTertiary:
|
|
2546
|
-
buttonTextTertiary:
|
|
2547
|
-
buttonTextDisabledTertiary:
|
|
3012
|
+
// ── Tertiary button (hover ← pressed, disabled ← default fill) ────
|
|
3013
|
+
buttonBackgroundTertiary: background.button.tertiary.default,
|
|
3014
|
+
buttonBackgroundHoverTertiary: background.button.tertiary.pressed,
|
|
3015
|
+
buttonBackgroundDisabledTertiary: background.button.tertiary.default,
|
|
3016
|
+
buttonTextTertiary: content3.button.tertiary.default,
|
|
3017
|
+
buttonTextDisabledTertiary: content3.button.tertiary.default,
|
|
2548
3018
|
buttonBorderTertiary: "transparent",
|
|
2549
|
-
buttonBorderFocusedTertiary:
|
|
2550
|
-
// ── Icon button / top bar
|
|
2551
|
-
headerButtonBackground:
|
|
2552
|
-
buttonIconBackgroundHover:
|
|
2553
|
-
buttonIconBackgroundPressed:
|
|
2554
|
-
buttonIconStroke:
|
|
2555
|
-
modalTopbarIcon:
|
|
2556
|
-
modalTopbarIconBackground:
|
|
2557
|
-
modalTopbarIconBackgroundHover:
|
|
2558
|
-
modalTopbarIconBackgroundPressed:
|
|
2559
|
-
// ── Input
|
|
2560
|
-
inputBackground:
|
|
2561
|
-
inputBackgroundHover:
|
|
2562
|
-
inputBorderBase:
|
|
2563
|
-
inputBorderHover:
|
|
2564
|
-
inputLabel:
|
|
2565
|
-
inputBorder:
|
|
2566
|
-
inputBorderFocused:
|
|
2567
|
-
inputBorderActive:
|
|
2568
|
-
inputPlaceholder:
|
|
3019
|
+
buttonBorderFocusedTertiary: border.elements.selected.color,
|
|
3020
|
+
// ── Icon button / top bar (hover ← pressed) ───────────────────────
|
|
3021
|
+
headerButtonBackground: background.button.icon.default,
|
|
3022
|
+
buttonIconBackgroundHover: background.button.icon.pressed,
|
|
3023
|
+
buttonIconBackgroundPressed: background.button.icon.pressed,
|
|
3024
|
+
buttonIconStroke: content3.button.icon.default,
|
|
3025
|
+
modalTopbarIcon: content3.button.icon.default,
|
|
3026
|
+
modalTopbarIconBackground: background.button.icon.default,
|
|
3027
|
+
modalTopbarIconBackgroundHover: background.button.icon.pressed,
|
|
3028
|
+
modalTopbarIconBackgroundPressed: background.button.icon.pressed,
|
|
3029
|
+
// ── Input (hover/focused ← border/elements variables) ─────────────
|
|
3030
|
+
inputBackground: background.modal,
|
|
3031
|
+
inputBackgroundHover: background.secondary,
|
|
3032
|
+
inputBorderBase: border.elements.default.color,
|
|
3033
|
+
inputBorderHover: border.elements.selected.color,
|
|
3034
|
+
inputLabel: content3.elements.primary,
|
|
3035
|
+
inputBorder: border.elements.default.color,
|
|
3036
|
+
inputBorderFocused: content3.elements.secondary,
|
|
3037
|
+
inputBorderActive: content3.elements.secondary,
|
|
3038
|
+
inputPlaceholder: content3.elements.secondary,
|
|
2569
3039
|
// ── Selection ─────────────────────────────────────────────────────
|
|
2570
|
-
selectedOptionBorder:
|
|
2571
|
-
focusedOptionBorder:
|
|
3040
|
+
selectedOptionBorder: border.elements.selected.color,
|
|
3041
|
+
focusedOptionBorder: border.elements.selected.color,
|
|
2572
3042
|
// ── Widget aliases (mirrors web buildSwappedTheme) ────────────────
|
|
2573
|
-
boxBackground:
|
|
2574
|
-
secondaryButtonBg:
|
|
2575
|
-
secondaryButtonText:
|
|
2576
|
-
secondaryButtonHover:
|
|
2577
|
-
secondaryButtonTextHover:
|
|
3043
|
+
boxBackground: background.secondary,
|
|
3044
|
+
secondaryButtonBg: background.button.tertiary.default,
|
|
3045
|
+
secondaryButtonText: content3.button.tertiary.default,
|
|
3046
|
+
secondaryButtonHover: background.button.tertiary.pressed,
|
|
3047
|
+
secondaryButtonTextHover: content3.button.tertiary.default
|
|
2578
3048
|
},
|
|
2579
3049
|
radii: {
|
|
2580
3050
|
modal: px(borderRadii.modal),
|
|
@@ -2589,13 +3059,13 @@ function buildSwappedThemeRN(theme, isDarkMode) {
|
|
|
2589
3059
|
headerHeight: px(sizes.topBar),
|
|
2590
3060
|
headerFontWeight: String(textVariants.headerTitle.fontWeight ?? "500"),
|
|
2591
3061
|
// web: topbarIconColor ← modalTopbarIcon (the icon on the top-bar buttons)
|
|
2592
|
-
topbarIconColor:
|
|
3062
|
+
topbarIconColor: content3.button.icon.default,
|
|
2593
3063
|
topbarTextFontSize: px(textVariants.headerTitle.fontSize ?? 13),
|
|
2594
3064
|
headerIconWrapperSize: px(sizes.buttonXs),
|
|
2595
3065
|
headerIconSize: px(sizes.iconMd),
|
|
2596
3066
|
buttonFontWeight: String(textVariants.bodyMedium.fontWeight ?? "500"),
|
|
2597
3067
|
modalBottomBarButtonHeight: px(sizes.buttonHeight),
|
|
2598
|
-
iframeBackground:
|
|
3068
|
+
iframeBackground: background.modal,
|
|
2599
3069
|
// Same fixed paddings web sends (web: modalBaseHorizontalPadding + 6px).
|
|
2600
3070
|
topbarPaddingX: px(spacing.modalHorizontal + 6),
|
|
2601
3071
|
topbarPaddingY: "12px",
|
|
@@ -2632,10 +3102,32 @@ var SWAPPED_WEBVIEW_INJECTED_JS = `(function () {
|
|
|
2632
3102
|
// Anything else is the embed talking to its host \u2192 forward to native.
|
|
2633
3103
|
forwardToNative(message);
|
|
2634
3104
|
}
|
|
2635
|
-
// The embed posts to window.parent (and sometimes window) \u2014 both are this
|
|
2636
|
-
// window at the top level, so both assignments install the same bridge.
|
|
2637
|
-
try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e) {}
|
|
2638
3105
|
try { window.postMessage = bridged; } catch (e) {}
|
|
3106
|
+
// The widget only emits some messages (notably SWAPPED_ORDER_DATA, the sell
|
|
3107
|
+
// deposit address) when it believes it is embedded in a parent frame \u2014 on web
|
|
3108
|
+
// that's a real <iframe> so window.parent !== window. A top-level WebView has
|
|
3109
|
+
// window.parent === window, so present a DISTINCT parent/top (a proxy over
|
|
3110
|
+
// window) whose postMessage forwards to native; the get-trap delegates every
|
|
3111
|
+
// other property to the real window so the widget's other parent.* access works.
|
|
3112
|
+
var frameProxy = window;
|
|
3113
|
+
try {
|
|
3114
|
+
frameProxy = new Proxy(window, {
|
|
3115
|
+
get: function (target, prop) {
|
|
3116
|
+
if (prop === 'postMessage') { return bridged; }
|
|
3117
|
+
var value = target[prop];
|
|
3118
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
3119
|
+
},
|
|
3120
|
+
});
|
|
3121
|
+
} catch (e) {
|
|
3122
|
+
// Proxy unavailable \u2192 fall back to bridging the real parent.
|
|
3123
|
+
try { if (window.parent) { window.parent.postMessage = bridged; } } catch (e2) {}
|
|
3124
|
+
}
|
|
3125
|
+
// Guard parent/top independently: parent is [Replaceable] so it sticks, but
|
|
3126
|
+
// top is [LegacyUnforgeable] (HTML spec) and throws on conforming engines
|
|
3127
|
+
// while succeeding on the WebView builds that gate embed detection on it \u2014
|
|
3128
|
+
// isolating them means a throw on one never skips the other.
|
|
3129
|
+
try { Object.defineProperty(window, 'parent', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}
|
|
3130
|
+
try { Object.defineProperty(window, 'top', { configurable: true, get: function () { return frameProxy; } }); } catch (e) {}
|
|
2639
3131
|
// No parent frame \u2192 the widget posts lifecycle messages to window.opener.
|
|
2640
3132
|
try { if (!window.opener) { window.opener = { postMessage: forwardToNative }; } } catch (e) {}
|
|
2641
3133
|
true;
|
|
@@ -2649,7 +3141,7 @@ function buildSwappedSendScript(msg) {
|
|
|
2649
3141
|
true;`;
|
|
2650
3142
|
}
|
|
2651
3143
|
function handleWebViewMessage(rawData, url) {
|
|
2652
|
-
if (url
|
|
3144
|
+
if (!url || getSwappedOrigin(url) == null) {
|
|
2653
3145
|
return null;
|
|
2654
3146
|
}
|
|
2655
3147
|
let parsed;
|
|
@@ -2700,9 +3192,10 @@ function createWebViewSwappedTransport({
|
|
|
2700
3192
|
}
|
|
2701
3193
|
|
|
2702
3194
|
// src/swapped/SwappedWebView.tsx
|
|
2703
|
-
import { jsx as
|
|
3195
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2704
3196
|
function SwappedWebView({ url, onMessage, style }) {
|
|
2705
3197
|
const webViewRef = useRef4(null);
|
|
3198
|
+
const lastCommittedUrlRef = useRef4(url);
|
|
2706
3199
|
const { transport, dispatch } = useMemo4(
|
|
2707
3200
|
() => createWebViewSwappedTransport({
|
|
2708
3201
|
getWebView: () => webViewRef.current
|
|
@@ -2736,12 +3229,26 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2736
3229
|
}),
|
|
2737
3230
|
[transport]
|
|
2738
3231
|
);
|
|
3232
|
+
const handleNavigationStateChange = (navState) => {
|
|
3233
|
+
if (navState.url) {
|
|
3234
|
+
lastCommittedUrlRef.current = navState.url;
|
|
3235
|
+
}
|
|
3236
|
+
};
|
|
2739
3237
|
const handleMessage = (event) => {
|
|
2740
|
-
dispatch(
|
|
3238
|
+
dispatch(
|
|
3239
|
+
event.nativeEvent.data,
|
|
3240
|
+
event.nativeEvent.url || lastCommittedUrlRef.current
|
|
3241
|
+
);
|
|
2741
3242
|
};
|
|
2742
3243
|
const renderLoading = useCallback2(
|
|
2743
|
-
() => /* @__PURE__ */
|
|
2744
|
-
|
|
3244
|
+
() => /* @__PURE__ */ jsx18(
|
|
3245
|
+
View,
|
|
3246
|
+
{
|
|
3247
|
+
style: [loadingOverlay, { backgroundColor: theme.background.modal }],
|
|
3248
|
+
children: /* @__PURE__ */ jsx18(ActivityIndicator, { color: theme.content.elements.secondary })
|
|
3249
|
+
}
|
|
3250
|
+
),
|
|
3251
|
+
[theme.background.modal, theme.content.elements.secondary]
|
|
2745
3252
|
);
|
|
2746
3253
|
const handleError = (event) => {
|
|
2747
3254
|
logger.warn("connect-rn:swapped:webview:error", {
|
|
@@ -2756,12 +3263,13 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2756
3263
|
url: event.nativeEvent.url
|
|
2757
3264
|
});
|
|
2758
3265
|
};
|
|
2759
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ jsx18(
|
|
2760
3267
|
WebView,
|
|
2761
3268
|
{
|
|
2762
3269
|
ref: webViewRef,
|
|
2763
3270
|
source: { uri: url },
|
|
2764
3271
|
onMessage: handleMessage,
|
|
3272
|
+
onNavigationStateChange: handleNavigationStateChange,
|
|
2765
3273
|
onError: handleError,
|
|
2766
3274
|
onHttpError: handleHttpError,
|
|
2767
3275
|
scrollEnabled: false,
|
|
@@ -2779,7 +3287,7 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2779
3287
|
contentInsetAdjustmentBehavior: "never",
|
|
2780
3288
|
setSupportMultipleWindows: false,
|
|
2781
3289
|
originWhitelist: ["https://*"],
|
|
2782
|
-
style: [{ backgroundColor: theme.
|
|
3290
|
+
style: [{ backgroundColor: theme.background.modal }, style]
|
|
2783
3291
|
}
|
|
2784
3292
|
);
|
|
2785
3293
|
}
|
|
@@ -2793,15 +3301,47 @@ var loadingOverlay = {
|
|
|
2793
3301
|
justifyContent: "center"
|
|
2794
3302
|
};
|
|
2795
3303
|
|
|
3304
|
+
// src/swapped/SwappedScreenShell.tsx
|
|
3305
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3306
|
+
function SwappedScreenShell({
|
|
3307
|
+
url,
|
|
3308
|
+
onMessage
|
|
3309
|
+
}) {
|
|
3310
|
+
const theme = useTheme();
|
|
3311
|
+
const handleMessage = useCallback3(
|
|
3312
|
+
(msg) => {
|
|
3313
|
+
if (msg.type === "SWAPPED_ERROR") {
|
|
3314
|
+
logger.warn("connect-rn:swapped:error", {
|
|
3315
|
+
data: msg.data ?? {}
|
|
3316
|
+
});
|
|
3317
|
+
}
|
|
3318
|
+
onMessage(msg);
|
|
3319
|
+
},
|
|
3320
|
+
[onMessage]
|
|
3321
|
+
);
|
|
3322
|
+
return /* @__PURE__ */ jsx19(
|
|
3323
|
+
Box,
|
|
3324
|
+
{
|
|
3325
|
+
borderTopLeftRadius: "modal",
|
|
3326
|
+
borderTopRightRadius: "modal",
|
|
3327
|
+
style: [sheet3, { backgroundColor: theme.background.modal }],
|
|
3328
|
+
children: /* @__PURE__ */ jsx19(SwappedWebView, { url, onMessage: handleMessage, style: fill })
|
|
3329
|
+
}
|
|
3330
|
+
);
|
|
3331
|
+
}
|
|
3332
|
+
var SHEET_HEIGHT = 550;
|
|
3333
|
+
var sheet3 = { height: SHEET_HEIGHT, overflow: "hidden" };
|
|
3334
|
+
var fill = { flex: 1 };
|
|
3335
|
+
|
|
2796
3336
|
// src/swapped/SwappedScreen.tsx
|
|
2797
|
-
import { jsx as
|
|
3337
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2798
3338
|
function SwappedScreen({
|
|
2799
3339
|
url,
|
|
2800
3340
|
onClose,
|
|
2801
3341
|
onBack,
|
|
2802
3342
|
onSuccess
|
|
2803
3343
|
}) {
|
|
2804
|
-
const handleMessage =
|
|
3344
|
+
const handleMessage = useCallback4(
|
|
2805
3345
|
(msg) => {
|
|
2806
3346
|
switch (msg.type) {
|
|
2807
3347
|
case "SWAPPED_GO_BACK":
|
|
@@ -2815,31 +3355,66 @@ function SwappedScreen({
|
|
|
2815
3355
|
logger.info("connect-rn:swapped:transaction_successful");
|
|
2816
3356
|
onSuccess?.();
|
|
2817
3357
|
break;
|
|
2818
|
-
case "SWAPPED_ERROR":
|
|
2819
|
-
logger.warn("connect-rn:swapped:error", {
|
|
2820
|
-
data: JSON.stringify(msg.data ?? {})
|
|
2821
|
-
});
|
|
2822
|
-
break;
|
|
2823
3358
|
default:
|
|
2824
3359
|
break;
|
|
2825
3360
|
}
|
|
2826
3361
|
},
|
|
2827
3362
|
[onBack, onClose, onSuccess]
|
|
2828
3363
|
);
|
|
2829
|
-
return /* @__PURE__ */
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
3364
|
+
return /* @__PURE__ */ jsx20(SwappedScreenShell, { url, onMessage: handleMessage });
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
// src/swapped/SwappedWithdrawScreen.tsx
|
|
3368
|
+
import {
|
|
3369
|
+
isValidOrderData
|
|
3370
|
+
} from "@funkit/connect-core";
|
|
3371
|
+
import { useCallback as useCallback5 } from "react";
|
|
3372
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
3373
|
+
function SwappedWithdrawScreen({
|
|
3374
|
+
url,
|
|
3375
|
+
onClose,
|
|
3376
|
+
onBack,
|
|
3377
|
+
onNewWithdrawal,
|
|
3378
|
+
onWithdrawalSuccess,
|
|
3379
|
+
onOrderData
|
|
3380
|
+
}) {
|
|
3381
|
+
const handleMessage = useCallback5(
|
|
3382
|
+
(msg) => {
|
|
3383
|
+
switch (msg.type) {
|
|
3384
|
+
case "SWAPPED_GO_BACK":
|
|
3385
|
+
onBack();
|
|
3386
|
+
break;
|
|
3387
|
+
case "SWAPPED_CLOSE":
|
|
3388
|
+
onClose();
|
|
3389
|
+
break;
|
|
3390
|
+
case "SWAPPED_NEW_WITHDRAWAL":
|
|
3391
|
+
logger.info("connect-rn:swapped:new_withdrawal");
|
|
3392
|
+
onNewWithdrawal?.();
|
|
3393
|
+
break;
|
|
3394
|
+
case "SWAPPED_WITHDRAWAL_SUCCESSFUL":
|
|
3395
|
+
logger.info("connect-rn:swapped:withdrawal_successful");
|
|
3396
|
+
onWithdrawalSuccess?.(msg.data);
|
|
3397
|
+
break;
|
|
3398
|
+
case "SWAPPED_ORDER_DATA":
|
|
3399
|
+
if (!isValidOrderData(msg.data)) {
|
|
3400
|
+
logger.warn("connect-rn:swapped:order_data:invalid", {
|
|
3401
|
+
data: msg.data ?? {}
|
|
3402
|
+
});
|
|
3403
|
+
break;
|
|
3404
|
+
}
|
|
3405
|
+
logger.info("connect-rn:swapped:order_data", {
|
|
3406
|
+
order_id: msg.data.order_id
|
|
3407
|
+
});
|
|
3408
|
+
onOrderData?.(msg.data);
|
|
3409
|
+
break;
|
|
3410
|
+
default:
|
|
3411
|
+
break;
|
|
3412
|
+
}
|
|
3413
|
+
},
|
|
3414
|
+
[onBack, onClose, onNewWithdrawal, onWithdrawalSuccess, onOrderData]
|
|
2838
3415
|
);
|
|
3416
|
+
return /* @__PURE__ */ jsx21(SwappedScreenShell, { url, onMessage: handleMessage });
|
|
2839
3417
|
}
|
|
2840
|
-
var SHEET_HEIGHT = 550;
|
|
2841
|
-
var sheet3 = { height: SHEET_HEIGHT, overflow: "hidden" };
|
|
2842
|
-
var fill = { flex: 1 };
|
|
2843
3418
|
|
|
2844
3419
|
// src/transfer/availableChains.ts
|
|
2845
3420
|
import {
|
|
@@ -2951,6 +3526,15 @@ function toFopRows(fops, exchangeRates) {
|
|
|
2951
3526
|
};
|
|
2952
3527
|
});
|
|
2953
3528
|
}
|
|
3529
|
+
function toWithdrawFopRows(fops) {
|
|
3530
|
+
return fops.map((fop) => ({
|
|
3531
|
+
id: `${fop.fopType}:${fop.name}`,
|
|
3532
|
+
name: fop.name,
|
|
3533
|
+
iconUri: fop.iconImageUrl,
|
|
3534
|
+
subtitle: fop.fopType === FormOfPaymentType.BANK_TRANSFER ? BANK_TRANSFER_TIME : "Instant",
|
|
3535
|
+
disabled: !fop.embeddedFlowUrl
|
|
3536
|
+
}));
|
|
3537
|
+
}
|
|
2954
3538
|
|
|
2955
3539
|
// src/transfer/formatDepositAddress.ts
|
|
2956
3540
|
function formatDepositAddress(address, leading = 6, trailing = 6) {
|
|
@@ -2976,17 +3560,27 @@ import {
|
|
|
2976
3560
|
FOPS_STALE_TIME,
|
|
2977
3561
|
getDepositAddressForChain,
|
|
2978
3562
|
sortFops,
|
|
2979
|
-
useDynamicConfig as useDynamicConfig3,
|
|
2980
3563
|
useSwappedDefaultCurrencyQuery
|
|
2981
3564
|
} from "@funkit/connect-core";
|
|
2982
3565
|
import { useTheme as useTheme3 } from "@shopify/restyle";
|
|
2983
|
-
import { useQuery as
|
|
3566
|
+
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
2984
3567
|
import { useMemo as useMemo6 } from "react";
|
|
2985
3568
|
|
|
2986
3569
|
// src/identity/IdentityContext.tsx
|
|
2987
3570
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
2988
|
-
|
|
3571
|
+
|
|
3572
|
+
// src/utils/customers.ts
|
|
3573
|
+
import { MALLARD_API_KEY } from "@funkit/api-base";
|
|
3574
|
+
function isMallardApiKey(apiKey) {
|
|
3575
|
+
return apiKey === MALLARD_API_KEY;
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
// src/identity/IdentityContext.tsx
|
|
3579
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2989
3580
|
function generateSyntheticUserId(apiKey, externalUserId) {
|
|
3581
|
+
if (isMallardApiKey(apiKey)) {
|
|
3582
|
+
return externalUserId;
|
|
3583
|
+
}
|
|
2990
3584
|
return `${apiKey}|${externalUserId}`;
|
|
2991
3585
|
}
|
|
2992
3586
|
function resolveFunkitIdentity(config, walletAddress) {
|
|
@@ -3004,7 +3598,7 @@ function FunkitIdentityProvider({
|
|
|
3004
3598
|
identity,
|
|
3005
3599
|
children
|
|
3006
3600
|
}) {
|
|
3007
|
-
return /* @__PURE__ */
|
|
3601
|
+
return /* @__PURE__ */ jsx22(FunkitIdentityContext.Provider, { value: identity, children });
|
|
3008
3602
|
}
|
|
3009
3603
|
function useFunkitIdentity() {
|
|
3010
3604
|
const identity = useContext2(FunkitIdentityContext);
|
|
@@ -3023,13 +3617,12 @@ import {
|
|
|
3023
3617
|
import {
|
|
3024
3618
|
getCheckoutTokenTransferParams
|
|
3025
3619
|
} from "@funkit/connect-core";
|
|
3026
|
-
import { useQuery
|
|
3620
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3027
3621
|
|
|
3028
3622
|
// src/transfer/hooks/useUDAParams.ts
|
|
3029
|
-
import { useDynamicConfig as useDynamicConfig2 } from "@funkit/connect-core";
|
|
3030
3623
|
import { useMemo as useMemo5 } from "react";
|
|
3031
3624
|
function useUDAParams(dynamicRoutingId) {
|
|
3032
|
-
const udaParams =
|
|
3625
|
+
const udaParams = useDynamicConfig("uda_params");
|
|
3033
3626
|
return useMemo5(
|
|
3034
3627
|
() => udaParams.find((param) => param.dynamicRoutingId === dynamicRoutingId)?.params,
|
|
3035
3628
|
[udaParams, dynamicRoutingId]
|
|
@@ -3054,7 +3647,7 @@ function useTransferInit({
|
|
|
3054
3647
|
recipientAddr: resolvedRecipient,
|
|
3055
3648
|
udaParams
|
|
3056
3649
|
});
|
|
3057
|
-
const { data, isLoading, isFetching } =
|
|
3650
|
+
const { data, isLoading, isFetching } = useQuery({
|
|
3058
3651
|
queryKey: ["initializeCheckoutTokenTransferAddress", params],
|
|
3059
3652
|
queryFn: ({ queryKey: [, queryParams] }) => queryParams ? initializeCheckoutTokenTransferAddress({
|
|
3060
3653
|
...queryParams,
|
|
@@ -3081,8 +3674,8 @@ function useFops({
|
|
|
3081
3674
|
enabled = true
|
|
3082
3675
|
}) {
|
|
3083
3676
|
const { apiKey, userId } = useFunkitIdentity();
|
|
3084
|
-
const isSwappedEnabled = !!
|
|
3085
|
-
const fopPriority =
|
|
3677
|
+
const isSwappedEnabled = !!useDynamicConfig("enableswappeddeposit");
|
|
3678
|
+
const fopPriority = useDynamicConfig("foppriority");
|
|
3086
3679
|
const { userIpInfo } = useUserIpInfo();
|
|
3087
3680
|
const countryCode = userIpInfo?.alpha2 || DEFAULT_COUNTRY_CODE;
|
|
3088
3681
|
const {
|
|
@@ -3111,7 +3704,7 @@ function useFops({
|
|
|
3111
3704
|
const targetChain = checkoutConfig?.targetChain;
|
|
3112
3705
|
const recipientAddress = targetChain ? getDepositAddressForChain(Number(targetChain), transferInit) : void 0;
|
|
3113
3706
|
const isEnabled = enabled && isSwappedEnabled && !!apiKey && !!targetAsset && !!targetChain && !!recipientAddress && !!transferInit && !isSwappedCurrencyCodeLoading;
|
|
3114
|
-
const query =
|
|
3707
|
+
const query = useQuery2({
|
|
3115
3708
|
queryKey: [
|
|
3116
3709
|
"fops",
|
|
3117
3710
|
userId,
|
|
@@ -3180,15 +3773,356 @@ function useFops({
|
|
|
3180
3773
|
};
|
|
3181
3774
|
}
|
|
3182
3775
|
|
|
3776
|
+
// src/transfer/hooks/useWithdrawalFops.ts
|
|
3777
|
+
import {
|
|
3778
|
+
RailConfigType,
|
|
3779
|
+
getFops as getFops2
|
|
3780
|
+
} from "@funkit/api-base";
|
|
3781
|
+
import {
|
|
3782
|
+
DEFAULT_FIAT_CURRENCY as DEFAULT_FIAT_CURRENCY2,
|
|
3783
|
+
FOPS_STALE_TIME as FOPS_STALE_TIME2,
|
|
3784
|
+
SWAPPED_MIN_SELL_EUR,
|
|
3785
|
+
findSwappedSourceOverride,
|
|
3786
|
+
getExchangeRate,
|
|
3787
|
+
resolveSwappedWithdrawalLegs,
|
|
3788
|
+
sortFops as sortFops2,
|
|
3789
|
+
useSwappedDefaultCurrencyQuery as useSwappedDefaultCurrencyQuery2
|
|
3790
|
+
} from "@funkit/connect-core";
|
|
3791
|
+
import { useTheme as useTheme4 } from "@shopify/restyle";
|
|
3792
|
+
import { useStatsigClient } from "@statsig/react-bindings";
|
|
3793
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
3794
|
+
import { useMemo as useMemo7 } from "react";
|
|
3795
|
+
|
|
3796
|
+
// src/transfer/hooks/useFiatExchangeRates.ts
|
|
3797
|
+
import { getFiatExchangeRates } from "@funkit/api-base";
|
|
3798
|
+
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
3799
|
+
function useFiatExchangeRates(enabled = true) {
|
|
3800
|
+
const { data, isLoading, error } = useQuery3({
|
|
3801
|
+
queryKey: ["fiatExchangeRates"],
|
|
3802
|
+
queryFn: () => getFiatExchangeRates({ logger }),
|
|
3803
|
+
refetchOnMount: false,
|
|
3804
|
+
refetchOnReconnect: false,
|
|
3805
|
+
refetchOnWindowFocus: false,
|
|
3806
|
+
gcTime: 1e3 * 60 * 60,
|
|
3807
|
+
// 1 hour
|
|
3808
|
+
enabled
|
|
3809
|
+
});
|
|
3810
|
+
return { data, isLoading, error };
|
|
3811
|
+
}
|
|
3812
|
+
|
|
3813
|
+
// src/transfer/hooks/useWithdrawalFops.ts
|
|
3814
|
+
var WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
3815
|
+
function useWithdrawalRoute(config) {
|
|
3816
|
+
const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
|
|
3817
|
+
return useMemo7(
|
|
3818
|
+
() => resolveSwappedWithdrawalLegs({
|
|
3819
|
+
source: config.sourceToken,
|
|
3820
|
+
target: config.swappedAcceptedToken,
|
|
3821
|
+
override: findSwappedSourceOverride(sourceOverrides, {
|
|
3822
|
+
chainId: config.sourceToken.chainId,
|
|
3823
|
+
tokenAddress: config.sourceToken.address
|
|
3824
|
+
})
|
|
3825
|
+
}),
|
|
3826
|
+
[config.sourceToken, config.swappedAcceptedToken, sourceOverrides]
|
|
3827
|
+
);
|
|
3828
|
+
}
|
|
3829
|
+
function useWithdrawalSellCap(config, walletAddress) {
|
|
3830
|
+
const { sourceUsdBalance } = config;
|
|
3831
|
+
const isBalanceCallback = typeof sourceUsdBalance === "function";
|
|
3832
|
+
const hasBalanceInfo = sourceUsdBalance != null;
|
|
3833
|
+
const balanceQuery = useQuery4({
|
|
3834
|
+
queryKey: [
|
|
3835
|
+
"withdrawSourceUsdBalance",
|
|
3836
|
+
walletAddress,
|
|
3837
|
+
config.sourceToken.chainId,
|
|
3838
|
+
config.sourceToken.address
|
|
3839
|
+
],
|
|
3840
|
+
queryFn: async () => {
|
|
3841
|
+
const value = isBalanceCallback ? await sourceUsdBalance() : 0;
|
|
3842
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
3843
|
+
},
|
|
3844
|
+
enabled: isBalanceCallback && !!walletAddress && walletAddress !== "0x",
|
|
3845
|
+
staleTime: 3e4,
|
|
3846
|
+
refetchOnWindowFocus: false
|
|
3847
|
+
});
|
|
3848
|
+
const isLoadingBalance = isBalanceCallback && balanceQuery.isLoading;
|
|
3849
|
+
const rawUsdBalance = isBalanceCallback ? balanceQuery.data ?? 0 : sourceUsdBalance ?? 0;
|
|
3850
|
+
const usdBalance = Number.isFinite(rawUsdBalance) && rawUsdBalance > 0 ? rawUsdBalance : 0;
|
|
3851
|
+
const { data: exchangeRates, isLoading: isLoadingRates } = useFiatExchangeRates(hasBalanceInfo);
|
|
3852
|
+
const eurRate = getExchangeRate("EUR", exchangeRates, 0);
|
|
3853
|
+
const eurMax = eurRate && usdBalance > 0 ? Math.floor(usdBalance * eurRate) : void 0;
|
|
3854
|
+
const cashMinUsd = eurRate ? SWAPPED_MIN_SELL_EUR / eurRate : void 0;
|
|
3855
|
+
const isBelowMinimumBalance = hasBalanceInfo && !isLoadingBalance && cashMinUsd != null && usdBalance < cashMinUsd;
|
|
3856
|
+
const isAwaitingCap = hasBalanceInfo && (isLoadingBalance || usdBalance > 0 && isLoadingRates);
|
|
3857
|
+
return { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap };
|
|
3858
|
+
}
|
|
3859
|
+
async function fetchWithdrawalFops({
|
|
3860
|
+
apiKey,
|
|
3861
|
+
userId,
|
|
3862
|
+
walletAddress,
|
|
3863
|
+
countryCode,
|
|
3864
|
+
swappedCurrencyCode,
|
|
3865
|
+
fopPriority,
|
|
3866
|
+
themeConfig,
|
|
3867
|
+
route,
|
|
3868
|
+
eurMax,
|
|
3869
|
+
usdBalance,
|
|
3870
|
+
sourceToken
|
|
3871
|
+
}) {
|
|
3872
|
+
const acceptedToken = {
|
|
3873
|
+
chainId: route.targetChainId,
|
|
3874
|
+
address: route.targetTokenAddress
|
|
3875
|
+
};
|
|
3876
|
+
logger.info("connect-rn:withdrawFops:source_override", {
|
|
3877
|
+
overrideApplied: route.overrideApplied,
|
|
3878
|
+
sourceChainId: sourceToken.chainId,
|
|
3879
|
+
sourceTokenAddress: sourceToken.address,
|
|
3880
|
+
acceptedChainId: route.targetChainId,
|
|
3881
|
+
acceptedTokenAddress: route.targetTokenAddress,
|
|
3882
|
+
acceptedTokenSymbol: route.targetTokenSymbol
|
|
3883
|
+
});
|
|
3884
|
+
const capForwarded = eurMax != null && eurMax > SWAPPED_MIN_SELL_EUR;
|
|
3885
|
+
logger.info("connect-rn:withdrawFops:sellLimits", {
|
|
3886
|
+
defaultMinAmount: SWAPPED_MIN_SELL_EUR,
|
|
3887
|
+
usdBalance,
|
|
3888
|
+
eurMax,
|
|
3889
|
+
capForwarded
|
|
3890
|
+
});
|
|
3891
|
+
const response = await getFops2({
|
|
3892
|
+
apiKey,
|
|
3893
|
+
logger,
|
|
3894
|
+
params: {
|
|
3895
|
+
recipientAddress: walletAddress,
|
|
3896
|
+
userId,
|
|
3897
|
+
destinationToken: acceptedToken,
|
|
3898
|
+
fiatCurrencyCode: swappedCurrencyCode,
|
|
3899
|
+
countryCode,
|
|
3900
|
+
railConfigs: [
|
|
3901
|
+
{
|
|
3902
|
+
type: RailConfigType.CRYPTO_TO_FIAT,
|
|
3903
|
+
userId,
|
|
3904
|
+
countryCode,
|
|
3905
|
+
fiatCurrencyCode: swappedCurrencyCode,
|
|
3906
|
+
sourceToken: acceptedToken,
|
|
3907
|
+
thirdPartyPaymentConfigs: { swapped: { themeConfig } },
|
|
3908
|
+
checkoutLimitsCriteria: {
|
|
3909
|
+
defaultMinAmount: SWAPPED_MIN_SELL_EUR,
|
|
3910
|
+
// Balance-derived cap; only meaningful above the minimum.
|
|
3911
|
+
...capForwarded ? { defaultMaxAmount: eurMax } : {}
|
|
3912
|
+
}
|
|
3913
|
+
}
|
|
3914
|
+
]
|
|
3915
|
+
}
|
|
3916
|
+
});
|
|
3917
|
+
const fops = sortFops2(response.genericFormsOfPayments, fopPriority);
|
|
3918
|
+
if (fops.length === 0) {
|
|
3919
|
+
logger.info("connect-rn:withdrawFops:empty", {
|
|
3920
|
+
countryCode,
|
|
3921
|
+
targetChainId: route.targetChainId,
|
|
3922
|
+
targetTokenAddress: route.targetTokenAddress
|
|
3923
|
+
});
|
|
3924
|
+
}
|
|
3925
|
+
return fops;
|
|
3926
|
+
}
|
|
3927
|
+
function useWithdrawalFops({
|
|
3928
|
+
config,
|
|
3929
|
+
enabled = true
|
|
3930
|
+
}) {
|
|
3931
|
+
const { apiKey, userId } = useFunkitIdentity();
|
|
3932
|
+
const { isLoading: isStatsigLoading } = useStatsigClient();
|
|
3933
|
+
const isWithdrawalEnabled = !!useDynamicConfig("enableswappedwithdrawal");
|
|
3934
|
+
const fopPriority = useDynamicConfig("foppriority");
|
|
3935
|
+
const walletAddress = config.withdrawalWallet.address();
|
|
3936
|
+
const route = useWithdrawalRoute(config);
|
|
3937
|
+
const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo();
|
|
3938
|
+
const countryCode = userIpInfo?.alpha2;
|
|
3939
|
+
const {
|
|
3940
|
+
data: swappedCurrencyCode = DEFAULT_FIAT_CURRENCY2,
|
|
3941
|
+
isLoading: isSwappedCurrencyCodeLoading
|
|
3942
|
+
} = useSwappedDefaultCurrencyQuery2({
|
|
3943
|
+
apiKey,
|
|
3944
|
+
countryCode: userIpInfo?.alpha2,
|
|
3945
|
+
logger
|
|
3946
|
+
});
|
|
3947
|
+
const theme = useTheme4();
|
|
3948
|
+
const themeConfig = useMemo7(
|
|
3949
|
+
() => buildSwappedThemeQueryParamsRN(theme),
|
|
3950
|
+
[theme]
|
|
3951
|
+
);
|
|
3952
|
+
const { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap } = useWithdrawalSellCap(config, walletAddress);
|
|
3953
|
+
const isEnabled = enabled && isWithdrawalEnabled && !!apiKey && !!userId && !!walletAddress && walletAddress !== "0x" && !!countryCode && !isSwappedCurrencyCodeLoading && !isAwaitingCap;
|
|
3954
|
+
const query = useQuery4({
|
|
3955
|
+
queryKey: [
|
|
3956
|
+
WITHDRAW_FOPS_QUERY_KEY,
|
|
3957
|
+
userId,
|
|
3958
|
+
walletAddress,
|
|
3959
|
+
apiKey,
|
|
3960
|
+
countryCode,
|
|
3961
|
+
swappedCurrencyCode,
|
|
3962
|
+
fopPriority,
|
|
3963
|
+
themeConfig,
|
|
3964
|
+
route.targetChainId,
|
|
3965
|
+
route.targetTokenAddress,
|
|
3966
|
+
eurMax
|
|
3967
|
+
],
|
|
3968
|
+
// `countryCode` is guaranteed by `isEnabled` (query stays disabled until it
|
|
3969
|
+
// resolves); the guard just narrows the type — the empty fallback is unreachable.
|
|
3970
|
+
queryFn: () => countryCode ? fetchWithdrawalFops({
|
|
3971
|
+
apiKey,
|
|
3972
|
+
userId,
|
|
3973
|
+
walletAddress,
|
|
3974
|
+
countryCode,
|
|
3975
|
+
swappedCurrencyCode,
|
|
3976
|
+
fopPriority,
|
|
3977
|
+
themeConfig,
|
|
3978
|
+
route,
|
|
3979
|
+
eurMax,
|
|
3980
|
+
usdBalance,
|
|
3981
|
+
sourceToken: config.sourceToken
|
|
3982
|
+
}) : Promise.resolve([]),
|
|
3983
|
+
enabled: isEnabled,
|
|
3984
|
+
staleTime: FOPS_STALE_TIME2,
|
|
3985
|
+
refetchOnWindowFocus: false
|
|
3986
|
+
});
|
|
3987
|
+
const isLoading = isStatsigLoading || isLoadingGeoCheck || isSwappedCurrencyCodeLoading || isAwaitingCap || isEnabled && query.isLoading;
|
|
3988
|
+
const noPaymentMethodsAvailable = !isLoading && (!isWithdrawalEnabled || query.isSuccess && (query.data?.length ?? 0) === 0);
|
|
3989
|
+
return {
|
|
3990
|
+
fops: query.data ?? [],
|
|
3991
|
+
isLoading,
|
|
3992
|
+
noPaymentMethodsAvailable,
|
|
3993
|
+
isBelowMinimumBalance,
|
|
3994
|
+
// Tie the query error to isEnabled ("gate off ⇒ no error"), plus web's
|
|
3995
|
+
// no-country case: geo settled without a country is unrecoverable here.
|
|
3996
|
+
isError: isEnabled && query.isError || !isLoadingGeoCheck && !countryCode,
|
|
3997
|
+
// Respect the enabled gate — refetch() would otherwise force a fetch even
|
|
3998
|
+
// when disabled (e.g. no resolved country).
|
|
3999
|
+
refetch: () => {
|
|
4000
|
+
if (isEnabled) void query.refetch();
|
|
4001
|
+
},
|
|
4002
|
+
isWithdrawalEnabled,
|
|
4003
|
+
route
|
|
4004
|
+
};
|
|
4005
|
+
}
|
|
4006
|
+
|
|
4007
|
+
// src/withdrawal/useWithdrawalExecution.ts
|
|
4008
|
+
import {
|
|
4009
|
+
ensureRelayClientInitialized,
|
|
4010
|
+
isUserRejectedError,
|
|
4011
|
+
processFiatWithdrawalOrder,
|
|
4012
|
+
toFiatWithdrawalOrder
|
|
4013
|
+
} from "@funkit/connect-core";
|
|
4014
|
+
import { useCallback as useCallback6, useRef as useRef5 } from "react";
|
|
4015
|
+
|
|
4016
|
+
// src/withdrawal/publicClient.ts
|
|
4017
|
+
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/chains";
|
|
4018
|
+
import { createPublicClient, fallback, http } from "viem";
|
|
4019
|
+
var clients = /* @__PURE__ */ new Map();
|
|
4020
|
+
function getPublicClientFor(chainId) {
|
|
4021
|
+
const cached = clients.get(chainId);
|
|
4022
|
+
if (cached) return cached;
|
|
4023
|
+
const info = FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO[chainId];
|
|
4024
|
+
if (!info) return void 0;
|
|
4025
|
+
const client = createPublicClient({
|
|
4026
|
+
chain: info.chainInfo,
|
|
4027
|
+
transport: info.fallbackRpcUrls.length ? fallback(info.fallbackRpcUrls.map((url) => http(url))) : http()
|
|
4028
|
+
});
|
|
4029
|
+
clients.set(chainId, client);
|
|
4030
|
+
return client;
|
|
4031
|
+
}
|
|
4032
|
+
|
|
4033
|
+
// src/withdrawal/useWithdrawalExecution.ts
|
|
4034
|
+
var submittedOrderIds = /* @__PURE__ */ new Set();
|
|
4035
|
+
function useWithdrawalExecution({
|
|
4036
|
+
config,
|
|
4037
|
+
route,
|
|
4038
|
+
callbacks,
|
|
4039
|
+
onError
|
|
4040
|
+
}) {
|
|
4041
|
+
const { apiKey, userId } = useFunkitIdentity();
|
|
4042
|
+
const isProcessingRef = useRef5(false);
|
|
4043
|
+
const executeOrder = useCallback6(
|
|
4044
|
+
async (data) => {
|
|
4045
|
+
const order = toFiatWithdrawalOrder(data);
|
|
4046
|
+
if (isProcessingRef.current) {
|
|
4047
|
+
logger.warn("connect-rn:withdrawal:already_processing", {
|
|
4048
|
+
order_id: order.orderId
|
|
4049
|
+
});
|
|
4050
|
+
return;
|
|
4051
|
+
}
|
|
4052
|
+
if (submittedOrderIds.has(order.orderId)) {
|
|
4053
|
+
logger.warn("connect-rn:withdrawal:duplicate", {
|
|
4054
|
+
order_id: order.orderId
|
|
4055
|
+
});
|
|
4056
|
+
return;
|
|
4057
|
+
}
|
|
4058
|
+
isProcessingRef.current = true;
|
|
4059
|
+
logger.info("connect-rn:withdrawal:route_decision", {
|
|
4060
|
+
order_id: order.orderId,
|
|
4061
|
+
overrideApplied: route.overrideApplied,
|
|
4062
|
+
requestedTargetChainId: config.swappedAcceptedToken?.chainId,
|
|
4063
|
+
requestedTargetTokenAddress: config.swappedAcceptedToken?.address,
|
|
4064
|
+
enforcedTargetChainId: route.targetChainId,
|
|
4065
|
+
enforcedTargetTokenAddress: route.targetTokenAddress,
|
|
4066
|
+
enforcedTargetTokenSymbol: route.targetTokenSymbol,
|
|
4067
|
+
providerCrypto: order.providerCrypto,
|
|
4068
|
+
providerNetwork: order.providerNetwork
|
|
4069
|
+
});
|
|
4070
|
+
let txHash;
|
|
4071
|
+
try {
|
|
4072
|
+
ensureRelayClientInitialized(logger, "funkit-connect-rn");
|
|
4073
|
+
({ txHash } = await processFiatWithdrawalOrder({
|
|
4074
|
+
order,
|
|
4075
|
+
wallet: config.withdrawalWallet,
|
|
4076
|
+
legs: route,
|
|
4077
|
+
apiKey,
|
|
4078
|
+
userId,
|
|
4079
|
+
logger,
|
|
4080
|
+
// Read the target token's decimals on-chain (via publicClient) rather
|
|
4081
|
+
// than trusting host-config `decimals` — a stale/wrong value would
|
|
4082
|
+
// mis-scale the amount transferred to Swapped's deposit address.
|
|
4083
|
+
publicClient: getPublicClientFor(Number(route.targetChainId))
|
|
4084
|
+
}));
|
|
4085
|
+
} catch (error) {
|
|
4086
|
+
if (isUserRejectedError(error)) {
|
|
4087
|
+
logger.warn("connect-rn:withdrawal:user_rejected", {
|
|
4088
|
+
order_id: order.orderId
|
|
4089
|
+
});
|
|
4090
|
+
return;
|
|
4091
|
+
}
|
|
4092
|
+
logger.error("connect-rn:withdrawal:execution_failed", error, {
|
|
4093
|
+
order_id: order.orderId
|
|
4094
|
+
});
|
|
4095
|
+
callbacks.onWithdrawalError?.({
|
|
4096
|
+
message: error instanceof Error ? error.message : String(error)
|
|
4097
|
+
});
|
|
4098
|
+
onError();
|
|
4099
|
+
return;
|
|
4100
|
+
} finally {
|
|
4101
|
+
isProcessingRef.current = false;
|
|
4102
|
+
}
|
|
4103
|
+
submittedOrderIds.add(order.orderId);
|
|
4104
|
+
try {
|
|
4105
|
+
callbacks.onWithdrawalSubmitted?.(order.orderId, txHash);
|
|
4106
|
+
} catch (error) {
|
|
4107
|
+
logger.warn("connect-rn:withdrawal:submitted_callback_threw", {
|
|
4108
|
+
order_id: order.orderId,
|
|
4109
|
+
error: error instanceof Error ? error.message : String(error)
|
|
4110
|
+
});
|
|
4111
|
+
}
|
|
4112
|
+
},
|
|
4113
|
+
[apiKey, userId, config, route, callbacks, onError]
|
|
4114
|
+
);
|
|
4115
|
+
return { executeOrder };
|
|
4116
|
+
}
|
|
4117
|
+
|
|
3183
4118
|
// src/transfer/hooks/useSupportedTokens.ts
|
|
3184
4119
|
import { getSupportedAssets } from "@funkit/api-base";
|
|
3185
4120
|
import {
|
|
3186
4121
|
isTransferChainEnabled,
|
|
3187
|
-
resolveTokenTransferConfig
|
|
3188
|
-
useDynamicConfig as useDynamicConfig4
|
|
4122
|
+
resolveTokenTransferConfig
|
|
3189
4123
|
} from "@funkit/connect-core";
|
|
3190
|
-
import { useQuery as
|
|
3191
|
-
import { useMemo as
|
|
4124
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
4125
|
+
import { useMemo as useMemo8 } from "react";
|
|
3192
4126
|
|
|
3193
4127
|
// src/transfer/supportedTokens.ts
|
|
3194
4128
|
function buildSupportedTokenList(resolved) {
|
|
@@ -3224,18 +4158,18 @@ function useSupportedTokens({
|
|
|
3224
4158
|
transferInit
|
|
3225
4159
|
} = {}) {
|
|
3226
4160
|
const { apiKey } = useFunkitIdentity();
|
|
3227
|
-
const tokenTransferConfig =
|
|
3228
|
-
const disabledChainAssets =
|
|
4161
|
+
const tokenTransferConfig = useDynamicConfig("tokentransferconfig");
|
|
4162
|
+
const disabledChainAssets = useDynamicConfig(
|
|
3229
4163
|
"disabletokentransferchainsandassets"
|
|
3230
4164
|
);
|
|
3231
|
-
const { data, isLoading } =
|
|
4165
|
+
const { data, isLoading } = useQuery5({
|
|
3232
4166
|
queryKey: ["getSupportedAssets", apiKey],
|
|
3233
4167
|
queryFn: ({ queryKey: [, key] }) => getSupportedAssets({ apiKey: key, logger }),
|
|
3234
4168
|
enabled: enabled && !!apiKey,
|
|
3235
4169
|
staleTime: 5 * 6e4,
|
|
3236
4170
|
refetchOnWindowFocus: false
|
|
3237
4171
|
});
|
|
3238
|
-
const { tokens, chainFilters } =
|
|
4172
|
+
const { tokens, chainFilters } = useMemo8(() => {
|
|
3239
4173
|
if (!data) {
|
|
3240
4174
|
return { tokens: [], chainFilters: [{ id: "all", label: "All" }] };
|
|
3241
4175
|
}
|
|
@@ -3263,8 +4197,7 @@ import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain3, tronChain a
|
|
|
3263
4197
|
import {
|
|
3264
4198
|
getDepositAddressForChain as getDepositAddressForChain2,
|
|
3265
4199
|
getMinTransferValueForChain as getMinTransferValueForChain2,
|
|
3266
|
-
getTransferTokenQrCodeUri
|
|
3267
|
-
useDynamicConfig as useDynamicConfig5
|
|
4200
|
+
getTransferTokenQrCodeUri
|
|
3268
4201
|
} from "@funkit/connect-core";
|
|
3269
4202
|
var DEFAULT_MAX_SLIPPAGE_PERCENT = 0.25;
|
|
3270
4203
|
function resolveBlockchain(chainId) {
|
|
@@ -3290,7 +4223,7 @@ function useTokenTransfer({
|
|
|
3290
4223
|
dynamicRoutingId,
|
|
3291
4224
|
enabled
|
|
3292
4225
|
});
|
|
3293
|
-
const minTransferLimits =
|
|
4226
|
+
const minTransferLimits = useDynamicConfig("mintokentransfervalue");
|
|
3294
4227
|
const minTransferUsd = selectedChainId !== void 0 ? Math.ceil(
|
|
3295
4228
|
getMinTransferValueForChain2(selectedChainId, minTransferLimits)
|
|
3296
4229
|
) : 0;
|
|
@@ -3311,9 +4244,9 @@ function useTokenTransfer({
|
|
|
3311
4244
|
|
|
3312
4245
|
// src/transfer/QrCode.tsx
|
|
3313
4246
|
import QRCode from "react-native-qrcode-svg";
|
|
3314
|
-
import { jsx as
|
|
4247
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3315
4248
|
function QrCode({ value, size = 220, ecl = "H" }) {
|
|
3316
|
-
return /* @__PURE__ */
|
|
4249
|
+
return /* @__PURE__ */ jsx23(
|
|
3317
4250
|
QRCode,
|
|
3318
4251
|
{
|
|
3319
4252
|
value,
|
|
@@ -3335,9 +4268,9 @@ function getDefaultDynamicTargetAsset(candidates, dynamicRoutingId) {
|
|
|
3335
4268
|
|
|
3336
4269
|
// src/flow/FlowSheet.tsx
|
|
3337
4270
|
import {
|
|
3338
|
-
useCallback as
|
|
4271
|
+
useCallback as useCallback7,
|
|
3339
4272
|
useEffect as useEffect10,
|
|
3340
|
-
useRef as
|
|
4273
|
+
useRef as useRef6
|
|
3341
4274
|
} from "react";
|
|
3342
4275
|
import { View as View2 } from "react-native";
|
|
3343
4276
|
import {
|
|
@@ -3375,22 +4308,22 @@ function useKeyboardHeight(enabled) {
|
|
|
3375
4308
|
}
|
|
3376
4309
|
|
|
3377
4310
|
// src/flow/FlowSheet.tsx
|
|
3378
|
-
import { jsx as
|
|
4311
|
+
import { jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3379
4312
|
function FlowSheet({
|
|
3380
4313
|
isOpen,
|
|
3381
4314
|
session,
|
|
3382
4315
|
onClose,
|
|
3383
|
-
content:
|
|
4316
|
+
content: content3,
|
|
3384
4317
|
children,
|
|
3385
4318
|
keyboardAvoidEnabled = false
|
|
3386
4319
|
}) {
|
|
3387
|
-
const ref =
|
|
3388
|
-
const setRef =
|
|
4320
|
+
const ref = useRef6(null);
|
|
4321
|
+
const setRef = useCallback7((instance) => {
|
|
3389
4322
|
ref.current = instance;
|
|
3390
4323
|
}, []);
|
|
3391
4324
|
const keyboardHeight = useKeyboardHeight(keyboardAvoidEnabled);
|
|
3392
|
-
const hasPresented =
|
|
3393
|
-
const sheetSelfDismissed =
|
|
4325
|
+
const hasPresented = useRef6(false);
|
|
4326
|
+
const sheetSelfDismissed = useRef6(false);
|
|
3394
4327
|
useEffect10(() => {
|
|
3395
4328
|
if (isOpen) {
|
|
3396
4329
|
sheetSelfDismissed.current = false;
|
|
@@ -3406,7 +4339,7 @@ function FlowSheet({
|
|
|
3406
4339
|
}
|
|
3407
4340
|
ref.current?.dismiss();
|
|
3408
4341
|
}, [isOpen, session]);
|
|
3409
|
-
const handleDismiss =
|
|
4342
|
+
const handleDismiss = useCallback7(() => {
|
|
3410
4343
|
sheetSelfDismissed.current = true;
|
|
3411
4344
|
onClose();
|
|
3412
4345
|
}, [onClose]);
|
|
@@ -3414,8 +4347,8 @@ function FlowSheet({
|
|
|
3414
4347
|
duration: 300,
|
|
3415
4348
|
easing: Easing4.bezier(0.22, 1, 0.36, 1)
|
|
3416
4349
|
});
|
|
3417
|
-
const renderBackdrop =
|
|
3418
|
-
(props) => /* @__PURE__ */
|
|
4350
|
+
const renderBackdrop = useCallback7(
|
|
4351
|
+
(props) => /* @__PURE__ */ jsx24(
|
|
3419
4352
|
BottomSheetBackdrop,
|
|
3420
4353
|
{
|
|
3421
4354
|
...props,
|
|
@@ -3428,7 +4361,7 @@ function FlowSheet({
|
|
|
3428
4361
|
);
|
|
3429
4362
|
return /* @__PURE__ */ jsxs10(BottomSheetModalProvider, { children: [
|
|
3430
4363
|
children,
|
|
3431
|
-
/* @__PURE__ */
|
|
4364
|
+
/* @__PURE__ */ jsx24(
|
|
3432
4365
|
BottomSheetModal,
|
|
3433
4366
|
{
|
|
3434
4367
|
ref: setRef,
|
|
@@ -3441,8 +4374,8 @@ function FlowSheet({
|
|
|
3441
4374
|
handleComponent: null,
|
|
3442
4375
|
backgroundComponent: FlowSheetBackground,
|
|
3443
4376
|
children: /* @__PURE__ */ jsxs10(BottomSheetView, { children: [
|
|
3444
|
-
|
|
3445
|
-
keyboardHeight > 0 ? /* @__PURE__ */
|
|
4377
|
+
content3,
|
|
4378
|
+
keyboardHeight > 0 ? /* @__PURE__ */ jsx24(View2, { style: { height: keyboardHeight } }) : null
|
|
3446
4379
|
] })
|
|
3447
4380
|
}
|
|
3448
4381
|
)
|
|
@@ -3454,15 +4387,15 @@ function FlowSheetBackground({
|
|
|
3454
4387
|
}) {
|
|
3455
4388
|
const theme = useTheme();
|
|
3456
4389
|
const surface = {
|
|
3457
|
-
backgroundColor: theme.
|
|
4390
|
+
backgroundColor: theme.background.modal,
|
|
3458
4391
|
borderTopLeftRadius: theme.borderRadii.modal,
|
|
3459
4392
|
borderTopRightRadius: theme.borderRadii.modal
|
|
3460
4393
|
};
|
|
3461
4394
|
const extension = {
|
|
3462
4395
|
...bottomExtension,
|
|
3463
|
-
backgroundColor: theme.
|
|
4396
|
+
backgroundColor: theme.background.modal
|
|
3464
4397
|
};
|
|
3465
|
-
return /* @__PURE__ */
|
|
4398
|
+
return /* @__PURE__ */ jsx24(View2, { pointerEvents, style: [style, surface], children: /* @__PURE__ */ jsx24(View2, { style: extension }) });
|
|
3466
4399
|
}
|
|
3467
4400
|
var bottomExtension = {
|
|
3468
4401
|
position: "absolute",
|
|
@@ -3473,12 +4406,11 @@ var bottomExtension = {
|
|
|
3473
4406
|
};
|
|
3474
4407
|
|
|
3475
4408
|
// src/flow/FunkitFlowProvider.tsx
|
|
3476
|
-
import { jsx as
|
|
4409
|
+
import { Fragment as Fragment2, jsx as jsx25, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3477
4410
|
var CLOSED = {
|
|
3478
4411
|
isOpen: false,
|
|
3479
4412
|
stack: [],
|
|
3480
|
-
|
|
3481
|
-
callbacks: {},
|
|
4413
|
+
flow: null,
|
|
3482
4414
|
session: 0
|
|
3483
4415
|
};
|
|
3484
4416
|
var FunkitFlowContext = createContext3(null);
|
|
@@ -3488,64 +4420,78 @@ function FunkitFlowProvider({
|
|
|
3488
4420
|
}) {
|
|
3489
4421
|
const insets = useSafeAreaInsets();
|
|
3490
4422
|
const [state, setState] = useState9(CLOSED);
|
|
3491
|
-
const beginDeposit =
|
|
4423
|
+
const beginDeposit = useCallback8(
|
|
3492
4424
|
(config, callbacks = {}) => {
|
|
3493
4425
|
callbacks.onOpen?.();
|
|
3494
4426
|
setState((prev) => ({
|
|
3495
4427
|
isOpen: true,
|
|
3496
4428
|
stack: ["addMoney"],
|
|
3497
|
-
config,
|
|
3498
|
-
callbacks,
|
|
4429
|
+
flow: { mode: "deposit", config, callbacks },
|
|
3499
4430
|
session: prev.session + 1
|
|
3500
4431
|
}));
|
|
3501
4432
|
},
|
|
3502
4433
|
[]
|
|
3503
4434
|
);
|
|
3504
|
-
const
|
|
4435
|
+
const beginWithdrawal = useCallback8(
|
|
4436
|
+
(config, callbacks = {}) => {
|
|
4437
|
+
callbacks.onOpen?.();
|
|
4438
|
+
setState((prev) => ({
|
|
4439
|
+
isOpen: true,
|
|
4440
|
+
stack: ["withdrawMethod"],
|
|
4441
|
+
flow: { mode: "withdrawal", config, callbacks },
|
|
4442
|
+
session: prev.session + 1
|
|
4443
|
+
}));
|
|
4444
|
+
},
|
|
4445
|
+
[]
|
|
4446
|
+
);
|
|
4447
|
+
const clearToast = useCallback8(() => {
|
|
3505
4448
|
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
3506
4449
|
if (unmountTimerRef.current) clearTimeout(unmountTimerRef.current);
|
|
3507
4450
|
setCopiedToastShown(false);
|
|
3508
4451
|
setToastMounted(false);
|
|
3509
4452
|
}, []);
|
|
3510
|
-
const closeFlow =
|
|
4453
|
+
const closeFlow = useCallback8(() => {
|
|
3511
4454
|
setState((prev) => {
|
|
3512
4455
|
if (!prev.isOpen) return prev;
|
|
3513
|
-
prev.callbacks.onClose?.();
|
|
4456
|
+
prev.flow?.callbacks.onClose?.();
|
|
3514
4457
|
return CLOSED;
|
|
3515
4458
|
});
|
|
3516
4459
|
clearToast();
|
|
3517
4460
|
}, [clearToast]);
|
|
3518
|
-
const navigate =
|
|
4461
|
+
const navigate = useCallback8((screen) => {
|
|
3519
4462
|
setState((prev) => ({ ...prev, stack: [...prev.stack, screen] }));
|
|
3520
4463
|
}, []);
|
|
3521
|
-
const
|
|
4464
|
+
const reset = useCallback8((screen) => {
|
|
4465
|
+
setState((prev) => prev.isOpen ? { ...prev, stack: [screen] } : prev);
|
|
4466
|
+
}, []);
|
|
4467
|
+
const back = useCallback8(() => {
|
|
3522
4468
|
setState((prev) => {
|
|
3523
4469
|
if (!prev.isOpen) return prev;
|
|
3524
4470
|
if (prev.stack.length <= 1) {
|
|
3525
|
-
prev.callbacks.onClose?.();
|
|
4471
|
+
prev.flow?.callbacks.onClose?.();
|
|
3526
4472
|
return CLOSED;
|
|
3527
4473
|
}
|
|
3528
4474
|
return { ...prev, stack: prev.stack.slice(0, -1) };
|
|
3529
4475
|
});
|
|
3530
4476
|
}, []);
|
|
3531
|
-
const value =
|
|
3532
|
-
() => ({ beginDeposit, closeFlow }),
|
|
3533
|
-
[beginDeposit, closeFlow]
|
|
4477
|
+
const value = useMemo9(
|
|
4478
|
+
() => ({ beginDeposit, beginWithdrawal, closeFlow }),
|
|
4479
|
+
[beginDeposit, beginWithdrawal, closeFlow]
|
|
3534
4480
|
);
|
|
3535
4481
|
const current = state.stack[state.stack.length - 1];
|
|
3536
|
-
const nav =
|
|
3537
|
-
() => ({ navigate, back, closeFlow }),
|
|
3538
|
-
[navigate, back, closeFlow]
|
|
4482
|
+
const nav = useMemo9(
|
|
4483
|
+
() => ({ navigate, back, reset, closeFlow }),
|
|
4484
|
+
[navigate, back, reset, closeFlow]
|
|
3539
4485
|
);
|
|
3540
4486
|
const [toastMounted, setToastMounted] = useState9(false);
|
|
3541
4487
|
const [copiedToastShown, setCopiedToastShown] = useState9(false);
|
|
3542
|
-
const hideTimerRef =
|
|
4488
|
+
const hideTimerRef = useRef7(
|
|
3543
4489
|
void 0
|
|
3544
4490
|
);
|
|
3545
|
-
const unmountTimerRef =
|
|
4491
|
+
const unmountTimerRef = useRef7(
|
|
3546
4492
|
void 0
|
|
3547
4493
|
);
|
|
3548
|
-
const showCopiedToast =
|
|
4494
|
+
const showCopiedToast = useCallback8(() => {
|
|
3549
4495
|
if (hideTimerRef.current) clearTimeout(hideTimerRef.current);
|
|
3550
4496
|
if (unmountTimerRef.current) clearTimeout(unmountTimerRef.current);
|
|
3551
4497
|
setToastMounted(true);
|
|
@@ -3559,8 +4505,8 @@ function FunkitFlowProvider({
|
|
|
3559
4505
|
}, TOAST_VISIBLE_MS);
|
|
3560
4506
|
}, []);
|
|
3561
4507
|
useEffect11(() => () => clearToast(), [clearToast]);
|
|
3562
|
-
return /* @__PURE__ */
|
|
3563
|
-
/* @__PURE__ */
|
|
4508
|
+
return /* @__PURE__ */ jsx25(FunkitFlowContext.Provider, { value, children: /* @__PURE__ */ jsxs11(View3, { style: rootContainer, children: [
|
|
4509
|
+
/* @__PURE__ */ jsx25(
|
|
3564
4510
|
FlowSheet,
|
|
3565
4511
|
{
|
|
3566
4512
|
isOpen: state.isOpen,
|
|
@@ -3568,23 +4514,31 @@ function FunkitFlowProvider({
|
|
|
3568
4514
|
onClose: closeFlow,
|
|
3569
4515
|
keyboardAvoidEnabled: current === "swapped",
|
|
3570
4516
|
content: (
|
|
3571
|
-
// Mounted only while open so the
|
|
3572
|
-
state.isOpen && state.
|
|
4517
|
+
// Mounted only while open so the flow queries run only then.
|
|
4518
|
+
state.isOpen && state.flow ? state.flow.mode === "deposit" ? /* @__PURE__ */ jsx25(
|
|
3573
4519
|
FlowContent,
|
|
3574
4520
|
{
|
|
3575
|
-
config: state.config,
|
|
4521
|
+
config: state.flow.config,
|
|
3576
4522
|
current,
|
|
3577
4523
|
nav,
|
|
3578
4524
|
copyToClipboard: copyToClipboard2,
|
|
3579
4525
|
onCopySuccess: showCopiedToast,
|
|
3580
|
-
callbacks: state.callbacks
|
|
4526
|
+
callbacks: state.flow.callbacks
|
|
4527
|
+
}
|
|
4528
|
+
) : /* @__PURE__ */ jsx25(
|
|
4529
|
+
WithdrawalFlowContent,
|
|
4530
|
+
{
|
|
4531
|
+
config: state.flow.config,
|
|
4532
|
+
callbacks: state.flow.callbacks,
|
|
4533
|
+
current,
|
|
4534
|
+
nav
|
|
3581
4535
|
}
|
|
3582
4536
|
) : null
|
|
3583
4537
|
),
|
|
3584
4538
|
children
|
|
3585
4539
|
}
|
|
3586
4540
|
),
|
|
3587
|
-
toastMounted ? /* @__PURE__ */
|
|
4541
|
+
toastMounted ? /* @__PURE__ */ jsx25(
|
|
3588
4542
|
View3,
|
|
3589
4543
|
{
|
|
3590
4544
|
style: [
|
|
@@ -3592,7 +4546,7 @@ function FunkitFlowProvider({
|
|
|
3592
4546
|
{ paddingTop: insets.top + TOAST_INSET_OFFSET }
|
|
3593
4547
|
],
|
|
3594
4548
|
pointerEvents: "none",
|
|
3595
|
-
children: copiedToastShown ? /* @__PURE__ */
|
|
4549
|
+
children: copiedToastShown ? /* @__PURE__ */ jsx25(AddressCopiedToast, {}) : null
|
|
3596
4550
|
}
|
|
3597
4551
|
) : null
|
|
3598
4552
|
] }) });
|
|
@@ -3650,7 +4604,7 @@ function FlowContent({
|
|
|
3650
4604
|
});
|
|
3651
4605
|
const fetched = useSupportedTokens({ transferInit });
|
|
3652
4606
|
const tokenChainFilters = config.tokenChainFilters ?? fetched.chainFilters;
|
|
3653
|
-
const depositNetworks =
|
|
4607
|
+
const depositNetworks = useMemo9(
|
|
3654
4608
|
() => buildDepositNetworks(tokenChainFilters),
|
|
3655
4609
|
[tokenChainFilters]
|
|
3656
4610
|
);
|
|
@@ -3658,7 +4612,7 @@ function FlowContent({
|
|
|
3658
4612
|
(n) => n.chainId != null && belongsToNetwork(initialChainId, n.chainId)
|
|
3659
4613
|
);
|
|
3660
4614
|
const selectedChain = depositNetworks.find((n) => n.id === selectedNetworkId) ?? initialNetwork ?? depositNetworks[0];
|
|
3661
|
-
const minTransferLimits =
|
|
4615
|
+
const minTransferLimits = useDynamicConfig("mintokentransfervalue");
|
|
3662
4616
|
const {
|
|
3663
4617
|
savedFops,
|
|
3664
4618
|
genericFops,
|
|
@@ -3670,6 +4624,7 @@ function FlowContent({
|
|
|
3670
4624
|
checkoutConfig: activeCheckoutConfig,
|
|
3671
4625
|
dynamicRoutingId: activeDynamicRoutingId
|
|
3672
4626
|
});
|
|
4627
|
+
const { isLoading: isStatsigLoading } = useStatsigClient2();
|
|
3673
4628
|
const [selectedSwappedUrl, setSelectedSwappedUrl] = useState9();
|
|
3674
4629
|
const availableChains = buildAvailableChains({
|
|
3675
4630
|
chainFilters: tokenChainFilters,
|
|
@@ -3685,7 +4640,7 @@ function FlowContent({
|
|
|
3685
4640
|
const singleChain = availableChains.length === 1 ? availableChains[0] : void 0;
|
|
3686
4641
|
const rawAddress = generatedAddress ?? config.depositAddress;
|
|
3687
4642
|
const displayAddress = rawAddress ? formatDepositAddress(rawAddress) : "Generating\u2026";
|
|
3688
|
-
const copyAddressAndToast =
|
|
4643
|
+
const copyAddressAndToast = useCallback8(
|
|
3689
4644
|
async (value) => {
|
|
3690
4645
|
const ok = await copyToClipboard2(value) !== false;
|
|
3691
4646
|
if (ok) onCopySuccess();
|
|
@@ -3693,6 +4648,31 @@ function FlowContent({
|
|
|
3693
4648
|
},
|
|
3694
4649
|
[copyToClipboard2, onCopySuccess]
|
|
3695
4650
|
);
|
|
4651
|
+
const nestedSheetRef = useRef7(null);
|
|
4652
|
+
const [nestedScreen, setNestedScreen] = useState9(null);
|
|
4653
|
+
const openNestedScreen = useCallback8((screen2) => {
|
|
4654
|
+
setNestedScreen(screen2);
|
|
4655
|
+
}, []);
|
|
4656
|
+
useEffect11(() => {
|
|
4657
|
+
if (nestedScreen) {
|
|
4658
|
+
nestedSheetRef.current?.present();
|
|
4659
|
+
}
|
|
4660
|
+
}, [nestedScreen]);
|
|
4661
|
+
const closeNestedScreen = useCallback8(() => {
|
|
4662
|
+
nestedSheetRef.current?.dismiss();
|
|
4663
|
+
}, []);
|
|
4664
|
+
const renderNestedBackdrop = useCallback8(
|
|
4665
|
+
(props) => /* @__PURE__ */ jsx25(
|
|
4666
|
+
BottomSheetBackdrop2,
|
|
4667
|
+
{
|
|
4668
|
+
...props,
|
|
4669
|
+
appearsOnIndex: 0,
|
|
4670
|
+
disappearsOnIndex: -1,
|
|
4671
|
+
pressBehavior: "close"
|
|
4672
|
+
}
|
|
4673
|
+
),
|
|
4674
|
+
[]
|
|
4675
|
+
);
|
|
3696
4676
|
const screen = (() => {
|
|
3697
4677
|
switch (current) {
|
|
3698
4678
|
case "addMoney": {
|
|
@@ -3704,8 +4684,8 @@ function FlowContent({
|
|
|
3704
4684
|
id: CRYPTO_METHOD_ID,
|
|
3705
4685
|
title: "Crypto",
|
|
3706
4686
|
subtitle: "No limit",
|
|
3707
|
-
icon: /* @__PURE__ */
|
|
3708
|
-
trailing: cryptoSourceIcons.length ? /* @__PURE__ */
|
|
4687
|
+
icon: /* @__PURE__ */ jsx25(CryptoBitcoinIcon, {}),
|
|
4688
|
+
trailing: cryptoSourceIcons.length ? /* @__PURE__ */ jsx25(
|
|
3709
4689
|
SourceTokenCluster,
|
|
3710
4690
|
{
|
|
3711
4691
|
icons: cryptoSourceIcons,
|
|
@@ -3718,7 +4698,7 @@ function FlowContent({
|
|
|
3718
4698
|
id: row3.id,
|
|
3719
4699
|
title: row3.name,
|
|
3720
4700
|
subtitle: row3.subtitle,
|
|
3721
|
-
icon: /* @__PURE__ */
|
|
4701
|
+
icon: /* @__PURE__ */ jsx25(FunIcon, { uri: row3.iconUri, fallbackUri: FALLBACK_ASSET_LOGO })
|
|
3722
4702
|
}));
|
|
3723
4703
|
const methods = isSwappedEnabled ? [
|
|
3724
4704
|
...toCashRows(savedFops),
|
|
@@ -3730,11 +4710,11 @@ function FlowContent({
|
|
|
3730
4710
|
(c, i) => ({
|
|
3731
4711
|
id: String(i),
|
|
3732
4712
|
label: c.badgeText ? `${c.tokenSymbol} (${c.badgeText})` : c.tokenSymbol,
|
|
3733
|
-
icon: /* @__PURE__ */
|
|
4713
|
+
icon: /* @__PURE__ */ jsx25(TokenChainIcon, { symbol: c.tokenSymbol, iconSrc: c.iconSrc })
|
|
3734
4714
|
})
|
|
3735
4715
|
);
|
|
3736
4716
|
const selectedReceiveTokenId = selectedCandidate && candidates ? String(candidates.indexOf(selectedCandidate)) : void 0;
|
|
3737
|
-
return /* @__PURE__ */
|
|
4717
|
+
return /* @__PURE__ */ jsx25(
|
|
3738
4718
|
SelectMethodScreen,
|
|
3739
4719
|
{
|
|
3740
4720
|
methods,
|
|
@@ -3746,7 +4726,7 @@ function FlowContent({
|
|
|
3746
4726
|
setSelectedCandidate(picked);
|
|
3747
4727
|
}
|
|
3748
4728
|
},
|
|
3749
|
-
loading: isLoadingGeoCheck || isAddressLoading || isSwappedEnabled && isFopsLoading,
|
|
4729
|
+
loading: isLoadingGeoCheck || isAddressLoading || isStatsigLoading || isSwappedEnabled && isFopsLoading,
|
|
3750
4730
|
error: isSwappedEnabled && isFopsError,
|
|
3751
4731
|
onRetry: refetchFops,
|
|
3752
4732
|
onSelectMethod: (id) => {
|
|
@@ -3774,7 +4754,7 @@ function FlowContent({
|
|
|
3774
4754
|
label: chain.label,
|
|
3775
4755
|
iconKeys: chain.iconKeys ?? []
|
|
3776
4756
|
}));
|
|
3777
|
-
return /* @__PURE__ */
|
|
4757
|
+
return /* @__PURE__ */ jsx25(
|
|
3778
4758
|
TransferCryptoScreen,
|
|
3779
4759
|
{
|
|
3780
4760
|
depositAddress: displayAddress,
|
|
@@ -3784,57 +4764,198 @@ function FlowContent({
|
|
|
3784
4764
|
supportedTokenIcons: singleChain ? void 0 : availableChains.length ? availableChains.map((c) => c.iconUri) : selectedChain?.iconKeys ?? [],
|
|
3785
4765
|
minimumDepositLabel: singleChain?.minLabel,
|
|
3786
4766
|
onBack: nav.back,
|
|
3787
|
-
onShowChains: availableChains.length > 1 ? () =>
|
|
3788
|
-
onShowQrCode: () =>
|
|
4767
|
+
onShowChains: availableChains.length > 1 ? () => openNestedScreen("availableChains") : void 0,
|
|
4768
|
+
onShowQrCode: () => openNestedScreen("qrCode"),
|
|
3789
4769
|
onCopyAddress: rawAddress ? () => void copyAddressAndToast(rawAddress) : void 0,
|
|
3790
4770
|
onShareAddress: rawAddress ? () => void Share.share({ message: rawAddress }) : void 0
|
|
3791
4771
|
}
|
|
3792
4772
|
);
|
|
3793
4773
|
}
|
|
4774
|
+
case "swapped":
|
|
4775
|
+
return selectedSwappedUrl ? /* @__PURE__ */ jsx25(
|
|
4776
|
+
SwappedScreen,
|
|
4777
|
+
{
|
|
4778
|
+
url: selectedSwappedUrl,
|
|
4779
|
+
onBack: nav.back,
|
|
4780
|
+
onClose: nav.closeFlow
|
|
4781
|
+
}
|
|
4782
|
+
) : null;
|
|
4783
|
+
default:
|
|
4784
|
+
return null;
|
|
4785
|
+
}
|
|
4786
|
+
})();
|
|
4787
|
+
const bottomSheetScreen = (() => {
|
|
4788
|
+
switch (nestedScreen) {
|
|
3794
4789
|
case "availableChains":
|
|
3795
|
-
return /* @__PURE__ */
|
|
4790
|
+
return /* @__PURE__ */ jsx25(
|
|
3796
4791
|
AvailableChainsScreen,
|
|
3797
4792
|
{
|
|
3798
4793
|
networkLabel: selectedChain?.label ?? "",
|
|
3799
4794
|
chains: availableChains,
|
|
3800
|
-
onClose:
|
|
4795
|
+
onClose: closeNestedScreen
|
|
3801
4796
|
}
|
|
3802
4797
|
);
|
|
3803
4798
|
case "qrCode":
|
|
3804
|
-
return /* @__PURE__ */
|
|
4799
|
+
return /* @__PURE__ */ jsx25(
|
|
3805
4800
|
QrCodeScreen,
|
|
3806
4801
|
{
|
|
3807
|
-
qrCode: config.qrCode ?? (qrCodeUri ? /* @__PURE__ */
|
|
3808
|
-
centerIcon: /* @__PURE__ */
|
|
4802
|
+
qrCode: config.qrCode ?? (qrCodeUri ? /* @__PURE__ */ jsx25(QrCode, { value: qrCodeUri, size: 235 }) : null),
|
|
4803
|
+
centerIcon: /* @__PURE__ */ jsx25(QrChainCluster, { iconKeys: selectedChain?.iconKeys ?? [] }),
|
|
3809
4804
|
address: rawAddress,
|
|
3810
4805
|
onCopyAddress: rawAddress ? () => copyAddressAndToast(rawAddress) : void 0,
|
|
3811
|
-
onClose:
|
|
4806
|
+
onClose: closeNestedScreen
|
|
3812
4807
|
}
|
|
3813
4808
|
);
|
|
3814
|
-
case "swapped":
|
|
3815
|
-
return selectedSwappedUrl ? /* @__PURE__ */ jsx21(
|
|
3816
|
-
SwappedScreen,
|
|
3817
|
-
{
|
|
3818
|
-
url: selectedSwappedUrl,
|
|
3819
|
-
onBack: nav.back,
|
|
3820
|
-
onClose: nav.closeFlow
|
|
3821
|
-
}
|
|
3822
|
-
) : null;
|
|
3823
4809
|
default:
|
|
3824
4810
|
return null;
|
|
3825
4811
|
}
|
|
3826
4812
|
})();
|
|
3827
4813
|
if (isGeoblocked) {
|
|
3828
|
-
return /* @__PURE__ */
|
|
4814
|
+
return /* @__PURE__ */ jsx25(CheckoutBlockedScreen, {});
|
|
4815
|
+
}
|
|
4816
|
+
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
4817
|
+
screen,
|
|
4818
|
+
/* @__PURE__ */ jsx25(
|
|
4819
|
+
BottomSheetModal2,
|
|
4820
|
+
{
|
|
4821
|
+
ref: nestedSheetRef,
|
|
4822
|
+
enableDynamicSizing: true,
|
|
4823
|
+
handleComponent: void 0,
|
|
4824
|
+
backgroundComponent: FlowSheetBackground,
|
|
4825
|
+
backdropComponent: renderNestedBackdrop,
|
|
4826
|
+
onDismiss: () => setNestedScreen(null),
|
|
4827
|
+
children: /* @__PURE__ */ jsx25(BottomSheetView2, { children: bottomSheetScreen })
|
|
4828
|
+
}
|
|
4829
|
+
)
|
|
4830
|
+
] });
|
|
4831
|
+
}
|
|
4832
|
+
function WithdrawalFlowContent({
|
|
4833
|
+
config,
|
|
4834
|
+
callbacks,
|
|
4835
|
+
current,
|
|
4836
|
+
nav
|
|
4837
|
+
}) {
|
|
4838
|
+
const { isGeoblocked, isLoadingGeoCheck } = useCheckoutBlocked({
|
|
4839
|
+
onCheckoutBlocked: callbacks.onCheckoutBlocked
|
|
4840
|
+
});
|
|
4841
|
+
const queryClient = useQueryClient();
|
|
4842
|
+
const {
|
|
4843
|
+
fops,
|
|
4844
|
+
isLoading,
|
|
4845
|
+
noPaymentMethodsAvailable,
|
|
4846
|
+
isBelowMinimumBalance,
|
|
4847
|
+
isError,
|
|
4848
|
+
refetch,
|
|
4849
|
+
route
|
|
4850
|
+
} = useWithdrawalFops({ config });
|
|
4851
|
+
const [selectedFop, setSelectedFop] = useState9();
|
|
4852
|
+
const [hasExecutionError, setHasExecutionError] = useState9(false);
|
|
4853
|
+
const onExecutionError = useCallback8(() => setHasExecutionError(true), []);
|
|
4854
|
+
const { executeOrder } = useWithdrawalExecution({
|
|
4855
|
+
config,
|
|
4856
|
+
route,
|
|
4857
|
+
callbacks,
|
|
4858
|
+
onError: onExecutionError
|
|
4859
|
+
});
|
|
4860
|
+
const invalidateWithdrawFops = useCallback8(() => {
|
|
4861
|
+
void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] });
|
|
4862
|
+
}, [queryClient]);
|
|
4863
|
+
if (isGeoblocked) {
|
|
4864
|
+
return /* @__PURE__ */ jsx25(CheckoutBlockedScreen, {});
|
|
4865
|
+
}
|
|
4866
|
+
if (hasExecutionError) {
|
|
4867
|
+
return /* @__PURE__ */ jsx25(
|
|
4868
|
+
WithdrawMethodScreen,
|
|
4869
|
+
{
|
|
4870
|
+
title: config.title,
|
|
4871
|
+
methods: [],
|
|
4872
|
+
hasError: true,
|
|
4873
|
+
onRetry: () => {
|
|
4874
|
+
setHasExecutionError(false);
|
|
4875
|
+
invalidateWithdrawFops();
|
|
4876
|
+
nav.reset("withdrawMethod");
|
|
4877
|
+
},
|
|
4878
|
+
onSelectMethod: () => void 0
|
|
4879
|
+
}
|
|
4880
|
+
);
|
|
4881
|
+
}
|
|
4882
|
+
switch (current) {
|
|
4883
|
+
case "withdrawMethod": {
|
|
4884
|
+
const methods = toWithdrawFopRows(fops).map(
|
|
4885
|
+
(row3, i) => ({
|
|
4886
|
+
id: String(i),
|
|
4887
|
+
title: row3.name,
|
|
4888
|
+
subtitle: row3.subtitle,
|
|
4889
|
+
icon: /* @__PURE__ */ jsx25(FunIcon, { uri: row3.iconUri, fallbackUri: FALLBACK_ASSET_LOGO })
|
|
4890
|
+
})
|
|
4891
|
+
);
|
|
4892
|
+
return /* @__PURE__ */ jsx25(
|
|
4893
|
+
WithdrawMethodScreen,
|
|
4894
|
+
{
|
|
4895
|
+
title: config.title,
|
|
4896
|
+
methods,
|
|
4897
|
+
loading: isLoadingGeoCheck || isLoading,
|
|
4898
|
+
hasError: isError,
|
|
4899
|
+
onRetry: refetch,
|
|
4900
|
+
isEmpty: noPaymentMethodsAvailable,
|
|
4901
|
+
isBelowMinimum: isBelowMinimumBalance,
|
|
4902
|
+
onSelectMethod: (id) => {
|
|
4903
|
+
const fop = fops[Number(id)];
|
|
4904
|
+
if (!fop?.embeddedFlowUrl) return;
|
|
4905
|
+
logger.info("connect-rn:withdrawal:method_selected", {
|
|
4906
|
+
fopType: fop.fopType,
|
|
4907
|
+
fopName: fop.name
|
|
4908
|
+
});
|
|
4909
|
+
setSelectedFop(fop);
|
|
4910
|
+
nav.navigate("swapped");
|
|
4911
|
+
}
|
|
4912
|
+
}
|
|
4913
|
+
);
|
|
4914
|
+
}
|
|
4915
|
+
case "swapped":
|
|
4916
|
+
return selectedFop?.embeddedFlowUrl ? /* @__PURE__ */ jsx25(
|
|
4917
|
+
SwappedWithdrawScreen,
|
|
4918
|
+
{
|
|
4919
|
+
url: selectedFop.embeddedFlowUrl,
|
|
4920
|
+
onBack: () => {
|
|
4921
|
+
invalidateWithdrawFops();
|
|
4922
|
+
nav.back();
|
|
4923
|
+
},
|
|
4924
|
+
onClose: () => {
|
|
4925
|
+
invalidateWithdrawFops();
|
|
4926
|
+
nav.closeFlow();
|
|
4927
|
+
},
|
|
4928
|
+
onNewWithdrawal: () => {
|
|
4929
|
+
invalidateWithdrawFops();
|
|
4930
|
+
nav.back();
|
|
4931
|
+
},
|
|
4932
|
+
onWithdrawalSuccess: (data) => {
|
|
4933
|
+
invalidateWithdrawFops();
|
|
4934
|
+
callbacks.onWithdrawalSuccess?.(data);
|
|
4935
|
+
},
|
|
4936
|
+
onOrderData: (order) => {
|
|
4937
|
+
try {
|
|
4938
|
+
callbacks.onWithdrawalOrder?.(order);
|
|
4939
|
+
} catch (error) {
|
|
4940
|
+
logger.warn("connect-rn:withdrawal:order_callback_threw", {
|
|
4941
|
+
order_id: order.order_id,
|
|
4942
|
+
error: error instanceof Error ? error.message : String(error)
|
|
4943
|
+
});
|
|
4944
|
+
}
|
|
4945
|
+
void executeOrder(order);
|
|
4946
|
+
}
|
|
4947
|
+
}
|
|
4948
|
+
) : null;
|
|
4949
|
+
default:
|
|
4950
|
+
return null;
|
|
3829
4951
|
}
|
|
3830
|
-
return screen;
|
|
3831
4952
|
}
|
|
3832
4953
|
var TOAST_VISIBLE_MS = 1800;
|
|
3833
4954
|
var TOAST_EXIT_MS = 350;
|
|
3834
4955
|
var TOAST_INSET_OFFSET = 20;
|
|
3835
4956
|
var rootContainer = { flex: 1 };
|
|
3836
4957
|
var toastOverlay = {
|
|
3837
|
-
...
|
|
4958
|
+
...StyleSheet4.absoluteFill,
|
|
3838
4959
|
zIndex: 1,
|
|
3839
4960
|
alignItems: "center"
|
|
3840
4961
|
};
|
|
@@ -3847,7 +4968,7 @@ function useFunkitFlow() {
|
|
|
3847
4968
|
}
|
|
3848
4969
|
|
|
3849
4970
|
// src/version.ts
|
|
3850
|
-
var CONNECT_RN_VERSION = true ? "
|
|
4971
|
+
var CONNECT_RN_VERSION = true ? "3.0.0" : "0.0.0-dev";
|
|
3851
4972
|
|
|
3852
4973
|
// src/providers/FunkitStatsigProvider.tsx
|
|
3853
4974
|
import {
|
|
@@ -3855,7 +4976,7 @@ import {
|
|
|
3855
4976
|
LogLevel,
|
|
3856
4977
|
StatsigProvider
|
|
3857
4978
|
} from "@statsig/react-bindings";
|
|
3858
|
-
import { useMemo as
|
|
4979
|
+
import { useMemo as useMemo10 } from "react";
|
|
3859
4980
|
|
|
3860
4981
|
// src/statsig/useClientAsyncInitRN.ts
|
|
3861
4982
|
import {
|
|
@@ -4040,7 +5161,7 @@ function useClientAsyncInitRN(sdkKey, initialUser, statsigOptions = null) {
|
|
|
4040
5161
|
}
|
|
4041
5162
|
|
|
4042
5163
|
// src/providers/FunkitStatsigProvider.tsx
|
|
4043
|
-
import { jsx as
|
|
5164
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
4044
5165
|
var STATSIG_API = "https://data-api.fun.xyz/v1";
|
|
4045
5166
|
var STATSIG_CLIENT_KEY = "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
|
|
4046
5167
|
var STATSIG_SDK_TYPE = "react-native";
|
|
@@ -4057,7 +5178,7 @@ function FunkitStatsigProvider({
|
|
|
4057
5178
|
userId,
|
|
4058
5179
|
isDevelopment = false
|
|
4059
5180
|
}) {
|
|
4060
|
-
const user =
|
|
5181
|
+
const user = useMemo10(
|
|
4061
5182
|
() => buildFunkitStatsigUser(userId, apiKey),
|
|
4062
5183
|
[userId, apiKey]
|
|
4063
5184
|
);
|
|
@@ -4076,12 +5197,13 @@ function FunkitStatsigProvider({
|
|
|
4076
5197
|
tier: isDevelopment ? "development" : "production"
|
|
4077
5198
|
}
|
|
4078
5199
|
});
|
|
4079
|
-
return /* @__PURE__ */
|
|
5200
|
+
return /* @__PURE__ */ jsx26(StatsigProvider, { client, children });
|
|
4080
5201
|
}
|
|
4081
5202
|
|
|
4082
5203
|
// src/providers/FunkitProvider.tsx
|
|
4083
|
-
import { jsx as
|
|
5204
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4084
5205
|
var ANONYMOUS_CONFIG = { apiKey: "" };
|
|
5206
|
+
var IS_DEV_BUILD = typeof __DEV__ !== "undefined" && !!__DEV__;
|
|
4085
5207
|
function createFallbackQueryClient() {
|
|
4086
5208
|
return new QueryClient({
|
|
4087
5209
|
defaultOptions: {
|
|
@@ -4098,13 +5220,13 @@ function FunkitProvider({
|
|
|
4098
5220
|
queryClient,
|
|
4099
5221
|
themes,
|
|
4100
5222
|
colorScheme,
|
|
4101
|
-
debug =
|
|
5223
|
+
debug = IS_DEV_BUILD,
|
|
4102
5224
|
copyToClipboard: copyToClipboard2
|
|
4103
5225
|
}) {
|
|
4104
|
-
const fallbackClient =
|
|
5226
|
+
const fallbackClient = useRef8(void 0);
|
|
4105
5227
|
fallbackClient.current ??= createFallbackQueryClient();
|
|
4106
5228
|
const client = queryClient ?? fallbackClient.current;
|
|
4107
|
-
const identity =
|
|
5229
|
+
const identity = useMemo11(
|
|
4108
5230
|
() => resolveFunkitIdentity(config ?? ANONYMOUS_CONFIG, walletAddress),
|
|
4109
5231
|
[config, walletAddress]
|
|
4110
5232
|
);
|
|
@@ -4123,26 +5245,30 @@ function FunkitProvider({
|
|
|
4123
5245
|
""
|
|
4124
5246
|
);
|
|
4125
5247
|
}, [identity]);
|
|
4126
|
-
return /* @__PURE__ */
|
|
5248
|
+
return /* @__PURE__ */ jsx27(SafeAreaProvider, { children: /* @__PURE__ */ jsx27(
|
|
4127
5249
|
FunkitStatsigProvider,
|
|
4128
5250
|
{
|
|
4129
5251
|
apiKey: identity.apiKey,
|
|
4130
5252
|
userId: identity.userId,
|
|
4131
5253
|
isDevelopment: debug,
|
|
4132
|
-
children: /* @__PURE__ */
|
|
5254
|
+
children: /* @__PURE__ */ jsx27(QueryClientProvider, { client, children: /* @__PURE__ */ jsx27(FunkitIdentityProvider, { identity, children: /* @__PURE__ */ jsx27(FunkitThemeProvider, { themes, colorScheme, children: /* @__PURE__ */ jsx27(FunkitFlowProvider, { copyToClipboard: copyToClipboard2, children }) }) }) })
|
|
4133
5255
|
}
|
|
4134
5256
|
) });
|
|
4135
5257
|
}
|
|
4136
5258
|
|
|
4137
5259
|
// src/providers/useFunkitCheckout.ts
|
|
4138
|
-
import { useCallback as
|
|
5260
|
+
import { useCallback as useCallback9 } from "react";
|
|
4139
5261
|
function useFunkitCheckout(callbacks = {}) {
|
|
4140
|
-
const { beginDeposit:
|
|
4141
|
-
const beginDeposit =
|
|
4142
|
-
(config) =>
|
|
4143
|
-
[
|
|
5262
|
+
const { beginDeposit: openDepositFlow, beginWithdrawal: openWithdrawalFlow } = useFunkitFlow();
|
|
5263
|
+
const beginDeposit = useCallback9(
|
|
5264
|
+
(config) => openDepositFlow(config, callbacks),
|
|
5265
|
+
[openDepositFlow, callbacks]
|
|
5266
|
+
);
|
|
5267
|
+
const beginWithdrawal = useCallback9(
|
|
5268
|
+
(config) => openWithdrawalFlow(config, callbacks),
|
|
5269
|
+
[openWithdrawalFlow, callbacks]
|
|
4144
5270
|
);
|
|
4145
|
-
return { beginDeposit };
|
|
5271
|
+
return { beginDeposit, beginWithdrawal };
|
|
4146
5272
|
}
|
|
4147
5273
|
export {
|
|
4148
5274
|
AddressCopiedToast,
|
|
@@ -4150,10 +5276,12 @@ export {
|
|
|
4150
5276
|
FunkitProvider,
|
|
4151
5277
|
FunkitThemeProvider,
|
|
4152
5278
|
Text,
|
|
5279
|
+
darkTheme,
|
|
4153
5280
|
darkTokens,
|
|
4154
5281
|
defaultDarkTheme,
|
|
4155
5282
|
defaultLightTheme,
|
|
4156
5283
|
fontFamilyForWeight,
|
|
5284
|
+
lightTheme,
|
|
4157
5285
|
lightTokens,
|
|
4158
5286
|
normalizeColorScheme,
|
|
4159
5287
|
resolveColorScheme,
|