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