@unifold/connect-react-native 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +400 -391
- package/dist/index.d.ts +400 -391
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/dist/stripe.d.mts +250 -29
- package/dist/stripe.d.ts +250 -29
- package/dist/stripe.js +2 -1
- package/dist/stripe.mjs +2 -1
- package/package.json +10 -15
package/dist/index.d.ts
CHANGED
|
@@ -1,378 +1,385 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React$1 from 'react';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React$1, { ReactNode } from 'react';
|
|
5
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Unifold color palette for React Native
|
|
6
|
+
* Matches the web theme colors
|
|
7
|
+
*/
|
|
6
8
|
declare const defaultColors: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
9
|
+
light: {
|
|
10
|
+
background: string;
|
|
11
|
+
card: string;
|
|
12
|
+
cardHover: string;
|
|
13
|
+
foreground: string;
|
|
14
|
+
foregroundMuted: string;
|
|
15
|
+
foregroundSubtle: string;
|
|
16
|
+
border: string;
|
|
17
|
+
borderSecondary: string;
|
|
18
|
+
primary: string;
|
|
19
|
+
primaryForeground: string;
|
|
20
|
+
success: string;
|
|
21
|
+
successBackground: string;
|
|
22
|
+
warning: string;
|
|
23
|
+
warningBackground: string;
|
|
24
|
+
error: string;
|
|
25
|
+
errorBackground: string;
|
|
26
|
+
overlay: string;
|
|
27
|
+
};
|
|
28
|
+
dark: {
|
|
29
|
+
background: string;
|
|
30
|
+
card: string;
|
|
31
|
+
cardHover: string;
|
|
32
|
+
foreground: string;
|
|
33
|
+
foregroundMuted: string;
|
|
34
|
+
foregroundSubtle: string;
|
|
35
|
+
border: string;
|
|
36
|
+
borderSecondary: string;
|
|
37
|
+
primary: string;
|
|
38
|
+
primaryForeground: string;
|
|
39
|
+
success: string;
|
|
40
|
+
successBackground: string;
|
|
41
|
+
warning: string;
|
|
42
|
+
warningBackground: string;
|
|
43
|
+
error: string;
|
|
44
|
+
errorBackground: string;
|
|
45
|
+
overlay: string;
|
|
46
|
+
};
|
|
45
47
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
type ThemeColors = typeof defaultColors.light;
|
|
49
|
+
type ThemeMode = "light" | "dark";
|
|
48
50
|
/** Partial theme colors for customization */
|
|
49
|
-
|
|
51
|
+
type CustomThemeColors = Partial<ThemeColors>;
|
|
50
52
|
/** Theme customization options */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
interface ThemeConfig {
|
|
54
|
+
/** Override colors for light mode */
|
|
55
|
+
light?: CustomThemeColors;
|
|
56
|
+
/** Override colors for dark mode */
|
|
57
|
+
dark?: CustomThemeColors;
|
|
56
58
|
}
|
|
57
59
|
/** Font configuration */
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
interface FontConfig {
|
|
61
|
+
/** Regular weight font family */
|
|
62
|
+
regular?: string;
|
|
63
|
+
/** Medium weight font family */
|
|
64
|
+
medium?: string;
|
|
65
|
+
/** Semi-bold weight font family */
|
|
66
|
+
semibold?: string;
|
|
67
|
+
/** Bold weight font family */
|
|
68
|
+
bold?: string;
|
|
67
69
|
}
|
|
68
70
|
/** Header component tokens */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
interface HeaderTokens {
|
|
72
|
+
titleColor: string;
|
|
73
|
+
buttonColor: string;
|
|
72
74
|
}
|
|
73
75
|
/** Shadow style for card/sheet */
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
interface ThemeShadowStyle {
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
77
79
|
}
|
|
78
80
|
/** Back shadow offset (absolute inset values for the view behind the card) */
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
interface ThemeBackShadowOffset {
|
|
82
|
+
top: number;
|
|
83
|
+
left: number;
|
|
84
|
+
right: number;
|
|
85
|
+
bottom: number;
|
|
84
86
|
}
|
|
85
87
|
/** Card/row component tokens (colors + optional border/shadow) */
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
88
|
+
interface CardTokens {
|
|
89
|
+
backgroundColor: string;
|
|
90
|
+
titleColor: string;
|
|
91
|
+
subtitleColor: string;
|
|
92
|
+
labelColor: string;
|
|
93
|
+
headerColor: string;
|
|
94
|
+
labelRightColor: string;
|
|
95
|
+
labelHighlightRightColor: string;
|
|
96
|
+
textRightColor: string;
|
|
97
|
+
subtextRightColor: string;
|
|
98
|
+
rowLeftLabel: string;
|
|
99
|
+
rowRightLabel: string;
|
|
100
|
+
iconColor: string;
|
|
101
|
+
iconBackgroundColor: string;
|
|
102
|
+
actionColor: string;
|
|
103
|
+
actionIcon: string;
|
|
104
|
+
descriptionColor: string;
|
|
105
|
+
/** Card/row border radius (default 12) */
|
|
106
|
+
borderRadius: number;
|
|
107
|
+
/** Card border width (default 0) */
|
|
108
|
+
borderWidth: number;
|
|
109
|
+
/** Card border color */
|
|
110
|
+
borderColor: string;
|
|
111
|
+
/** Card shadow color */
|
|
112
|
+
shadowColor: string;
|
|
113
|
+
/** Card shadow offset */
|
|
114
|
+
shadowOffset: ThemeShadowStyle;
|
|
115
|
+
/** Card shadow opacity (0 = no shadow) */
|
|
116
|
+
shadowOpacity: number;
|
|
117
|
+
/** Card shadow radius */
|
|
118
|
+
shadowRadius: number;
|
|
119
|
+
/** Android elevation */
|
|
120
|
+
elevation: number;
|
|
121
|
+
/** Icon container (e.g. detail icon) border radius (default 12) */
|
|
122
|
+
iconContainerBorderRadius: number;
|
|
123
|
+
/** Back shadow: color of the view behind the card (default 'transparent' = no back shadow) */
|
|
124
|
+
backShadowColor: string;
|
|
125
|
+
/** Back shadow: offset of the view behind the card (default { top: 4, left: 4, right: -4, bottom: -4 }) */
|
|
126
|
+
backShadowOffset: ThemeBackShadowOffset;
|
|
127
|
+
/** Extra vertical spacing below the card when back shadow is used (default 8) */
|
|
128
|
+
backShadowSpacing: number;
|
|
127
129
|
}
|
|
128
130
|
/** Input component tokens */
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
131
|
+
interface InputTokens {
|
|
132
|
+
backgroundColor: string;
|
|
133
|
+
textColor: string;
|
|
134
|
+
placeholderColor: string;
|
|
135
|
+
borderColor: string;
|
|
136
|
+
/** Input border radius (default 8) */
|
|
137
|
+
borderRadius: number;
|
|
138
|
+
/** Input border width (default 1) */
|
|
139
|
+
borderWidth: number;
|
|
138
140
|
}
|
|
139
141
|
/** Button component tokens */
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
interface ButtonTokens {
|
|
143
|
+
primaryBackground: string;
|
|
144
|
+
primaryText: string;
|
|
145
|
+
secondaryBackground: string;
|
|
146
|
+
secondaryText: string;
|
|
147
|
+
/** Button border radius (default 12) */
|
|
148
|
+
borderRadius: number;
|
|
149
|
+
/** Button border width (default 0) */
|
|
150
|
+
borderWidth: number;
|
|
151
|
+
/** Button border color (outline/secondary) */
|
|
152
|
+
borderColor: string;
|
|
151
153
|
}
|
|
152
154
|
/** Badge/tag component tokens */
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
interface BadgeTokens {
|
|
156
|
+
/** Badge border radius (default 8) */
|
|
157
|
+
borderRadius: number;
|
|
156
158
|
}
|
|
157
159
|
/** Container/status display component tokens */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
160
|
+
interface ContainerTokens {
|
|
161
|
+
titleColor: string;
|
|
162
|
+
subtitleColor: string;
|
|
163
|
+
actionColor: string;
|
|
164
|
+
actionTitle: string;
|
|
165
|
+
buttonColor: string;
|
|
166
|
+
buttonTitleColor: string;
|
|
167
|
+
iconBackgroundColor: string;
|
|
168
|
+
iconColor: string;
|
|
167
169
|
}
|
|
168
170
|
/** Search component tokens */
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
interface SearchTokens {
|
|
172
|
+
backgroundColor: string;
|
|
173
|
+
inputColor: string;
|
|
174
|
+
placeholderColor: string;
|
|
175
|
+
/** Search container border radius (default 8) */
|
|
176
|
+
borderRadius: number;
|
|
175
177
|
}
|
|
176
178
|
/** Sheet (modal) shadow tokens – e.g. BottomSheet */
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
interface SheetTokens {
|
|
180
|
+
shadowColor: string;
|
|
181
|
+
shadowOffset: ThemeShadowStyle;
|
|
182
|
+
shadowOpacity: number;
|
|
183
|
+
shadowRadius: number;
|
|
184
|
+
elevation: number;
|
|
183
185
|
}
|
|
184
186
|
/** List component tokens */
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
interface ListTokens {
|
|
188
|
+
titleSectionColor: string;
|
|
189
|
+
/** List row border radius (default 12) */
|
|
190
|
+
rowBorderRadius: number;
|
|
189
191
|
}
|
|
190
192
|
/** Per-surface card overrides (config input) */
|
|
191
|
-
|
|
192
|
-
|
|
193
|
+
interface DepositMenuOverrides {
|
|
194
|
+
card?: Partial<CardTokens>;
|
|
193
195
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
interface TransferCryptoOverrides {
|
|
197
|
+
depositAddress?: {
|
|
198
|
+
card?: Partial<CardTokens>;
|
|
199
|
+
};
|
|
198
200
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
interface DepositCardOverrides {
|
|
202
|
+
quoteProvider?: {
|
|
203
|
+
card?: Partial<CardTokens>;
|
|
204
|
+
};
|
|
203
205
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
206
|
+
interface DepositTrackerOverrides {
|
|
207
|
+
executionRow?: {
|
|
208
|
+
card?: Partial<CardTokens>;
|
|
209
|
+
};
|
|
208
210
|
}
|
|
209
211
|
/** Per-mode overrides including per-surface card overrides */
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
interface ComponentOverridesWithSurfaces {
|
|
213
|
+
depositMenu?: DepositMenuOverrides;
|
|
214
|
+
transferCrypto?: TransferCryptoOverrides;
|
|
215
|
+
depositCard?: DepositCardOverrides;
|
|
216
|
+
depositTracker?: DepositTrackerOverrides;
|
|
215
217
|
}
|
|
216
218
|
/** Per-component overrides structure */
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
219
|
+
interface ComponentOverrides {
|
|
220
|
+
header?: Partial<HeaderTokens>;
|
|
221
|
+
card?: Partial<CardTokens>;
|
|
222
|
+
input?: Partial<InputTokens>;
|
|
223
|
+
button?: Partial<ButtonTokens>;
|
|
224
|
+
container?: Partial<ContainerTokens>;
|
|
225
|
+
search?: Partial<SearchTokens>;
|
|
226
|
+
list?: Partial<ListTokens>;
|
|
227
|
+
badge?: Partial<BadgeTokens>;
|
|
228
|
+
sheet?: Partial<SheetTokens>;
|
|
227
229
|
}
|
|
228
230
|
/**
|
|
229
231
|
* User-provided component overrides (all optional).
|
|
230
232
|
* Use flat keys (card, button, ...) for global tokens, or per-surface keys to style
|
|
231
233
|
* specific card surfaces (deposit menu, transfer crypto address box, quote provider, tracker rows).
|
|
232
234
|
*/
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
interface ComponentConfig extends ComponentOverrides, ComponentOverridesWithSurfaces {
|
|
236
|
+
/** Light mode specific overrides */
|
|
237
|
+
light?: ComponentOverrides & ComponentOverridesWithSurfaces;
|
|
238
|
+
/** Dark mode specific overrides */
|
|
239
|
+
dark?: ComponentOverrides & ComponentOverridesWithSurfaces;
|
|
238
240
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
241
|
+
|
|
242
|
+
interface ThemeProviderProps {
|
|
243
|
+
children: React$1.ReactNode;
|
|
244
|
+
/** Force a specific theme mode, or 'auto' to use system preference */
|
|
245
|
+
mode?: ThemeMode | "auto";
|
|
246
|
+
/** Simple accent/primary color override (applies to both light and dark) */
|
|
247
|
+
accentColor?: string;
|
|
248
|
+
/** Full theme customization per mode */
|
|
249
|
+
theme?: ThemeConfig;
|
|
250
|
+
/** Single font family for all weights */
|
|
251
|
+
fontFamily?: string;
|
|
252
|
+
/** Granular font family configuration */
|
|
253
|
+
fonts?: FontConfig;
|
|
254
|
+
/** Component-specific token overrides (optional, falls back to base colors) */
|
|
255
|
+
components?: ComponentConfig;
|
|
253
256
|
}
|
|
254
257
|
/** Same props as ThemeProvider without children — for re-wrapping subtrees (e.g. nested modals). */
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
type ThemeProviderConfig = Omit<ThemeProviderProps, "children">;
|
|
259
|
+
|
|
260
|
+
interface BorderRadiusConfig {
|
|
261
|
+
borderTopLeftRadius?: number;
|
|
262
|
+
borderTopRightRadius?: number;
|
|
259
263
|
}
|
|
264
|
+
|
|
260
265
|
/** Controls which transfer crypto input variant is rendered */
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
266
|
+
type TransferInputVariant = "single_input" | "double_input";
|
|
267
|
+
interface DepositModalProps {
|
|
268
|
+
/** Whether the modal is visible */
|
|
269
|
+
visible: boolean;
|
|
270
|
+
/** Callback when the modal should close */
|
|
271
|
+
onClose: () => void;
|
|
272
|
+
/** User ID for the deposit */
|
|
273
|
+
externalUserId: string;
|
|
274
|
+
/** Publishable API key */
|
|
275
|
+
publishableKey: string;
|
|
276
|
+
/** Custom modal title */
|
|
277
|
+
modalTitle?: string;
|
|
278
|
+
/** Target token symbol (e.g., "USDC") */
|
|
279
|
+
destinationTokenSymbol?: string;
|
|
280
|
+
/** Recipient wallet address */
|
|
281
|
+
recipientAddress?: string;
|
|
282
|
+
/** Target chain type */
|
|
283
|
+
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
284
|
+
/** Target chain ID (e.g., "137" for Polygon) */
|
|
285
|
+
destinationChainId?: string;
|
|
286
|
+
/** Target token contract address */
|
|
287
|
+
destinationTokenAddress?: string;
|
|
288
|
+
/** Default source chain type to pre-select in UI */
|
|
289
|
+
defaultChainType?: "ethereum" | "solana" | "bitcoin";
|
|
290
|
+
/** Default source chain ID to pre-select in UI (e.g., "137" for Polygon) */
|
|
291
|
+
defaultChainId?: string;
|
|
292
|
+
/** Default source token address to pre-select in UI */
|
|
293
|
+
defaultTokenAddress?: string;
|
|
294
|
+
/** Show recipient's destination token balance in the header */
|
|
295
|
+
showBalance?: boolean;
|
|
296
|
+
/** Hide the deposit tracker button */
|
|
297
|
+
hideDepositTracker?: boolean;
|
|
298
|
+
/** Show "Pay with Link" (Stripe) option in the deposit menu */
|
|
299
|
+
enableStripeLinkPay?: boolean;
|
|
300
|
+
/** Injected StripeOnramp component — avoids bundling Stripe into the main entry */
|
|
301
|
+
StripeOnrampComponent?: React$1.ComponentType<any>;
|
|
302
|
+
/** Pre-fills Stripe Link Pay email — set via `beginDeposit({ stripeOnrampEmail })` (forwarded as `email` on `StripeOnramp`) */
|
|
303
|
+
stripeOnrampEmail?: string;
|
|
304
|
+
/** Pre-fills Stripe Link Pay phone — set via `beginDeposit({ stripeOnrampPhone })` (forwarded as `phone` on `StripeOnramp`) */
|
|
305
|
+
stripeOnrampPhone?: string;
|
|
306
|
+
/**
|
|
307
|
+
* Same ThemeProvider options as `UnifoldProvider` (`theme`, `components`, fonts, etc.).
|
|
308
|
+
* Re-wrapped around the Stripe Link Pay sheet so nested modals receive theme context and
|
|
309
|
+
* `components.input` and other theme overrides apply like the rest of the deposit UI.
|
|
310
|
+
*/
|
|
311
|
+
stripeTheme?: ThemeProviderConfig;
|
|
312
|
+
/**
|
|
313
|
+
* How deposit confirmation is handled: auto_ui (show waiting UI + poll after 10s),
|
|
314
|
+
* auto_silent (poll after 10s, no waiting UI), manual ("I've deposited" button starts polling).
|
|
315
|
+
*/
|
|
316
|
+
depositConfirmationMode?: "auto_ui" | "auto_silent" | "manual";
|
|
317
|
+
/** Transfer input variant: 'single_input' (unified selector) or 'double_input' (separate token/chain). Defaults to 'double_input' */
|
|
318
|
+
transferInputVariant?: TransferInputVariant;
|
|
319
|
+
/** Callback when deposit succeeds */
|
|
320
|
+
onDepositSuccess?: (data: {
|
|
321
|
+
message: string;
|
|
322
|
+
executionId?: string;
|
|
323
|
+
}) => void;
|
|
324
|
+
/** Callback when deposit fails */
|
|
325
|
+
onDepositError?: (error: {
|
|
326
|
+
message: string;
|
|
327
|
+
error?: unknown;
|
|
328
|
+
code?: string;
|
|
329
|
+
}) => void;
|
|
330
|
+
/** Theme mode: 'light', 'dark', or 'auto' */
|
|
331
|
+
theme?: ThemeMode | "auto";
|
|
332
|
+
/** Border radius configuration for all bottom sheets */
|
|
333
|
+
sheetBorderRadius?: {
|
|
334
|
+
/** Default top-left corner radius for all bottom sheets (default: 24) */
|
|
335
|
+
globalBorderTopLeftRadius?: number;
|
|
336
|
+
/** Default top-right corner radius for all bottom sheets (default: 24) */
|
|
337
|
+
globalBorderTopRightRadius?: number;
|
|
338
|
+
/** The main deposit modal sheet */
|
|
339
|
+
main?: BorderRadiusConfig;
|
|
340
|
+
/** Transfer crypto wrapper sheet */
|
|
341
|
+
transferCrypto?: BorderRadiusConfig;
|
|
342
|
+
/** Buy with card wrapper sheet */
|
|
343
|
+
buyWithCard?: BorderRadiusConfig;
|
|
344
|
+
/** Deposits tracker modal */
|
|
345
|
+
depositsTracker?: BorderRadiusConfig;
|
|
346
|
+
/** Token selector sheet (inside transfer crypto) */
|
|
347
|
+
tokenSelector?: BorderRadiusConfig;
|
|
348
|
+
/** Chain selector sheet (inside transfer crypto, double_input variant) */
|
|
349
|
+
chainSelector?: BorderRadiusConfig;
|
|
350
|
+
/** Currency selector modal (inside buy with card) */
|
|
351
|
+
currencyModal?: BorderRadiusConfig;
|
|
352
|
+
/** Provider selection modal (inside buy with card) */
|
|
353
|
+
providerModal?: BorderRadiusConfig;
|
|
354
|
+
/** Deposit status sheet */
|
|
355
|
+
depositStatus?: BorderRadiusConfig;
|
|
356
|
+
/** Price impact & slippage info sheet */
|
|
357
|
+
infoSheet?: BorderRadiusConfig;
|
|
358
|
+
/** WebView sheet (inside buy with card) */
|
|
359
|
+
webView?: BorderRadiusConfig;
|
|
360
|
+
};
|
|
356
361
|
}
|
|
362
|
+
|
|
357
363
|
/**
|
|
358
364
|
* Set development API URL (only works in __DEV__ mode)
|
|
359
365
|
* For internal Unifold developers testing against localhost
|
|
360
366
|
*/
|
|
361
|
-
|
|
367
|
+
declare function setDevApiUrl(url: string): void;
|
|
368
|
+
|
|
362
369
|
/**
|
|
363
370
|
* Result of the useAllowedCountry hook
|
|
364
371
|
*/
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
372
|
+
interface AllowedCountryResult {
|
|
373
|
+
/** Whether the user is in an allowed country. null while loading. */
|
|
374
|
+
isAllowed: boolean | null;
|
|
375
|
+
/** ISO 3166-1 alpha-2 country code in lowercase (e.g., "us", "pt") */
|
|
376
|
+
alpha2: string | null;
|
|
377
|
+
/** Full country name (e.g., "United States", "Portugal") */
|
|
378
|
+
country: string | null;
|
|
379
|
+
/** Whether the hook is still loading data */
|
|
380
|
+
isLoading: boolean;
|
|
381
|
+
/** Error if either API call failed */
|
|
382
|
+
error: Error | null;
|
|
376
383
|
}
|
|
377
384
|
/**
|
|
378
385
|
* Hook to determine if the current user is in an allowed country
|
|
@@ -397,7 +404,8 @@ export interface AllowedCountryResult {
|
|
|
397
404
|
* }
|
|
398
405
|
* ```
|
|
399
406
|
*/
|
|
400
|
-
|
|
407
|
+
declare function useAllowedCountry(publishableKey: string, enabled?: boolean): AllowedCountryResult;
|
|
408
|
+
|
|
401
409
|
/**
|
|
402
410
|
* Register the StripeOnramp component so the deposit menu can render it.
|
|
403
411
|
* Called automatically by `@unifold/connect-react-native/stripe` when imported,
|
|
@@ -406,82 +414,83 @@ export declare function useAllowedCountry(publishableKey: string, enabled?: bool
|
|
|
406
414
|
* Uses globalThis so the registration survives across separately-bundled entries
|
|
407
415
|
* (tsup bundles index.js and stripe.js with splitting:false, creating isolated scopes).
|
|
408
416
|
*/
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
417
|
+
declare function registerStripeOnramp(component: React.ComponentType<any>): void;
|
|
418
|
+
|
|
419
|
+
interface UnifoldConnectProviderConfig {
|
|
420
|
+
publishableKey: string;
|
|
421
|
+
config?: {
|
|
422
|
+
modalTitle?: string;
|
|
423
|
+
hideDepositTracker?: boolean;
|
|
424
|
+
/** Theme appearance: 'light', 'dark', or 'auto' (system preference). Defaults to 'dark' */
|
|
425
|
+
appearance?: ThemeMode | "auto";
|
|
426
|
+
/** Transfer input variant: 'single_input' (unified selector) or 'double_input' (separate token/chain). Defaults to 'double_input' */
|
|
427
|
+
transferInputVariant?: TransferInputVariant;
|
|
428
|
+
/** Simple accent/primary color override (applies to both light and dark modes) */
|
|
429
|
+
accentColor?: string;
|
|
430
|
+
/** Full theme color customization per mode */
|
|
431
|
+
theme?: ThemeConfig;
|
|
432
|
+
/** Single font family for all text (host app must load the font) */
|
|
433
|
+
fontFamily?: string;
|
|
434
|
+
/** Granular font family configuration for different weights */
|
|
435
|
+
fonts?: FontConfig;
|
|
436
|
+
/** Component-specific token overrides */
|
|
437
|
+
components?: ComponentConfig;
|
|
438
|
+
/** Border radius configuration for all bottom sheets */
|
|
439
|
+
sheetBorderRadius?: DepositModalProps["sheetBorderRadius"];
|
|
440
|
+
/**
|
|
441
|
+
* Show "Pay with Link" (Stripe) option in the deposit menu.
|
|
442
|
+
* Requires `import "@unifold/connect-react-native/stripe"` in your app entry
|
|
443
|
+
* and `@stripe/stripe-react-native` to be installed.
|
|
444
|
+
*/
|
|
445
|
+
enableStripeLinkPay?: boolean;
|
|
446
|
+
};
|
|
438
447
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
448
|
+
interface DepositResult {
|
|
449
|
+
message: string;
|
|
450
|
+
transaction?: unknown;
|
|
451
|
+
executionId?: string;
|
|
443
452
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
453
|
+
interface DepositError {
|
|
454
|
+
message: string;
|
|
455
|
+
error?: unknown;
|
|
456
|
+
code?: string;
|
|
448
457
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
458
|
+
interface DepositConfig {
|
|
459
|
+
externalUserId: string;
|
|
460
|
+
destinationChainType?: "ethereum" | "solana" | "bitcoin";
|
|
461
|
+
destinationChainId?: string;
|
|
462
|
+
destinationTokenAddress?: string;
|
|
463
|
+
destinationTokenSymbol?: string;
|
|
464
|
+
recipientAddress?: string;
|
|
465
|
+
defaultChainType?: "ethereum" | "solana" | "bitcoin";
|
|
466
|
+
defaultChainId?: string;
|
|
467
|
+
defaultTokenAddress?: string;
|
|
468
|
+
showBalance?: boolean;
|
|
469
|
+
/** Pre-fills Stripe Link Pay email (`beginDeposit` only — not provider config) */
|
|
470
|
+
stripeOnrampEmail?: string;
|
|
471
|
+
/** Pre-fills Stripe Link Pay phone; with `stripeOnrampEmail`, Stripe may skip verify steps */
|
|
472
|
+
stripeOnrampPhone?: string;
|
|
473
|
+
/**
|
|
474
|
+
* How deposit confirmation and waiting behavior is handled.
|
|
475
|
+
* - auto_ui (default): Automatically show "Processing deposit" UI and start polling after 10s. No "I've deposited" button.
|
|
476
|
+
* - auto_silent: Automatically start polling after 10s. Do not show waiting UI (host controls UI).
|
|
477
|
+
* - manual: Show "I've deposited" button. Clicking enters waiting UI and starts polling. No automatic polling.
|
|
478
|
+
*/
|
|
479
|
+
depositConfirmationMode?: "auto_ui" | "auto_silent" | "manual";
|
|
480
|
+
onSuccess?: (data: DepositResult) => void;
|
|
481
|
+
onError?: (error: DepositError) => void;
|
|
473
482
|
}
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
483
|
+
interface ConnectContextValue {
|
|
484
|
+
publishableKey: string;
|
|
485
|
+
beginDeposit: (config: DepositConfig) => Promise<DepositResult>;
|
|
486
|
+
closeDeposit: () => void;
|
|
478
487
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
488
|
+
interface UnifoldProviderProps {
|
|
489
|
+
children: ReactNode;
|
|
490
|
+
publishableKey: string;
|
|
491
|
+
config?: UnifoldConnectProviderConfig["config"];
|
|
483
492
|
}
|
|
484
|
-
|
|
485
|
-
|
|
493
|
+
declare function UnifoldProvider({ children, publishableKey, config, }: UnifoldProviderProps): react_jsx_runtime.JSX.Element;
|
|
494
|
+
declare function useUnifold(): ConnectContextValue;
|
|
486
495
|
|
|
487
|
-
export {};
|
|
496
|
+
export { type AllowedCountryResult, type BorderRadiusConfig, type ComponentConfig, type CustomThemeColors, type DepositConfig, type DepositError, type DepositResult, type FontConfig, type ThemeColors, type ThemeConfig, type ThemeMode, type ThemeProviderConfig, type TransferInputVariant, type UnifoldConnectProviderConfig, UnifoldProvider, type UnifoldProviderProps, registerStripeOnramp, setDevApiUrl, useAllowedCountry, useUnifold };
|