@unifold/connect-react-native 0.1.50 → 0.1.52
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/README.md +6 -7
- package/dist/index.d.mts +48 -29
- package/dist/index.d.ts +48 -29
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Link Pay uses `@stripe/stripe-react-native`, which includes **native** code (App
|
|
|
36
36
|
|
|
37
37
|
Importing `@unifold/connect-react-native` loads the Stripe UI registration in the same JS bundle as the provider. Ensure the peer dependencies in **Installation** above are installed so Metro does not duplicate native modules.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The Apple Pay **`merchantIdentifier`** in `app.json` is still required for the **native entitlement** at build time. The value used at runtime for `initStripe`, however, comes **only** from the Unifold dashboard (via the Stripe config endpoint) — the SDK no longer reads it from a prop or `app.json`, so make sure the dashboard value matches the id compiled into your build.
|
|
40
40
|
|
|
41
41
|
#### Expo Go vs development build vs prebuild
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ Importing `@unifold/connect-react-native` loads the Stripe UI registration in th
|
|
|
50
50
|
1. **Peer dependencies** — Install everything in **Installation** (or `expo install …`). Missing peers often show up as duplicate native modules or Metro resolution errors.
|
|
51
51
|
2. **`react-native-gesture-handler`** — In bare React Native, import it at the **entry file** first (see [React Navigation](https://reactnavigation.org/docs/getting-started/#installing-dependencies-into-a-bare-react-native-project)); Expo Router projects usually already satisfy this.
|
|
52
52
|
3. **`UnifoldProvider` placement** — Wrap near the root so `beginDeposit` and theme context are available app-wide. Call `setDevApiUrl` **before** the provider if you use staging in development (see example app).
|
|
53
|
-
4. **Stripe Link Pay** — Requires a **development / EAS build** on Expo (not Expo Go), the Stripe **config plugin** in `app.json`, and `config.
|
|
53
|
+
4. **Stripe Link Pay** — Requires a **development / EAS build** on Expo (not Expo Go), the Stripe **config plugin** in `app.json`, and `config.enableStripeLink: true`. Apple Pay's `merchantIdentifier` must be set in the `app.json` plugin (native entitlement); the runtime value is sourced from the Unifold dashboard (Stripe config endpoint), so keep the two in sync.
|
|
54
54
|
5. **Theme** — `UnifoldProvider` applies `ThemeProvider` to **all** children. If you use another theme system, nest it inside or outside deliberately so `useTheme` resolves as you expect.
|
|
55
55
|
|
|
56
56
|
## Quick Start
|
|
@@ -192,8 +192,9 @@ await beginDeposit({
|
|
|
192
192
|
| `config.fonts` | `FontConfig` | No | Granular font weight configuration |
|
|
193
193
|
| `config.components` | `ComponentConfig` | No | Component-specific token overrides |
|
|
194
194
|
| `config.sheetBorderRadius` | `SheetBorderRadius` | No | Border radius configuration for all bottom sheets (see below) |
|
|
195
|
-
| `config.
|
|
196
|
-
|
|
195
|
+
| `config.enableStripeLink` | `boolean` | No | Show Pay with Link (Stripe) in the deposit menu (default: omit / falsy hides it). Stripe is bundled with Connect. |
|
|
196
|
+
|
|
197
|
+
> **Apple Pay merchant id:** there is no longer an SDK config for this. The runtime value comes solely from the Unifold dashboard (Stripe config endpoint). Keep it in sync with the `merchantIdentifier` in your `app.json` Stripe plugin, which is still required for the native entitlement.
|
|
197
198
|
|
|
198
199
|
### SheetBorderRadius
|
|
199
200
|
|
|
@@ -251,8 +252,7 @@ const { beginDeposit, closeDeposit, publishableKey } = useUnifold();
|
|
|
251
252
|
| `destinationTokenAddress` | `string` | No | Target token contract address |
|
|
252
253
|
| `destinationTokenSymbol` | `string` | No | Target token symbol (e.g., `'USDC'`) |
|
|
253
254
|
| `recipientAddress` | `string` | No | Wallet address to receive funds |
|
|
254
|
-
| `
|
|
255
|
-
| `stripeOnrampPhone` | `string` | No | Pre-fills Stripe Link Pay phone (use with `stripeOnrampEmail` per Stripe’s flow) |
|
|
255
|
+
| `user` | `{ email?: string; phone?: string }` | No | Host-app-supplied user identity. Pre-fills supported flows — currently Stripe Link Pay uses `user.email` / `user.phone` (with both set, Stripe may skip verify steps). |
|
|
256
256
|
| `defaultChainType` | `'ethereum' \| 'solana' \| 'bitcoin'` | No | Pre-select source network type |
|
|
257
257
|
| `defaultChainId` | `string` | No | Pre-select source chain ID |
|
|
258
258
|
| `defaultTokenAddress` | `string` | No | Pre-select source token address |
|
|
@@ -308,7 +308,6 @@ import type {
|
|
|
308
308
|
| react-native-gesture-handler | >= 2.14.0 |
|
|
309
309
|
| react-native-svg | >= 13.0.0 |
|
|
310
310
|
| react-native-webview | >= 13.0.0 |
|
|
311
|
-
| expo-constants | Installed with Connect (>= 14) — mirrors `merchantIdentifier` from the Stripe Expo plugin into JS; optional override via `config.stripeMerchantIdentifier` |
|
|
312
311
|
|
|
313
312
|
## Support
|
|
314
313
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
2
|
+
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampConfig, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripeConfig, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Unifold color palette for React Native
|
|
@@ -371,6 +371,11 @@ interface BottomSheetProps {
|
|
|
371
371
|
onClose: () => void;
|
|
372
372
|
children: React$1.ReactNode;
|
|
373
373
|
closeOnBackdropPress?: boolean;
|
|
374
|
+
/** Handler invoked when the backdrop is tapped (and `closeOnBackdropPress`
|
|
375
|
+
* is true). Defaults to `onClose`. Provide this when a backdrop tap should
|
|
376
|
+
* behave differently from pan-down/hardware-back (e.g. fully dismiss a
|
|
377
|
+
* multi-screen modal instead of navigating back one step). */
|
|
378
|
+
onBackdropPress?: () => void;
|
|
374
379
|
enablePanDownToClose?: boolean;
|
|
375
380
|
showHandle?: boolean;
|
|
376
381
|
heightPercent?: number;
|
|
@@ -389,7 +394,7 @@ interface BottomSheetProps {
|
|
|
389
394
|
* Use this for sheets that must appear on top of an already-open Modal (iOS limitation). */
|
|
390
395
|
useModal?: boolean;
|
|
391
396
|
}
|
|
392
|
-
declare function BottomSheet({ visible, onClose, children, closeOnBackdropPress, enablePanDownToClose, showHandle, heightPercent, maxHeightPercent, startExpanded, noPadding, borderTopLeftRadius, borderTopRightRadius, marginHorizontal: marginH, marginBottom: marginBottomProp, overlay, useModal: useModalProp, }: BottomSheetProps): React$1.JSX.Element | null;
|
|
397
|
+
declare function BottomSheet({ visible, onClose, children, closeOnBackdropPress, onBackdropPress, enablePanDownToClose, showHandle, heightPercent, maxHeightPercent, startExpanded, noPadding, borderTopLeftRadius, borderTopRightRadius, marginHorizontal: marginH, marginBottom: marginBottomProp, overlay, useModal: useModalProp, }: BottomSheetProps): React$1.JSX.Element | null;
|
|
393
398
|
|
|
394
399
|
/** Controls which transfer crypto input variant is rendered */
|
|
395
400
|
type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
@@ -401,11 +406,26 @@ type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
|
401
406
|
type DepositMenuDisplay = "stacked" | "tabs";
|
|
402
407
|
/** Controls which screen opens first when the deposit modal is shown */
|
|
403
408
|
type DepositInitialScreen = "main" | "transfer" | "card" | "tracker" | "cashapp" | "wallet";
|
|
409
|
+
/**
|
|
410
|
+
* Host-app-supplied user identity used to pre-fill supported flows.
|
|
411
|
+
* Currently consumed by Stripe Link Pay (email/phone pre-fill). Kept as an
|
|
412
|
+
* extensible object so more fields can be added later without new top-level
|
|
413
|
+
* props.
|
|
414
|
+
*/
|
|
415
|
+
interface UnifoldUser {
|
|
416
|
+
/** Pre-fills the user's email (e.g. Stripe Link Pay). */
|
|
417
|
+
email?: string;
|
|
418
|
+
/** Pre-fills the user's phone; with `email`, Stripe may skip verify steps. */
|
|
419
|
+
phone?: string;
|
|
420
|
+
}
|
|
404
421
|
interface DepositModalProps {
|
|
405
422
|
/** Whether the modal is visible */
|
|
406
423
|
visible: boolean;
|
|
407
424
|
/** Callback when the modal should close */
|
|
408
425
|
onClose: () => void;
|
|
426
|
+
/** When true, tapping the backdrop (outside the sheet) dismisses the deposit
|
|
427
|
+
* modal. Defaults to false so an outside tap does not dismiss. */
|
|
428
|
+
closeOnBackdropPress?: boolean;
|
|
409
429
|
/** User ID for the deposit */
|
|
410
430
|
externalUserId: string;
|
|
411
431
|
/** Publishable API key */
|
|
@@ -441,19 +461,14 @@ interface DepositModalProps {
|
|
|
441
461
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
442
462
|
enableFiatOnramp?: boolean;
|
|
443
463
|
/** Show "Pay with Link" (Stripe) option in the deposit menu */
|
|
444
|
-
|
|
445
|
-
/** Registered Stripe onramp component (Connect sets this from `
|
|
464
|
+
enableStripeLink?: boolean;
|
|
465
|
+
/** Registered Stripe onramp component (Connect sets this from `enableStripeLink`) */
|
|
446
466
|
StripeOnrampComponent?: React$1.ComponentType<any>;
|
|
447
|
-
/** Pre-fills Stripe Link Pay email — set via `beginDeposit({ stripeOnrampEmail })` (forwarded as `email` on `StripeOnramp`) */
|
|
448
|
-
stripeOnrampEmail?: string;
|
|
449
|
-
/** Pre-fills Stripe Link Pay phone — set via `beginDeposit({ stripeOnrampPhone })` (forwarded as `phone` on `StripeOnramp`) */
|
|
450
|
-
stripeOnrampPhone?: string;
|
|
451
467
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* in app.json (the UI reads it via `expo-constants`).
|
|
468
|
+
* Host-app-supplied user identity. Pre-fills supported flows (currently Stripe
|
|
469
|
+
* Link Pay email/phone). Set via `beginDeposit({ user })`.
|
|
455
470
|
*/
|
|
456
|
-
|
|
471
|
+
user?: UnifoldUser;
|
|
457
472
|
/** Where to render the Stripe payment method selector: "header" or "inline". Default: "header" */
|
|
458
473
|
stripePaymentSelectorPosition?: "header" | "inline";
|
|
459
474
|
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
@@ -521,7 +536,7 @@ interface DepositModalProps {
|
|
|
521
536
|
/** Price impact & slippage info sheet */
|
|
522
537
|
infoSheet?: BorderRadiusConfig;
|
|
523
538
|
/** Stripe Link Pay sheet */
|
|
524
|
-
|
|
539
|
+
stripeLink?: BorderRadiusConfig;
|
|
525
540
|
/** Cash App sheet */
|
|
526
541
|
cashApp?: BorderRadiusConfig;
|
|
527
542
|
/** Connect Wallet sheet */
|
|
@@ -628,7 +643,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
628
643
|
* Show "Pay with Link" (Stripe) option in the deposit menu.
|
|
629
644
|
* Stripe onramp is bundled with Connect; set to false to hide the option.
|
|
630
645
|
*/
|
|
631
|
-
|
|
646
|
+
enableStripeLink?: boolean;
|
|
632
647
|
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
633
648
|
enableTransferCrypto?: boolean;
|
|
634
649
|
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false. */
|
|
@@ -637,17 +652,13 @@ interface UnifoldConnectProviderConfig {
|
|
|
637
652
|
enableConnectWallet?: boolean;
|
|
638
653
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
639
654
|
enableFiatOnramp?: boolean;
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
648
|
-
stripePaymentSelectorPosition?: "header" | "inline";
|
|
649
|
-
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
650
|
-
stripeSkipSuccessConfirmation?: boolean;
|
|
655
|
+
/** Stripe Link Pay tuning options (only applies when `enableStripeLink` is true). */
|
|
656
|
+
stripeLink?: {
|
|
657
|
+
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
658
|
+
paymentSelectorPosition?: "header" | "inline";
|
|
659
|
+
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
660
|
+
skipSuccessConfirmation?: boolean;
|
|
661
|
+
};
|
|
651
662
|
};
|
|
652
663
|
}
|
|
653
664
|
interface DepositResult {
|
|
@@ -671,10 +682,13 @@ interface DepositConfig {
|
|
|
671
682
|
defaultChainId?: string;
|
|
672
683
|
defaultTokenAddress?: string;
|
|
673
684
|
showBalance?: boolean;
|
|
674
|
-
/**
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
685
|
+
/**
|
|
686
|
+
* Host-app-supplied user identity (`beginDeposit` only — not provider config).
|
|
687
|
+
* Pre-fills supported flows; currently Stripe Link Pay uses `user.email` /
|
|
688
|
+
* `user.phone` (with both set, Stripe may skip verify steps). Kept as an
|
|
689
|
+
* object so more fields can be added later without new `stripeXxx` params.
|
|
690
|
+
*/
|
|
691
|
+
user?: UnifoldUser;
|
|
678
692
|
/**
|
|
679
693
|
* How deposit confirmation and waiting behavior is handled.
|
|
680
694
|
* - auto_ui (default): Automatically show "Processing deposit" UI and start polling after 10s. No "I've deposited" button.
|
|
@@ -692,6 +706,11 @@ interface DepositConfig {
|
|
|
692
706
|
initialScreen?: DepositInitialScreen;
|
|
693
707
|
onSuccess?: (data: DepositResult) => void;
|
|
694
708
|
onError?: (error: DepositError) => void;
|
|
709
|
+
/** Called when the user dismisses the deposit modal */
|
|
710
|
+
onDismiss?: () => void;
|
|
711
|
+
/** When true, tapping outside the deposit modal (backdrop) dismisses it and
|
|
712
|
+
* triggers `onDismiss`. Defaults to false. */
|
|
713
|
+
closeOnBackdropPress?: boolean;
|
|
695
714
|
}
|
|
696
715
|
interface WithdrawResult {
|
|
697
716
|
message: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
2
|
+
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampConfig, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripeConfig, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Unifold color palette for React Native
|
|
@@ -371,6 +371,11 @@ interface BottomSheetProps {
|
|
|
371
371
|
onClose: () => void;
|
|
372
372
|
children: React$1.ReactNode;
|
|
373
373
|
closeOnBackdropPress?: boolean;
|
|
374
|
+
/** Handler invoked when the backdrop is tapped (and `closeOnBackdropPress`
|
|
375
|
+
* is true). Defaults to `onClose`. Provide this when a backdrop tap should
|
|
376
|
+
* behave differently from pan-down/hardware-back (e.g. fully dismiss a
|
|
377
|
+
* multi-screen modal instead of navigating back one step). */
|
|
378
|
+
onBackdropPress?: () => void;
|
|
374
379
|
enablePanDownToClose?: boolean;
|
|
375
380
|
showHandle?: boolean;
|
|
376
381
|
heightPercent?: number;
|
|
@@ -389,7 +394,7 @@ interface BottomSheetProps {
|
|
|
389
394
|
* Use this for sheets that must appear on top of an already-open Modal (iOS limitation). */
|
|
390
395
|
useModal?: boolean;
|
|
391
396
|
}
|
|
392
|
-
declare function BottomSheet({ visible, onClose, children, closeOnBackdropPress, enablePanDownToClose, showHandle, heightPercent, maxHeightPercent, startExpanded, noPadding, borderTopLeftRadius, borderTopRightRadius, marginHorizontal: marginH, marginBottom: marginBottomProp, overlay, useModal: useModalProp, }: BottomSheetProps): React$1.JSX.Element | null;
|
|
397
|
+
declare function BottomSheet({ visible, onClose, children, closeOnBackdropPress, onBackdropPress, enablePanDownToClose, showHandle, heightPercent, maxHeightPercent, startExpanded, noPadding, borderTopLeftRadius, borderTopRightRadius, marginHorizontal: marginH, marginBottom: marginBottomProp, overlay, useModal: useModalProp, }: BottomSheetProps): React$1.JSX.Element | null;
|
|
393
398
|
|
|
394
399
|
/** Controls which transfer crypto input variant is rendered */
|
|
395
400
|
type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
@@ -401,11 +406,26 @@ type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
|
401
406
|
type DepositMenuDisplay = "stacked" | "tabs";
|
|
402
407
|
/** Controls which screen opens first when the deposit modal is shown */
|
|
403
408
|
type DepositInitialScreen = "main" | "transfer" | "card" | "tracker" | "cashapp" | "wallet";
|
|
409
|
+
/**
|
|
410
|
+
* Host-app-supplied user identity used to pre-fill supported flows.
|
|
411
|
+
* Currently consumed by Stripe Link Pay (email/phone pre-fill). Kept as an
|
|
412
|
+
* extensible object so more fields can be added later without new top-level
|
|
413
|
+
* props.
|
|
414
|
+
*/
|
|
415
|
+
interface UnifoldUser {
|
|
416
|
+
/** Pre-fills the user's email (e.g. Stripe Link Pay). */
|
|
417
|
+
email?: string;
|
|
418
|
+
/** Pre-fills the user's phone; with `email`, Stripe may skip verify steps. */
|
|
419
|
+
phone?: string;
|
|
420
|
+
}
|
|
404
421
|
interface DepositModalProps {
|
|
405
422
|
/** Whether the modal is visible */
|
|
406
423
|
visible: boolean;
|
|
407
424
|
/** Callback when the modal should close */
|
|
408
425
|
onClose: () => void;
|
|
426
|
+
/** When true, tapping the backdrop (outside the sheet) dismisses the deposit
|
|
427
|
+
* modal. Defaults to false so an outside tap does not dismiss. */
|
|
428
|
+
closeOnBackdropPress?: boolean;
|
|
409
429
|
/** User ID for the deposit */
|
|
410
430
|
externalUserId: string;
|
|
411
431
|
/** Publishable API key */
|
|
@@ -441,19 +461,14 @@ interface DepositModalProps {
|
|
|
441
461
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
442
462
|
enableFiatOnramp?: boolean;
|
|
443
463
|
/** Show "Pay with Link" (Stripe) option in the deposit menu */
|
|
444
|
-
|
|
445
|
-
/** Registered Stripe onramp component (Connect sets this from `
|
|
464
|
+
enableStripeLink?: boolean;
|
|
465
|
+
/** Registered Stripe onramp component (Connect sets this from `enableStripeLink`) */
|
|
446
466
|
StripeOnrampComponent?: React$1.ComponentType<any>;
|
|
447
|
-
/** Pre-fills Stripe Link Pay email — set via `beginDeposit({ stripeOnrampEmail })` (forwarded as `email` on `StripeOnramp`) */
|
|
448
|
-
stripeOnrampEmail?: string;
|
|
449
|
-
/** Pre-fills Stripe Link Pay phone — set via `beginDeposit({ stripeOnrampPhone })` (forwarded as `phone` on `StripeOnramp`) */
|
|
450
|
-
stripeOnrampPhone?: string;
|
|
451
467
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
454
|
-
* in app.json (the UI reads it via `expo-constants`).
|
|
468
|
+
* Host-app-supplied user identity. Pre-fills supported flows (currently Stripe
|
|
469
|
+
* Link Pay email/phone). Set via `beginDeposit({ user })`.
|
|
455
470
|
*/
|
|
456
|
-
|
|
471
|
+
user?: UnifoldUser;
|
|
457
472
|
/** Where to render the Stripe payment method selector: "header" or "inline". Default: "header" */
|
|
458
473
|
stripePaymentSelectorPosition?: "header" | "inline";
|
|
459
474
|
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
@@ -521,7 +536,7 @@ interface DepositModalProps {
|
|
|
521
536
|
/** Price impact & slippage info sheet */
|
|
522
537
|
infoSheet?: BorderRadiusConfig;
|
|
523
538
|
/** Stripe Link Pay sheet */
|
|
524
|
-
|
|
539
|
+
stripeLink?: BorderRadiusConfig;
|
|
525
540
|
/** Cash App sheet */
|
|
526
541
|
cashApp?: BorderRadiusConfig;
|
|
527
542
|
/** Connect Wallet sheet */
|
|
@@ -628,7 +643,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
628
643
|
* Show "Pay with Link" (Stripe) option in the deposit menu.
|
|
629
644
|
* Stripe onramp is bundled with Connect; set to false to hide the option.
|
|
630
645
|
*/
|
|
631
|
-
|
|
646
|
+
enableStripeLink?: boolean;
|
|
632
647
|
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
633
648
|
enableTransferCrypto?: boolean;
|
|
634
649
|
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false. */
|
|
@@ -637,17 +652,13 @@ interface UnifoldConnectProviderConfig {
|
|
|
637
652
|
enableConnectWallet?: boolean;
|
|
638
653
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
639
654
|
enableFiatOnramp?: boolean;
|
|
640
|
-
/**
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
648
|
-
stripePaymentSelectorPosition?: "header" | "inline";
|
|
649
|
-
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
650
|
-
stripeSkipSuccessConfirmation?: boolean;
|
|
655
|
+
/** Stripe Link Pay tuning options (only applies when `enableStripeLink` is true). */
|
|
656
|
+
stripeLink?: {
|
|
657
|
+
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
658
|
+
paymentSelectorPosition?: "header" | "inline";
|
|
659
|
+
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
660
|
+
skipSuccessConfirmation?: boolean;
|
|
661
|
+
};
|
|
651
662
|
};
|
|
652
663
|
}
|
|
653
664
|
interface DepositResult {
|
|
@@ -671,10 +682,13 @@ interface DepositConfig {
|
|
|
671
682
|
defaultChainId?: string;
|
|
672
683
|
defaultTokenAddress?: string;
|
|
673
684
|
showBalance?: boolean;
|
|
674
|
-
/**
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
685
|
+
/**
|
|
686
|
+
* Host-app-supplied user identity (`beginDeposit` only — not provider config).
|
|
687
|
+
* Pre-fills supported flows; currently Stripe Link Pay uses `user.email` /
|
|
688
|
+
* `user.phone` (with both set, Stripe may skip verify steps). Kept as an
|
|
689
|
+
* object so more fields can be added later without new `stripeXxx` params.
|
|
690
|
+
*/
|
|
691
|
+
user?: UnifoldUser;
|
|
678
692
|
/**
|
|
679
693
|
* How deposit confirmation and waiting behavior is handled.
|
|
680
694
|
* - auto_ui (default): Automatically show "Processing deposit" UI and start polling after 10s. No "I've deposited" button.
|
|
@@ -692,6 +706,11 @@ interface DepositConfig {
|
|
|
692
706
|
initialScreen?: DepositInitialScreen;
|
|
693
707
|
onSuccess?: (data: DepositResult) => void;
|
|
694
708
|
onError?: (error: DepositError) => void;
|
|
709
|
+
/** Called when the user dismisses the deposit modal */
|
|
710
|
+
onDismiss?: () => void;
|
|
711
|
+
/** When true, tapping outside the deposit modal (backdrop) dismisses it and
|
|
712
|
+
* triggers `onDismiss`. Defaults to false. */
|
|
713
|
+
closeOnBackdropPress?: boolean;
|
|
695
714
|
}
|
|
696
715
|
interface WithdrawResult {
|
|
697
716
|
message: string;
|