@funkit/connect-rn 2.1.0 → 3.1.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 +71 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1433 -843
- 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.map +1 -1
- 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/history/useCheckoutsListenerByUserId.d.ts +19 -0
- package/dist/src/history/useCheckoutsListenerByUserId.d.ts.map +1 -0
- package/dist/src/history/useRecentDeposits.d.ts +36 -0
- package/dist/src/history/useRecentDeposits.d.ts.map +1 -0
- package/dist/src/icons/FunIcon.d.ts.map +1 -1
- package/dist/src/icons/PaymentBrandIcons.d.ts +9 -0
- package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -1
- package/dist/src/icons/PaymentMethodIcon.d.ts +5 -0
- package/dist/src/icons/PaymentMethodIcon.d.ts.map +1 -0
- package/dist/src/icons/QrChainCluster.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/providers/FunkitProvider.d.ts.map +1 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts +3 -3
- 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.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/statsig/useDynamicConfig.d.ts +6 -0
- package/dist/src/statsig/useDynamicConfig.d.ts.map +1 -0
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/swapped/buildSwappedTheme.d.ts +7 -4
- package/dist/src/swapped/buildSwappedTheme.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 +0 -2
- package/dist/src/transfer/fops.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/src/utils/customers.d.ts +2 -0
- package/dist/src/utils/customers.d.ts.map +1 -0
- package/package.json +3 -3
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
|
-
btnTertiaryPressed: "#EFEFEF",
|
|
30
|
-
btnTertiaryFocused: "#FFFFFF",
|
|
31
|
-
btnTertiaryDisabled: "#FFFFFF",
|
|
32
|
-
btnIcon: "#FFFFFF",
|
|
33
|
-
btnIconHover: "#F9F9F9",
|
|
34
|
-
btnIconPressed: "#EFEFEF",
|
|
35
|
-
btnIconFocused: "#FFFFFF",
|
|
36
|
-
btnIconDisabled: "#FFFFFF",
|
|
37
|
-
btnDestructive: "#F34126",
|
|
38
|
-
btnDestructiveHover: "#DB3B22",
|
|
39
|
-
btnDestructivePressed: "#C2341E",
|
|
40
|
-
btnDestructiveFocused: "#F34126",
|
|
41
|
-
btnDestructiveDisabled: "#F34126",
|
|
42
|
-
pill: "#FFFFFF",
|
|
43
|
-
pillHover: "#F9F9F9",
|
|
44
|
-
pillPressed: "#EFEFEF",
|
|
45
|
-
pillFocused: "#FFFFFF",
|
|
46
|
-
pillDisabled: "#FFFFFF",
|
|
47
|
-
textPrimary: "#0F0F0F",
|
|
48
|
-
textSecondary: "#6C6C6C",
|
|
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" }
|
|
68
25
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
element: 12,
|
|
72
|
-
elementInner: 8,
|
|
73
|
-
button: 999,
|
|
74
|
-
rounded: 999
|
|
26
|
+
opacity: {
|
|
27
|
+
disabled: 40
|
|
75
28
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
+
}
|
|
82
45
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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 }
|
|
87
54
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
+
}
|
|
99
68
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
amountInput: 48,
|
|
107
|
-
amountSummary: 48
|
|
69
|
+
spacing: {
|
|
70
|
+
padding: {
|
|
71
|
+
elements: { horizontal: 12 },
|
|
72
|
+
modal: { horizontal: 16 }
|
|
73
|
+
},
|
|
74
|
+
heights: { topBar: 56, button: 42 }
|
|
108
75
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
76
|
+
brand: {
|
|
77
|
+
primary: "#0F0F0F"
|
|
78
|
+
},
|
|
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
|
-
btnTertiaryPressed: "#464646",
|
|
131
|
-
btnTertiaryFocused: "#0F0F0F",
|
|
132
|
-
btnTertiaryDisabled: "#0F0F0F",
|
|
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" }
|
|
169
100
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
element: 12,
|
|
173
|
-
elementInner: 8,
|
|
174
|
-
button: 999,
|
|
175
|
-
rounded: 999
|
|
101
|
+
opacity: {
|
|
102
|
+
disabled: 40
|
|
176
103
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
+
}
|
|
183
120
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
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 }
|
|
188
129
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
+
}
|
|
143
|
+
},
|
|
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";
|
|
@@ -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(
|
|
@@ -455,18 +459,19 @@ var enterAnimation = new Keyframe({
|
|
|
455
459
|
}).duration(450);
|
|
456
460
|
var exitAnimation = FadeOutUp.duration(350);
|
|
457
461
|
function AddressCopiedToast({
|
|
458
|
-
label
|
|
462
|
+
label = "Address copied"
|
|
459
463
|
}) {
|
|
464
|
+
const theme = useTheme();
|
|
460
465
|
return /* @__PURE__ */ jsxs(
|
|
461
466
|
Animated.View,
|
|
462
467
|
{
|
|
463
468
|
entering: enterAnimation,
|
|
464
469
|
exiting: exitAnimation,
|
|
465
|
-
style: styles.pill,
|
|
470
|
+
style: [styles.pill, { backgroundColor: theme.background.pill.default }],
|
|
466
471
|
accessibilityRole: "alert",
|
|
467
|
-
accessibilityLabel:
|
|
472
|
+
accessibilityLabel: label,
|
|
468
473
|
children: [
|
|
469
|
-
/* @__PURE__ */ jsx2(
|
|
474
|
+
/* @__PURE__ */ jsx2(Text, { variant: "bodyMedium", children: label }),
|
|
470
475
|
/* @__PURE__ */ jsx2(FigmaSuccessCheckIcon, { size: 16 })
|
|
471
476
|
]
|
|
472
477
|
}
|
|
@@ -476,7 +481,6 @@ var pill = {
|
|
|
476
481
|
height: 42,
|
|
477
482
|
paddingHorizontal: 16,
|
|
478
483
|
borderRadius: 999,
|
|
479
|
-
backgroundColor: "#ffffff",
|
|
480
484
|
flexDirection: "row",
|
|
481
485
|
alignItems: "center",
|
|
482
486
|
gap: 6,
|
|
@@ -485,12 +489,7 @@ var pill = {
|
|
|
485
489
|
shadowOffset: { width: 0, height: 4 },
|
|
486
490
|
shadowRadius: 12
|
|
487
491
|
};
|
|
488
|
-
var
|
|
489
|
-
color: "#111111",
|
|
490
|
-
fontSize: 16,
|
|
491
|
-
fontWeight: "500"
|
|
492
|
-
};
|
|
493
|
-
var styles = StyleSheet.create({ pill, label });
|
|
492
|
+
var styles = StyleSheet.create({ pill });
|
|
494
493
|
|
|
495
494
|
// src/theme/FunkitThemeProvider.tsx
|
|
496
495
|
import { ThemeProvider } from "@shopify/restyle";
|
|
@@ -550,7 +549,7 @@ function useFunkitColorScheme() {
|
|
|
550
549
|
|
|
551
550
|
// src/providers/FunkitProvider.tsx
|
|
552
551
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
553
|
-
import { useEffect as useEffect12, useMemo as useMemo11, useRef as
|
|
552
|
+
import { useEffect as useEffect12, useMemo as useMemo11, useRef as useRef9 } from "react";
|
|
554
553
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
555
554
|
|
|
556
555
|
// src/flow/FunkitFlowProvider.tsx
|
|
@@ -559,23 +558,14 @@ import {
|
|
|
559
558
|
BottomSheetModal as BottomSheetModal2,
|
|
560
559
|
BottomSheetView as BottomSheetView2
|
|
561
560
|
} from "@gorhom/bottom-sheet";
|
|
562
|
-
|
|
563
|
-
|
|
561
|
+
|
|
562
|
+
// src/statsig/useDynamicConfig.ts
|
|
564
563
|
import {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
useContext as useContext3,
|
|
568
|
-
useEffect as useEffect11,
|
|
569
|
-
useMemo as useMemo9,
|
|
570
|
-
useRef as useRef7,
|
|
571
|
-
useState as useState9
|
|
572
|
-
} from "react";
|
|
573
|
-
import { Share, StyleSheet as StyleSheet3, View as View3 } from "react-native";
|
|
574
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
564
|
+
useDynamicConfig as useCoreDynamicConfig
|
|
565
|
+
} from "@funkit/connect-core";
|
|
575
566
|
|
|
576
|
-
// src/geo/
|
|
577
|
-
import {
|
|
578
|
-
import { useDynamicConfig, useEffectEvent } from "@funkit/connect-core";
|
|
567
|
+
// src/geo/useUserIpInfo.ts
|
|
568
|
+
import { useUserIpInfo as useCoreUserIpInfo } from "@funkit/connect-core";
|
|
579
569
|
|
|
580
570
|
// src/logging/logger.ts
|
|
581
571
|
import { FunLogger } from "@funkit/connect-core";
|
|
@@ -687,6 +677,43 @@ var logger = new FunLogger(
|
|
|
687
677
|
})
|
|
688
678
|
);
|
|
689
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 useRef8,
|
|
708
|
+
useState as useState10
|
|
709
|
+
} from "react";
|
|
710
|
+
import { Share, StyleSheet as StyleSheet4, View as View4 } from "react-native";
|
|
711
|
+
import { useSafeAreaInsets as useSafeAreaInsets3 } 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
|
+
|
|
690
717
|
// src/geo/isCountryBlocked.ts
|
|
691
718
|
var ALL_MATCH = "*";
|
|
692
719
|
function isCountryBlocked(blockedList, userIpInfo) {
|
|
@@ -703,58 +730,6 @@ function isCountryBlocked(blockedList, userIpInfo) {
|
|
|
703
730
|
return isBlocked;
|
|
704
731
|
}
|
|
705
732
|
|
|
706
|
-
// src/geo/useUserIpInfo.ts
|
|
707
|
-
import { useQuery } from "@tanstack/react-query";
|
|
708
|
-
var MOONPAY_LIVE_API_KEY = "pk_live_IxayBRQuBC3RzpPZkbGPrwUsRWAaeO";
|
|
709
|
-
function errData(error) {
|
|
710
|
-
return { error: error instanceof Error ? error.message : String(error) };
|
|
711
|
-
}
|
|
712
|
-
async function getIpViaMoonpay() {
|
|
713
|
-
const res = await fetch(
|
|
714
|
-
`https://api.moonpay.com/v3/ip_address?apiKey=${MOONPAY_LIVE_API_KEY}`
|
|
715
|
-
);
|
|
716
|
-
if (!res.ok) {
|
|
717
|
-
throw new Error(res.statusText);
|
|
718
|
-
}
|
|
719
|
-
const data = await res.json();
|
|
720
|
-
return { alpha2: data.alpha2, state: data.state };
|
|
721
|
-
}
|
|
722
|
-
async function getIpViaIpApi() {
|
|
723
|
-
const res = await fetch("https://ipapi.co/json");
|
|
724
|
-
if (!res.ok) {
|
|
725
|
-
throw new Error(res.statusText);
|
|
726
|
-
}
|
|
727
|
-
const data = await res.json();
|
|
728
|
-
return { alpha2: data.country_code, state: data.region_code };
|
|
729
|
-
}
|
|
730
|
-
function useUserIpInfo() {
|
|
731
|
-
const { data: userIpInfo, isLoading: isLoadingGeoCheck } = useQuery({
|
|
732
|
-
queryKey: ["getUserIpInfo"],
|
|
733
|
-
queryFn: async () => {
|
|
734
|
-
try {
|
|
735
|
-
return await getIpViaMoonpay();
|
|
736
|
-
} catch (moonpayError) {
|
|
737
|
-
logger.warn(
|
|
738
|
-
"connect-rn:getUserIpViaMoonpay:error",
|
|
739
|
-
errData(moonpayError)
|
|
740
|
-
);
|
|
741
|
-
try {
|
|
742
|
-
return await getIpViaIpApi();
|
|
743
|
-
} catch (ipApiError) {
|
|
744
|
-
logger.warn("connect-rn:getUserIpViaIpApi:error", errData(ipApiError));
|
|
745
|
-
throw ipApiError;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
},
|
|
749
|
-
// Location is stable within a session; don't refetch aggressively.
|
|
750
|
-
staleTime: Number.POSITIVE_INFINITY,
|
|
751
|
-
refetchOnMount: false,
|
|
752
|
-
refetchOnReconnect: true,
|
|
753
|
-
refetchOnWindowFocus: false
|
|
754
|
-
});
|
|
755
|
-
return { userIpInfo, isLoadingGeoCheck };
|
|
756
|
-
}
|
|
757
|
-
|
|
758
733
|
// src/geo/useCheckoutBlocked.ts
|
|
759
734
|
function useCheckoutBlocked(params) {
|
|
760
735
|
const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo();
|
|
@@ -779,6 +754,9 @@ function useCheckoutBlocked(params) {
|
|
|
779
754
|
return { isGeoblocked, isLoadingGeoCheck };
|
|
780
755
|
}
|
|
781
756
|
|
|
757
|
+
// src/icons/PaymentMethodIcon.tsx
|
|
758
|
+
import { getSwappedIcon, isSavedFormOfPaymentType } from "@funkit/connect-core";
|
|
759
|
+
|
|
782
760
|
// src/icons/assetLogos.ts
|
|
783
761
|
var ASSET_LOGO_SRCS = {
|
|
784
762
|
$MFER: "https://sdk-cdn.fun.xyz/images/mfer.png",
|
|
@@ -877,28 +855,11 @@ var ASSET_LOGO_SRCS = {
|
|
|
877
855
|
};
|
|
878
856
|
var FALLBACK_ASSET_LOGO = "https://sdk-cdn.fun.xyz/images/dollar_circle.png";
|
|
879
857
|
|
|
880
|
-
// src/icons/CryptoBitcoinIcon.tsx
|
|
881
|
-
import { SvgXml as SvgXml2 } from "react-native-svg";
|
|
882
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
883
|
-
var CIRCLE_BITCOIN_SVG = `<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.9168 11.8737C12.9168 12.449 12.4505 12.9154 11.8752 12.9154H8.75016V10.832H11.8752C12.4505 10.832 12.9168 11.2984 12.9168 11.8737Z" fill="currentColor"/><path d="M11.4585 7.08203H8.75016V9.16536H11.4585C12.0338 9.16536 12.5002 8.69899 12.5002 8.1237C12.5002 7.5484 12.0338 7.08203 11.4585 7.08203Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0002 0.832031C4.93755 0.832031 0.833496 4.93609 0.833496 9.9987C0.833496 15.0613 4.93755 19.1654 10.0002 19.1654C15.0628 19.1654 19.1668 15.0613 19.1668 9.9987C19.1668 4.93609 15.0628 0.832031 10.0002 0.832031ZM8.3335 4.16536C8.79373 4.16536 9.16683 4.53846 9.16683 4.9987V5.41536H10.0002V4.9987C10.0002 4.53846 10.3733 4.16536 10.8335 4.16536C11.2937 4.16536 11.6668 4.53846 11.6668 4.9987V5.42326C13.0653 5.52964 14.1668 6.69803 14.1668 8.1237C14.1668 8.74941 13.9546 9.32557 13.5983 9.78413C14.2 10.2809 14.5835 11.0325 14.5835 11.8737C14.5835 13.3695 13.3709 14.582 11.8752 14.582H11.6668V14.9987C11.6668 15.4589 11.2937 15.832 10.8335 15.832C10.3733 15.832 10.0002 15.4589 10.0002 14.9987V14.582H9.16683V14.9987C9.16683 15.4589 8.79373 15.832 8.3335 15.832C7.87326 15.832 7.50016 15.4589 7.50016 14.9987V14.582H6.66683C6.20659 14.582 5.8335 14.2089 5.8335 13.7487C5.8335 13.2885 6.20659 12.9154 6.66683 12.9154H7.0835V7.08203H6.66683C6.20659 7.08203 5.8335 6.70894 5.8335 6.2487C5.8335 5.78846 6.20659 5.41536 6.66683 5.41536H7.50016V4.9987C7.50016 4.53846 7.87326 4.16536 8.3335 4.16536Z" fill="currentColor"/></svg>`;
|
|
884
|
-
function CryptoBitcoinIcon({ size = 28 }) {
|
|
885
|
-
const theme = useTheme();
|
|
886
|
-
return /* @__PURE__ */ jsx4(
|
|
887
|
-
SvgXml2,
|
|
888
|
-
{
|
|
889
|
-
xml: CIRCLE_BITCOIN_SVG,
|
|
890
|
-
width: size,
|
|
891
|
-
height: size,
|
|
892
|
-
color: theme.colors.textPrimary
|
|
893
|
-
}
|
|
894
|
-
);
|
|
895
|
-
}
|
|
896
|
-
|
|
897
858
|
// src/icons/FunIcon.tsx
|
|
898
859
|
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
899
860
|
import { Image } from "react-native";
|
|
900
|
-
import { SvgXml as
|
|
901
|
-
import { jsx as
|
|
861
|
+
import { SvgXml as SvgXml2 } from "react-native-svg";
|
|
862
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
902
863
|
var svgCache = /* @__PURE__ */ new Map();
|
|
903
864
|
function ensureViewBox(svg) {
|
|
904
865
|
if (/\bviewBox\s*=/.test(svg)) {
|
|
@@ -918,6 +879,7 @@ function FunIcon({ uri, size = 32, fallbackUri }) {
|
|
|
918
879
|
() => svgCache.get(currentUri) ?? null
|
|
919
880
|
);
|
|
920
881
|
const [rasterLoaded, setRasterLoaded] = useState3(false);
|
|
882
|
+
const theme = useTheme();
|
|
921
883
|
useEffect3(() => {
|
|
922
884
|
setCurrentUri(uri);
|
|
923
885
|
setRasterLoaded(false);
|
|
@@ -965,15 +927,17 @@ function FunIcon({ uri, size = 32, fallbackUri }) {
|
|
|
965
927
|
}, [currentUri, isSvg]);
|
|
966
928
|
const ready = isSvg ? xml != null : rasterLoaded;
|
|
967
929
|
const clip = { overflow: "hidden" };
|
|
968
|
-
return /* @__PURE__ */
|
|
930
|
+
return /* @__PURE__ */ jsx4(
|
|
969
931
|
Box,
|
|
970
932
|
{
|
|
971
933
|
width: size,
|
|
972
934
|
height: size,
|
|
973
935
|
borderRadius: "rounded",
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
936
|
+
style: [
|
|
937
|
+
clip,
|
|
938
|
+
{ backgroundColor: ready ? void 0 : theme.background.secondary }
|
|
939
|
+
],
|
|
940
|
+
children: isSvg ? xml != null ? /* @__PURE__ */ jsx4(SvgXml2, { xml, width: size, height: size }) : null : /* @__PURE__ */ jsx4(
|
|
977
941
|
Image,
|
|
978
942
|
{
|
|
979
943
|
source: { uri: currentUri },
|
|
@@ -986,19 +950,91 @@ function FunIcon({ uri, size = 32, fallbackUri }) {
|
|
|
986
950
|
);
|
|
987
951
|
}
|
|
988
952
|
|
|
953
|
+
// src/icons/PaymentBrandIcons.tsx
|
|
954
|
+
import { SvgXml as SvgXml3 } from "react-native-svg";
|
|
955
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
956
|
+
var MASTERCARD_SVG = '<svg width="24" height="18" viewBox="0 0 24 18" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8.5" cy="9" r="7.5" fill="#EB001B"/><circle cx="15.5" cy="9" r="7.5" fill="#F79E1B"/><path d="M12 3.3A7.49 7.49 0 0 1 12 14.7 7.49 7.49 0 0 1 12 3.3Z" fill="#FF5F00"/></svg>';
|
|
957
|
+
var VISA_SVG = '<svg width="24" height="19" viewBox="0 0 24 19" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 0.00405757L15.7253 19H10.3255L6.25345 3.83691C6.17546 3.09873 5.70545 2.48223 5.05208 2.17398L5.03943 2.16789C3.58936 1.48244 1.90322 0.924752 0.139106 0.573914L0 0.551607L0.122245 0.00202878H8.81426C9.99877 0.00202878 10.9831 0.835522 11.1664 1.92454L11.1685 1.93671L13.3205 12.9303L18.636 0L24 0.00405757Z" fill="#1B33C3"/></svg>';
|
|
958
|
+
var JCB_SVG = '<svg width="24" height="19" viewBox="0 0 24 19" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_5933_159)"><path d="M23.9201 15.1208C23.9201 17.2137 22.2589 18.9179 20.2188 18.9179H0.0800781V3.8791C0.0800781 1.78623 1.7413 0.0820312 3.7814 0.0820312H23.9201V15.1208Z" fill="white"/><path d="M17.3625 11.264H18.8926C18.9363 11.264 19.0383 11.249 19.0821 11.249C19.3735 11.1892 19.6212 10.9201 19.6212 10.5464C19.6212 10.1876 19.3735 9.91855 19.0821 9.84381C19.0383 9.82886 18.9509 9.82886 18.8926 9.82886H17.3625V11.264Z" fill="url(#paint0_linear_5933_159)"/><path d="M18.7177 1.35266C17.2605 1.35266 16.0656 2.56354 16.0656 4.0734V6.89878H19.8106C19.8981 6.89878 20.0001 6.89878 20.0729 6.91373C20.9181 6.95857 21.5447 7.40705 21.5447 8.1844C21.5447 8.79731 21.1221 9.32053 20.3352 9.42517V9.45507C21.195 9.51487 21.8507 10.0082 21.8507 10.7706C21.8507 11.5928 21.1221 12.131 20.1604 12.131H16.051V17.6621H19.9418C21.399 17.6621 22.5939 16.4512 22.5939 14.9414V1.35266H18.7177Z" fill="url(#paint1_linear_5933_159)"/><path d="M19.4318 8.36381C19.4318 8.00504 19.1841 7.76585 18.8926 7.721C18.8635 7.721 18.7906 7.70605 18.7469 7.70605H17.3625V9.02158H18.7469C18.7906 9.02158 18.8781 9.02158 18.8926 9.00663C19.1841 8.96178 19.4318 8.72259 19.4318 8.36381Z" fill="url(#paint2_linear_5933_159)"/><path d="M4.0583 1.35266C2.60109 1.35266 1.40617 2.56354 1.40617 4.0734V10.7855C2.14935 11.1593 2.92168 11.3985 3.694 11.3985C4.61204 11.3985 5.10749 10.8304 5.10749 10.053V6.88383H7.38075V10.0381C7.38075 11.2639 6.63757 12.2655 4.11659 12.2655C2.58652 12.2655 1.3916 11.9217 1.3916 11.9217V17.6472H5.28236C6.73957 17.6472 7.93449 16.4363 7.93449 14.9264V1.35266H4.0583Z" fill="url(#paint3_linear_5933_159)"/><path d="M11.388 1.35266C9.93075 1.35266 8.73584 2.56354 8.73584 4.0734V7.63128C9.40616 7.04827 10.5719 6.67454 12.4517 6.76423C13.4572 6.80908 14.5355 7.09311 14.5355 7.09311V8.24419C13.9964 7.96016 13.3552 7.70603 12.5246 7.64623C11.0965 7.54159 10.2368 8.25914 10.2368 9.51487C10.2368 10.7855 11.0965 11.5031 12.5246 11.3835C13.3552 11.3237 13.9964 11.0546 14.5355 10.7855V11.9366C14.5355 11.9366 13.4718 12.2207 12.4517 12.2655C10.5719 12.3552 9.40616 11.9815 8.73584 11.3985V17.6771H12.6266C14.0838 17.6771 15.2787 16.4662 15.2787 14.9563V1.35266H11.388Z" fill="url(#paint4_linear_5933_159)"/></g><defs><linearGradient id="paint0_linear_5933_159" x1="16.0632" y1="10.5482" x2="22.6115" y2="10.5482" gradientUnits="userSpaceOnUse"><stop stop-color="#007940"/><stop offset="0.2285" stop-color="#00873F"/><stop offset="0.7433" stop-color="#40A737"/><stop offset="1" stop-color="#5CB531"/></linearGradient><linearGradient id="paint1_linear_5933_159" x1="16.063" y1="9.50087" x2="22.6118" y2="9.50087" gradientUnits="userSpaceOnUse"><stop stop-color="#007940"/><stop offset="0.2285" stop-color="#00873F"/><stop offset="0.7433" stop-color="#40A737"/><stop offset="1" stop-color="#5CB531"/></linearGradient><linearGradient id="paint2_linear_5933_159" x1="16.063" y1="8.36194" x2="22.6116" y2="8.36194" gradientUnits="userSpaceOnUse"><stop stop-color="#007940"/><stop offset="0.2285" stop-color="#00873F"/><stop offset="0.7433" stop-color="#40A737"/><stop offset="1" stop-color="#5CB531"/></linearGradient><linearGradient id="paint3_linear_5933_159" x1="1.40309" y1="9.50086" x2="8.05279" y2="9.50086" gradientUnits="userSpaceOnUse"><stop stop-color="#1F286F"/><stop offset="0.4751" stop-color="#004E94"/><stop offset="0.8261" stop-color="#0066B1"/><stop offset="1" stop-color="#006FBC"/></linearGradient><linearGradient id="paint4_linear_5933_159" x1="8.69816" y1="9.50086" x2="15.1566" y2="9.50086" gradientUnits="userSpaceOnUse"><stop stop-color="#6C2C2F"/><stop offset="0.1735" stop-color="#882730"/><stop offset="0.5731" stop-color="#BE1833"/><stop offset="0.8585" stop-color="#DC0436"/><stop offset="1" stop-color="#E60039"/></linearGradient><clipPath id="clip0_5933_159"><rect width="24" height="19" fill="white"/></clipPath></defs></svg>';
|
|
959
|
+
var UNIONPAY_SVG = '<svg width="256px" height="160px" viewBox="0 0 256 160" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid"><g><path d="M50.041631,0.000667563305 L113.820211,0.000667563305 C122.723127,0.000667563305 128.260438,7.25731345 126.183558,16.1897657 L96.4900715,143.675416 C94.3945365,152.576777 85.480739,159.839641 76.571605,159.839641 L12.7992433,159.839641 C3.908764,159.839641 -1.64098444,152.576777 0.435896208,143.675416 L30.1418186,16.1897657 C32.2186993,7.25731345 41.1278333,0.000667563305 50.041631,0.000667563305" fill="#E21836"></path><path d="M108.513283,0.000667563305 L181.857018,0.000667563305 C190.758378,0.000667563305 186.744527,7.25731345 184.650546,16.1897657 L154.961724,143.675416 C152.878625,152.576777 153.528427,159.839641 144.608411,159.839641 L71.2646775,159.839641 C62.3446615,159.839641 56.8244495,152.576777 58.919985,143.675416 L88.6072525,16.1897657 C90.715224,7.25731345 99.6057035,0.000667563305 108.513283,0.000667563305" fill="#00447C"></path><path d="M178.94783,0.000667563305 L242.726409,0.000667563305 C251.641762,0.000667563305 257.179074,7.25731345 255.085093,16.1897657 L225.396271,143.675416 C223.300736,152.576777 214.380719,159.839641 205.466922,159.839641 L141.717879,159.839641 C132.797863,159.839641 127.265215,152.576777 129.354532,143.675416 L159.048017,16.1897657 C161.124899,7.25731345 170.027814,0.000667563305 178.94783,0.000667563305" fill="#007B84"></path><path d="M66.698338,40.8561434 C60.139686,40.9229891 58.202715,40.8561434 57.5840035,40.7100156 C57.346157,41.8401744 52.920349,62.256098 52.9079125,62.273198 C51.9549725,66.403641 51.261643,69.347961 48.9064975,71.2491775 C47.5695833,72.3544635 46.0088137,72.8876745 44.1993159,72.8876745 C41.2907503,72.8876745 39.5962892,71.4434965 39.3118063,68.704377 L39.2573971,67.7638735 C39.2573971,67.7638735 40.1434913,62.231225 40.1434913,62.200134 C40.1434913,62.200134 44.7884909,43.5952629 45.6201759,41.1359627 C45.6637033,40.9960531 45.6761397,40.9229891 45.6870215,40.8561434 C36.6457507,40.9354255 35.0430082,40.8561434 34.9326351,40.7100156 C34.8720075,40.9105527 34.6481522,42.0640298 34.6481522,42.0640298 L29.9052159,63.0333735 L29.4979234,64.8117805 L28.7097659,70.6289115 C28.7097659,72.3544635 29.0486581,73.762887 29.7233334,74.9536735 C31.8841598,78.729679 38.0479561,79.2955355 41.5348148,79.2955355 C46.0274683,79.2955355 50.241857,78.341041 53.089795,76.598389 C58.0332685,73.677387 59.3266555,69.1116695 60.4801325,65.0542905 L61.014898,62.972746 C61.014898,62.972746 65.7998075,43.6496723 66.6128375,41.1359627 C66.643929,40.9960531 66.656365,40.9229891 66.698338,40.8561434 Z M82.9786885,56.444252 C81.825211,56.444252 79.7172395,56.724071 77.823796,57.6521385 C77.1366845,58.0050215 76.486882,58.412314 75.8013245,58.818052 L76.420036,56.5841615 L76.081144,56.20796 C72.0657375,57.0209905 71.167207,57.129809 67.4580475,57.6521385 L67.147137,57.8588935 C66.7165265,61.4296985 66.3341065,64.1144085 64.7375825,71.133208 C64.129753,73.7199815 63.498605,76.331628 62.8659025,78.912183 L63.036903,79.2401935 C66.8377815,79.0396565 67.9912585,79.0396565 71.29468,79.0940655 L71.562063,78.8033645 C71.981792,76.65342 72.036201,76.1497455 72.965823,71.795447 C73.402652,69.7310025 74.313619,65.1948215 74.7628845,63.579643 C75.588351,63.197223 76.402936,62.8210215 77.1802115,62.8210215 C79.0316825,62.8210215 78.8062725,64.4362005 78.734763,65.079785 C78.655481,66.160198 77.9808055,69.68903 77.2890305,72.7188505 L76.8273285,74.674476 C76.5055365,76.1186545 76.152653,77.522414 75.830861,78.954156 L75.9707705,79.2401935 C79.7172395,79.0396565 80.859835,79.0396565 84.0591015,79.0940655 L84.435303,78.8033645 C85.013596,75.4455335 85.183042,74.547003 86.209046,69.6579385 L86.725157,67.411612 C87.727843,63.0153405 88.2315175,60.786114 87.4728965,58.970398 C86.670748,56.93549 84.7462135,56.444252 82.9786885,56.444252 Z M101.165696,61.047123 C99.1743155,61.429543 97.904247,61.684489 96.6419515,61.8492715 C95.3905375,62.049809 94.1702145,62.2316915 92.24568,62.499074 L92.093334,62.637429 L91.9534245,62.7478025 C91.7528875,64.181099 91.6129775,65.420076 91.3471495,66.876691 C91.1217395,68.383051 90.7750745,70.094612 90.2107725,72.5539125 C89.7739435,74.436474 89.5485335,75.092495 89.299805,75.754734 C89.057295,76.4169725 88.7899125,77.060557 88.298674,78.9120275 L88.413711,79.0830285 L88.510093,79.240038 C90.308709,79.1545375 91.4855045,79.09391 92.6949455,79.0830285 C93.902832,79.039501 95.1542455,79.0830285 97.0912165,79.09391 L97.260663,78.955555 L97.4425455,78.803209 C97.7223645,77.133621 97.7643375,76.6843555 97.935338,75.8697705 C98.104784,74.9961125 98.39704,73.786672 99.113688,70.556314 C99.4525805,69.039072 99.8303365,67.5264935 100.181665,65.97816 C100.546985,64.436045 100.929404,62.9172485 101.293169,61.4000065 L101.23876,61.2165695 L101.165696,61.047123 Z M101.208135,54.841043 C99.3986375,53.7730665 96.222689,54.1119585 94.0851805,55.587228 C91.953891,57.0329605 91.711381,59.0849685 93.5146605,60.166936 C95.293067,61.2053765 98.481452,60.896021 100.600305,59.408315 C102.726932,57.9314915 102.99276,55.898138 101.208135,54.841043 Z M112.151399,79.574733 C115.812368,79.574733 119.565055,78.565829 122.389675,75.571763 C124.562938,73.143554 125.559405,69.5307765 125.904516,68.043071 C127.028457,63.112034 126.153244,60.809743 125.054176,59.407538 C123.384588,57.2700295 120.43405,56.5844725 117.373138,56.5844725 C115.532549,56.5844725 111.148714,56.766355 107.724038,59.923649 C105.264737,62.2010665 104.12836,65.291515 103.442803,68.2544895 C102.751028,71.2734285 101.955097,76.70814 106.95298,78.7306115 C108.495095,79.3928505 110.718104,79.574733 112.151399,79.574733 Z M111.865362,68.4798995 C112.709484,64.7458675 113.705951,61.6118915 116.249197,61.6118915 C118.242132,61.6118915 118.386705,63.943719 117.500611,67.6901875 C117.342047,68.5218725 116.614517,71.6138755 115.630486,72.9305805 C114.943374,73.902175 114.130344,74.49135 113.231813,74.49135 C112.96443,74.49135 111.374124,74.49135 111.349251,72.1299865 C111.336815,70.964073 111.574661,69.7732865 111.865362,68.4798995 Z M135.05616,79.094532 L135.342197,78.803831 C135.747935,76.6538865 135.814781,76.148657 136.713312,71.7959135 C137.162577,69.731469 138.092198,65.195288 138.529028,63.580109 C139.356049,63.196135 140.156643,62.8199335 140.958791,62.8199335 C142.797825,62.8199335 142.57397,64.4351125 142.500907,65.0786965 C142.43406,66.1606645 141.759386,69.6879415 141.055173,72.717762 L140.618345,74.673388 C140.284116,76.1191205 139.920351,77.521326 139.598559,78.9546225 L139.738469,79.24066 C143.497374,79.0401225 144.596441,79.0401225 147.814363,79.094532 L148.203001,78.803831 C148.767303,75.4444455 148.919649,74.5459145 149.976744,69.658405 L150.480419,67.410524 C151.487768,63.0142525 151.99766,60.7865805 151.251476,58.9708645 C150.426009,56.9359565 148.489038,56.4447185 146.746386,56.4447185 C145.591354,56.4447185 143.472501,56.722983 141.589939,57.652605 C140.916819,58.005488 140.242143,58.411226 139.579904,58.8185185 L140.156643,56.584628 L139.847287,56.206872 C135.833436,57.021457 134.91625,57.1302755 131.211754,57.652605 L130.927271,57.85936 C130.478006,61.4301645 130.112686,64.1133205 128.516162,71.1336745 C127.908333,73.720448 127.277185,76.332094 126.646037,78.9126495 L126.815483,79.24066 C130.622579,79.0401225 131.758957,79.0401225 135.05616,79.094532 Z M162.673542,79.2398825 C162.909834,78.0864055 164.313594,71.2494885 164.32603,71.2494885 C164.32603,71.2494885 165.52148,66.232951 165.594545,66.0510685 C165.594545,66.0510685 165.970746,65.5287395 166.346947,65.321984 L166.900367,65.321984 C172.122106,65.321984 178.018519,65.321984 182.6402,61.92218 C185.785058,59.590353 187.935002,56.1470215 188.89416,51.9621695 C189.142889,50.9361655 189.326326,49.7158426 189.326326,48.4955199 C189.326326,46.8927774 189.004534,45.3071349 188.074912,44.0681575 C185.718212,40.770954 181.025022,40.7103265 175.60741,40.6854536 C175.59031,40.6854536 172.93669,40.7103265 172.93669,40.7103265 C166.001837,40.7958268 163.220744,40.770954 162.078149,40.6310444 C161.981767,41.1362735 161.799884,42.0348043 161.799884,42.0348043 C161.799884,42.0348043 159.315711,53.547812 159.315711,53.5664665 C159.315711,53.5664665 153.371107,78.0444325 153.091287,79.1979095 C159.146265,79.124846 161.628884,79.124846 162.673542,79.2398825 Z M167.276569,58.7882045 C167.276569,58.7882045 169.917752,47.2985153 169.905316,47.3420427 L169.990815,46.7528678 L170.028125,46.3036024 L171.083665,46.4124209 C171.083665,46.4124209 176.530813,46.8803409 176.658287,46.8927774 C178.808231,47.7244624 179.694325,49.8681887 179.075614,52.666381 C178.511312,55.223618 176.852606,57.373563 174.721316,58.412003 C172.966227,59.291879 170.816282,59.364943 168.601047,59.364943 L167.167751,59.364943 L167.276569,58.7882045 Z M183.721236,68.692718 C183.023242,71.668129 182.221093,77.102841 187.194103,79.039812 C188.779745,79.714487 190.200605,79.915024 191.644784,79.8419605 C193.169799,79.759569 194.582886,78.99473 195.891818,77.8941075 C195.773673,78.346482 195.655527,78.7988565 195.537381,79.2527855 L195.76279,79.5434865 C199.339813,79.392695 200.449763,79.392695 204.325259,79.4222315 L204.676588,79.1548485 C205.242445,75.8281085 205.775656,72.597751 207.246262,66.2334175 C207.962909,63.184942 208.678003,60.1660035 209.413306,57.1299645 L209.29827,56.795736 C205.296854,57.537257 204.227323,57.6958215 200.378253,58.241469 L200.085998,58.479315 C200.047134,58.788671 200.006716,59.08559 199.969406,59.3825095 C199.370904,58.4155785 198.503465,57.590112 197.164996,57.0755555 C195.453434,56.4024345 191.433365,57.269874 187.977597,60.416286 C185.549388,62.662613 184.383475,65.7406245 183.721236,68.692718 Z M192.12514,68.8746005 C192.981698,65.2074135 193.965729,62.104529 196.515194,62.104529 C198.127263,62.104529 198.976048,63.5922345 198.803493,66.1292625 C198.666693,66.761965 198.51901,67.4288675 198.343345,68.182825 C198.0884,69.2725655 197.811689,70.3529785 197.542752,71.4349465 C197.26915,72.174913 196.950468,72.8729065 196.600694,73.3377175 C195.944673,74.267339 194.383904,74.8440775 193.485373,74.8440775 C193.230426,74.8440775 191.65722,74.8440775 191.602811,72.524687 C191.590374,71.3696555 191.828221,70.1804235 192.12514,68.8746005 Z M236.010903,56.766044 L235.701548,56.413161 C231.742105,57.2153095 231.025456,57.3427825 227.387807,57.834021 L227.120423,58.1014035 C227.107988,58.144931 227.097105,58.211777 227.078451,58.2724045 L227.066014,58.211777 C224.357986,64.459519 224.437268,63.111723 222.232914,68.0303235 C222.220477,67.806468 222.220477,67.6665585 222.208042,67.428712 L221.656175,56.766044 L221.30951,56.413161 C217.161968,57.2153095 217.064031,57.3427825 213.233616,57.834021 L212.935143,58.1014035 C212.893169,58.228877 212.893169,58.3687865 212.868297,58.5211325 L212.893169,58.575542 C213.371971,61.022406 213.256934,60.4767585 213.737291,64.338264 C213.961146,66.233262 214.25962,68.139142 214.483475,70.010822 C214.861232,73.143243 215.072651,74.685358 215.534352,79.4656035 C212.947578,83.7344015 212.335085,85.3495805 209.844694,89.0960495 L209.861794,89.1333585 L208.10826,91.906678 C207.907723,92.198934 207.725841,92.399471 207.470894,92.4849715 C207.191075,92.6233265 206.82731,92.648199 206.32208,92.648199 L205.350486,92.648199 L203.906308,97.451763 L208.860663,97.5372635 C211.769228,97.524827 213.597381,96.1645945 214.581412,94.336442 L217.696733,88.9981125 L217.646987,88.9981125 L217.974998,88.621911 C220.070533,84.110603 236.010903,56.766044 236.010903,56.766044 Z M183.72108,119.853625 L181.619326,119.853625 L189.398302,94.1242455 L191.978857,94.1242455 L192.798105,91.4737355 L192.877387,94.421165 C192.781005,96.243099 194.214302,97.858278 197.979425,97.5908955 L202.333723,97.5908955 L203.832311,92.63654 L202.193814,92.63654 C201.251756,92.63654 200.814927,92.3986935 200.869337,91.888801 L200.790054,88.890071 L192.726596,88.890071 L192.726596,88.9056165 C190.119614,88.960026 182.33442,89.1558995 180.758105,89.5756285 C178.850671,90.0668665 176.840635,91.5125995 176.840635,91.5125995 L177.630347,88.85898 L170.087664,88.85898 L168.516013,94.1242455 L160.632883,120.246927 L159.103204,120.246927 L157.603062,125.165528 L172.626247,125.165528 L172.122572,126.805579 L179.525345,126.805579 L180.016584,125.165528 L182.093465,125.165528 L183.72108,119.853625 Z M177.557284,99.352202 C176.349398,99.6864305 174.101516,100.699998 174.101516,100.699998 L176.100669,94.1242455 L182.093465,94.1242455 L180.647732,98.915373 C180.647732,98.915373 178.796261,99.0241915 177.557284,99.352202 Z M177.672321,108.746356 C177.672321,108.746356 175.789759,108.982648 174.550781,109.262467 C173.330458,109.632451 171.042159,110.798364 171.042159,110.798364 L173.106603,103.955229 L179.13049,103.955229 L177.672321,108.746356 Z M174.31449,119.914253 L168.30304,119.914253 L170.045692,114.139095 L176.038487,114.139095 L174.31449,119.914253 Z M188.791404,103.955229 L197.456474,103.955229 L196.211278,107.987735 L187.431173,107.987735 L186.112912,112.396443 L193.795505,112.396443 L187.978375,120.587374 C187.571082,121.188986 187.205762,121.401959 186.800025,121.571405 C186.392732,121.77816 185.857967,122.02067 185.239255,122.02067 L183.107965,122.02067 L181.643577,126.849107 L187.218198,126.849107 C190.115882,126.849107 191.827443,125.530847 193.091294,123.800631 L197.080273,118.341047 L197.936831,123.884578 C198.118713,124.923017 198.864898,125.530847 199.370127,125.767139 C199.928211,126.046958 200.50495,126.527315 201.319535,126.598824 C202.193192,126.636133 202.82434,126.66567 203.244069,126.66567 L205.983189,126.66567 L207.627904,121.262049 L206.547491,121.262049 C205.927224,121.262049 204.859248,121.157894 204.677366,120.963575 C204.495483,120.727283 204.495483,120.363518 204.397546,119.810098 L203.528552,114.254131 L199.970183,114.254131 L201.530954,112.396443 L210.293959,112.396443 L211.641755,107.987735 L203.528552,107.987735 L204.792402,103.955229 L212.880733,103.955229 L214.380875,98.982219 L190.266674,98.982219 L188.791404,103.955229 Z M115.605924,121.037106 L117.628395,114.309008 L125.940582,114.309008 L127.459378,109.304907 L119.139419,109.304907 L120.409488,105.163582 L128.539791,105.163582 L130.046152,100.318045 L109.703292,100.318045 L108.228023,105.163582 L112.849704,105.163582 L111.616945,109.304907 L106.982827,109.304907 L105.446931,114.394508 L110.067057,114.394508 L107.371465,123.295869 C107.0077,124.474219 107.542466,124.923484 107.881358,125.470686 C108.228023,126.003897 108.579352,126.35678 109.369064,126.557317 C110.183649,126.7392 110.741733,126.848018 111.500354,126.848018 L120.87119,126.848018 L122.540778,121.304488 L118.387016,121.875009 C117.584868,121.875009 115.363414,121.778627 115.605924,121.037106 Z M116.55933,88.8286665 L114.452913,92.635763 C114.002093,93.4674475 113.596355,93.983559 113.231036,94.221405 C112.909244,94.4219425 112.271878,94.505888 111.348474,94.505888 L110.249406,94.505888 L108.780355,99.3762975 L112.430442,99.3762975 C114.18553,99.3762975 115.533326,98.7327135 116.176911,98.410921 C116.868686,98.040938 117.050568,98.252357 117.585334,97.736246 L118.818094,96.668269 L130.216064,96.668269 L131.728643,91.5973225 L123.385365,91.5973225 L124.84198,88.8286665 L116.55933,88.8286665 Z M133.386416,121.134887 C133.192097,120.855067 133.332007,120.362275 133.628926,119.336271 L136.744247,109.024932 L147.826644,109.024932 C149.441823,109.001614 150.607736,108.982959 151.366357,108.92855 C152.180942,108.843049 153.067037,108.552348 154.032413,108.030019 C155.028881,107.482817 155.538773,106.906078 155.969384,106.243839 C156.44974,105.583155 157.220798,104.137422 157.883037,101.908196 L161.798952,88.859291 L150.298381,88.926137 C150.298381,88.926137 146.757113,89.448466 145.197898,90.0252045 C143.624692,90.668789 141.37681,92.4658505 141.37681,92.4658505 L142.415251,88.8888275 L135.31095,88.8888275 L125.364931,121.874854 C125.012048,123.155803 124.775756,124.085425 124.721347,124.643509 C124.702692,125.245121 125.479968,125.840514 125.983643,126.289779 C126.579036,126.739045 127.458911,126.665981 128.303033,126.739045 C129.190682,126.805891 130.452978,126.847863 132.195629,126.847863 L137.655214,126.847863 L139.33102,121.189296 L134.443511,121.650998 C133.921182,121.650998 133.543426,121.371178 133.386416,121.134887 Z M138.754282,102.060541 L150.394763,102.060541 L149.654797,104.379932 C149.550642,104.434341 149.301913,104.264895 148.117345,104.404805 L138.037634,104.404805 L138.754282,102.060541 Z M141.086109,94.2815665 L152.824526,94.2815665 L151.980405,97.075095 C151.980405,97.075095 146.447757,97.020686 145.561663,97.1839135 C141.662847,97.858589 139.38543,99.941688 139.38543,99.941688 L141.086109,94.2815665 Z M149.915339,112.146937 C149.818957,112.493602 149.666611,112.705021 149.453638,112.863585 C149.217345,113.015931 148.834926,113.07034 148.264406,113.07034 L146.605699,113.07034 L146.703636,110.245721 L139.804537,110.245721 L139.524718,124.054801 C139.513836,125.051268 139.610218,125.628007 140.339303,126.089709 C141.068387,126.666447 143.314714,126.739511 146.338316,126.739511 L150.661524,126.739511 L152.222294,121.570628 L148.458724,121.777383 L147.207311,121.850447 C147.03631,121.777383 146.873082,121.710537 146.6912,121.528655 C146.532635,121.371645 146.265253,121.468028 146.30878,120.47156 L146.338316,116.931847 L150.285323,116.768619 C152.416613,116.768619 153.32758,116.075288 154.104855,115.414604 C154.846376,114.781902 155.088886,114.054372 155.368706,113.07034 L156.030945,109.936365 L150.607114,109.936365 L149.915339,112.146937 Z" fill="#FEFEFE"></path></g></svg>';
|
|
960
|
+
function MastercardIcon({ size = 24 }) {
|
|
961
|
+
return /* @__PURE__ */ jsx5(SvgXml3, { xml: MASTERCARD_SVG, width: size, height: size * (18 / 24) });
|
|
962
|
+
}
|
|
963
|
+
function VisaIcon({ size = 24 }) {
|
|
964
|
+
return /* @__PURE__ */ jsx5(SvgXml3, { xml: VISA_SVG, width: size, height: size * (19 / 24) });
|
|
965
|
+
}
|
|
966
|
+
function JcbIcon({ size = 24 }) {
|
|
967
|
+
return /* @__PURE__ */ jsx5(SvgXml3, { xml: JCB_SVG, width: size, height: size * (19 / 24) });
|
|
968
|
+
}
|
|
969
|
+
function UnionPayIcon({ size = 24 }) {
|
|
970
|
+
return /* @__PURE__ */ jsx5(SvgXml3, { xml: UNIONPAY_SVG, width: size, height: size * (160 / 256) });
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
// src/icons/PaymentMethodIcon.tsx
|
|
974
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
975
|
+
var CARD_ICON = "https://sdk-cdn.fun.xyz/images/swapped/card-payment.svg";
|
|
976
|
+
var BRAND_ICONS = {
|
|
977
|
+
mastercard: MastercardIcon,
|
|
978
|
+
visa: VisaIcon,
|
|
979
|
+
jcb: JcbIcon,
|
|
980
|
+
unionpay: UnionPayIcon
|
|
981
|
+
};
|
|
982
|
+
var genericCardIcon = (isDarkMode) => isDarkMode ? CARD_ICON.replace(".svg", "-light.svg") : CARD_ICON;
|
|
983
|
+
function PaymentMethodIcon({ fop }) {
|
|
984
|
+
const isDarkMode = useFunkitColorScheme().colorScheme === "dark";
|
|
985
|
+
if (isSavedFormOfPaymentType(fop)) {
|
|
986
|
+
const BrandIcon = BRAND_ICONS[fop.cardBrand.replace(/ /g, "_").toLowerCase()];
|
|
987
|
+
if (BrandIcon) {
|
|
988
|
+
return /* @__PURE__ */ jsx6(BrandIcon, { size: 32 });
|
|
989
|
+
}
|
|
990
|
+
return /* @__PURE__ */ jsx6(
|
|
991
|
+
FunIcon,
|
|
992
|
+
{
|
|
993
|
+
uri: genericCardIcon(isDarkMode),
|
|
994
|
+
fallbackUri: FALLBACK_ASSET_LOGO
|
|
995
|
+
}
|
|
996
|
+
);
|
|
997
|
+
}
|
|
998
|
+
return /* @__PURE__ */ jsx6(
|
|
999
|
+
FunIcon,
|
|
1000
|
+
{
|
|
1001
|
+
uri: getSwappedIcon(fop, isDarkMode),
|
|
1002
|
+
fallbackUri: FALLBACK_ASSET_LOGO
|
|
1003
|
+
}
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
// src/icons/CryptoBitcoinIcon.tsx
|
|
1008
|
+
import { SvgXml as SvgXml4 } from "react-native-svg";
|
|
1009
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1010
|
+
var CIRCLE_BITCOIN_SVG = `<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.9168 11.8737C12.9168 12.449 12.4505 12.9154 11.8752 12.9154H8.75016V10.832H11.8752C12.4505 10.832 12.9168 11.2984 12.9168 11.8737Z" fill="currentColor"/><path d="M11.4585 7.08203H8.75016V9.16536H11.4585C12.0338 9.16536 12.5002 8.69899 12.5002 8.1237C12.5002 7.5484 12.0338 7.08203 11.4585 7.08203Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0002 0.832031C4.93755 0.832031 0.833496 4.93609 0.833496 9.9987C0.833496 15.0613 4.93755 19.1654 10.0002 19.1654C15.0628 19.1654 19.1668 15.0613 19.1668 9.9987C19.1668 4.93609 15.0628 0.832031 10.0002 0.832031ZM8.3335 4.16536C8.79373 4.16536 9.16683 4.53846 9.16683 4.9987V5.41536H10.0002V4.9987C10.0002 4.53846 10.3733 4.16536 10.8335 4.16536C11.2937 4.16536 11.6668 4.53846 11.6668 4.9987V5.42326C13.0653 5.52964 14.1668 6.69803 14.1668 8.1237C14.1668 8.74941 13.9546 9.32557 13.5983 9.78413C14.2 10.2809 14.5835 11.0325 14.5835 11.8737C14.5835 13.3695 13.3709 14.582 11.8752 14.582H11.6668V14.9987C11.6668 15.4589 11.2937 15.832 10.8335 15.832C10.3733 15.832 10.0002 15.4589 10.0002 14.9987V14.582H9.16683V14.9987C9.16683 15.4589 8.79373 15.832 8.3335 15.832C7.87326 15.832 7.50016 15.4589 7.50016 14.9987V14.582H6.66683C6.20659 14.582 5.8335 14.2089 5.8335 13.7487C5.8335 13.2885 6.20659 12.9154 6.66683 12.9154H7.0835V7.08203H6.66683C6.20659 7.08203 5.8335 6.70894 5.8335 6.2487C5.8335 5.78846 6.20659 5.41536 6.66683 5.41536H7.50016V4.9987C7.50016 4.53846 7.87326 4.16536 8.3335 4.16536Z" fill="currentColor"/></svg>`;
|
|
1011
|
+
function CryptoBitcoinIcon({ size = 28 }) {
|
|
1012
|
+
const theme = useTheme();
|
|
1013
|
+
return /* @__PURE__ */ jsx7(
|
|
1014
|
+
SvgXml4,
|
|
1015
|
+
{
|
|
1016
|
+
xml: CIRCLE_BITCOIN_SVG,
|
|
1017
|
+
width: size,
|
|
1018
|
+
height: size,
|
|
1019
|
+
color: theme.content.elements.primary
|
|
1020
|
+
}
|
|
1021
|
+
);
|
|
1022
|
+
}
|
|
1023
|
+
|
|
989
1024
|
// src/icons/funIconUri.ts
|
|
990
1025
|
var CDN_BASE = "https://sdk-cdn.fun.xyz/images";
|
|
991
1026
|
var chainIconUri = (chainKey) => `${CDN_BASE}/${chainKey}.svg`;
|
|
992
1027
|
var tokenLogoUri = (symbol) => ASSET_LOGO_SRCS[symbol.toUpperCase()] ?? `${CDN_BASE}/${symbol.toLowerCase()}.svg`;
|
|
993
1028
|
|
|
994
1029
|
// src/icons/QrChainCluster.tsx
|
|
995
|
-
import { jsx as
|
|
1030
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
996
1031
|
function toIconUri(icon) {
|
|
997
1032
|
return icon.startsWith("http") ? icon : chainIconUri(icon);
|
|
998
1033
|
}
|
|
999
|
-
var CARD_SIZE =
|
|
1000
|
-
var
|
|
1001
|
-
var
|
|
1034
|
+
var CARD_SIZE = 46;
|
|
1035
|
+
var CARD_RADIUS = 12;
|
|
1036
|
+
var SINGLE_SIZE = 34;
|
|
1037
|
+
var GRID_SIZE = 16;
|
|
1002
1038
|
var GRID_GAP = 3;
|
|
1003
1039
|
function QrChainCluster({ iconKeys, max = 4 }) {
|
|
1004
1040
|
const keys = iconKeys.slice(0, max);
|
|
@@ -1007,7 +1043,7 @@ function QrChainCluster({ iconKeys, max = 4 }) {
|
|
|
1007
1043
|
return null;
|
|
1008
1044
|
}
|
|
1009
1045
|
if (keys.length === 1) {
|
|
1010
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ jsx8(Box, { alignItems: "center", justifyContent: "center", style: card, children: /* @__PURE__ */ jsx8(Box, { style: ring(SINGLE_SIZE), children: /* @__PURE__ */ jsx8(
|
|
1011
1047
|
FunIcon,
|
|
1012
1048
|
{
|
|
1013
1049
|
uri: toIconUri(first),
|
|
@@ -1016,7 +1052,7 @@ function QrChainCluster({ iconKeys, max = 4 }) {
|
|
|
1016
1052
|
}
|
|
1017
1053
|
) }) });
|
|
1018
1054
|
}
|
|
1019
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ jsx8(Box, { alignItems: "center", justifyContent: "center", style: card, children: /* @__PURE__ */ jsx8(Box, { flexDirection: "row", flexWrap: "wrap", style: grid, children: keys.map((key) => /* @__PURE__ */ jsx8(Box, { style: ring(GRID_SIZE), children: /* @__PURE__ */ jsx8(
|
|
1020
1056
|
FunIcon,
|
|
1021
1057
|
{
|
|
1022
1058
|
uri: toIconUri(key),
|
|
@@ -1032,7 +1068,7 @@ var grid = {
|
|
|
1032
1068
|
var card = {
|
|
1033
1069
|
width: CARD_SIZE,
|
|
1034
1070
|
height: CARD_SIZE,
|
|
1035
|
-
borderRadius:
|
|
1071
|
+
borderRadius: CARD_RADIUS,
|
|
1036
1072
|
backgroundColor: "#FFFFFF"
|
|
1037
1073
|
};
|
|
1038
1074
|
var ring = (iconSize) => ({
|
|
@@ -1044,7 +1080,7 @@ var ring = (iconSize) => ({
|
|
|
1044
1080
|
});
|
|
1045
1081
|
|
|
1046
1082
|
// src/icons/SourceTokenCluster.tsx
|
|
1047
|
-
import { jsx as
|
|
1083
|
+
import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1048
1084
|
function toIconUri2(icon) {
|
|
1049
1085
|
return icon.startsWith("http") ? icon : chainIconUri(icon);
|
|
1050
1086
|
}
|
|
@@ -1059,34 +1095,56 @@ function SourceTokenCluster({
|
|
|
1059
1095
|
const visible = icons.slice(0, maxVisible);
|
|
1060
1096
|
const overflow = icons.length - visible.length;
|
|
1061
1097
|
return /* @__PURE__ */ jsxs2(Box, { flexDirection: "row", alignItems: "center", style: { gap }, children: [
|
|
1062
|
-
visible.map((icon) => /* @__PURE__ */
|
|
1063
|
-
|
|
1098
|
+
visible.map((icon) => /* @__PURE__ */ jsx9(
|
|
1099
|
+
Box,
|
|
1064
1100
|
{
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1101
|
+
style: [
|
|
1102
|
+
iconRing(size),
|
|
1103
|
+
{ backgroundColor: theme.background.secondary }
|
|
1104
|
+
],
|
|
1105
|
+
children: /* @__PURE__ */ jsx9(
|
|
1106
|
+
FunIcon,
|
|
1107
|
+
{
|
|
1108
|
+
uri: toIconUri2(icon),
|
|
1109
|
+
size,
|
|
1110
|
+
fallbackUri: FALLBACK_ASSET_LOGO
|
|
1111
|
+
}
|
|
1112
|
+
)
|
|
1113
|
+
},
|
|
1114
|
+
icon
|
|
1115
|
+
)),
|
|
1070
1116
|
overflow > 0 ? (
|
|
1071
1117
|
// Both chips are a fixed `size`×`size` circle (Figma). The "+" glyph sits
|
|
1072
1118
|
// on `bgSecondary` (Add money `crypto2`); the "+N" count on `pillPressed`
|
|
1073
1119
|
// (Transfer `tap-target`).
|
|
1074
|
-
/* @__PURE__ */
|
|
1120
|
+
/* @__PURE__ */ jsx9(
|
|
1075
1121
|
Box,
|
|
1076
1122
|
{
|
|
1077
|
-
backgroundColor: overflowMode === "plus" ? "bgSecondary" : "pillPressed",
|
|
1078
1123
|
alignItems: "center",
|
|
1079
1124
|
justifyContent: "center",
|
|
1080
|
-
style:
|
|
1125
|
+
style: [
|
|
1126
|
+
overflowCircle(size),
|
|
1127
|
+
{
|
|
1128
|
+
backgroundColor: overflowMode === "plus" ? theme.background.secondary : theme.background.pill.pressed
|
|
1129
|
+
}
|
|
1130
|
+
],
|
|
1081
1131
|
children: overflowMode === "plus" ? (
|
|
1082
1132
|
// The geometric "+" glyph centers cleanly; the text "+" did not.
|
|
1083
|
-
/* @__PURE__ */
|
|
1084
|
-
|
|
1133
|
+
/* @__PURE__ */ jsx9(
|
|
1134
|
+
FigmaPlusIcon,
|
|
1135
|
+
{
|
|
1136
|
+
size,
|
|
1137
|
+
color: theme.content.elements.secondary
|
|
1138
|
+
}
|
|
1139
|
+
)
|
|
1140
|
+
) : /* @__PURE__ */ jsx9(
|
|
1085
1141
|
Text,
|
|
1086
1142
|
{
|
|
1087
1143
|
variant: "bodyMedium",
|
|
1088
|
-
|
|
1089
|
-
|
|
1144
|
+
style: [
|
|
1145
|
+
overflowText(size),
|
|
1146
|
+
{ color: theme.content.elements.secondary }
|
|
1147
|
+
],
|
|
1090
1148
|
children: `+${overflow}`
|
|
1091
1149
|
}
|
|
1092
1150
|
)
|
|
@@ -1118,16 +1176,17 @@ var overflowText = (size) => ({
|
|
|
1118
1176
|
});
|
|
1119
1177
|
|
|
1120
1178
|
// src/icons/TokenChainIcon.tsx
|
|
1121
|
-
import { jsx as
|
|
1179
|
+
import { jsx as jsx10, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1122
1180
|
function TokenChainIcon({
|
|
1123
1181
|
symbol,
|
|
1124
1182
|
iconSrc,
|
|
1125
1183
|
chainKey,
|
|
1126
1184
|
size = 24
|
|
1127
1185
|
}) {
|
|
1186
|
+
const theme = useTheme();
|
|
1128
1187
|
const badge = Math.round(size * 0.5);
|
|
1129
1188
|
return /* @__PURE__ */ jsxs3(Box, { width: size, height: size, children: [
|
|
1130
|
-
/* @__PURE__ */
|
|
1189
|
+
/* @__PURE__ */ jsx10(
|
|
1131
1190
|
FunIcon,
|
|
1132
1191
|
{
|
|
1133
1192
|
uri: iconSrc ?? tokenLogoUri(symbol),
|
|
@@ -1135,15 +1194,17 @@ function TokenChainIcon({
|
|
|
1135
1194
|
fallbackUri: FALLBACK_ASSET_LOGO
|
|
1136
1195
|
}
|
|
1137
1196
|
),
|
|
1138
|
-
chainKey ? /* @__PURE__ */
|
|
1197
|
+
chainKey ? /* @__PURE__ */ jsx10(
|
|
1139
1198
|
Box,
|
|
1140
1199
|
{
|
|
1141
|
-
backgroundColor: "bgModal",
|
|
1142
1200
|
borderRadius: "rounded",
|
|
1143
1201
|
alignItems: "center",
|
|
1144
1202
|
justifyContent: "center",
|
|
1145
|
-
style:
|
|
1146
|
-
|
|
1203
|
+
style: [
|
|
1204
|
+
badgeRing(badge),
|
|
1205
|
+
{ backgroundColor: theme.background.modal }
|
|
1206
|
+
],
|
|
1207
|
+
children: /* @__PURE__ */ jsx10(
|
|
1147
1208
|
FunIcon,
|
|
1148
1209
|
{
|
|
1149
1210
|
uri: chainIconUri(chainKey),
|
|
@@ -1173,7 +1234,35 @@ import Reanimated, {
|
|
|
1173
1234
|
useSharedValue,
|
|
1174
1235
|
withTiming
|
|
1175
1236
|
} from "react-native-reanimated";
|
|
1176
|
-
|
|
1237
|
+
|
|
1238
|
+
// src/icons/StatusIcon.tsx
|
|
1239
|
+
import { StyleSheet as StyleSheet2 } from "react-native";
|
|
1240
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1241
|
+
function StatusIcon() {
|
|
1242
|
+
const theme = useTheme();
|
|
1243
|
+
return /* @__PURE__ */ jsx11(
|
|
1244
|
+
Box,
|
|
1245
|
+
{
|
|
1246
|
+
borderRadius: "rounded",
|
|
1247
|
+
alignItems: "center",
|
|
1248
|
+
justifyContent: "center",
|
|
1249
|
+
style: [styles2.circle, { backgroundColor: theme.background.secondary }],
|
|
1250
|
+
children: /* @__PURE__ */ jsx11(
|
|
1251
|
+
FigmaAlertCircleIcon,
|
|
1252
|
+
{
|
|
1253
|
+
size: 20,
|
|
1254
|
+
color: theme.content.button.icon.default
|
|
1255
|
+
}
|
|
1256
|
+
)
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
var styles2 = StyleSheet2.create({
|
|
1261
|
+
circle: { width: 48, height: 48 }
|
|
1262
|
+
});
|
|
1263
|
+
|
|
1264
|
+
// src/screens/SelectMethodScreen.tsx
|
|
1265
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1177
1266
|
var DROPDOWN_OPEN_DURATION = 250;
|
|
1178
1267
|
var DROPDOWN_CLOSE_DURATION = 150;
|
|
1179
1268
|
var DROPDOWN_EASING = Easing2.bezier(0.22, 1, 0.36, 1);
|
|
@@ -1237,6 +1326,7 @@ function SelectMethodScreen({
|
|
|
1237
1326
|
payWithLabel = "Pay with",
|
|
1238
1327
|
initialDropdownOpen = false
|
|
1239
1328
|
}) {
|
|
1329
|
+
const theme = useTheme();
|
|
1240
1330
|
const selected = receiveTokens?.find((t) => t.id === selectedReceiveTokenId);
|
|
1241
1331
|
const showDropdown = receiveTokens && receiveTokens.length > 0 && selected;
|
|
1242
1332
|
const [dropdownOpen, setDropdownOpen] = useState4(initialDropdownOpen);
|
|
@@ -1244,15 +1334,30 @@ function SelectMethodScreen({
|
|
|
1244
1334
|
return /* @__PURE__ */ jsxs4(
|
|
1245
1335
|
Box,
|
|
1246
1336
|
{
|
|
1247
|
-
backgroundColor: "bgModal",
|
|
1248
1337
|
borderTopLeftRadius: "modal",
|
|
1249
1338
|
borderTopRightRadius: "modal",
|
|
1339
|
+
style: { backgroundColor: theme.background.modal },
|
|
1250
1340
|
children: [
|
|
1251
1341
|
/* @__PURE__ */ jsxs4(Box, { alignItems: "center", style: topBar, children: [
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
|
|
1342
|
+
/* @__PURE__ */ jsx12(
|
|
1343
|
+
Box,
|
|
1344
|
+
{
|
|
1345
|
+
style: [
|
|
1346
|
+
grabber,
|
|
1347
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
1348
|
+
]
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
/* @__PURE__ */ jsx12(
|
|
1352
|
+
Text,
|
|
1353
|
+
{
|
|
1354
|
+
variant: "bodyMedium",
|
|
1355
|
+
style: { color: theme.content.elements.primary },
|
|
1356
|
+
children: title
|
|
1357
|
+
}
|
|
1358
|
+
)
|
|
1254
1359
|
] }),
|
|
1255
|
-
error ? /* @__PURE__ */
|
|
1360
|
+
error ? /* @__PURE__ */ jsx12(
|
|
1256
1361
|
SelectMethodError,
|
|
1257
1362
|
{
|
|
1258
1363
|
title: errorTitle,
|
|
@@ -1260,7 +1365,7 @@ function SelectMethodScreen({
|
|
|
1260
1365
|
retryLabel,
|
|
1261
1366
|
onRetry
|
|
1262
1367
|
}
|
|
1263
|
-
) : loading ? /* @__PURE__ */
|
|
1368
|
+
) : loading ? /* @__PURE__ */ jsx12(
|
|
1264
1369
|
SelectMethodLoading,
|
|
1265
1370
|
{
|
|
1266
1371
|
count: skeletonCount,
|
|
@@ -1270,8 +1375,16 @@ function SelectMethodScreen({
|
|
|
1270
1375
|
}
|
|
1271
1376
|
) : /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1272
1377
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: depositSection, children: [
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
|
|
1378
|
+
/* @__PURE__ */ jsx12(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx12(
|
|
1379
|
+
Text,
|
|
1380
|
+
{
|
|
1381
|
+
variant: "detail",
|
|
1382
|
+
weight: "medium",
|
|
1383
|
+
style: { color: theme.content.elements.secondary },
|
|
1384
|
+
children: depositToLabel
|
|
1385
|
+
}
|
|
1386
|
+
) }),
|
|
1387
|
+
/* @__PURE__ */ jsx12(
|
|
1275
1388
|
ReceiveTokenDropdown,
|
|
1276
1389
|
{
|
|
1277
1390
|
tokens: receiveTokens,
|
|
@@ -1289,24 +1402,36 @@ function SelectMethodScreen({
|
|
|
1289
1402
|
// "Pay with" section: a labeled, bordered card wrapping the method
|
|
1290
1403
|
// rows with hairline dividers between them (Figma node 11202:8282).
|
|
1291
1404
|
/* @__PURE__ */ jsxs4(Box, { style: payWithSection, children: [
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
|
|
1405
|
+
/* @__PURE__ */ jsx12(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx12(
|
|
1406
|
+
Text,
|
|
1407
|
+
{
|
|
1408
|
+
variant: "detail",
|
|
1409
|
+
weight: "medium",
|
|
1410
|
+
style: { color: theme.content.elements.secondary },
|
|
1411
|
+
children: payWithLabel
|
|
1412
|
+
}
|
|
1413
|
+
) }),
|
|
1414
|
+
/* @__PURE__ */ jsx12(
|
|
1294
1415
|
Box,
|
|
1295
1416
|
{
|
|
1296
|
-
backgroundColor: "bgModal",
|
|
1297
|
-
borderColor: "borderDefault",
|
|
1298
1417
|
borderWidth: 1,
|
|
1299
1418
|
borderRadius: "element",
|
|
1300
|
-
style:
|
|
1419
|
+
style: [
|
|
1420
|
+
methodsCard,
|
|
1421
|
+
{
|
|
1422
|
+
backgroundColor: theme.background.modal,
|
|
1423
|
+
borderColor: theme.border.elements.default.color
|
|
1424
|
+
}
|
|
1425
|
+
],
|
|
1301
1426
|
children: methods.map((method, i) => /* @__PURE__ */ jsxs4(Box, { children: [
|
|
1302
|
-
i > 0 ? /* @__PURE__ */
|
|
1303
|
-
/* @__PURE__ */
|
|
1427
|
+
i > 0 ? /* @__PURE__ */ jsx12(MethodDivider, {}) : null,
|
|
1428
|
+
/* @__PURE__ */ jsx12(
|
|
1304
1429
|
Pressable,
|
|
1305
1430
|
{
|
|
1306
1431
|
onPress: () => onSelectMethod(method.id),
|
|
1307
1432
|
accessibilityRole: "button",
|
|
1308
1433
|
accessibilityLabel: method.title,
|
|
1309
|
-
children: /* @__PURE__ */
|
|
1434
|
+
children: /* @__PURE__ */ jsx12(PaymentMethodRow, { method })
|
|
1310
1435
|
}
|
|
1311
1436
|
)
|
|
1312
1437
|
] }, method.id))
|
|
@@ -1316,20 +1441,20 @@ function SelectMethodScreen({
|
|
|
1316
1441
|
) : (
|
|
1317
1442
|
// Methods-only: bare rows with full-width hairline dividers, no
|
|
1318
1443
|
// outer border (Figma node 11202:8632).
|
|
1319
|
-
/* @__PURE__ */
|
|
1444
|
+
/* @__PURE__ */ jsx12(
|
|
1320
1445
|
ScrollView,
|
|
1321
1446
|
{
|
|
1322
1447
|
contentContainerStyle: listContent,
|
|
1323
1448
|
showsVerticalScrollIndicator: false,
|
|
1324
1449
|
children: methods.map((method, i) => /* @__PURE__ */ jsxs4(Box, { children: [
|
|
1325
|
-
i > 0 ? /* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1450
|
+
i > 0 ? /* @__PURE__ */ jsx12(MethodDivider, {}) : null,
|
|
1451
|
+
/* @__PURE__ */ jsx12(
|
|
1327
1452
|
Pressable,
|
|
1328
1453
|
{
|
|
1329
1454
|
onPress: () => onSelectMethod(method.id),
|
|
1330
1455
|
accessibilityRole: "button",
|
|
1331
1456
|
accessibilityLabel: method.title,
|
|
1332
|
-
children: /* @__PURE__ */
|
|
1457
|
+
children: /* @__PURE__ */ jsx12(PaymentMethodRow, { method })
|
|
1333
1458
|
}
|
|
1334
1459
|
)
|
|
1335
1460
|
] }, method.id))
|
|
@@ -1337,7 +1462,7 @@ function SelectMethodScreen({
|
|
|
1337
1462
|
)
|
|
1338
1463
|
)
|
|
1339
1464
|
] }),
|
|
1340
|
-
scrimVisible ? /* @__PURE__ */
|
|
1465
|
+
scrimVisible ? /* @__PURE__ */ jsx12(
|
|
1341
1466
|
AnimatedPressable,
|
|
1342
1467
|
{
|
|
1343
1468
|
entering: scrimEnter,
|
|
@@ -1358,26 +1483,54 @@ function SelectMethodError({
|
|
|
1358
1483
|
retryLabel,
|
|
1359
1484
|
onRetry
|
|
1360
1485
|
}) {
|
|
1486
|
+
const theme = useTheme();
|
|
1361
1487
|
return /* @__PURE__ */ jsxs4(Box, { alignItems: "center", justifyContent: "center", style: errorContainer, children: [
|
|
1488
|
+
/* @__PURE__ */ jsx12(StatusIcon, {}),
|
|
1362
1489
|
/* @__PURE__ */ jsxs4(Box, { alignItems: "center", style: errorText, children: [
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
|
|
1490
|
+
/* @__PURE__ */ jsx12(
|
|
1491
|
+
Text,
|
|
1492
|
+
{
|
|
1493
|
+
variant: "bodyMedium",
|
|
1494
|
+
style: { color: theme.content.elements.primary },
|
|
1495
|
+
children: title
|
|
1496
|
+
}
|
|
1497
|
+
),
|
|
1498
|
+
/* @__PURE__ */ jsx12(
|
|
1499
|
+
Text,
|
|
1500
|
+
{
|
|
1501
|
+
variant: "detail",
|
|
1502
|
+
style: [
|
|
1503
|
+
errorMessageText,
|
|
1504
|
+
{ color: theme.content.elements.secondary }
|
|
1505
|
+
],
|
|
1506
|
+
children: message
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1365
1509
|
] }),
|
|
1366
|
-
onRetry ? /* @__PURE__ */
|
|
1510
|
+
onRetry ? /* @__PURE__ */ jsx12(
|
|
1367
1511
|
Pressable,
|
|
1368
1512
|
{
|
|
1369
1513
|
onPress: onRetry,
|
|
1370
1514
|
accessibilityRole: "button",
|
|
1371
1515
|
accessibilityLabel: retryLabel,
|
|
1372
|
-
children: /* @__PURE__ */
|
|
1516
|
+
children: /* @__PURE__ */ jsx12(
|
|
1373
1517
|
Box,
|
|
1374
1518
|
{
|
|
1375
|
-
backgroundColor: "btnPrimary",
|
|
1376
1519
|
borderRadius: "button",
|
|
1377
1520
|
alignItems: "center",
|
|
1378
1521
|
justifyContent: "center",
|
|
1379
|
-
style:
|
|
1380
|
-
|
|
1522
|
+
style: [
|
|
1523
|
+
retryButton,
|
|
1524
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
1525
|
+
],
|
|
1526
|
+
children: /* @__PURE__ */ jsx12(
|
|
1527
|
+
Text,
|
|
1528
|
+
{
|
|
1529
|
+
variant: "bodyMedium",
|
|
1530
|
+
style: { color: theme.content.button.primary.default },
|
|
1531
|
+
children: retryLabel
|
|
1532
|
+
}
|
|
1533
|
+
)
|
|
1381
1534
|
}
|
|
1382
1535
|
)
|
|
1383
1536
|
}
|
|
@@ -1385,6 +1538,7 @@ function SelectMethodError({
|
|
|
1385
1538
|
] });
|
|
1386
1539
|
}
|
|
1387
1540
|
function PaymentMethodRow({ method }) {
|
|
1541
|
+
const theme = useTheme();
|
|
1388
1542
|
return /* @__PURE__ */ jsxs4(
|
|
1389
1543
|
Box,
|
|
1390
1544
|
{
|
|
@@ -1393,21 +1547,24 @@ function PaymentMethodRow({ method }) {
|
|
|
1393
1547
|
gap: "elementsHorizontal",
|
|
1394
1548
|
style: row,
|
|
1395
1549
|
children: [
|
|
1396
|
-
/* @__PURE__ */
|
|
1397
|
-
Box,
|
|
1398
|
-
{
|
|
1399
|
-
width: 48,
|
|
1400
|
-
height: 48,
|
|
1401
|
-
borderRadius: "rounded",
|
|
1402
|
-
backgroundColor: "bgSecondary",
|
|
1403
|
-
alignItems: "center",
|
|
1404
|
-
justifyContent: "center",
|
|
1405
|
-
children: method.icon
|
|
1406
|
-
}
|
|
1407
|
-
),
|
|
1550
|
+
/* @__PURE__ */ jsx12(Box, { width: 48, height: 48, alignItems: "center", justifyContent: "center", children: method.icon }),
|
|
1408
1551
|
/* @__PURE__ */ jsxs4(Box, { flex: 1, style: details, children: [
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
|
|
1552
|
+
/* @__PURE__ */ jsx12(
|
|
1553
|
+
Text,
|
|
1554
|
+
{
|
|
1555
|
+
variant: "bodyMedium",
|
|
1556
|
+
style: { color: theme.content.elements.primary },
|
|
1557
|
+
children: method.title
|
|
1558
|
+
}
|
|
1559
|
+
),
|
|
1560
|
+
method.subtitle ? /* @__PURE__ */ jsx12(
|
|
1561
|
+
Text,
|
|
1562
|
+
{
|
|
1563
|
+
variant: "detail",
|
|
1564
|
+
style: { color: theme.content.elements.secondary },
|
|
1565
|
+
children: method.subtitle
|
|
1566
|
+
}
|
|
1567
|
+
) : null
|
|
1411
1568
|
] }),
|
|
1412
1569
|
method.trailing
|
|
1413
1570
|
]
|
|
@@ -1415,7 +1572,16 @@ function PaymentMethodRow({ method }) {
|
|
|
1415
1572
|
);
|
|
1416
1573
|
}
|
|
1417
1574
|
function MethodDivider() {
|
|
1418
|
-
|
|
1575
|
+
const theme = useTheme();
|
|
1576
|
+
return /* @__PURE__ */ jsx12(
|
|
1577
|
+
Box,
|
|
1578
|
+
{
|
|
1579
|
+
style: [
|
|
1580
|
+
divider,
|
|
1581
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
1582
|
+
]
|
|
1583
|
+
}
|
|
1584
|
+
);
|
|
1419
1585
|
}
|
|
1420
1586
|
function ReceiveTokenDropdown({
|
|
1421
1587
|
tokens,
|
|
@@ -1424,9 +1590,10 @@ function ReceiveTokenDropdown({
|
|
|
1424
1590
|
onToggle,
|
|
1425
1591
|
onSelect
|
|
1426
1592
|
}) {
|
|
1593
|
+
const theme = useTheme();
|
|
1427
1594
|
const selectable = tokens.length > 1;
|
|
1428
1595
|
return /* @__PURE__ */ jsxs4(Box, { style: dropdownAnchor, children: [
|
|
1429
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ jsx12(
|
|
1430
1597
|
Pressable,
|
|
1431
1598
|
{
|
|
1432
1599
|
onPress: selectable ? onToggle : void 0,
|
|
@@ -1438,44 +1605,46 @@ function ReceiveTokenDropdown({
|
|
|
1438
1605
|
flexDirection: "row",
|
|
1439
1606
|
alignItems: "center",
|
|
1440
1607
|
justifyContent: "space-between",
|
|
1441
|
-
backgroundColor: "bgModal",
|
|
1442
|
-
borderColor: "borderDefault",
|
|
1443
1608
|
borderWidth: 1,
|
|
1444
1609
|
borderRadius: "element",
|
|
1445
|
-
style:
|
|
1610
|
+
style: [
|
|
1611
|
+
dropdownTrigger,
|
|
1612
|
+
{
|
|
1613
|
+
backgroundColor: theme.background.modal,
|
|
1614
|
+
borderColor: theme.border.elements.default.color
|
|
1615
|
+
}
|
|
1616
|
+
],
|
|
1446
1617
|
children: [
|
|
1447
1618
|
/* @__PURE__ */ jsxs4(Box, { flexDirection: "row", alignItems: "center", style: triggerLeft, children: [
|
|
1448
|
-
selected.icon ?? /* @__PURE__ */
|
|
1449
|
-
/* @__PURE__ */
|
|
1619
|
+
selected.icon ?? /* @__PURE__ */ jsx12(ReceiveTokenIconFallback, {}),
|
|
1620
|
+
/* @__PURE__ */ jsx12(
|
|
1450
1621
|
Text,
|
|
1451
1622
|
{
|
|
1452
1623
|
variant: "bodyMedium",
|
|
1453
|
-
color: "textPrimary",
|
|
1454
1624
|
numberOfLines: 1,
|
|
1455
|
-
style: triggerLabel,
|
|
1625
|
+
style: [triggerLabel, { color: theme.content.elements.primary }],
|
|
1456
1626
|
children: selected.label
|
|
1457
1627
|
}
|
|
1458
1628
|
)
|
|
1459
1629
|
] }),
|
|
1460
|
-
selectable ? /* @__PURE__ */
|
|
1630
|
+
selectable ? /* @__PURE__ */ jsx12(AnimatedChevron, { open }) : null
|
|
1461
1631
|
]
|
|
1462
1632
|
}
|
|
1463
1633
|
)
|
|
1464
1634
|
}
|
|
1465
1635
|
),
|
|
1466
|
-
open && selectable ? /* @__PURE__ */
|
|
1636
|
+
open && selectable ? /* @__PURE__ */ jsx12(
|
|
1467
1637
|
Reanimated.View,
|
|
1468
1638
|
{
|
|
1469
1639
|
entering: menuEnter,
|
|
1470
1640
|
exiting: menuExit,
|
|
1471
1641
|
style: dropdownMenuOverlay,
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1642
|
+
children: /* @__PURE__ */ jsx12(
|
|
1473
1643
|
Box,
|
|
1474
1644
|
{
|
|
1475
|
-
backgroundColor: "bgModal",
|
|
1476
1645
|
borderRadius: "element",
|
|
1477
|
-
style: dropdownMenu,
|
|
1478
|
-
children: tokens.map((token) => /* @__PURE__ */
|
|
1646
|
+
style: [dropdownMenu, { backgroundColor: theme.background.modal }],
|
|
1647
|
+
children: tokens.map((token) => /* @__PURE__ */ jsx12(
|
|
1479
1648
|
Pressable,
|
|
1480
1649
|
{
|
|
1481
1650
|
onPress: () => onSelect(token.id),
|
|
@@ -1496,12 +1665,19 @@ function ReceiveTokenDropdown({
|
|
|
1496
1665
|
alignItems: "center",
|
|
1497
1666
|
style: triggerLeft,
|
|
1498
1667
|
children: [
|
|
1499
|
-
token.icon ?? /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1668
|
+
token.icon ?? /* @__PURE__ */ jsx12(ReceiveTokenIconFallback, {}),
|
|
1669
|
+
/* @__PURE__ */ jsx12(
|
|
1670
|
+
Text,
|
|
1671
|
+
{
|
|
1672
|
+
variant: "bodyMedium",
|
|
1673
|
+
style: { color: theme.content.elements.primary },
|
|
1674
|
+
children: token.label
|
|
1675
|
+
}
|
|
1676
|
+
)
|
|
1501
1677
|
]
|
|
1502
1678
|
}
|
|
1503
1679
|
),
|
|
1504
|
-
token.id === selected.id ? /* @__PURE__ */
|
|
1680
|
+
token.id === selected.id ? /* @__PURE__ */ jsx12(CheckIcon, {}) : null
|
|
1505
1681
|
]
|
|
1506
1682
|
}
|
|
1507
1683
|
)
|
|
@@ -1515,18 +1691,19 @@ function ReceiveTokenDropdown({
|
|
|
1515
1691
|
] });
|
|
1516
1692
|
}
|
|
1517
1693
|
function ReceiveTokenIconFallback() {
|
|
1518
|
-
|
|
1694
|
+
const theme = useTheme();
|
|
1695
|
+
return /* @__PURE__ */ jsx12(
|
|
1519
1696
|
Box,
|
|
1520
1697
|
{
|
|
1521
1698
|
width: 24,
|
|
1522
1699
|
height: 24,
|
|
1523
1700
|
borderRadius: "rounded",
|
|
1524
|
-
backgroundColor:
|
|
1701
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1525
1702
|
}
|
|
1526
1703
|
);
|
|
1527
1704
|
}
|
|
1528
1705
|
function ChevronDownIcon() {
|
|
1529
|
-
return /* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ jsx12(FigmaChevronDownIcon, { size: 16 });
|
|
1530
1707
|
}
|
|
1531
1708
|
function AnimatedChevron({ open }) {
|
|
1532
1709
|
const rotation = useSharedValue(open ? 1 : 0);
|
|
@@ -1539,10 +1716,10 @@ function AnimatedChevron({ open }) {
|
|
|
1539
1716
|
const style = useAnimatedStyle(() => ({
|
|
1540
1717
|
transform: [{ rotate: `${rotation.value * 180}deg` }]
|
|
1541
1718
|
}));
|
|
1542
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ jsx12(Reanimated.View, { style, children: /* @__PURE__ */ jsx12(FigmaChevronDownIcon, { size: 16 }) });
|
|
1543
1720
|
}
|
|
1544
1721
|
function CheckIcon() {
|
|
1545
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsx12(FigmaCheckIcon, { size: 16 });
|
|
1546
1723
|
}
|
|
1547
1724
|
function SelectMethodLoading({
|
|
1548
1725
|
count,
|
|
@@ -1550,71 +1727,103 @@ function SelectMethodLoading({
|
|
|
1550
1727
|
depositToLabel,
|
|
1551
1728
|
payWithLabel
|
|
1552
1729
|
}) {
|
|
1730
|
+
const theme = useTheme();
|
|
1553
1731
|
const opacity = usePulse();
|
|
1554
1732
|
const rowCount = count ?? (showDropdown ? 5 : 6);
|
|
1555
1733
|
return /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
1556
1734
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: depositSection, children: [
|
|
1557
|
-
/* @__PURE__ */
|
|
1735
|
+
/* @__PURE__ */ jsx12(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx12(
|
|
1736
|
+
Text,
|
|
1737
|
+
{
|
|
1738
|
+
variant: "detail",
|
|
1739
|
+
style: { color: theme.content.elements.secondary },
|
|
1740
|
+
children: depositToLabel
|
|
1741
|
+
}
|
|
1742
|
+
) }),
|
|
1558
1743
|
/* @__PURE__ */ jsxs4(
|
|
1559
1744
|
Box,
|
|
1560
1745
|
{
|
|
1561
1746
|
flexDirection: "row",
|
|
1562
1747
|
alignItems: "center",
|
|
1563
1748
|
justifyContent: "space-between",
|
|
1564
|
-
backgroundColor: "bgModal",
|
|
1565
|
-
borderColor: "borderDefault",
|
|
1566
1749
|
borderWidth: 1,
|
|
1567
1750
|
borderRadius: "element",
|
|
1568
|
-
style:
|
|
1751
|
+
style: [
|
|
1752
|
+
dropdownTrigger,
|
|
1753
|
+
{
|
|
1754
|
+
backgroundColor: theme.background.modal,
|
|
1755
|
+
borderColor: theme.border.elements.default.color
|
|
1756
|
+
}
|
|
1757
|
+
],
|
|
1569
1758
|
children: [
|
|
1570
1759
|
/* @__PURE__ */ jsxs4(Animated2.View, { style: [loadingSelectorLeft, { opacity }], children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ jsx12(
|
|
1572
1761
|
Box,
|
|
1573
1762
|
{
|
|
1574
1763
|
width: 20,
|
|
1575
1764
|
height: 20,
|
|
1576
1765
|
borderRadius: "rounded",
|
|
1577
|
-
backgroundColor:
|
|
1766
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1578
1767
|
}
|
|
1579
1768
|
),
|
|
1580
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ jsx12(
|
|
1770
|
+
Box,
|
|
1771
|
+
{
|
|
1772
|
+
style: [
|
|
1773
|
+
skeletonTitleBar,
|
|
1774
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1775
|
+
]
|
|
1776
|
+
}
|
|
1777
|
+
)
|
|
1581
1778
|
] }),
|
|
1582
|
-
/* @__PURE__ */
|
|
1779
|
+
/* @__PURE__ */ jsx12(ChevronDownIcon, {})
|
|
1583
1780
|
]
|
|
1584
1781
|
}
|
|
1585
1782
|
)
|
|
1586
1783
|
] }) : null,
|
|
1587
1784
|
showDropdown ? /* @__PURE__ */ jsxs4(Box, { style: payWithSection, children: [
|
|
1588
|
-
/* @__PURE__ */
|
|
1589
|
-
|
|
1785
|
+
/* @__PURE__ */ jsx12(Box, { style: sectionLabel, children: /* @__PURE__ */ jsx12(
|
|
1786
|
+
Text,
|
|
1787
|
+
{
|
|
1788
|
+
variant: "detail",
|
|
1789
|
+
style: { color: theme.content.elements.secondary },
|
|
1790
|
+
children: payWithLabel
|
|
1791
|
+
}
|
|
1792
|
+
) }),
|
|
1793
|
+
/* @__PURE__ */ jsx12(
|
|
1590
1794
|
Box,
|
|
1591
1795
|
{
|
|
1592
|
-
backgroundColor: "bgModal",
|
|
1593
|
-
borderColor: "borderDefault",
|
|
1594
1796
|
borderWidth: 1,
|
|
1595
1797
|
borderRadius: "element",
|
|
1596
|
-
style:
|
|
1597
|
-
|
|
1798
|
+
style: [
|
|
1799
|
+
methodsCard,
|
|
1800
|
+
{
|
|
1801
|
+
backgroundColor: theme.background.modal,
|
|
1802
|
+
borderColor: theme.border.elements.default.color
|
|
1803
|
+
}
|
|
1804
|
+
],
|
|
1805
|
+
children: /* @__PURE__ */ jsx12(
|
|
1598
1806
|
Animated2.View,
|
|
1599
1807
|
{
|
|
1600
1808
|
style: { opacity },
|
|
1601
1809
|
accessibilityLabel: "Loading payment methods",
|
|
1602
|
-
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */
|
|
1810
|
+
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */ jsx12(PaymentMethodRowSkeleton, {}, i))
|
|
1603
1811
|
}
|
|
1604
1812
|
)
|
|
1605
1813
|
}
|
|
1606
1814
|
)
|
|
1607
|
-
] }) : /* @__PURE__ */
|
|
1815
|
+
] }) : /* @__PURE__ */ jsx12(Box, { style: skeletonListContent, children: /* @__PURE__ */ jsx12(
|
|
1608
1816
|
Animated2.View,
|
|
1609
1817
|
{
|
|
1610
1818
|
style: { opacity },
|
|
1611
1819
|
accessibilityLabel: "Loading payment methods",
|
|
1612
|
-
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */
|
|
1820
|
+
children: Array.from({ length: rowCount }, (_, i) => /* @__PURE__ */ jsx12(PaymentMethodRowSkeleton, {}, i))
|
|
1613
1821
|
}
|
|
1614
1822
|
) })
|
|
1615
1823
|
] });
|
|
1616
1824
|
}
|
|
1617
1825
|
function PaymentMethodRowSkeleton() {
|
|
1826
|
+
const theme = useTheme();
|
|
1618
1827
|
return /* @__PURE__ */ jsxs4(
|
|
1619
1828
|
Box,
|
|
1620
1829
|
{
|
|
@@ -1623,18 +1832,34 @@ function PaymentMethodRowSkeleton() {
|
|
|
1623
1832
|
gap: "elementsHorizontal",
|
|
1624
1833
|
style: skeletonRow,
|
|
1625
1834
|
children: [
|
|
1626
|
-
/* @__PURE__ */
|
|
1835
|
+
/* @__PURE__ */ jsx12(
|
|
1627
1836
|
Box,
|
|
1628
1837
|
{
|
|
1629
1838
|
width: 48,
|
|
1630
1839
|
height: 48,
|
|
1631
1840
|
borderRadius: "rounded",
|
|
1632
|
-
backgroundColor:
|
|
1841
|
+
style: { backgroundColor: theme.background.pill.pressed }
|
|
1633
1842
|
}
|
|
1634
1843
|
),
|
|
1635
1844
|
/* @__PURE__ */ jsxs4(Box, { flex: 1, style: skeletonDetails, children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
|
|
1845
|
+
/* @__PURE__ */ jsx12(
|
|
1846
|
+
Box,
|
|
1847
|
+
{
|
|
1848
|
+
style: [
|
|
1849
|
+
skeletonTitleBar,
|
|
1850
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1851
|
+
]
|
|
1852
|
+
}
|
|
1853
|
+
),
|
|
1854
|
+
/* @__PURE__ */ jsx12(
|
|
1855
|
+
Box,
|
|
1856
|
+
{
|
|
1857
|
+
style: [
|
|
1858
|
+
skeletonSubtitleBar,
|
|
1859
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
1860
|
+
]
|
|
1861
|
+
}
|
|
1862
|
+
)
|
|
1638
1863
|
] })
|
|
1639
1864
|
]
|
|
1640
1865
|
}
|
|
@@ -1670,9 +1895,10 @@ var grabber = {
|
|
|
1670
1895
|
height: 5,
|
|
1671
1896
|
borderRadius: 999
|
|
1672
1897
|
};
|
|
1898
|
+
var BOTTOM_GAP = 50;
|
|
1673
1899
|
var listContent = {
|
|
1674
1900
|
paddingHorizontal: 16,
|
|
1675
|
-
paddingBottom:
|
|
1901
|
+
paddingBottom: BOTTOM_GAP
|
|
1676
1902
|
};
|
|
1677
1903
|
var row = { padding: 12 };
|
|
1678
1904
|
var details = { gap: 2 };
|
|
@@ -1683,7 +1909,7 @@ var depositSection = {
|
|
|
1683
1909
|
var payWithSection = {
|
|
1684
1910
|
paddingHorizontal: 16,
|
|
1685
1911
|
paddingTop: 12,
|
|
1686
|
-
paddingBottom:
|
|
1912
|
+
paddingBottom: BOTTOM_GAP
|
|
1687
1913
|
};
|
|
1688
1914
|
var sectionLabel = { paddingHorizontal: 12, paddingBottom: 6 };
|
|
1689
1915
|
var methodsCard = { paddingVertical: 2, overflow: "hidden" };
|
|
@@ -1727,7 +1953,7 @@ var errorMessageText = { textAlign: "center" };
|
|
|
1727
1953
|
var retryButton = { height: 48, paddingHorizontal: 20 };
|
|
1728
1954
|
var skeletonListContent = {
|
|
1729
1955
|
paddingHorizontal: 16,
|
|
1730
|
-
paddingBottom:
|
|
1956
|
+
paddingBottom: BOTTOM_GAP
|
|
1731
1957
|
};
|
|
1732
1958
|
var skeletonRow = { padding: 12 };
|
|
1733
1959
|
var loadingSelectorLeft = {
|
|
@@ -1745,12 +1971,18 @@ var skeletonSubtitleBar = {
|
|
|
1745
1971
|
};
|
|
1746
1972
|
|
|
1747
1973
|
// src/screens/AvailableChainsScreen.tsx
|
|
1974
|
+
import { useRef as useRef2, useState as useState5 } from "react";
|
|
1748
1975
|
import {
|
|
1749
1976
|
Pressable as Pressable2,
|
|
1750
1977
|
ScrollView as ScrollView2,
|
|
1978
|
+
View,
|
|
1751
1979
|
useWindowDimensions
|
|
1752
1980
|
} from "react-native";
|
|
1753
|
-
import {
|
|
1981
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
1982
|
+
import Svg, { Defs, LinearGradient, Rect, Stop } from "react-native-svg";
|
|
1983
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1984
|
+
var SCROLL_FADE_HEIGHT = 42;
|
|
1985
|
+
var SCROLL_EPSILON = 1;
|
|
1754
1986
|
function AvailableChainsScreen({
|
|
1755
1987
|
networkLabel,
|
|
1756
1988
|
chains,
|
|
@@ -1761,64 +1993,134 @@ function AvailableChainsScreen({
|
|
|
1761
1993
|
onClose
|
|
1762
1994
|
}) {
|
|
1763
1995
|
const { height } = useWindowDimensions();
|
|
1996
|
+
const theme = useTheme();
|
|
1997
|
+
const insets = useSafeAreaInsets();
|
|
1998
|
+
const [showTopFade, setShowTopFade] = useState5(false);
|
|
1999
|
+
const [showBottomFade, setShowBottomFade] = useState5(false);
|
|
2000
|
+
const metrics = useRef2({ scrollY: 0, viewportH: 0, contentH: 0 });
|
|
2001
|
+
const recomputeFades = () => {
|
|
2002
|
+
const { scrollY, viewportH, contentH } = metrics.current;
|
|
2003
|
+
const overflows = contentH > viewportH + SCROLL_EPSILON;
|
|
2004
|
+
setShowTopFade(overflows && scrollY > SCROLL_EPSILON);
|
|
2005
|
+
setShowBottomFade(
|
|
2006
|
+
overflows && scrollY + viewportH < contentH - SCROLL_EPSILON
|
|
2007
|
+
);
|
|
2008
|
+
};
|
|
2009
|
+
const onScroll = (e) => {
|
|
2010
|
+
metrics.current.scrollY = e.nativeEvent.contentOffset.y;
|
|
2011
|
+
recomputeFades();
|
|
2012
|
+
};
|
|
2013
|
+
const onViewportLayout = (e) => {
|
|
2014
|
+
metrics.current.viewportH = e.nativeEvent.layout.height;
|
|
2015
|
+
recomputeFades();
|
|
2016
|
+
};
|
|
2017
|
+
const onContentSizeChange = (_w, h) => {
|
|
2018
|
+
metrics.current.contentH = h;
|
|
2019
|
+
metrics.current.scrollY = Math.min(
|
|
2020
|
+
metrics.current.scrollY,
|
|
2021
|
+
Math.max(0, h - metrics.current.viewportH)
|
|
2022
|
+
);
|
|
2023
|
+
recomputeFades();
|
|
2024
|
+
};
|
|
1764
2025
|
return /* @__PURE__ */ jsxs5(
|
|
1765
2026
|
Box,
|
|
1766
2027
|
{
|
|
1767
|
-
backgroundColor: "bgModal",
|
|
1768
2028
|
borderTopLeftRadius: "modal",
|
|
1769
2029
|
borderTopRightRadius: "modal",
|
|
1770
|
-
style:
|
|
2030
|
+
style: {
|
|
2031
|
+
backgroundColor: theme.background.modal,
|
|
2032
|
+
// 16px gap above the home indicator (design review), device-aware.
|
|
2033
|
+
paddingBottom: insets.bottom + 16
|
|
2034
|
+
},
|
|
1771
2035
|
children: [
|
|
1772
2036
|
/* @__PURE__ */ jsxs5(Box, { flexDirection: "row", alignItems: "center", style: topBar2, children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
/* @__PURE__ */
|
|
1775
|
-
|
|
2037
|
+
/* @__PURE__ */ jsx13(Box, { style: topBarSpacer }),
|
|
2038
|
+
/* @__PURE__ */ jsx13(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx13(
|
|
2039
|
+
Text,
|
|
2040
|
+
{
|
|
2041
|
+
variant: "bodyMedium",
|
|
2042
|
+
style: { color: theme.content.elements.primary },
|
|
2043
|
+
children: title
|
|
2044
|
+
}
|
|
2045
|
+
) }),
|
|
2046
|
+
/* @__PURE__ */ jsx13(Box, { style: topBarSpacer })
|
|
1776
2047
|
] }),
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
2048
|
+
/* @__PURE__ */ jsxs5(View, { style: scrollArea, children: [
|
|
2049
|
+
/* @__PURE__ */ jsx13(
|
|
2050
|
+
ScrollView2,
|
|
2051
|
+
{
|
|
2052
|
+
style: [list, { maxHeight: height * 0.72 }],
|
|
2053
|
+
showsVerticalScrollIndicator: false,
|
|
2054
|
+
contentContainerStyle: listContent2,
|
|
2055
|
+
onScroll,
|
|
2056
|
+
onLayout: onViewportLayout,
|
|
2057
|
+
onContentSizeChange,
|
|
2058
|
+
scrollEventThrottle: 16,
|
|
2059
|
+
children: loading ? Array.from({ length: skeletonCount }, (_, index) => /* @__PURE__ */ jsx13(AvailableChainSkeleton, {}, index)) : chains.map((chain) => /* @__PURE__ */ jsxs5(
|
|
2060
|
+
Box,
|
|
2061
|
+
{
|
|
2062
|
+
flexDirection: "row",
|
|
2063
|
+
alignItems: "center",
|
|
2064
|
+
style: row2,
|
|
2065
|
+
children: [
|
|
2066
|
+
/* @__PURE__ */ jsx13(Box, { style: iconRing2, children: /* @__PURE__ */ jsx13(
|
|
2067
|
+
FunIcon,
|
|
2068
|
+
{
|
|
2069
|
+
uri: chain.iconUri,
|
|
2070
|
+
size: 36,
|
|
2071
|
+
fallbackUri: FALLBACK_ASSET_LOGO
|
|
2072
|
+
}
|
|
2073
|
+
) }),
|
|
2074
|
+
/* @__PURE__ */ jsx13(Box, { flex: 1, children: /* @__PURE__ */ jsx13(
|
|
2075
|
+
Text,
|
|
2076
|
+
{
|
|
2077
|
+
variant: "bodyMedium",
|
|
2078
|
+
style: { color: theme.content.elements.primary },
|
|
2079
|
+
children: chain.name
|
|
2080
|
+
}
|
|
2081
|
+
) }),
|
|
2082
|
+
chain.minLabel ? /* @__PURE__ */ jsx13(
|
|
2083
|
+
Text,
|
|
2084
|
+
{
|
|
2085
|
+
variant: "detail",
|
|
2086
|
+
style: { color: theme.content.elements.secondary },
|
|
2087
|
+
children: chain.minLabel
|
|
2088
|
+
}
|
|
2089
|
+
) : null
|
|
2090
|
+
]
|
|
2091
|
+
},
|
|
2092
|
+
chain.id
|
|
2093
|
+
))
|
|
2094
|
+
}
|
|
2095
|
+
),
|
|
2096
|
+
showTopFade ? /* @__PURE__ */ jsx13(ScrollFade, { edge: "top", color: theme.background.modal }) : null,
|
|
2097
|
+
showBottomFade ? /* @__PURE__ */ jsx13(ScrollFade, { edge: "bottom", color: theme.background.modal }) : null
|
|
2098
|
+
] }),
|
|
2099
|
+
/* @__PURE__ */ jsx13(Box, { style: buttonContainer, children: /* @__PURE__ */ jsx13(
|
|
1807
2100
|
Pressable2,
|
|
1808
2101
|
{
|
|
1809
2102
|
onPress: onClose,
|
|
1810
2103
|
accessibilityRole: "button",
|
|
1811
2104
|
accessibilityLabel: gotItLabel,
|
|
1812
|
-
children: /* @__PURE__ */
|
|
2105
|
+
children: /* @__PURE__ */ jsx13(
|
|
1813
2106
|
Box,
|
|
1814
2107
|
{
|
|
1815
2108
|
flexDirection: "row",
|
|
1816
2109
|
alignItems: "center",
|
|
1817
2110
|
justifyContent: "center",
|
|
1818
|
-
backgroundColor: "btnPrimary",
|
|
1819
2111
|
borderRadius: "button",
|
|
1820
|
-
style:
|
|
1821
|
-
|
|
2112
|
+
style: [
|
|
2113
|
+
gotItButton,
|
|
2114
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2115
|
+
],
|
|
2116
|
+
children: /* @__PURE__ */ jsx13(
|
|
2117
|
+
Text,
|
|
2118
|
+
{
|
|
2119
|
+
variant: "bodyMedium",
|
|
2120
|
+
style: { color: theme.content.button.primary.default },
|
|
2121
|
+
children: gotItLabel
|
|
2122
|
+
}
|
|
2123
|
+
)
|
|
1822
2124
|
}
|
|
1823
2125
|
)
|
|
1824
2126
|
}
|
|
@@ -1828,13 +2130,79 @@ function AvailableChainsScreen({
|
|
|
1828
2130
|
);
|
|
1829
2131
|
}
|
|
1830
2132
|
function AvailableChainSkeleton() {
|
|
2133
|
+
const theme = useTheme();
|
|
1831
2134
|
return /* @__PURE__ */ jsxs5(Box, { flexDirection: "row", alignItems: "center", style: row2, children: [
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
|
|
1834
|
-
|
|
2135
|
+
/* @__PURE__ */ jsx13(
|
|
2136
|
+
Box,
|
|
2137
|
+
{
|
|
2138
|
+
style: [
|
|
2139
|
+
skeletonIcon,
|
|
2140
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2141
|
+
]
|
|
2142
|
+
}
|
|
2143
|
+
),
|
|
2144
|
+
/* @__PURE__ */ jsx13(Box, { flex: 1, children: /* @__PURE__ */ jsx13(
|
|
2145
|
+
Box,
|
|
2146
|
+
{
|
|
2147
|
+
style: [
|
|
2148
|
+
skeletonName,
|
|
2149
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2150
|
+
]
|
|
2151
|
+
}
|
|
2152
|
+
) }),
|
|
2153
|
+
/* @__PURE__ */ jsx13(
|
|
2154
|
+
Box,
|
|
2155
|
+
{
|
|
2156
|
+
style: [
|
|
2157
|
+
skeletonMin,
|
|
2158
|
+
{ backgroundColor: theme.background.pill.pressed }
|
|
2159
|
+
]
|
|
2160
|
+
}
|
|
2161
|
+
)
|
|
1835
2162
|
] });
|
|
1836
2163
|
}
|
|
1837
|
-
|
|
2164
|
+
function ScrollFade({
|
|
2165
|
+
edge,
|
|
2166
|
+
color
|
|
2167
|
+
}) {
|
|
2168
|
+
const id = `chains-fade-${edge}`;
|
|
2169
|
+
const topOpaque = edge === "top";
|
|
2170
|
+
return /* @__PURE__ */ jsx13(
|
|
2171
|
+
View,
|
|
2172
|
+
{
|
|
2173
|
+
pointerEvents: "none",
|
|
2174
|
+
style: [fade, edge === "top" ? { top: 0 } : { bottom: 0 }],
|
|
2175
|
+
children: /* @__PURE__ */ jsxs5(Svg, { width: "100%", height: "100%", children: [
|
|
2176
|
+
/* @__PURE__ */ jsx13(Defs, { children: /* @__PURE__ */ jsxs5(LinearGradient, { id, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
2177
|
+
/* @__PURE__ */ jsx13(
|
|
2178
|
+
Stop,
|
|
2179
|
+
{
|
|
2180
|
+
offset: "0",
|
|
2181
|
+
stopColor: color,
|
|
2182
|
+
stopOpacity: topOpaque ? 1 : 0
|
|
2183
|
+
}
|
|
2184
|
+
),
|
|
2185
|
+
/* @__PURE__ */ jsx13(
|
|
2186
|
+
Stop,
|
|
2187
|
+
{
|
|
2188
|
+
offset: "1",
|
|
2189
|
+
stopColor: color,
|
|
2190
|
+
stopOpacity: topOpaque ? 0 : 1
|
|
2191
|
+
}
|
|
2192
|
+
)
|
|
2193
|
+
] }) }),
|
|
2194
|
+
/* @__PURE__ */ jsx13(Rect, { x: "0", y: "0", width: "100%", height: "100%", fill: `url(#${id})` })
|
|
2195
|
+
] })
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
var scrollArea = { position: "relative" };
|
|
2200
|
+
var fade = {
|
|
2201
|
+
position: "absolute",
|
|
2202
|
+
left: 0,
|
|
2203
|
+
right: 0,
|
|
2204
|
+
height: SCROLL_FADE_HEIGHT
|
|
2205
|
+
};
|
|
1838
2206
|
var topBar2 = {
|
|
1839
2207
|
paddingBottom: 12,
|
|
1840
2208
|
paddingHorizontal: 24,
|
|
@@ -1861,55 +2229,72 @@ var iconRing2 = {
|
|
|
1861
2229
|
};
|
|
1862
2230
|
|
|
1863
2231
|
// src/screens/CheckoutBlockedScreen.tsx
|
|
1864
|
-
import { Linking, Pressable as Pressable3, StyleSheet as
|
|
1865
|
-
import { jsx as
|
|
2232
|
+
import { Linking, Pressable as Pressable3, StyleSheet as StyleSheet3 } from "react-native";
|
|
2233
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1866
2234
|
var FUN_REGIONAL_RESTRICTIONS_URL = "https://intercom.help/funxyz/en/articles/9827689-regional-restrictions";
|
|
1867
2235
|
function CheckoutBlockedScreen() {
|
|
2236
|
+
const theme = useTheme();
|
|
1868
2237
|
return /* @__PURE__ */ jsxs6(
|
|
1869
2238
|
Box,
|
|
1870
2239
|
{
|
|
1871
|
-
backgroundColor: "bgModal",
|
|
1872
2240
|
borderTopLeftRadius: "modal",
|
|
1873
2241
|
borderTopRightRadius: "modal",
|
|
2242
|
+
style: { backgroundColor: theme.background.modal },
|
|
1874
2243
|
children: [
|
|
1875
|
-
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", style:
|
|
1876
|
-
/* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */ jsx11(Text, { variant: "bodyMedium", color: "textPrimary", children: "Add money" })
|
|
1878
|
-
] }),
|
|
1879
|
-
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", justifyContent: "center", style: styles2.content, children: [
|
|
1880
|
-
/* @__PURE__ */ jsx11(
|
|
2244
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", style: styles3.topBar, children: [
|
|
2245
|
+
/* @__PURE__ */ jsx14(
|
|
1881
2246
|
Box,
|
|
1882
2247
|
{
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
style: styles2.iconCircle,
|
|
1888
|
-
children: /* @__PURE__ */ jsx11(FigmaAlertCircleIcon, { size: 20 })
|
|
2248
|
+
style: [
|
|
2249
|
+
styles3.grabber,
|
|
2250
|
+
{ backgroundColor: theme.border.elements.default.color }
|
|
2251
|
+
]
|
|
1889
2252
|
}
|
|
1890
2253
|
),
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
|
|
2254
|
+
/* @__PURE__ */ jsx14(
|
|
2255
|
+
Text,
|
|
2256
|
+
{
|
|
2257
|
+
variant: "bodyMedium",
|
|
2258
|
+
style: { color: theme.content.elements.primary },
|
|
2259
|
+
children: "Add money"
|
|
2260
|
+
}
|
|
2261
|
+
)
|
|
2262
|
+
] }),
|
|
2263
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", justifyContent: "center", style: styles3.content, children: [
|
|
2264
|
+
/* @__PURE__ */ jsx14(StatusIcon, {}),
|
|
2265
|
+
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", style: styles3.textGroup, children: [
|
|
2266
|
+
/* @__PURE__ */ jsx14(
|
|
2267
|
+
Text,
|
|
2268
|
+
{
|
|
2269
|
+
variant: "bodyMedium",
|
|
2270
|
+
style: { color: theme.content.elements.primary },
|
|
2271
|
+
children: "Not available"
|
|
2272
|
+
}
|
|
2273
|
+
),
|
|
1893
2274
|
/* @__PURE__ */ jsxs6(Box, { alignItems: "center", children: [
|
|
1894
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ jsx14(
|
|
1895
2276
|
Text,
|
|
1896
2277
|
{
|
|
1897
2278
|
variant: "detail",
|
|
1898
|
-
|
|
1899
|
-
|
|
2279
|
+
style: [
|
|
2280
|
+
styles3.descriptionText,
|
|
2281
|
+
{ color: theme.content.elements.secondary }
|
|
2282
|
+
],
|
|
1900
2283
|
children: "This service is not available in your region."
|
|
1901
2284
|
}
|
|
1902
2285
|
),
|
|
1903
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ jsx14(
|
|
1904
2287
|
Pressable3,
|
|
1905
2288
|
{
|
|
1906
2289
|
onPress: () => Linking.openURL(FUN_REGIONAL_RESTRICTIONS_URL),
|
|
1907
|
-
children: /* @__PURE__ */
|
|
2290
|
+
children: /* @__PURE__ */ jsx14(
|
|
1908
2291
|
Text,
|
|
1909
2292
|
{
|
|
1910
2293
|
variant: "detail",
|
|
1911
|
-
|
|
1912
|
-
|
|
2294
|
+
style: [
|
|
2295
|
+
styles3.linkText,
|
|
2296
|
+
{ color: theme.content.elements.secondary }
|
|
2297
|
+
],
|
|
1913
2298
|
children: "View available regions."
|
|
1914
2299
|
}
|
|
1915
2300
|
)
|
|
@@ -1922,7 +2307,7 @@ function CheckoutBlockedScreen() {
|
|
|
1922
2307
|
}
|
|
1923
2308
|
);
|
|
1924
2309
|
}
|
|
1925
|
-
var
|
|
2310
|
+
var styles3 = StyleSheet3.create({
|
|
1926
2311
|
topBar: { height: 64, paddingTop: 25, paddingBottom: 12 },
|
|
1927
2312
|
grabber: {
|
|
1928
2313
|
position: "absolute",
|
|
@@ -1937,14 +2322,13 @@ var styles2 = StyleSheet2.create({
|
|
|
1937
2322
|
paddingHorizontal: 16,
|
|
1938
2323
|
paddingBottom: 34
|
|
1939
2324
|
},
|
|
1940
|
-
iconCircle: { width: 48, height: 48 },
|
|
1941
2325
|
textGroup: { gap: 8 },
|
|
1942
2326
|
descriptionText: { textAlign: "center" },
|
|
1943
2327
|
linkText: { textAlign: "center", textDecorationLine: "underline" }
|
|
1944
2328
|
});
|
|
1945
2329
|
|
|
1946
2330
|
// src/screens/QrCodeScreen.tsx
|
|
1947
|
-
import { useEffect as useEffect5, useRef as
|
|
2331
|
+
import { useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
|
|
1948
2332
|
import { Pressable as Pressable4 } from "react-native";
|
|
1949
2333
|
|
|
1950
2334
|
// src/hooks/useScreenSize.ts
|
|
@@ -1956,24 +2340,24 @@ function useScreenSize() {
|
|
|
1956
2340
|
}
|
|
1957
2341
|
|
|
1958
2342
|
// src/icons/CopyAddressIcon.tsx
|
|
1959
|
-
import { SvgXml as
|
|
1960
|
-
import { jsx as
|
|
2343
|
+
import { SvgXml as SvgXml5 } from "react-native-svg";
|
|
2344
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1961
2345
|
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>`;
|
|
1962
2346
|
function CopyAddressIcon({ size = 16 }) {
|
|
1963
2347
|
const theme = useTheme();
|
|
1964
|
-
return /* @__PURE__ */
|
|
1965
|
-
|
|
2348
|
+
return /* @__PURE__ */ jsx15(
|
|
2349
|
+
SvgXml5,
|
|
1966
2350
|
{
|
|
1967
2351
|
xml: COPY_ADDRESS_SVG,
|
|
1968
2352
|
width: size,
|
|
1969
2353
|
height: size,
|
|
1970
|
-
color: theme.
|
|
2354
|
+
color: theme.content.button.secondary.default
|
|
1971
2355
|
}
|
|
1972
2356
|
);
|
|
1973
2357
|
}
|
|
1974
2358
|
|
|
1975
2359
|
// src/screens/QrCodeScreen.tsx
|
|
1976
|
-
import { jsx as
|
|
2360
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1977
2361
|
function QrCodeScreen({
|
|
1978
2362
|
qrCode,
|
|
1979
2363
|
centerIcon,
|
|
@@ -1987,8 +2371,9 @@ function QrCodeScreen({
|
|
|
1987
2371
|
onCopyAddress
|
|
1988
2372
|
}) {
|
|
1989
2373
|
const { isShort } = useScreenSize();
|
|
1990
|
-
const
|
|
1991
|
-
const
|
|
2374
|
+
const theme = useTheme();
|
|
2375
|
+
const [copied, setCopied] = useState6(false);
|
|
2376
|
+
const copyTimer = useRef3(void 0);
|
|
1992
2377
|
useEffect5(() => () => clearTimeout(copyTimer.current), []);
|
|
1993
2378
|
const handleCopy = async () => {
|
|
1994
2379
|
const ok = await onCopyAddress?.();
|
|
@@ -2000,15 +2385,21 @@ function QrCodeScreen({
|
|
|
2000
2385
|
return /* @__PURE__ */ jsxs7(
|
|
2001
2386
|
Box,
|
|
2002
2387
|
{
|
|
2003
|
-
backgroundColor: "bgModal",
|
|
2004
2388
|
borderTopLeftRadius: "modal",
|
|
2005
2389
|
borderTopRightRadius: "modal",
|
|
2006
|
-
style:
|
|
2390
|
+
style: [sheet, { backgroundColor: theme.background.modal }],
|
|
2007
2391
|
children: [
|
|
2008
2392
|
/* @__PURE__ */ jsxs7(Box, { flexDirection: "row", alignItems: "center", style: topBar3, children: [
|
|
2009
|
-
/* @__PURE__ */
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
|
|
2393
|
+
/* @__PURE__ */ jsx16(Box, { style: topBarSpacer2 }),
|
|
2394
|
+
/* @__PURE__ */ jsx16(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx16(
|
|
2395
|
+
Text,
|
|
2396
|
+
{
|
|
2397
|
+
variant: "bodyMedium",
|
|
2398
|
+
style: { color: theme.content.elements.primary },
|
|
2399
|
+
children: title
|
|
2400
|
+
}
|
|
2401
|
+
) }),
|
|
2402
|
+
/* @__PURE__ */ jsx16(Box, { style: topBarSpacer2 })
|
|
2012
2403
|
] }),
|
|
2013
2404
|
/* @__PURE__ */ jsxs7(Box, { style: { paddingVertical: isShort ? 0 : 16 }, children: [
|
|
2014
2405
|
/* @__PURE__ */ jsxs7(
|
|
@@ -2021,15 +2412,19 @@ function QrCodeScreen({
|
|
|
2021
2412
|
/* @__PURE__ */ jsxs7(
|
|
2022
2413
|
Box,
|
|
2023
2414
|
{
|
|
2024
|
-
backgroundColor: "bgModal",
|
|
2025
|
-
borderColor: "borderDefault",
|
|
2026
2415
|
borderWidth: 1.5,
|
|
2027
2416
|
alignItems: "center",
|
|
2028
2417
|
justifyContent: "center",
|
|
2029
|
-
style:
|
|
2418
|
+
style: [
|
|
2419
|
+
qrFrame,
|
|
2420
|
+
{
|
|
2421
|
+
backgroundColor: theme.background.modal,
|
|
2422
|
+
borderColor: theme.border.elements.default.color
|
|
2423
|
+
}
|
|
2424
|
+
],
|
|
2030
2425
|
children: [
|
|
2031
2426
|
qrCode,
|
|
2032
|
-
centerIcon ? /* @__PURE__ */
|
|
2427
|
+
centerIcon ? /* @__PURE__ */ jsx16(
|
|
2033
2428
|
Box,
|
|
2034
2429
|
{
|
|
2035
2430
|
alignItems: "center",
|
|
@@ -2042,8 +2437,18 @@ function QrCodeScreen({
|
|
|
2042
2437
|
}
|
|
2043
2438
|
),
|
|
2044
2439
|
address ? /* @__PURE__ */ jsxs7(Box, { alignItems: "center", style: addressGroup, children: [
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
|
|
2440
|
+
/* @__PURE__ */ jsx16(
|
|
2441
|
+
Text,
|
|
2442
|
+
{
|
|
2443
|
+
variant: "body",
|
|
2444
|
+
style: [
|
|
2445
|
+
addressText,
|
|
2446
|
+
{ color: theme.content.elements.secondary }
|
|
2447
|
+
],
|
|
2448
|
+
children: address
|
|
2449
|
+
}
|
|
2450
|
+
),
|
|
2451
|
+
onCopyAddress ? /* @__PURE__ */ jsx16(
|
|
2047
2452
|
Pressable4,
|
|
2048
2453
|
{
|
|
2049
2454
|
onPress: handleCopy,
|
|
@@ -2055,14 +2460,25 @@ function QrCodeScreen({
|
|
|
2055
2460
|
flexDirection: "row",
|
|
2056
2461
|
alignItems: "center",
|
|
2057
2462
|
justifyContent: "center",
|
|
2058
|
-
backgroundColor: "btnSecondary",
|
|
2059
|
-
borderColor: "btnSecondary",
|
|
2060
2463
|
borderWidth: 1,
|
|
2061
2464
|
borderRadius: "element",
|
|
2062
|
-
style:
|
|
2465
|
+
style: [
|
|
2466
|
+
copyButton,
|
|
2467
|
+
{
|
|
2468
|
+
backgroundColor: theme.background.button.secondary.default,
|
|
2469
|
+
borderColor: theme.background.button.secondary.default
|
|
2470
|
+
}
|
|
2471
|
+
],
|
|
2063
2472
|
children: [
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsx16(CopyAddressIcon, {}),
|
|
2474
|
+
/* @__PURE__ */ jsx16(
|
|
2475
|
+
Text,
|
|
2476
|
+
{
|
|
2477
|
+
variant: "bodyMedium",
|
|
2478
|
+
style: { color: theme.content.button.secondary.default },
|
|
2479
|
+
children: copied ? copiedLabel : copyLabel
|
|
2480
|
+
}
|
|
2481
|
+
)
|
|
2066
2482
|
]
|
|
2067
2483
|
}
|
|
2068
2484
|
)
|
|
@@ -2072,22 +2488,31 @@ function QrCodeScreen({
|
|
|
2072
2488
|
]
|
|
2073
2489
|
}
|
|
2074
2490
|
),
|
|
2075
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx16(Box, { style: buttonContainer2, children: /* @__PURE__ */ jsx16(
|
|
2076
2492
|
Pressable4,
|
|
2077
2493
|
{
|
|
2078
2494
|
onPress: onClose,
|
|
2079
2495
|
accessibilityRole: "button",
|
|
2080
2496
|
accessibilityLabel: doneLabel,
|
|
2081
|
-
children: /* @__PURE__ */
|
|
2497
|
+
children: /* @__PURE__ */ jsx16(
|
|
2082
2498
|
Box,
|
|
2083
2499
|
{
|
|
2084
2500
|
flexDirection: "row",
|
|
2085
2501
|
alignItems: "center",
|
|
2086
2502
|
justifyContent: "center",
|
|
2087
|
-
backgroundColor: "btnPrimary",
|
|
2088
2503
|
borderRadius: "button",
|
|
2089
|
-
style:
|
|
2090
|
-
|
|
2504
|
+
style: [
|
|
2505
|
+
doneButton,
|
|
2506
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2507
|
+
],
|
|
2508
|
+
children: /* @__PURE__ */ jsx16(
|
|
2509
|
+
Text,
|
|
2510
|
+
{
|
|
2511
|
+
variant: "bodyMedium",
|
|
2512
|
+
style: { color: theme.content.button.primary.default },
|
|
2513
|
+
children: doneLabel
|
|
2514
|
+
}
|
|
2515
|
+
)
|
|
2091
2516
|
}
|
|
2092
2517
|
)
|
|
2093
2518
|
}
|
|
@@ -2097,7 +2522,7 @@ function QrCodeScreen({
|
|
|
2097
2522
|
}
|
|
2098
2523
|
);
|
|
2099
2524
|
}
|
|
2100
|
-
var
|
|
2525
|
+
var sheet = { paddingBottom: 34 };
|
|
2101
2526
|
var topBar3 = {
|
|
2102
2527
|
paddingBottom: 12,
|
|
2103
2528
|
paddingHorizontal: 24,
|
|
@@ -2139,11 +2564,12 @@ var buttonContainer2 = { paddingHorizontal: 20 };
|
|
|
2139
2564
|
var doneButton = { height: 56, paddingHorizontal: 24 };
|
|
2140
2565
|
|
|
2141
2566
|
// src/screens/TransferCryptoScreen.tsx
|
|
2142
|
-
import { useEffect as useEffect7, useRef as
|
|
2567
|
+
import { useEffect as useEffect7, useRef as useRef4, useState as useState8 } from "react";
|
|
2143
2568
|
import { Pressable as Pressable6 } from "react-native";
|
|
2569
|
+
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
2144
2570
|
|
|
2145
2571
|
// src/screens/NetworkSelector.tsx
|
|
2146
|
-
import { useEffect as useEffect6, useState as
|
|
2572
|
+
import { useEffect as useEffect6, useState as useState7 } from "react";
|
|
2147
2573
|
import { Pressable as Pressable5 } from "react-native";
|
|
2148
2574
|
import Animated3, {
|
|
2149
2575
|
Easing as Easing3,
|
|
@@ -2151,7 +2577,7 @@ import Animated3, {
|
|
|
2151
2577
|
FadeOut,
|
|
2152
2578
|
LinearTransition
|
|
2153
2579
|
} from "react-native-reanimated";
|
|
2154
|
-
import { jsx as
|
|
2580
|
+
import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2155
2581
|
function toIconUri3(icon) {
|
|
2156
2582
|
return icon.startsWith("http") ? icon : chainIconUri(icon);
|
|
2157
2583
|
}
|
|
@@ -2160,21 +2586,26 @@ function NetworkSelector({
|
|
|
2160
2586
|
selectedId,
|
|
2161
2587
|
onSelect
|
|
2162
2588
|
}) {
|
|
2163
|
-
const [animate, setAnimate] =
|
|
2589
|
+
const [animate, setAnimate] = useState7(false);
|
|
2164
2590
|
useEffect6(() => setAnimate(true), []);
|
|
2165
|
-
|
|
2591
|
+
const theme = useTheme();
|
|
2592
|
+
return /* @__PURE__ */ jsx17(
|
|
2166
2593
|
Box,
|
|
2167
2594
|
{
|
|
2168
2595
|
flexDirection: "row",
|
|
2169
2596
|
alignItems: "center",
|
|
2170
|
-
backgroundColor: "bgSecondary",
|
|
2171
|
-
borderColor: "borderDefault",
|
|
2172
2597
|
borderWidth: 1,
|
|
2173
2598
|
borderRadius: "rounded",
|
|
2174
|
-
style:
|
|
2599
|
+
style: [
|
|
2600
|
+
track,
|
|
2601
|
+
{
|
|
2602
|
+
backgroundColor: theme.background.secondary,
|
|
2603
|
+
borderColor: theme.border.elements.default.color
|
|
2604
|
+
}
|
|
2605
|
+
],
|
|
2175
2606
|
children: networks.map((network) => {
|
|
2176
2607
|
const selected = network.id === selectedId;
|
|
2177
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ jsx17(
|
|
2178
2609
|
AnimatedPressable2,
|
|
2179
2610
|
{
|
|
2180
2611
|
onPress: () => onSelect(network.id),
|
|
@@ -2183,7 +2614,7 @@ function NetworkSelector({
|
|
|
2183
2614
|
accessibilityLabel: network.label,
|
|
2184
2615
|
style: selected ? selectedPress : iconPress,
|
|
2185
2616
|
layout: animate ? segmentLayout : void 0,
|
|
2186
|
-
children: selected ? /* @__PURE__ */
|
|
2617
|
+
children: selected ? /* @__PURE__ */ jsx17(
|
|
2187
2618
|
Animated3.View,
|
|
2188
2619
|
{
|
|
2189
2620
|
entering: animate ? FadeIn.duration(SLIDE_MS) : void 0,
|
|
@@ -2195,19 +2626,30 @@ function NetworkSelector({
|
|
|
2195
2626
|
flexDirection: "row",
|
|
2196
2627
|
alignItems: "center",
|
|
2197
2628
|
justifyContent: "center",
|
|
2198
|
-
backgroundColor: "bgModal",
|
|
2199
|
-
borderColor: "borderDefault",
|
|
2200
2629
|
borderWidth: 1,
|
|
2201
2630
|
borderRadius: "rounded",
|
|
2202
|
-
style:
|
|
2631
|
+
style: [
|
|
2632
|
+
selectedPill,
|
|
2633
|
+
{
|
|
2634
|
+
backgroundColor: theme.background.modal,
|
|
2635
|
+
borderColor: theme.border.elements.default.color
|
|
2636
|
+
}
|
|
2637
|
+
],
|
|
2203
2638
|
children: [
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ jsx17(ChainGlyph, { iconKeys: network.iconKeys }),
|
|
2640
|
+
/* @__PURE__ */ jsx17(
|
|
2641
|
+
Text,
|
|
2642
|
+
{
|
|
2643
|
+
variant: "bodyMedium",
|
|
2644
|
+
style: { color: theme.content.elements.primary },
|
|
2645
|
+
children: network.label
|
|
2646
|
+
}
|
|
2647
|
+
)
|
|
2206
2648
|
]
|
|
2207
2649
|
}
|
|
2208
2650
|
)
|
|
2209
2651
|
}
|
|
2210
|
-
) : /* @__PURE__ */
|
|
2652
|
+
) : /* @__PURE__ */ jsx17(ChainGlyph, { iconKeys: network.iconKeys })
|
|
2211
2653
|
},
|
|
2212
2654
|
network.id
|
|
2213
2655
|
);
|
|
@@ -2223,7 +2665,7 @@ var segmentLayout = LinearTransition.duration(SLIDE_MS).easing(
|
|
|
2223
2665
|
);
|
|
2224
2666
|
function ChainGlyph({ iconKeys }) {
|
|
2225
2667
|
if (iconKeys.length <= 1) {
|
|
2226
|
-
return /* @__PURE__ */
|
|
2668
|
+
return /* @__PURE__ */ jsx17(
|
|
2227
2669
|
FunIcon,
|
|
2228
2670
|
{
|
|
2229
2671
|
uri: toIconUri3(iconKeys[0] ?? ""),
|
|
@@ -2232,7 +2674,7 @@ function ChainGlyph({ iconKeys }) {
|
|
|
2232
2674
|
}
|
|
2233
2675
|
);
|
|
2234
2676
|
}
|
|
2235
|
-
return /* @__PURE__ */
|
|
2677
|
+
return /* @__PURE__ */ jsx17(Box, { width: 24, height: 24, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx17(Box, { flexDirection: "row", flexWrap: "wrap", style: miniGrid, children: iconKeys.slice(0, 4).map((key) => /* @__PURE__ */ jsx17(
|
|
2236
2678
|
FunIcon,
|
|
2237
2679
|
{
|
|
2238
2680
|
uri: toIconUri3(key),
|
|
@@ -2259,7 +2701,7 @@ var iconPress = {
|
|
|
2259
2701
|
var miniGrid = { width: 23.5, gap: 1.5 };
|
|
2260
2702
|
|
|
2261
2703
|
// src/screens/TransferCryptoScreen.tsx
|
|
2262
|
-
import { jsx as
|
|
2704
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2263
2705
|
function TransferCryptoScreen({
|
|
2264
2706
|
depositAddress,
|
|
2265
2707
|
networks,
|
|
@@ -2280,8 +2722,9 @@ function TransferCryptoScreen({
|
|
|
2280
2722
|
onShareAddress
|
|
2281
2723
|
}) {
|
|
2282
2724
|
const theme = useTheme();
|
|
2283
|
-
const
|
|
2284
|
-
const
|
|
2725
|
+
const insets = useSafeAreaInsets2();
|
|
2726
|
+
const [copied, setCopied] = useState8(false);
|
|
2727
|
+
const copyTimer = useRef4(void 0);
|
|
2285
2728
|
useEffect7(() => () => clearTimeout(copyTimer.current), []);
|
|
2286
2729
|
const handleCopy = () => {
|
|
2287
2730
|
onCopyAddress?.();
|
|
@@ -2296,35 +2739,42 @@ function TransferCryptoScreen({
|
|
|
2296
2739
|
return /* @__PURE__ */ jsxs9(
|
|
2297
2740
|
Box,
|
|
2298
2741
|
{
|
|
2299
|
-
backgroundColor: "bgModal",
|
|
2300
2742
|
borderTopLeftRadius: "modal",
|
|
2301
2743
|
borderTopRightRadius: "modal",
|
|
2744
|
+
style: { backgroundColor: theme.background.modal },
|
|
2302
2745
|
children: [
|
|
2303
2746
|
/* @__PURE__ */ jsxs9(Box, { flexDirection: "row", alignItems: "center", style: topBar4, children: [
|
|
2304
|
-
/* @__PURE__ */
|
|
2747
|
+
/* @__PURE__ */ jsx18(
|
|
2305
2748
|
Pressable6,
|
|
2306
2749
|
{
|
|
2307
2750
|
onPress: onBack,
|
|
2308
2751
|
hitSlop: 12,
|
|
2309
2752
|
accessibilityRole: "button",
|
|
2310
2753
|
accessibilityLabel: "Back",
|
|
2311
|
-
children: /* @__PURE__ */
|
|
2754
|
+
children: /* @__PURE__ */ jsx18(Box, { alignItems: "center", justifyContent: "center", style: iconButton, children: /* @__PURE__ */ jsx18(FigmaChevronLeftIcon, {}) })
|
|
2312
2755
|
}
|
|
2313
2756
|
),
|
|
2314
|
-
/* @__PURE__ */
|
|
2315
|
-
|
|
2757
|
+
/* @__PURE__ */ jsx18(Box, { flex: 1, alignItems: "center", children: /* @__PURE__ */ jsx18(
|
|
2758
|
+
Text,
|
|
2759
|
+
{
|
|
2760
|
+
variant: "bodyMedium",
|
|
2761
|
+
style: { color: theme.content.elements.primary },
|
|
2762
|
+
children: title
|
|
2763
|
+
}
|
|
2764
|
+
) }),
|
|
2765
|
+
/* @__PURE__ */ jsx18(
|
|
2316
2766
|
Pressable6,
|
|
2317
2767
|
{
|
|
2318
2768
|
onPress: onShowQrCode,
|
|
2319
2769
|
hitSlop: 12,
|
|
2320
2770
|
accessibilityRole: "button",
|
|
2321
2771
|
accessibilityLabel: "Show QR code",
|
|
2322
|
-
children: /* @__PURE__ */
|
|
2772
|
+
children: /* @__PURE__ */ jsx18(Box, { alignItems: "center", justifyContent: "center", style: iconButton, children: /* @__PURE__ */ jsx18(FigmaQrScanIcon, {}) })
|
|
2323
2773
|
}
|
|
2324
2774
|
)
|
|
2325
2775
|
] }),
|
|
2326
|
-
/* @__PURE__ */ jsxs9(Box, { style: content2, children: [
|
|
2327
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsxs9(Box, { style: [content2, { paddingBottom: insets.bottom + 16 }], children: [
|
|
2777
|
+
/* @__PURE__ */ jsx18(
|
|
2328
2778
|
NetworkSelector,
|
|
2329
2779
|
{
|
|
2330
2780
|
networks,
|
|
@@ -2339,31 +2789,44 @@ function TransferCryptoScreen({
|
|
|
2339
2789
|
justifyContent: "flex-end",
|
|
2340
2790
|
style: addressRegion,
|
|
2341
2791
|
children: [
|
|
2342
|
-
/* @__PURE__ */
|
|
2792
|
+
/* @__PURE__ */ jsx18(
|
|
2343
2793
|
Box,
|
|
2344
2794
|
{
|
|
2345
2795
|
flex: 1,
|
|
2346
2796
|
alignItems: "center",
|
|
2347
2797
|
justifyContent: "center",
|
|
2348
|
-
backgroundColor: "bgModal",
|
|
2349
|
-
borderColor: "borderDefault",
|
|
2350
2798
|
borderWidth: 1,
|
|
2351
2799
|
borderRadius: "element",
|
|
2352
|
-
style:
|
|
2800
|
+
style: [
|
|
2801
|
+
addressCard,
|
|
2802
|
+
{
|
|
2803
|
+
backgroundColor: theme.background.modal,
|
|
2804
|
+
borderColor: theme.border.elements.default.color
|
|
2805
|
+
}
|
|
2806
|
+
],
|
|
2353
2807
|
children: /* @__PURE__ */ jsxs9(Box, { alignItems: "center", style: addressColumn, children: [
|
|
2354
2808
|
/* @__PURE__ */ jsxs9(Box, { alignItems: "center", style: addressGroup2, children: [
|
|
2355
|
-
/* @__PURE__ */
|
|
2356
|
-
|
|
2809
|
+
/* @__PURE__ */ jsx18(
|
|
2810
|
+
Text,
|
|
2811
|
+
{
|
|
2812
|
+
variant: "body",
|
|
2813
|
+
style: { color: theme.content.elements.secondary },
|
|
2814
|
+
children: depositAddressLabel
|
|
2815
|
+
}
|
|
2816
|
+
),
|
|
2817
|
+
/* @__PURE__ */ jsx18(
|
|
2357
2818
|
Text,
|
|
2358
2819
|
{
|
|
2359
2820
|
variant: "bodyMedium",
|
|
2360
|
-
|
|
2361
|
-
|
|
2821
|
+
style: [
|
|
2822
|
+
addressText2,
|
|
2823
|
+
{ color: theme.content.elements.primary }
|
|
2824
|
+
],
|
|
2362
2825
|
children: depositAddress
|
|
2363
2826
|
}
|
|
2364
2827
|
)
|
|
2365
2828
|
] }),
|
|
2366
|
-
showPreview ? /* @__PURE__ */
|
|
2829
|
+
showPreview ? /* @__PURE__ */ jsx18(
|
|
2367
2830
|
Pressable6,
|
|
2368
2831
|
{
|
|
2369
2832
|
onPress: onShowChains,
|
|
@@ -2374,10 +2837,12 @@ function TransferCryptoScreen({
|
|
|
2374
2837
|
{
|
|
2375
2838
|
flexDirection: "row",
|
|
2376
2839
|
alignItems: "center",
|
|
2377
|
-
|
|
2378
|
-
|
|
2840
|
+
style: [
|
|
2841
|
+
previewPill,
|
|
2842
|
+
{ backgroundColor: theme.background.secondary }
|
|
2843
|
+
],
|
|
2379
2844
|
children: [
|
|
2380
|
-
/* @__PURE__ */
|
|
2845
|
+
/* @__PURE__ */ jsx18(
|
|
2381
2846
|
SourceTokenCluster,
|
|
2382
2847
|
{
|
|
2383
2848
|
icons: supportedTokenIcons,
|
|
@@ -2385,18 +2850,18 @@ function TransferCryptoScreen({
|
|
|
2385
2850
|
gap: 4
|
|
2386
2851
|
}
|
|
2387
2852
|
),
|
|
2388
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsx18(
|
|
2389
2854
|
FigmaChevronRightIcon,
|
|
2390
2855
|
{
|
|
2391
2856
|
size: 16,
|
|
2392
|
-
color: theme.
|
|
2857
|
+
color: theme.content.elements.secondary
|
|
2393
2858
|
}
|
|
2394
2859
|
)
|
|
2395
2860
|
]
|
|
2396
2861
|
}
|
|
2397
2862
|
)
|
|
2398
2863
|
}
|
|
2399
|
-
) : minimumDepositLabel ? /* @__PURE__ */
|
|
2864
|
+
) : minimumDepositLabel ? /* @__PURE__ */ jsx18(
|
|
2400
2865
|
MinimumDepositPill,
|
|
2401
2866
|
{
|
|
2402
2867
|
label: minimumDepositLabel,
|
|
@@ -2407,21 +2872,21 @@ function TransferCryptoScreen({
|
|
|
2407
2872
|
}
|
|
2408
2873
|
),
|
|
2409
2874
|
/* @__PURE__ */ jsxs9(Box, { flexDirection: "row", style: buttonsRow, children: [
|
|
2410
|
-
/* @__PURE__ */
|
|
2875
|
+
/* @__PURE__ */ jsx18(
|
|
2411
2876
|
PillButton,
|
|
2412
2877
|
{
|
|
2413
2878
|
label: copied ? copiedLabel : copyLabel,
|
|
2414
2879
|
accessibilityLabel: copied ? "Address copied" : "Copy address",
|
|
2415
|
-
icon: /* @__PURE__ */
|
|
2880
|
+
icon: /* @__PURE__ */ jsx18(FigmaCopyIcon, { color: theme.content.button.primary.default }),
|
|
2416
2881
|
onPress: handleCopy
|
|
2417
2882
|
}
|
|
2418
2883
|
),
|
|
2419
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx18(
|
|
2420
2885
|
PillButton,
|
|
2421
2886
|
{
|
|
2422
2887
|
label: shareLabel,
|
|
2423
2888
|
accessibilityLabel: "Share address",
|
|
2424
|
-
icon: /* @__PURE__ */
|
|
2889
|
+
icon: /* @__PURE__ */ jsx18(FigmaShareIcon, { color: theme.content.button.primary.default }),
|
|
2425
2890
|
onPress: onShareAddress
|
|
2426
2891
|
}
|
|
2427
2892
|
)
|
|
@@ -2435,11 +2900,12 @@ function TransferCryptoScreen({
|
|
|
2435
2900
|
);
|
|
2436
2901
|
}
|
|
2437
2902
|
function MinimumDepositPill({
|
|
2438
|
-
label
|
|
2903
|
+
label,
|
|
2439
2904
|
iconKey
|
|
2440
2905
|
}) {
|
|
2441
|
-
|
|
2442
|
-
|
|
2906
|
+
const theme = useTheme();
|
|
2907
|
+
return /* @__PURE__ */ jsx18(Box, { alignItems: "center", justifyContent: "flex-start", style: minimumPill, children: /* @__PURE__ */ jsxs9(Box, { flexDirection: "row", alignItems: "center", style: minimumPillRow, children: [
|
|
2908
|
+
iconKey ? /* @__PURE__ */ jsx18(
|
|
2443
2909
|
FunIcon,
|
|
2444
2910
|
{
|
|
2445
2911
|
uri: iconKey.startsWith("http") ? iconKey : chainIconUri(iconKey),
|
|
@@ -2447,16 +2913,24 @@ function MinimumDepositPill({
|
|
|
2447
2913
|
fallbackUri: FALLBACK_ASSET_LOGO
|
|
2448
2914
|
}
|
|
2449
2915
|
) : null,
|
|
2450
|
-
/* @__PURE__ */
|
|
2916
|
+
/* @__PURE__ */ jsx18(
|
|
2917
|
+
Text,
|
|
2918
|
+
{
|
|
2919
|
+
variant: "detail",
|
|
2920
|
+
style: { color: theme.content.elements.secondary },
|
|
2921
|
+
children: label
|
|
2922
|
+
}
|
|
2923
|
+
)
|
|
2451
2924
|
] }) });
|
|
2452
2925
|
}
|
|
2453
2926
|
function PillButton({
|
|
2454
|
-
label
|
|
2927
|
+
label,
|
|
2455
2928
|
accessibilityLabel,
|
|
2456
2929
|
icon,
|
|
2457
2930
|
onPress
|
|
2458
2931
|
}) {
|
|
2459
|
-
|
|
2932
|
+
const theme = useTheme();
|
|
2933
|
+
return /* @__PURE__ */ jsx18(
|
|
2460
2934
|
Pressable6,
|
|
2461
2935
|
{
|
|
2462
2936
|
onPress,
|
|
@@ -2469,12 +2943,21 @@ function PillButton({
|
|
|
2469
2943
|
flexDirection: "row",
|
|
2470
2944
|
alignItems: "center",
|
|
2471
2945
|
justifyContent: "center",
|
|
2472
|
-
backgroundColor: "btnPrimary",
|
|
2473
2946
|
borderRadius: "button",
|
|
2474
|
-
style:
|
|
2947
|
+
style: [
|
|
2948
|
+
pillButton,
|
|
2949
|
+
{ backgroundColor: theme.background.button.primary.default }
|
|
2950
|
+
],
|
|
2475
2951
|
children: [
|
|
2476
2952
|
icon,
|
|
2477
|
-
/* @__PURE__ */
|
|
2953
|
+
/* @__PURE__ */ jsx18(
|
|
2954
|
+
Text,
|
|
2955
|
+
{
|
|
2956
|
+
variant: "bodyMedium",
|
|
2957
|
+
style: { color: theme.content.button.primary.default },
|
|
2958
|
+
children: label
|
|
2959
|
+
}
|
|
2960
|
+
)
|
|
2478
2961
|
]
|
|
2479
2962
|
}
|
|
2480
2963
|
)
|
|
@@ -2490,9 +2973,8 @@ var topBar4 = {
|
|
|
2490
2973
|
var iconButton = { width: 32, height: 32 };
|
|
2491
2974
|
var content2 = {
|
|
2492
2975
|
paddingHorizontal: 20,
|
|
2493
|
-
//
|
|
2494
|
-
//
|
|
2495
|
-
paddingBottom: 34,
|
|
2976
|
+
// paddingBottom is set inline: safe-area inset + 16 so the buttons keep a 16px
|
|
2977
|
+
// gap above the home indicator on every device.
|
|
2496
2978
|
paddingTop: 8,
|
|
2497
2979
|
gap: 16
|
|
2498
2980
|
};
|
|
@@ -2527,7 +3009,7 @@ var pillButtonPress = { flex: 1 };
|
|
|
2527
3009
|
var pillButton = { height: 56, paddingHorizontal: 24, gap: 8 };
|
|
2528
3010
|
|
|
2529
3011
|
// src/screens/WithdrawMethodScreen.tsx
|
|
2530
|
-
import { jsx as
|
|
3012
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2531
3013
|
var EMPTY_TITLE = "Withdrawals unavailable";
|
|
2532
3014
|
var EMPTY_MESSAGE = "Cash withdrawals aren't available in your region right now.";
|
|
2533
3015
|
var BELOW_MIN_TITLE = "Balance too low";
|
|
@@ -2553,7 +3035,7 @@ function WithdrawMethodScreen({
|
|
|
2553
3035
|
}) {
|
|
2554
3036
|
const terminalError = getTerminalError(isBelowMinimum, isEmpty);
|
|
2555
3037
|
if (terminalError && !hasError && !loading) {
|
|
2556
|
-
return /* @__PURE__ */
|
|
3038
|
+
return /* @__PURE__ */ jsx19(
|
|
2557
3039
|
SelectMethodScreen,
|
|
2558
3040
|
{
|
|
2559
3041
|
title,
|
|
@@ -2565,7 +3047,7 @@ function WithdrawMethodScreen({
|
|
|
2565
3047
|
}
|
|
2566
3048
|
);
|
|
2567
3049
|
}
|
|
2568
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ jsx19(
|
|
2569
3051
|
SelectMethodScreen,
|
|
2570
3052
|
{
|
|
2571
3053
|
title,
|
|
@@ -2586,8 +3068,8 @@ import { useCallback as useCallback3 } from "react";
|
|
|
2586
3068
|
|
|
2587
3069
|
// src/swapped/SwappedWebView.tsx
|
|
2588
3070
|
import { useTheme as useTheme2 } from "@shopify/restyle";
|
|
2589
|
-
import { useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo4, useRef as
|
|
2590
|
-
import { ActivityIndicator, View } from "react-native";
|
|
3071
|
+
import { useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo4, useRef as useRef5 } from "react";
|
|
3072
|
+
import { ActivityIndicator, View as View2 } from "react-native";
|
|
2591
3073
|
import {
|
|
2592
3074
|
WebView
|
|
2593
3075
|
} from "react-native-webview";
|
|
@@ -2596,100 +3078,109 @@ import {
|
|
|
2596
3078
|
var px = (value) => `${value}px`;
|
|
2597
3079
|
var toRawHex = (color) => color.replace(/^#/, "");
|
|
2598
3080
|
function buildSwappedThemeQueryParamsRN(theme) {
|
|
2599
|
-
const {
|
|
3081
|
+
const { background, content: content3, border, borderRadii } = theme;
|
|
2600
3082
|
return {
|
|
2601
|
-
iframeBackground: toRawHex(
|
|
2602
|
-
widgetBackground: toRawHex(
|
|
2603
|
-
textColor: toRawHex(
|
|
2604
|
-
spinnerColor: toRawHex(
|
|
3083
|
+
iframeBackground: toRawHex(background.modal),
|
|
3084
|
+
widgetBackground: toRawHex(background.modal),
|
|
3085
|
+
textColor: toRawHex(content3.elements.primary),
|
|
3086
|
+
spinnerColor: toRawHex(content3.elements.primary),
|
|
2605
3087
|
modalRadii: px(borderRadii.modal),
|
|
2606
|
-
skeletonColor: toRawHex(
|
|
2607
|
-
skeletonSecondaryColor: toRawHex(
|
|
3088
|
+
skeletonColor: toRawHex(border.elements.default.color),
|
|
3089
|
+
skeletonSecondaryColor: toRawHex(background.secondary)
|
|
2608
3090
|
};
|
|
2609
3091
|
}
|
|
2610
3092
|
function buildSwappedThemeRN(theme, isDarkMode) {
|
|
2611
|
-
const {
|
|
3093
|
+
const {
|
|
3094
|
+
background,
|
|
3095
|
+
content: content3,
|
|
3096
|
+
border,
|
|
3097
|
+
brand,
|
|
3098
|
+
borderRadii,
|
|
3099
|
+
sizes,
|
|
3100
|
+
spacing,
|
|
3101
|
+
textVariants
|
|
3102
|
+
} = theme;
|
|
2612
3103
|
return {
|
|
2613
3104
|
colors: {
|
|
2614
3105
|
// ── Core text ─────────────────────────────────────────────────────
|
|
2615
|
-
primaryText:
|
|
2616
|
-
secondaryText:
|
|
2617
|
-
tertiaryText:
|
|
3106
|
+
primaryText: content3.elements.primary,
|
|
3107
|
+
secondaryText: content3.elements.secondary,
|
|
3108
|
+
tertiaryText: content3.elements.secondary,
|
|
2618
3109
|
// ── Surfaces ──────────────────────────────────────────────────────
|
|
2619
|
-
modalBackground:
|
|
2620
|
-
offBackground:
|
|
2621
|
-
hoverState:
|
|
2622
|
-
lightStroke:
|
|
2623
|
-
mediumStroke:
|
|
2624
|
-
heavyStroke:
|
|
2625
|
-
modalBorder:
|
|
2626
|
-
modalHeaderDivider:
|
|
2627
|
-
modalFooterDivider:
|
|
3110
|
+
modalBackground: background.modal,
|
|
3111
|
+
offBackground: background.secondary,
|
|
3112
|
+
hoverState: background.secondary,
|
|
3113
|
+
lightStroke: border.elements.default.color,
|
|
3114
|
+
mediumStroke: border.elements.default.color,
|
|
3115
|
+
heavyStroke: border.elements.default.color,
|
|
3116
|
+
modalBorder: border.modal.default,
|
|
3117
|
+
modalHeaderDivider: border.elements.default.color,
|
|
3118
|
+
modalFooterDivider: border.elements.default.color,
|
|
2628
3119
|
// ── Accent / brand ────────────────────────────────────────────────
|
|
2629
|
-
actionColor:
|
|
2630
|
-
accentColor:
|
|
2631
|
-
accentColorForeground:
|
|
3120
|
+
actionColor: brand.primary,
|
|
3121
|
+
accentColor: brand.primary,
|
|
3122
|
+
accentColorForeground: content3.button.primary.default,
|
|
2632
3123
|
// ── Status ────────────────────────────────────────────────────────
|
|
2633
|
-
error:
|
|
2634
|
-
success:
|
|
3124
|
+
error: content3.elements.error,
|
|
3125
|
+
success: content3.elements.success,
|
|
2635
3126
|
// ── Spinner ───────────────────────────────────────────────────────
|
|
2636
|
-
spinnerIndicator:
|
|
2637
|
-
spinnerBackground:
|
|
2638
|
-
// ── Primary button
|
|
3127
|
+
spinnerIndicator: content3.elements.primary,
|
|
3128
|
+
spinnerBackground: border.elements.default.color,
|
|
3129
|
+
// ── Primary button (hover ← pressed, disabled ← default fill) ─────
|
|
2639
3130
|
// web spreads both `buttonBackground*` (ThemeVars) and `buttonPrimary*`
|
|
2640
3131
|
// (widget aliases); the widget reads whichever is present.
|
|
2641
|
-
buttonBackground:
|
|
2642
|
-
buttonBackgroundHover:
|
|
2643
|
-
buttonBackgroundPressed:
|
|
2644
|
-
buttonBackgroundDisabled:
|
|
2645
|
-
buttonPrimary:
|
|
2646
|
-
buttonPrimaryHover:
|
|
2647
|
-
buttonDisabled:
|
|
2648
|
-
buttonTextPrimary:
|
|
2649
|
-
buttonTextHover:
|
|
2650
|
-
buttonTextDisabled:
|
|
2651
|
-
buttonTextSecondary:
|
|
2652
|
-
buttonTextSecondaryDisabled:
|
|
3132
|
+
buttonBackground: background.button.primary.default,
|
|
3133
|
+
buttonBackgroundHover: background.button.primary.pressed,
|
|
3134
|
+
buttonBackgroundPressed: background.button.primary.pressed,
|
|
3135
|
+
buttonBackgroundDisabled: background.button.primary.default,
|
|
3136
|
+
buttonPrimary: background.button.primary.default,
|
|
3137
|
+
buttonPrimaryHover: background.button.primary.pressed,
|
|
3138
|
+
buttonDisabled: background.button.primary.default,
|
|
3139
|
+
buttonTextPrimary: content3.button.primary.default,
|
|
3140
|
+
buttonTextHover: content3.button.primary.default,
|
|
3141
|
+
buttonTextDisabled: content3.button.primary.default,
|
|
3142
|
+
buttonTextSecondary: content3.button.secondary.default,
|
|
3143
|
+
buttonTextSecondaryDisabled: content3.button.secondary.default,
|
|
2653
3144
|
buttonFocusedOutline: "none",
|
|
2654
3145
|
buttonBorderGradient: "none",
|
|
2655
3146
|
buttonHoverBorderGradient: "none",
|
|
2656
3147
|
buttonDisabledBorderGradient: "none",
|
|
2657
|
-
// ── Tertiary button
|
|
2658
|
-
buttonBackgroundTertiary:
|
|
2659
|
-
buttonBackgroundHoverTertiary:
|
|
2660
|
-
buttonBackgroundDisabledTertiary:
|
|
2661
|
-
buttonTextTertiary:
|
|
2662
|
-
buttonTextDisabledTertiary:
|
|
3148
|
+
// ── Tertiary button (hover ← pressed, disabled ← default fill) ────
|
|
3149
|
+
buttonBackgroundTertiary: background.button.tertiary.default,
|
|
3150
|
+
buttonBackgroundHoverTertiary: background.button.tertiary.pressed,
|
|
3151
|
+
buttonBackgroundDisabledTertiary: background.button.tertiary.default,
|
|
3152
|
+
buttonTextTertiary: content3.button.tertiary.default,
|
|
3153
|
+
buttonTextDisabledTertiary: content3.button.tertiary.default,
|
|
2663
3154
|
buttonBorderTertiary: "transparent",
|
|
2664
|
-
buttonBorderFocusedTertiary:
|
|
2665
|
-
// ── Icon button / top bar
|
|
2666
|
-
headerButtonBackground:
|
|
2667
|
-
buttonIconBackgroundHover:
|
|
2668
|
-
buttonIconBackgroundPressed:
|
|
2669
|
-
buttonIconStroke:
|
|
2670
|
-
modalTopbarIcon:
|
|
2671
|
-
modalTopbarIconBackground:
|
|
2672
|
-
modalTopbarIconBackgroundHover:
|
|
2673
|
-
modalTopbarIconBackgroundPressed:
|
|
2674
|
-
// ── Input
|
|
2675
|
-
inputBackground:
|
|
2676
|
-
inputBackgroundHover:
|
|
2677
|
-
inputBorderBase:
|
|
2678
|
-
inputBorderHover:
|
|
2679
|
-
inputLabel:
|
|
2680
|
-
inputBorder:
|
|
2681
|
-
inputBorderFocused:
|
|
2682
|
-
inputBorderActive:
|
|
2683
|
-
inputPlaceholder:
|
|
3155
|
+
buttonBorderFocusedTertiary: border.elements.selected.color,
|
|
3156
|
+
// ── Icon button / top bar (hover ← pressed) ───────────────────────
|
|
3157
|
+
headerButtonBackground: background.button.icon.default,
|
|
3158
|
+
buttonIconBackgroundHover: background.button.icon.pressed,
|
|
3159
|
+
buttonIconBackgroundPressed: background.button.icon.pressed,
|
|
3160
|
+
buttonIconStroke: content3.button.icon.default,
|
|
3161
|
+
modalTopbarIcon: content3.button.icon.default,
|
|
3162
|
+
modalTopbarIconBackground: background.button.icon.default,
|
|
3163
|
+
modalTopbarIconBackgroundHover: background.button.icon.pressed,
|
|
3164
|
+
modalTopbarIconBackgroundPressed: background.button.icon.pressed,
|
|
3165
|
+
// ── Input (hover/focused ← border/elements variables) ─────────────
|
|
3166
|
+
inputBackground: background.modal,
|
|
3167
|
+
inputBackgroundHover: background.secondary,
|
|
3168
|
+
inputBorderBase: border.elements.default.color,
|
|
3169
|
+
inputBorderHover: border.elements.selected.color,
|
|
3170
|
+
inputLabel: content3.elements.primary,
|
|
3171
|
+
inputBorder: border.elements.default.color,
|
|
3172
|
+
inputBorderFocused: content3.elements.secondary,
|
|
3173
|
+
inputBorderActive: content3.elements.secondary,
|
|
3174
|
+
inputPlaceholder: content3.elements.secondary,
|
|
2684
3175
|
// ── Selection ─────────────────────────────────────────────────────
|
|
2685
|
-
selectedOptionBorder:
|
|
2686
|
-
focusedOptionBorder:
|
|
3176
|
+
selectedOptionBorder: border.elements.selected.color,
|
|
3177
|
+
focusedOptionBorder: border.elements.selected.color,
|
|
2687
3178
|
// ── Widget aliases (mirrors web buildSwappedTheme) ────────────────
|
|
2688
|
-
boxBackground:
|
|
2689
|
-
secondaryButtonBg:
|
|
2690
|
-
secondaryButtonText:
|
|
2691
|
-
secondaryButtonHover:
|
|
2692
|
-
secondaryButtonTextHover:
|
|
3179
|
+
boxBackground: background.secondary,
|
|
3180
|
+
secondaryButtonBg: background.button.tertiary.default,
|
|
3181
|
+
secondaryButtonText: content3.button.tertiary.default,
|
|
3182
|
+
secondaryButtonHover: background.button.tertiary.pressed,
|
|
3183
|
+
secondaryButtonTextHover: content3.button.tertiary.default
|
|
2693
3184
|
},
|
|
2694
3185
|
radii: {
|
|
2695
3186
|
modal: px(borderRadii.modal),
|
|
@@ -2704,13 +3195,13 @@ function buildSwappedThemeRN(theme, isDarkMode) {
|
|
|
2704
3195
|
headerHeight: px(sizes.topBar),
|
|
2705
3196
|
headerFontWeight: String(textVariants.headerTitle.fontWeight ?? "500"),
|
|
2706
3197
|
// web: topbarIconColor ← modalTopbarIcon (the icon on the top-bar buttons)
|
|
2707
|
-
topbarIconColor:
|
|
3198
|
+
topbarIconColor: content3.button.icon.default,
|
|
2708
3199
|
topbarTextFontSize: px(textVariants.headerTitle.fontSize ?? 13),
|
|
2709
3200
|
headerIconWrapperSize: px(sizes.buttonXs),
|
|
2710
3201
|
headerIconSize: px(sizes.iconMd),
|
|
2711
3202
|
buttonFontWeight: String(textVariants.bodyMedium.fontWeight ?? "500"),
|
|
2712
3203
|
modalBottomBarButtonHeight: px(sizes.buttonHeight),
|
|
2713
|
-
iframeBackground:
|
|
3204
|
+
iframeBackground: background.modal,
|
|
2714
3205
|
// Same fixed paddings web sends (web: modalBaseHorizontalPadding + 6px).
|
|
2715
3206
|
topbarPaddingX: px(spacing.modalHorizontal + 6),
|
|
2716
3207
|
topbarPaddingY: "12px",
|
|
@@ -2837,10 +3328,10 @@ function createWebViewSwappedTransport({
|
|
|
2837
3328
|
}
|
|
2838
3329
|
|
|
2839
3330
|
// src/swapped/SwappedWebView.tsx
|
|
2840
|
-
import { jsx as
|
|
3331
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2841
3332
|
function SwappedWebView({ url, onMessage, style }) {
|
|
2842
|
-
const webViewRef =
|
|
2843
|
-
const lastCommittedUrlRef =
|
|
3333
|
+
const webViewRef = useRef5(null);
|
|
3334
|
+
const lastCommittedUrlRef = useRef5(url);
|
|
2844
3335
|
const { transport, dispatch } = useMemo4(
|
|
2845
3336
|
() => createWebViewSwappedTransport({
|
|
2846
3337
|
getWebView: () => webViewRef.current
|
|
@@ -2853,11 +3344,11 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2853
3344
|
() => buildSwappedThemeRN(theme, colorScheme === "dark"),
|
|
2854
3345
|
[theme, colorScheme]
|
|
2855
3346
|
);
|
|
2856
|
-
const swappedThemeRef =
|
|
3347
|
+
const swappedThemeRef = useRef5(swappedTheme);
|
|
2857
3348
|
swappedThemeRef.current = swappedTheme;
|
|
2858
|
-
const colorSchemeRef =
|
|
3349
|
+
const colorSchemeRef = useRef5(colorScheme);
|
|
2859
3350
|
colorSchemeRef.current = colorScheme;
|
|
2860
|
-
const handlerRef =
|
|
3351
|
+
const handlerRef = useRef5(onMessage);
|
|
2861
3352
|
handlerRef.current = onMessage;
|
|
2862
3353
|
useEffect8(
|
|
2863
3354
|
() => transport.onMessage((msg) => {
|
|
@@ -2886,8 +3377,14 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2886
3377
|
);
|
|
2887
3378
|
};
|
|
2888
3379
|
const renderLoading = useCallback2(
|
|
2889
|
-
() => /* @__PURE__ */
|
|
2890
|
-
|
|
3380
|
+
() => /* @__PURE__ */ jsx20(
|
|
3381
|
+
View2,
|
|
3382
|
+
{
|
|
3383
|
+
style: [loadingOverlay, { backgroundColor: theme.background.modal }],
|
|
3384
|
+
children: /* @__PURE__ */ jsx20(ActivityIndicator, { color: theme.content.elements.secondary })
|
|
3385
|
+
}
|
|
3386
|
+
),
|
|
3387
|
+
[theme.background.modal, theme.content.elements.secondary]
|
|
2891
3388
|
);
|
|
2892
3389
|
const handleError = (event) => {
|
|
2893
3390
|
logger.warn("connect-rn:swapped:webview:error", {
|
|
@@ -2902,7 +3399,7 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2902
3399
|
url: event.nativeEvent.url
|
|
2903
3400
|
});
|
|
2904
3401
|
};
|
|
2905
|
-
return /* @__PURE__ */
|
|
3402
|
+
return /* @__PURE__ */ jsx20(
|
|
2906
3403
|
WebView,
|
|
2907
3404
|
{
|
|
2908
3405
|
ref: webViewRef,
|
|
@@ -2926,7 +3423,7 @@ function SwappedWebView({ url, onMessage, style }) {
|
|
|
2926
3423
|
contentInsetAdjustmentBehavior: "never",
|
|
2927
3424
|
setSupportMultipleWindows: false,
|
|
2928
3425
|
originWhitelist: ["https://*"],
|
|
2929
|
-
style: [{ backgroundColor: theme.
|
|
3426
|
+
style: [{ backgroundColor: theme.background.modal }, style]
|
|
2930
3427
|
}
|
|
2931
3428
|
);
|
|
2932
3429
|
}
|
|
@@ -2941,11 +3438,12 @@ var loadingOverlay = {
|
|
|
2941
3438
|
};
|
|
2942
3439
|
|
|
2943
3440
|
// src/swapped/SwappedScreenShell.tsx
|
|
2944
|
-
import { jsx as
|
|
3441
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2945
3442
|
function SwappedScreenShell({
|
|
2946
3443
|
url,
|
|
2947
3444
|
onMessage
|
|
2948
3445
|
}) {
|
|
3446
|
+
const theme = useTheme();
|
|
2949
3447
|
const handleMessage = useCallback3(
|
|
2950
3448
|
(msg) => {
|
|
2951
3449
|
if (msg.type === "SWAPPED_ERROR") {
|
|
@@ -2957,23 +3455,22 @@ function SwappedScreenShell({
|
|
|
2957
3455
|
},
|
|
2958
3456
|
[onMessage]
|
|
2959
3457
|
);
|
|
2960
|
-
return /* @__PURE__ */
|
|
3458
|
+
return /* @__PURE__ */ jsx21(
|
|
2961
3459
|
Box,
|
|
2962
3460
|
{
|
|
2963
|
-
backgroundColor: "bgModal",
|
|
2964
3461
|
borderTopLeftRadius: "modal",
|
|
2965
3462
|
borderTopRightRadius: "modal",
|
|
2966
|
-
style:
|
|
2967
|
-
children: /* @__PURE__ */
|
|
3463
|
+
style: [sheet2, { backgroundColor: theme.background.modal }],
|
|
3464
|
+
children: /* @__PURE__ */ jsx21(SwappedWebView, { url, onMessage: handleMessage, style: fill })
|
|
2968
3465
|
}
|
|
2969
3466
|
);
|
|
2970
3467
|
}
|
|
2971
3468
|
var SHEET_HEIGHT = 550;
|
|
2972
|
-
var
|
|
3469
|
+
var sheet2 = { height: SHEET_HEIGHT, overflow: "hidden" };
|
|
2973
3470
|
var fill = { flex: 1 };
|
|
2974
3471
|
|
|
2975
3472
|
// src/swapped/SwappedScreen.tsx
|
|
2976
|
-
import { jsx as
|
|
3473
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
2977
3474
|
function SwappedScreen({
|
|
2978
3475
|
url,
|
|
2979
3476
|
onClose,
|
|
@@ -3000,7 +3497,7 @@ function SwappedScreen({
|
|
|
3000
3497
|
},
|
|
3001
3498
|
[onBack, onClose, onSuccess]
|
|
3002
3499
|
);
|
|
3003
|
-
return /* @__PURE__ */
|
|
3500
|
+
return /* @__PURE__ */ jsx22(SwappedScreenShell, { url, onMessage: handleMessage });
|
|
3004
3501
|
}
|
|
3005
3502
|
|
|
3006
3503
|
// src/swapped/SwappedWithdrawScreen.tsx
|
|
@@ -3008,7 +3505,7 @@ import {
|
|
|
3008
3505
|
isValidOrderData
|
|
3009
3506
|
} from "@funkit/connect-core";
|
|
3010
3507
|
import { useCallback as useCallback5 } from "react";
|
|
3011
|
-
import { jsx as
|
|
3508
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3012
3509
|
function SwappedWithdrawScreen({
|
|
3013
3510
|
url,
|
|
3014
3511
|
onClose,
|
|
@@ -3052,7 +3549,7 @@ function SwappedWithdrawScreen({
|
|
|
3052
3549
|
},
|
|
3053
3550
|
[onBack, onClose, onNewWithdrawal, onWithdrawalSuccess, onOrderData]
|
|
3054
3551
|
);
|
|
3055
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ jsx23(SwappedScreenShell, { url, onMessage: handleMessage });
|
|
3056
3553
|
}
|
|
3057
3554
|
|
|
3058
3555
|
// src/transfer/availableChains.ts
|
|
@@ -3150,7 +3647,7 @@ async function copyToClipboard(value) {
|
|
|
3150
3647
|
import {
|
|
3151
3648
|
FormOfPaymentType
|
|
3152
3649
|
} from "@funkit/api-base";
|
|
3153
|
-
import { getFopsLimit } from "@funkit/connect-core";
|
|
3650
|
+
import { getFopsLimit, getFormOfPaymentDisplayName } from "@funkit/connect-core";
|
|
3154
3651
|
var BANK_TRANSFER_TIME = "1-2 days";
|
|
3155
3652
|
function toFopRows(fops, exchangeRates) {
|
|
3156
3653
|
return fops.map((fop) => {
|
|
@@ -3158,8 +3655,7 @@ function toFopRows(fops, exchangeRates) {
|
|
|
3158
3655
|
const subtitle = fop.fopType === FormOfPaymentType.BANK_TRANSFER ? `${limit} \xB7 ${BANK_TRANSFER_TIME}` : limit;
|
|
3159
3656
|
return {
|
|
3160
3657
|
id: `${fop.fopType}:${fop.name}`,
|
|
3161
|
-
name: fop
|
|
3162
|
-
iconUri: fop.iconImageUrl,
|
|
3658
|
+
name: getFormOfPaymentDisplayName(fop),
|
|
3163
3659
|
subtitle,
|
|
3164
3660
|
disabled: !fop.embeddedFlowUrl
|
|
3165
3661
|
};
|
|
@@ -3168,8 +3664,7 @@ function toFopRows(fops, exchangeRates) {
|
|
|
3168
3664
|
function toWithdrawFopRows(fops) {
|
|
3169
3665
|
return fops.map((fop) => ({
|
|
3170
3666
|
id: `${fop.fopType}:${fop.name}`,
|
|
3171
|
-
name: fop
|
|
3172
|
-
iconUri: fop.iconImageUrl,
|
|
3667
|
+
name: getFormOfPaymentDisplayName(fop),
|
|
3173
3668
|
subtitle: fop.fopType === FormOfPaymentType.BANK_TRANSFER ? BANK_TRANSFER_TIME : "Instant",
|
|
3174
3669
|
disabled: !fop.embeddedFlowUrl
|
|
3175
3670
|
}));
|
|
@@ -3186,6 +3681,23 @@ function formatDepositAddress(address, leading = 6, trailing = 6) {
|
|
|
3186
3681
|
return `${address.slice(0, leading)}\u2026${address.slice(-trailing)}`;
|
|
3187
3682
|
}
|
|
3188
3683
|
|
|
3684
|
+
// src/transfer/hooks/useFiatExchangeRates.ts
|
|
3685
|
+
import { getFiatExchangeRates } from "@funkit/api-base";
|
|
3686
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3687
|
+
function useFiatExchangeRates(enabled = true) {
|
|
3688
|
+
const { data, isLoading, error } = useQuery({
|
|
3689
|
+
queryKey: ["fiatExchangeRates"],
|
|
3690
|
+
queryFn: () => getFiatExchangeRates({ logger }),
|
|
3691
|
+
refetchOnMount: false,
|
|
3692
|
+
refetchOnReconnect: false,
|
|
3693
|
+
refetchOnWindowFocus: false,
|
|
3694
|
+
gcTime: 1e3 * 60 * 60,
|
|
3695
|
+
// 1 hour
|
|
3696
|
+
enabled
|
|
3697
|
+
});
|
|
3698
|
+
return { data, isLoading, error };
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3189
3701
|
// src/transfer/hooks/useFops.ts
|
|
3190
3702
|
import {
|
|
3191
3703
|
getFops
|
|
@@ -3199,7 +3711,6 @@ import {
|
|
|
3199
3711
|
FOPS_STALE_TIME,
|
|
3200
3712
|
getDepositAddressForChain,
|
|
3201
3713
|
sortFops,
|
|
3202
|
-
useDynamicConfig as useDynamicConfig3,
|
|
3203
3714
|
useSwappedDefaultCurrencyQuery
|
|
3204
3715
|
} from "@funkit/connect-core";
|
|
3205
3716
|
import { useTheme as useTheme3 } from "@shopify/restyle";
|
|
@@ -3208,8 +3719,19 @@ import { useMemo as useMemo6 } from "react";
|
|
|
3208
3719
|
|
|
3209
3720
|
// src/identity/IdentityContext.tsx
|
|
3210
3721
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
3211
|
-
|
|
3722
|
+
|
|
3723
|
+
// src/utils/customers.ts
|
|
3724
|
+
import { MALLARD_API_KEY } from "@funkit/api-base";
|
|
3725
|
+
function isMallardApiKey(apiKey) {
|
|
3726
|
+
return apiKey === MALLARD_API_KEY;
|
|
3727
|
+
}
|
|
3728
|
+
|
|
3729
|
+
// src/identity/IdentityContext.tsx
|
|
3730
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
3212
3731
|
function generateSyntheticUserId(apiKey, externalUserId) {
|
|
3732
|
+
if (isMallardApiKey(apiKey)) {
|
|
3733
|
+
return externalUserId;
|
|
3734
|
+
}
|
|
3213
3735
|
return `${apiKey}|${externalUserId}`;
|
|
3214
3736
|
}
|
|
3215
3737
|
function resolveFunkitIdentity(config, walletAddress) {
|
|
@@ -3227,7 +3749,7 @@ function FunkitIdentityProvider({
|
|
|
3227
3749
|
identity,
|
|
3228
3750
|
children
|
|
3229
3751
|
}) {
|
|
3230
|
-
return /* @__PURE__ */
|
|
3752
|
+
return /* @__PURE__ */ jsx24(FunkitIdentityContext.Provider, { value: identity, children });
|
|
3231
3753
|
}
|
|
3232
3754
|
function useFunkitIdentity() {
|
|
3233
3755
|
const identity = useContext2(FunkitIdentityContext);
|
|
@@ -3249,10 +3771,9 @@ import {
|
|
|
3249
3771
|
import { useQuery as useQuery2 } from "@tanstack/react-query";
|
|
3250
3772
|
|
|
3251
3773
|
// src/transfer/hooks/useUDAParams.ts
|
|
3252
|
-
import { useDynamicConfig as useDynamicConfig2 } from "@funkit/connect-core";
|
|
3253
3774
|
import { useMemo as useMemo5 } from "react";
|
|
3254
3775
|
function useUDAParams(dynamicRoutingId) {
|
|
3255
|
-
const udaParams =
|
|
3776
|
+
const udaParams = useDynamicConfig("uda_params");
|
|
3256
3777
|
return useMemo5(
|
|
3257
3778
|
() => udaParams.find((param) => param.dynamicRoutingId === dynamicRoutingId)?.params,
|
|
3258
3779
|
[udaParams, dynamicRoutingId]
|
|
@@ -3304,8 +3825,8 @@ function useFops({
|
|
|
3304
3825
|
enabled = true
|
|
3305
3826
|
}) {
|
|
3306
3827
|
const { apiKey, userId } = useFunkitIdentity();
|
|
3307
|
-
const isSwappedEnabled = !!
|
|
3308
|
-
const fopPriority =
|
|
3828
|
+
const isSwappedEnabled = !!useDynamicConfig("enableswappeddeposit");
|
|
3829
|
+
const fopPriority = useDynamicConfig("foppriority");
|
|
3309
3830
|
const { userIpInfo } = useUserIpInfo();
|
|
3310
3831
|
const countryCode = userIpInfo?.alpha2 || DEFAULT_COUNTRY_CODE;
|
|
3311
3832
|
const {
|
|
@@ -3416,35 +3937,15 @@ import {
|
|
|
3416
3937
|
getExchangeRate,
|
|
3417
3938
|
resolveSwappedWithdrawalLegs,
|
|
3418
3939
|
sortFops as sortFops2,
|
|
3419
|
-
useDynamicConfig as useDynamicConfig4,
|
|
3420
3940
|
useSwappedDefaultCurrencyQuery as useSwappedDefaultCurrencyQuery2
|
|
3421
3941
|
} from "@funkit/connect-core";
|
|
3422
3942
|
import { useTheme as useTheme4 } from "@shopify/restyle";
|
|
3423
3943
|
import { useStatsigClient } from "@statsig/react-bindings";
|
|
3424
|
-
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
3425
|
-
import { useMemo as useMemo7 } from "react";
|
|
3426
|
-
|
|
3427
|
-
// src/transfer/hooks/useFiatExchangeRates.ts
|
|
3428
|
-
import { getFiatExchangeRates } from "@funkit/api-base";
|
|
3429
3944
|
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
3430
|
-
|
|
3431
|
-
const { data, isLoading, error } = useQuery4({
|
|
3432
|
-
queryKey: ["fiatExchangeRates"],
|
|
3433
|
-
queryFn: () => getFiatExchangeRates({ logger }),
|
|
3434
|
-
refetchOnMount: false,
|
|
3435
|
-
refetchOnReconnect: false,
|
|
3436
|
-
refetchOnWindowFocus: false,
|
|
3437
|
-
gcTime: 1e3 * 60 * 60,
|
|
3438
|
-
// 1 hour
|
|
3439
|
-
enabled
|
|
3440
|
-
});
|
|
3441
|
-
return { data, isLoading, error };
|
|
3442
|
-
}
|
|
3443
|
-
|
|
3444
|
-
// src/transfer/hooks/useWithdrawalFops.ts
|
|
3945
|
+
import { useMemo as useMemo7 } from "react";
|
|
3445
3946
|
var WITHDRAW_FOPS_QUERY_KEY = "withdrawFops";
|
|
3446
3947
|
function useWithdrawalRoute(config) {
|
|
3447
|
-
const sourceOverrides =
|
|
3948
|
+
const sourceOverrides = useDynamicConfig("swappedwithdrawalsourceoverrides");
|
|
3448
3949
|
return useMemo7(
|
|
3449
3950
|
() => resolveSwappedWithdrawalLegs({
|
|
3450
3951
|
source: config.sourceToken,
|
|
@@ -3461,7 +3962,7 @@ function useWithdrawalSellCap(config, walletAddress) {
|
|
|
3461
3962
|
const { sourceUsdBalance } = config;
|
|
3462
3963
|
const isBalanceCallback = typeof sourceUsdBalance === "function";
|
|
3463
3964
|
const hasBalanceInfo = sourceUsdBalance != null;
|
|
3464
|
-
const balanceQuery =
|
|
3965
|
+
const balanceQuery = useQuery4({
|
|
3465
3966
|
queryKey: [
|
|
3466
3967
|
"withdrawSourceUsdBalance",
|
|
3467
3968
|
walletAddress,
|
|
@@ -3561,8 +4062,8 @@ function useWithdrawalFops({
|
|
|
3561
4062
|
}) {
|
|
3562
4063
|
const { apiKey, userId } = useFunkitIdentity();
|
|
3563
4064
|
const { isLoading: isStatsigLoading } = useStatsigClient();
|
|
3564
|
-
const isWithdrawalEnabled = !!
|
|
3565
|
-
const fopPriority =
|
|
4065
|
+
const isWithdrawalEnabled = !!useDynamicConfig("enableswappedwithdrawal");
|
|
4066
|
+
const fopPriority = useDynamicConfig("foppriority");
|
|
3566
4067
|
const walletAddress = config.withdrawalWallet.address();
|
|
3567
4068
|
const route = useWithdrawalRoute(config);
|
|
3568
4069
|
const { userIpInfo, isLoadingGeoCheck } = useUserIpInfo();
|
|
@@ -3582,7 +4083,7 @@ function useWithdrawalFops({
|
|
|
3582
4083
|
);
|
|
3583
4084
|
const { usdBalance, eurMax, isBelowMinimumBalance, isAwaitingCap } = useWithdrawalSellCap(config, walletAddress);
|
|
3584
4085
|
const isEnabled = enabled && isWithdrawalEnabled && !!apiKey && !!userId && !!walletAddress && walletAddress !== "0x" && !!countryCode && !isSwappedCurrencyCodeLoading && !isAwaitingCap;
|
|
3585
|
-
const query =
|
|
4086
|
+
const query = useQuery4({
|
|
3586
4087
|
queryKey: [
|
|
3587
4088
|
WITHDRAW_FOPS_QUERY_KEY,
|
|
3588
4089
|
userId,
|
|
@@ -3642,7 +4143,7 @@ import {
|
|
|
3642
4143
|
processFiatWithdrawalOrder,
|
|
3643
4144
|
toFiatWithdrawalOrder
|
|
3644
4145
|
} from "@funkit/connect-core";
|
|
3645
|
-
import { useCallback as useCallback6, useRef as
|
|
4146
|
+
import { useCallback as useCallback6, useRef as useRef6 } from "react";
|
|
3646
4147
|
|
|
3647
4148
|
// src/withdrawal/publicClient.ts
|
|
3648
4149
|
import { FUNKIT_CONNECT_SUPPORTED_CHAINS_INFO } from "@funkit/chains";
|
|
@@ -3670,7 +4171,7 @@ function useWithdrawalExecution({
|
|
|
3670
4171
|
onError
|
|
3671
4172
|
}) {
|
|
3672
4173
|
const { apiKey, userId } = useFunkitIdentity();
|
|
3673
|
-
const isProcessingRef =
|
|
4174
|
+
const isProcessingRef = useRef6(false);
|
|
3674
4175
|
const executeOrder = useCallback6(
|
|
3675
4176
|
async (data) => {
|
|
3676
4177
|
const order = toFiatWithdrawalOrder(data);
|
|
@@ -3750,10 +4251,9 @@ function useWithdrawalExecution({
|
|
|
3750
4251
|
import { getSupportedAssets } from "@funkit/api-base";
|
|
3751
4252
|
import {
|
|
3752
4253
|
isTransferChainEnabled,
|
|
3753
|
-
resolveTokenTransferConfig
|
|
3754
|
-
useDynamicConfig as useDynamicConfig5
|
|
4254
|
+
resolveTokenTransferConfig
|
|
3755
4255
|
} from "@funkit/connect-core";
|
|
3756
|
-
import { useQuery as
|
|
4256
|
+
import { useQuery as useQuery5 } from "@tanstack/react-query";
|
|
3757
4257
|
import { useMemo as useMemo8 } from "react";
|
|
3758
4258
|
|
|
3759
4259
|
// src/transfer/supportedTokens.ts
|
|
@@ -3790,11 +4290,11 @@ function useSupportedTokens({
|
|
|
3790
4290
|
transferInit
|
|
3791
4291
|
} = {}) {
|
|
3792
4292
|
const { apiKey } = useFunkitIdentity();
|
|
3793
|
-
const tokenTransferConfig =
|
|
3794
|
-
const disabledChainAssets =
|
|
4293
|
+
const tokenTransferConfig = useDynamicConfig("tokentransferconfig");
|
|
4294
|
+
const disabledChainAssets = useDynamicConfig(
|
|
3795
4295
|
"disabletokentransferchainsandassets"
|
|
3796
4296
|
);
|
|
3797
|
-
const { data, isLoading } =
|
|
4297
|
+
const { data, isLoading } = useQuery5({
|
|
3798
4298
|
queryKey: ["getSupportedAssets", apiKey],
|
|
3799
4299
|
queryFn: ({ queryKey: [, key] }) => getSupportedAssets({ apiKey: key, logger }),
|
|
3800
4300
|
enabled: enabled && !!apiKey,
|
|
@@ -3829,8 +4329,7 @@ import { bitcoinChain as bitcoinChain2, solanaChain as solanaChain3, tronChain a
|
|
|
3829
4329
|
import {
|
|
3830
4330
|
getDepositAddressForChain as getDepositAddressForChain2,
|
|
3831
4331
|
getMinTransferValueForChain as getMinTransferValueForChain2,
|
|
3832
|
-
getTransferTokenQrCodeUri
|
|
3833
|
-
useDynamicConfig as useDynamicConfig6
|
|
4332
|
+
getTransferTokenQrCodeUri
|
|
3834
4333
|
} from "@funkit/connect-core";
|
|
3835
4334
|
var DEFAULT_MAX_SLIPPAGE_PERCENT = 0.25;
|
|
3836
4335
|
function resolveBlockchain(chainId) {
|
|
@@ -3856,7 +4355,7 @@ function useTokenTransfer({
|
|
|
3856
4355
|
dynamicRoutingId,
|
|
3857
4356
|
enabled
|
|
3858
4357
|
});
|
|
3859
|
-
const minTransferLimits =
|
|
4358
|
+
const minTransferLimits = useDynamicConfig("mintokentransfervalue");
|
|
3860
4359
|
const minTransferUsd = selectedChainId !== void 0 ? Math.ceil(
|
|
3861
4360
|
getMinTransferValueForChain2(selectedChainId, minTransferLimits)
|
|
3862
4361
|
) : 0;
|
|
@@ -3877,9 +4376,9 @@ function useTokenTransfer({
|
|
|
3877
4376
|
|
|
3878
4377
|
// src/transfer/QrCode.tsx
|
|
3879
4378
|
import QRCode from "react-native-qrcode-svg";
|
|
3880
|
-
import { jsx as
|
|
4379
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3881
4380
|
function QrCode({ value, size = 220, ecl = "H" }) {
|
|
3882
|
-
return /* @__PURE__ */
|
|
4381
|
+
return /* @__PURE__ */ jsx25(
|
|
3883
4382
|
QRCode,
|
|
3884
4383
|
{
|
|
3885
4384
|
value,
|
|
@@ -3903,9 +4402,9 @@ function getDefaultDynamicTargetAsset(candidates, dynamicRoutingId) {
|
|
|
3903
4402
|
import {
|
|
3904
4403
|
useCallback as useCallback7,
|
|
3905
4404
|
useEffect as useEffect10,
|
|
3906
|
-
useRef as
|
|
4405
|
+
useRef as useRef7
|
|
3907
4406
|
} from "react";
|
|
3908
|
-
import { View as
|
|
4407
|
+
import { View as View3 } from "react-native";
|
|
3909
4408
|
import {
|
|
3910
4409
|
BottomSheetBackdrop,
|
|
3911
4410
|
BottomSheetModal,
|
|
@@ -3916,10 +4415,10 @@ import {
|
|
|
3916
4415
|
import { Easing as Easing4 } from "react-native-reanimated";
|
|
3917
4416
|
|
|
3918
4417
|
// src/flow/useKeyboardHeight.ts
|
|
3919
|
-
import { useEffect as useEffect9, useState as
|
|
4418
|
+
import { useEffect as useEffect9, useState as useState9 } from "react";
|
|
3920
4419
|
import { Keyboard, Platform } from "react-native";
|
|
3921
4420
|
function useKeyboardHeight(enabled) {
|
|
3922
|
-
const [height, setHeight] =
|
|
4421
|
+
const [height, setHeight] = useState9(0);
|
|
3923
4422
|
useEffect9(() => {
|
|
3924
4423
|
if (!enabled) {
|
|
3925
4424
|
setHeight(0);
|
|
@@ -3941,7 +4440,7 @@ function useKeyboardHeight(enabled) {
|
|
|
3941
4440
|
}
|
|
3942
4441
|
|
|
3943
4442
|
// src/flow/FlowSheet.tsx
|
|
3944
|
-
import { jsx as
|
|
4443
|
+
import { jsx as jsx26, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3945
4444
|
function FlowSheet({
|
|
3946
4445
|
isOpen,
|
|
3947
4446
|
session,
|
|
@@ -3950,13 +4449,13 @@ function FlowSheet({
|
|
|
3950
4449
|
children,
|
|
3951
4450
|
keyboardAvoidEnabled = false
|
|
3952
4451
|
}) {
|
|
3953
|
-
const ref =
|
|
4452
|
+
const ref = useRef7(null);
|
|
3954
4453
|
const setRef = useCallback7((instance) => {
|
|
3955
4454
|
ref.current = instance;
|
|
3956
4455
|
}, []);
|
|
3957
4456
|
const keyboardHeight = useKeyboardHeight(keyboardAvoidEnabled);
|
|
3958
|
-
const hasPresented =
|
|
3959
|
-
const sheetSelfDismissed =
|
|
4457
|
+
const hasPresented = useRef7(false);
|
|
4458
|
+
const sheetSelfDismissed = useRef7(false);
|
|
3960
4459
|
useEffect10(() => {
|
|
3961
4460
|
if (isOpen) {
|
|
3962
4461
|
sheetSelfDismissed.current = false;
|
|
@@ -3981,7 +4480,7 @@ function FlowSheet({
|
|
|
3981
4480
|
easing: Easing4.bezier(0.22, 1, 0.36, 1)
|
|
3982
4481
|
});
|
|
3983
4482
|
const renderBackdrop = useCallback7(
|
|
3984
|
-
(props) => /* @__PURE__ */
|
|
4483
|
+
(props) => /* @__PURE__ */ jsx26(
|
|
3985
4484
|
BottomSheetBackdrop,
|
|
3986
4485
|
{
|
|
3987
4486
|
...props,
|
|
@@ -3994,7 +4493,7 @@ function FlowSheet({
|
|
|
3994
4493
|
);
|
|
3995
4494
|
return /* @__PURE__ */ jsxs10(BottomSheetModalProvider, { children: [
|
|
3996
4495
|
children,
|
|
3997
|
-
/* @__PURE__ */
|
|
4496
|
+
/* @__PURE__ */ jsx26(
|
|
3998
4497
|
BottomSheetModal,
|
|
3999
4498
|
{
|
|
4000
4499
|
ref: setRef,
|
|
@@ -4008,7 +4507,7 @@ function FlowSheet({
|
|
|
4008
4507
|
backgroundComponent: FlowSheetBackground,
|
|
4009
4508
|
children: /* @__PURE__ */ jsxs10(BottomSheetView, { children: [
|
|
4010
4509
|
content3,
|
|
4011
|
-
keyboardHeight > 0 ? /* @__PURE__ */
|
|
4510
|
+
keyboardHeight > 0 ? /* @__PURE__ */ jsx26(View3, { style: { height: keyboardHeight } }) : null
|
|
4012
4511
|
] })
|
|
4013
4512
|
}
|
|
4014
4513
|
)
|
|
@@ -4020,15 +4519,15 @@ function FlowSheetBackground({
|
|
|
4020
4519
|
}) {
|
|
4021
4520
|
const theme = useTheme();
|
|
4022
4521
|
const surface = {
|
|
4023
|
-
backgroundColor: theme.
|
|
4522
|
+
backgroundColor: theme.background.modal,
|
|
4024
4523
|
borderTopLeftRadius: theme.borderRadii.modal,
|
|
4025
4524
|
borderTopRightRadius: theme.borderRadii.modal
|
|
4026
4525
|
};
|
|
4027
4526
|
const extension = {
|
|
4028
4527
|
...bottomExtension,
|
|
4029
|
-
backgroundColor: theme.
|
|
4528
|
+
backgroundColor: theme.background.modal
|
|
4030
4529
|
};
|
|
4031
|
-
return /* @__PURE__ */
|
|
4530
|
+
return /* @__PURE__ */ jsx26(View3, { pointerEvents, style: [style, surface], children: /* @__PURE__ */ jsx26(View3, { style: extension }) });
|
|
4032
4531
|
}
|
|
4033
4532
|
var bottomExtension = {
|
|
4034
4533
|
position: "absolute",
|
|
@@ -4039,7 +4538,7 @@ var bottomExtension = {
|
|
|
4039
4538
|
};
|
|
4040
4539
|
|
|
4041
4540
|
// src/flow/FunkitFlowProvider.tsx
|
|
4042
|
-
import { Fragment as Fragment2, jsx as
|
|
4541
|
+
import { Fragment as Fragment2, jsx as jsx27, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
4043
4542
|
var CLOSED = {
|
|
4044
4543
|
isOpen: false,
|
|
4045
4544
|
stack: [],
|
|
@@ -4051,8 +4550,8 @@ function FunkitFlowProvider({
|
|
|
4051
4550
|
children,
|
|
4052
4551
|
copyToClipboard: copyToClipboard2 = copyToClipboard
|
|
4053
4552
|
}) {
|
|
4054
|
-
const insets =
|
|
4055
|
-
const [state, setState] =
|
|
4553
|
+
const insets = useSafeAreaInsets3();
|
|
4554
|
+
const [state, setState] = useState10(CLOSED);
|
|
4056
4555
|
const beginDeposit = useCallback8(
|
|
4057
4556
|
(config, callbacks = {}) => {
|
|
4058
4557
|
callbacks.onOpen?.();
|
|
@@ -4116,12 +4615,12 @@ function FunkitFlowProvider({
|
|
|
4116
4615
|
() => ({ navigate, back, reset, closeFlow }),
|
|
4117
4616
|
[navigate, back, reset, closeFlow]
|
|
4118
4617
|
);
|
|
4119
|
-
const [toastMounted, setToastMounted] =
|
|
4120
|
-
const [copiedToastShown, setCopiedToastShown] =
|
|
4121
|
-
const hideTimerRef =
|
|
4618
|
+
const [toastMounted, setToastMounted] = useState10(false);
|
|
4619
|
+
const [copiedToastShown, setCopiedToastShown] = useState10(false);
|
|
4620
|
+
const hideTimerRef = useRef8(
|
|
4122
4621
|
void 0
|
|
4123
4622
|
);
|
|
4124
|
-
const unmountTimerRef =
|
|
4623
|
+
const unmountTimerRef = useRef8(
|
|
4125
4624
|
void 0
|
|
4126
4625
|
);
|
|
4127
4626
|
const showCopiedToast = useCallback8(() => {
|
|
@@ -4138,8 +4637,8 @@ function FunkitFlowProvider({
|
|
|
4138
4637
|
}, TOAST_VISIBLE_MS);
|
|
4139
4638
|
}, []);
|
|
4140
4639
|
useEffect11(() => () => clearToast(), [clearToast]);
|
|
4141
|
-
return /* @__PURE__ */
|
|
4142
|
-
/* @__PURE__ */
|
|
4640
|
+
return /* @__PURE__ */ jsx27(FunkitFlowContext.Provider, { value, children: /* @__PURE__ */ jsxs11(View4, { style: rootContainer, children: [
|
|
4641
|
+
/* @__PURE__ */ jsx27(
|
|
4143
4642
|
FlowSheet,
|
|
4144
4643
|
{
|
|
4145
4644
|
isOpen: state.isOpen,
|
|
@@ -4148,7 +4647,7 @@ function FunkitFlowProvider({
|
|
|
4148
4647
|
keyboardAvoidEnabled: current === "swapped",
|
|
4149
4648
|
content: (
|
|
4150
4649
|
// Mounted only while open so the flow queries run only then.
|
|
4151
|
-
state.isOpen && state.flow ? state.flow.mode === "deposit" ? /* @__PURE__ */
|
|
4650
|
+
state.isOpen && state.flow ? state.flow.mode === "deposit" ? /* @__PURE__ */ jsx27(
|
|
4152
4651
|
FlowContent,
|
|
4153
4652
|
{
|
|
4154
4653
|
config: state.flow.config,
|
|
@@ -4158,7 +4657,7 @@ function FunkitFlowProvider({
|
|
|
4158
4657
|
onCopySuccess: showCopiedToast,
|
|
4159
4658
|
callbacks: state.flow.callbacks
|
|
4160
4659
|
}
|
|
4161
|
-
) : /* @__PURE__ */
|
|
4660
|
+
) : /* @__PURE__ */ jsx27(
|
|
4162
4661
|
WithdrawalFlowContent,
|
|
4163
4662
|
{
|
|
4164
4663
|
config: state.flow.config,
|
|
@@ -4171,15 +4670,15 @@ function FunkitFlowProvider({
|
|
|
4171
4670
|
children
|
|
4172
4671
|
}
|
|
4173
4672
|
),
|
|
4174
|
-
toastMounted ? /* @__PURE__ */
|
|
4175
|
-
|
|
4673
|
+
toastMounted ? /* @__PURE__ */ jsx27(
|
|
4674
|
+
View4,
|
|
4176
4675
|
{
|
|
4177
4676
|
style: [
|
|
4178
4677
|
toastOverlay,
|
|
4179
4678
|
{ paddingTop: insets.top + TOAST_INSET_OFFSET }
|
|
4180
4679
|
],
|
|
4181
4680
|
pointerEvents: "none",
|
|
4182
|
-
children: copiedToastShown ? /* @__PURE__ */
|
|
4681
|
+
children: copiedToastShown ? /* @__PURE__ */ jsx27(AddressCopiedToast, {}) : null
|
|
4183
4682
|
}
|
|
4184
4683
|
) : null
|
|
4185
4684
|
] }) });
|
|
@@ -4203,8 +4702,8 @@ function FlowContent({
|
|
|
4203
4702
|
const { isGeoblocked, isLoadingGeoCheck } = useCheckoutBlocked({
|
|
4204
4703
|
onCheckoutBlocked: callbacks.onCheckoutBlocked
|
|
4205
4704
|
});
|
|
4206
|
-
const [selectedNetworkId, setSelectedNetworkId] =
|
|
4207
|
-
const [selectedCandidate, setSelectedCandidate] =
|
|
4705
|
+
const [selectedNetworkId, setSelectedNetworkId] = useState10();
|
|
4706
|
+
const [selectedCandidate, setSelectedCandidate] = useState10(
|
|
4208
4707
|
() => getDefaultDynamicTargetAsset(
|
|
4209
4708
|
config.dynamicTargetAssetCandidates,
|
|
4210
4709
|
config.dynamicRoutingId
|
|
@@ -4245,7 +4744,7 @@ function FlowContent({
|
|
|
4245
4744
|
(n) => n.chainId != null && belongsToNetwork(initialChainId, n.chainId)
|
|
4246
4745
|
);
|
|
4247
4746
|
const selectedChain = depositNetworks.find((n) => n.id === selectedNetworkId) ?? initialNetwork ?? depositNetworks[0];
|
|
4248
|
-
const minTransferLimits =
|
|
4747
|
+
const minTransferLimits = useDynamicConfig("mintokentransfervalue");
|
|
4249
4748
|
const {
|
|
4250
4749
|
savedFops,
|
|
4251
4750
|
genericFops,
|
|
@@ -4257,7 +4756,9 @@ function FlowContent({
|
|
|
4257
4756
|
checkoutConfig: activeCheckoutConfig,
|
|
4258
4757
|
dynamicRoutingId: activeDynamicRoutingId
|
|
4259
4758
|
});
|
|
4260
|
-
const
|
|
4759
|
+
const { data: exchangeRates } = useFiatExchangeRates(isSwappedEnabled);
|
|
4760
|
+
const { isLoading: isStatsigLoading } = useStatsigClient2();
|
|
4761
|
+
const [selectedSwappedUrl, setSelectedSwappedUrl] = useState10();
|
|
4261
4762
|
const availableChains = buildAvailableChains({
|
|
4262
4763
|
chainFilters: tokenChainFilters,
|
|
4263
4764
|
networkChainId: selectedChainId,
|
|
@@ -4280,8 +4781,8 @@ function FlowContent({
|
|
|
4280
4781
|
},
|
|
4281
4782
|
[copyToClipboard2, onCopySuccess]
|
|
4282
4783
|
);
|
|
4283
|
-
const nestedSheetRef =
|
|
4284
|
-
const [nestedScreen, setNestedScreen] =
|
|
4784
|
+
const nestedSheetRef = useRef8(null);
|
|
4785
|
+
const [nestedScreen, setNestedScreen] = useState10(null);
|
|
4285
4786
|
const openNestedScreen = useCallback8((screen2) => {
|
|
4286
4787
|
setNestedScreen(screen2);
|
|
4287
4788
|
}, []);
|
|
@@ -4294,7 +4795,7 @@ function FlowContent({
|
|
|
4294
4795
|
nestedSheetRef.current?.dismiss();
|
|
4295
4796
|
}, []);
|
|
4296
4797
|
const renderNestedBackdrop = useCallback8(
|
|
4297
|
-
(props) => /* @__PURE__ */
|
|
4798
|
+
(props) => /* @__PURE__ */ jsx27(
|
|
4298
4799
|
BottomSheetBackdrop2,
|
|
4299
4800
|
{
|
|
4300
4801
|
...props,
|
|
@@ -4316,8 +4817,8 @@ function FlowContent({
|
|
|
4316
4817
|
id: CRYPTO_METHOD_ID,
|
|
4317
4818
|
title: "Crypto",
|
|
4318
4819
|
subtitle: "No limit",
|
|
4319
|
-
icon: /* @__PURE__ */
|
|
4320
|
-
trailing: cryptoSourceIcons.length ? /* @__PURE__ */
|
|
4820
|
+
icon: /* @__PURE__ */ jsx27(CryptoBitcoinIcon, {}),
|
|
4821
|
+
trailing: cryptoSourceIcons.length ? /* @__PURE__ */ jsx27(
|
|
4321
4822
|
SourceTokenCluster,
|
|
4322
4823
|
{
|
|
4323
4824
|
icons: cryptoSourceIcons,
|
|
@@ -4326,11 +4827,11 @@ function FlowContent({
|
|
|
4326
4827
|
) : void 0
|
|
4327
4828
|
}
|
|
4328
4829
|
];
|
|
4329
|
-
const toCashRows = (fops) => toFopRows(fops).map((row3) => ({
|
|
4830
|
+
const toCashRows = (fops) => toFopRows(fops, exchangeRates).map((row3, i) => ({
|
|
4330
4831
|
id: row3.id,
|
|
4331
4832
|
title: row3.name,
|
|
4332
4833
|
subtitle: row3.subtitle,
|
|
4333
|
-
icon: /* @__PURE__ */
|
|
4834
|
+
icon: /* @__PURE__ */ jsx27(PaymentMethodIcon, { fop: fops[i] })
|
|
4334
4835
|
}));
|
|
4335
4836
|
const methods = isSwappedEnabled ? [
|
|
4336
4837
|
...toCashRows(savedFops),
|
|
@@ -4342,11 +4843,11 @@ function FlowContent({
|
|
|
4342
4843
|
(c, i) => ({
|
|
4343
4844
|
id: String(i),
|
|
4344
4845
|
label: c.badgeText ? `${c.tokenSymbol} (${c.badgeText})` : c.tokenSymbol,
|
|
4345
|
-
icon: /* @__PURE__ */
|
|
4846
|
+
icon: /* @__PURE__ */ jsx27(TokenChainIcon, { symbol: c.tokenSymbol, iconSrc: c.iconSrc })
|
|
4346
4847
|
})
|
|
4347
4848
|
);
|
|
4348
4849
|
const selectedReceiveTokenId = selectedCandidate && candidates ? String(candidates.indexOf(selectedCandidate)) : void 0;
|
|
4349
|
-
return /* @__PURE__ */
|
|
4850
|
+
return /* @__PURE__ */ jsx27(
|
|
4350
4851
|
SelectMethodScreen,
|
|
4351
4852
|
{
|
|
4352
4853
|
methods,
|
|
@@ -4358,7 +4859,7 @@ function FlowContent({
|
|
|
4358
4859
|
setSelectedCandidate(picked);
|
|
4359
4860
|
}
|
|
4360
4861
|
},
|
|
4361
|
-
loading: isLoadingGeoCheck || isAddressLoading || isSwappedEnabled && isFopsLoading,
|
|
4862
|
+
loading: isLoadingGeoCheck || isAddressLoading || isStatsigLoading || isSwappedEnabled && isFopsLoading,
|
|
4362
4863
|
error: isSwappedEnabled && isFopsError,
|
|
4363
4864
|
onRetry: refetchFops,
|
|
4364
4865
|
onSelectMethod: (id) => {
|
|
@@ -4386,7 +4887,7 @@ function FlowContent({
|
|
|
4386
4887
|
label: chain.label,
|
|
4387
4888
|
iconKeys: chain.iconKeys ?? []
|
|
4388
4889
|
}));
|
|
4389
|
-
return /* @__PURE__ */
|
|
4890
|
+
return /* @__PURE__ */ jsx27(
|
|
4390
4891
|
TransferCryptoScreen,
|
|
4391
4892
|
{
|
|
4392
4893
|
depositAddress: displayAddress,
|
|
@@ -4404,7 +4905,7 @@ function FlowContent({
|
|
|
4404
4905
|
);
|
|
4405
4906
|
}
|
|
4406
4907
|
case "swapped":
|
|
4407
|
-
return selectedSwappedUrl ? /* @__PURE__ */
|
|
4908
|
+
return selectedSwappedUrl ? /* @__PURE__ */ jsx27(
|
|
4408
4909
|
SwappedScreen,
|
|
4409
4910
|
{
|
|
4410
4911
|
url: selectedSwappedUrl,
|
|
@@ -4419,7 +4920,7 @@ function FlowContent({
|
|
|
4419
4920
|
const bottomSheetScreen = (() => {
|
|
4420
4921
|
switch (nestedScreen) {
|
|
4421
4922
|
case "availableChains":
|
|
4422
|
-
return /* @__PURE__ */
|
|
4923
|
+
return /* @__PURE__ */ jsx27(
|
|
4423
4924
|
AvailableChainsScreen,
|
|
4424
4925
|
{
|
|
4425
4926
|
networkLabel: selectedChain?.label ?? "",
|
|
@@ -4428,11 +4929,11 @@ function FlowContent({
|
|
|
4428
4929
|
}
|
|
4429
4930
|
);
|
|
4430
4931
|
case "qrCode":
|
|
4431
|
-
return /* @__PURE__ */
|
|
4932
|
+
return /* @__PURE__ */ jsx27(
|
|
4432
4933
|
QrCodeScreen,
|
|
4433
4934
|
{
|
|
4434
|
-
qrCode: config.qrCode ?? (qrCodeUri ? /* @__PURE__ */
|
|
4435
|
-
centerIcon: /* @__PURE__ */
|
|
4935
|
+
qrCode: config.qrCode ?? (qrCodeUri ? /* @__PURE__ */ jsx27(QrCode, { value: qrCodeUri, size: 235 }) : null),
|
|
4936
|
+
centerIcon: /* @__PURE__ */ jsx27(QrChainCluster, { iconKeys: selectedChain?.iconKeys ?? [] }),
|
|
4436
4937
|
address: rawAddress,
|
|
4437
4938
|
onCopyAddress: rawAddress ? () => copyAddressAndToast(rawAddress) : void 0,
|
|
4438
4939
|
onClose: closeNestedScreen
|
|
@@ -4443,11 +4944,11 @@ function FlowContent({
|
|
|
4443
4944
|
}
|
|
4444
4945
|
})();
|
|
4445
4946
|
if (isGeoblocked) {
|
|
4446
|
-
return /* @__PURE__ */
|
|
4947
|
+
return /* @__PURE__ */ jsx27(CheckoutBlockedScreen, {});
|
|
4447
4948
|
}
|
|
4448
4949
|
return /* @__PURE__ */ jsxs11(Fragment2, { children: [
|
|
4449
4950
|
screen,
|
|
4450
|
-
/* @__PURE__ */
|
|
4951
|
+
/* @__PURE__ */ jsx27(
|
|
4451
4952
|
BottomSheetModal2,
|
|
4452
4953
|
{
|
|
4453
4954
|
ref: nestedSheetRef,
|
|
@@ -4456,7 +4957,7 @@ function FlowContent({
|
|
|
4456
4957
|
backgroundComponent: FlowSheetBackground,
|
|
4457
4958
|
backdropComponent: renderNestedBackdrop,
|
|
4458
4959
|
onDismiss: () => setNestedScreen(null),
|
|
4459
|
-
children: /* @__PURE__ */
|
|
4960
|
+
children: /* @__PURE__ */ jsx27(BottomSheetView2, { children: bottomSheetScreen })
|
|
4460
4961
|
}
|
|
4461
4962
|
)
|
|
4462
4963
|
] });
|
|
@@ -4480,8 +4981,8 @@ function WithdrawalFlowContent({
|
|
|
4480
4981
|
refetch,
|
|
4481
4982
|
route
|
|
4482
4983
|
} = useWithdrawalFops({ config });
|
|
4483
|
-
const [selectedFop, setSelectedFop] =
|
|
4484
|
-
const [hasExecutionError, setHasExecutionError] =
|
|
4984
|
+
const [selectedFop, setSelectedFop] = useState10();
|
|
4985
|
+
const [hasExecutionError, setHasExecutionError] = useState10(false);
|
|
4485
4986
|
const onExecutionError = useCallback8(() => setHasExecutionError(true), []);
|
|
4486
4987
|
const { executeOrder } = useWithdrawalExecution({
|
|
4487
4988
|
config,
|
|
@@ -4493,10 +4994,10 @@ function WithdrawalFlowContent({
|
|
|
4493
4994
|
void queryClient.invalidateQueries({ queryKey: [WITHDRAW_FOPS_QUERY_KEY] });
|
|
4494
4995
|
}, [queryClient]);
|
|
4495
4996
|
if (isGeoblocked) {
|
|
4496
|
-
return /* @__PURE__ */
|
|
4997
|
+
return /* @__PURE__ */ jsx27(CheckoutBlockedScreen, {});
|
|
4497
4998
|
}
|
|
4498
4999
|
if (hasExecutionError) {
|
|
4499
|
-
return /* @__PURE__ */
|
|
5000
|
+
return /* @__PURE__ */ jsx27(
|
|
4500
5001
|
WithdrawMethodScreen,
|
|
4501
5002
|
{
|
|
4502
5003
|
title: config.title,
|
|
@@ -4518,10 +5019,10 @@ function WithdrawalFlowContent({
|
|
|
4518
5019
|
id: String(i),
|
|
4519
5020
|
title: row3.name,
|
|
4520
5021
|
subtitle: row3.subtitle,
|
|
4521
|
-
icon: /* @__PURE__ */
|
|
5022
|
+
icon: /* @__PURE__ */ jsx27(PaymentMethodIcon, { fop: fops[i] })
|
|
4522
5023
|
})
|
|
4523
5024
|
);
|
|
4524
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ jsx27(
|
|
4525
5026
|
WithdrawMethodScreen,
|
|
4526
5027
|
{
|
|
4527
5028
|
title: config.title,
|
|
@@ -4545,7 +5046,7 @@ function WithdrawalFlowContent({
|
|
|
4545
5046
|
);
|
|
4546
5047
|
}
|
|
4547
5048
|
case "swapped":
|
|
4548
|
-
return selectedFop?.embeddedFlowUrl ? /* @__PURE__ */
|
|
5049
|
+
return selectedFop?.embeddedFlowUrl ? /* @__PURE__ */ jsx27(
|
|
4549
5050
|
SwappedWithdrawScreen,
|
|
4550
5051
|
{
|
|
4551
5052
|
url: selectedFop.embeddedFlowUrl,
|
|
@@ -4587,7 +5088,7 @@ var TOAST_EXIT_MS = 350;
|
|
|
4587
5088
|
var TOAST_INSET_OFFSET = 20;
|
|
4588
5089
|
var rootContainer = { flex: 1 };
|
|
4589
5090
|
var toastOverlay = {
|
|
4590
|
-
...
|
|
5091
|
+
...StyleSheet4.absoluteFill,
|
|
4591
5092
|
zIndex: 1,
|
|
4592
5093
|
alignItems: "center"
|
|
4593
5094
|
};
|
|
@@ -4600,7 +5101,7 @@ function useFunkitFlow() {
|
|
|
4600
5101
|
}
|
|
4601
5102
|
|
|
4602
5103
|
// src/version.ts
|
|
4603
|
-
var CONNECT_RN_VERSION = true ? "
|
|
5104
|
+
var CONNECT_RN_VERSION = true ? "3.1.0" : "0.0.0-dev";
|
|
4604
5105
|
|
|
4605
5106
|
// src/providers/FunkitStatsigProvider.tsx
|
|
4606
5107
|
import {
|
|
@@ -4793,7 +5294,7 @@ function useClientAsyncInitRN(sdkKey, initialUser, statsigOptions = null) {
|
|
|
4793
5294
|
}
|
|
4794
5295
|
|
|
4795
5296
|
// src/providers/FunkitStatsigProvider.tsx
|
|
4796
|
-
import { jsx as
|
|
5297
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4797
5298
|
var STATSIG_API = "https://data-api.fun.xyz/v1";
|
|
4798
5299
|
var STATSIG_CLIENT_KEY = "client-UmFd8WIJljA7cLmZuDqs3X25M8sKd5WIQP4BSC2bRbM";
|
|
4799
5300
|
var STATSIG_SDK_TYPE = "react-native";
|
|
@@ -4829,12 +5330,13 @@ function FunkitStatsigProvider({
|
|
|
4829
5330
|
tier: isDevelopment ? "development" : "production"
|
|
4830
5331
|
}
|
|
4831
5332
|
});
|
|
4832
|
-
return /* @__PURE__ */
|
|
5333
|
+
return /* @__PURE__ */ jsx28(StatsigProvider, { client, children });
|
|
4833
5334
|
}
|
|
4834
5335
|
|
|
4835
5336
|
// src/providers/FunkitProvider.tsx
|
|
4836
|
-
import { jsx as
|
|
5337
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4837
5338
|
var ANONYMOUS_CONFIG = { apiKey: "" };
|
|
5339
|
+
var IS_DEV_BUILD = typeof __DEV__ !== "undefined" && !!__DEV__;
|
|
4838
5340
|
function createFallbackQueryClient() {
|
|
4839
5341
|
return new QueryClient({
|
|
4840
5342
|
defaultOptions: {
|
|
@@ -4851,10 +5353,10 @@ function FunkitProvider({
|
|
|
4851
5353
|
queryClient,
|
|
4852
5354
|
themes,
|
|
4853
5355
|
colorScheme,
|
|
4854
|
-
debug =
|
|
5356
|
+
debug = IS_DEV_BUILD,
|
|
4855
5357
|
copyToClipboard: copyToClipboard2
|
|
4856
5358
|
}) {
|
|
4857
|
-
const fallbackClient =
|
|
5359
|
+
const fallbackClient = useRef9(void 0);
|
|
4858
5360
|
fallbackClient.current ??= createFallbackQueryClient();
|
|
4859
5361
|
const client = queryClient ?? fallbackClient.current;
|
|
4860
5362
|
const identity = useMemo11(
|
|
@@ -4876,13 +5378,13 @@ function FunkitProvider({
|
|
|
4876
5378
|
""
|
|
4877
5379
|
);
|
|
4878
5380
|
}, [identity]);
|
|
4879
|
-
return /* @__PURE__ */
|
|
5381
|
+
return /* @__PURE__ */ jsx29(SafeAreaProvider, { children: /* @__PURE__ */ jsx29(
|
|
4880
5382
|
FunkitStatsigProvider,
|
|
4881
5383
|
{
|
|
4882
5384
|
apiKey: identity.apiKey,
|
|
4883
5385
|
userId: identity.userId,
|
|
4884
5386
|
isDevelopment: debug,
|
|
4885
|
-
children: /* @__PURE__ */
|
|
5387
|
+
children: /* @__PURE__ */ jsx29(QueryClientProvider, { client, children: /* @__PURE__ */ jsx29(FunkitIdentityProvider, { identity, children: /* @__PURE__ */ jsx29(FunkitThemeProvider, { themes, colorScheme, children: /* @__PURE__ */ jsx29(FunkitFlowProvider, { copyToClipboard: copyToClipboard2, children }) }) }) })
|
|
4886
5388
|
}
|
|
4887
5389
|
) });
|
|
4888
5390
|
}
|
|
@@ -4901,23 +5403,111 @@ function useFunkitCheckout(callbacks = {}) {
|
|
|
4901
5403
|
);
|
|
4902
5404
|
return { beginDeposit, beginWithdrawal };
|
|
4903
5405
|
}
|
|
5406
|
+
|
|
5407
|
+
// src/history/useRecentDeposits.ts
|
|
5408
|
+
import {
|
|
5409
|
+
processRecentDepositsForNotifications,
|
|
5410
|
+
purifyCheckoutHistoryItem,
|
|
5411
|
+
useRecentDepositsApiQuery
|
|
5412
|
+
} from "@funkit/connect-core";
|
|
5413
|
+
import { useMemo as useMemo12 } from "react";
|
|
5414
|
+
function useFunkitRecentDeposits({
|
|
5415
|
+
isVisible,
|
|
5416
|
+
fetchSize = 5,
|
|
5417
|
+
cutOffTimeMs,
|
|
5418
|
+
memoizedFilterFunc
|
|
5419
|
+
}) {
|
|
5420
|
+
const { apiKey, userId } = useFunkitIdentity();
|
|
5421
|
+
const { listRefresh } = useDynamicConfig(
|
|
5422
|
+
"checkoutnotificationsrefreshinterval"
|
|
5423
|
+
);
|
|
5424
|
+
const effectiveUserId = userId === "0x" ? "" : userId;
|
|
5425
|
+
const { data: directExecutions } = useRecentDepositsApiQuery({
|
|
5426
|
+
isVisible,
|
|
5427
|
+
apiKey,
|
|
5428
|
+
userId: effectiveUserId,
|
|
5429
|
+
refreshIntervalMs: listRefresh,
|
|
5430
|
+
fetchSize: fetchSize * 2,
|
|
5431
|
+
// over-fetch to account for merging
|
|
5432
|
+
logger
|
|
5433
|
+
});
|
|
5434
|
+
const mergedDirectExecutions = useMemo12(
|
|
5435
|
+
() => processRecentDepositsForNotifications(
|
|
5436
|
+
memoizedFilterFunc ? directExecutions?.filter(memoizedFilterFunc) : directExecutions,
|
|
5437
|
+
{ cutOffTimeMs }
|
|
5438
|
+
),
|
|
5439
|
+
[directExecutions, cutOffTimeMs, memoizedFilterFunc]
|
|
5440
|
+
);
|
|
5441
|
+
return useMemo12(
|
|
5442
|
+
() => ({
|
|
5443
|
+
data: mergedDirectExecutions?.map((de) => purifyCheckoutHistoryItem(de)).slice(0, fetchSize)
|
|
5444
|
+
}),
|
|
5445
|
+
[mergedDirectExecutions, fetchSize]
|
|
5446
|
+
);
|
|
5447
|
+
}
|
|
5448
|
+
|
|
5449
|
+
// src/history/useCheckoutsListenerByUserId.ts
|
|
5450
|
+
import {
|
|
5451
|
+
getCheckoutsByUserId,
|
|
5452
|
+
getDirectExecutionsByUserId
|
|
5453
|
+
} from "@funkit/api-base";
|
|
5454
|
+
import {
|
|
5455
|
+
purifyCheckoutHistoryItem as purifyCheckoutHistoryItem2
|
|
5456
|
+
} from "@funkit/connect-core";
|
|
5457
|
+
import { useQuery as useQuery6 } from "@tanstack/react-query";
|
|
5458
|
+
var CHECKOUT_HISTORY_HOOK_LIMIT = 100;
|
|
5459
|
+
function useCheckoutsListenerByUserId(userId) {
|
|
5460
|
+
const { apiKey, userId: identityUserId } = useFunkitIdentity();
|
|
5461
|
+
const { listRefresh } = useDynamicConfig(
|
|
5462
|
+
"checkoutnotificationsrefreshinterval"
|
|
5463
|
+
);
|
|
5464
|
+
const resolvedUserId = userId ?? identityUserId;
|
|
5465
|
+
const effectiveUserId = resolvedUserId === "0x" ? "" : resolvedUserId;
|
|
5466
|
+
const { data, isLoading } = useQuery6({
|
|
5467
|
+
enabled: !!effectiveUserId,
|
|
5468
|
+
queryKey: ["getPurifiedCheckoutsByUserId", effectiveUserId],
|
|
5469
|
+
queryFn: async () => {
|
|
5470
|
+
const [checkouts, directExecutions] = await Promise.all([
|
|
5471
|
+
getCheckoutsByUserId({
|
|
5472
|
+
apiKey,
|
|
5473
|
+
logger,
|
|
5474
|
+
userId: effectiveUserId,
|
|
5475
|
+
limit: CHECKOUT_HISTORY_HOOK_LIMIT
|
|
5476
|
+
}),
|
|
5477
|
+
getDirectExecutionsByUserId({
|
|
5478
|
+
apiKey,
|
|
5479
|
+
logger,
|
|
5480
|
+
userId: effectiveUserId,
|
|
5481
|
+
limit: CHECKOUT_HISTORY_HOOK_LIMIT
|
|
5482
|
+
})
|
|
5483
|
+
]);
|
|
5484
|
+
return [...checkouts, ...directExecutions].map(purifyCheckoutHistoryItem2).sort((a, b) => b.createdTimeMs - a.createdTimeMs).slice(0, CHECKOUT_HISTORY_HOOK_LIMIT);
|
|
5485
|
+
},
|
|
5486
|
+
refetchInterval: listRefresh
|
|
5487
|
+
});
|
|
5488
|
+
return { data, isLoading };
|
|
5489
|
+
}
|
|
4904
5490
|
export {
|
|
4905
5491
|
AddressCopiedToast,
|
|
4906
5492
|
Box,
|
|
4907
5493
|
FunkitProvider,
|
|
4908
5494
|
FunkitThemeProvider,
|
|
4909
5495
|
Text,
|
|
5496
|
+
darkTheme,
|
|
4910
5497
|
darkTokens,
|
|
4911
5498
|
defaultDarkTheme,
|
|
4912
5499
|
defaultLightTheme,
|
|
4913
5500
|
fontFamilyForWeight,
|
|
5501
|
+
lightTheme,
|
|
4914
5502
|
lightTokens,
|
|
4915
5503
|
normalizeColorScheme,
|
|
4916
5504
|
resolveColorScheme,
|
|
4917
5505
|
toRestyleTheme,
|
|
5506
|
+
useCheckoutsListenerByUserId,
|
|
4918
5507
|
useColorScheme,
|
|
4919
5508
|
useFunkitCheckout,
|
|
4920
5509
|
useFunkitColorScheme,
|
|
5510
|
+
useFunkitRecentDeposits,
|
|
4921
5511
|
useFunkitTheme
|
|
4922
5512
|
};
|
|
4923
5513
|
//# sourceMappingURL=index.js.map
|