@unifold/connect-react 0.1.61 → 0.1.63
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 +2 -2
- package/dist/index.d.mts +18 -12
- package/dist/index.d.ts +18 -12
- package/dist/index.js +739 -460
- package/dist/index.mjs +895 -616
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -132,13 +132,13 @@ Launches the deposit modal with the specified configuration. **Returns a Promise
|
|
|
132
132
|
| `destinationTokenAddress` | string | ✅ | Token contract address |
|
|
133
133
|
| `destinationTokenSymbol` | string | ✅ | Token symbol (e.g., "USDC") |
|
|
134
134
|
| `recipientAddress` | string | ✅ | Recipient wallet address |
|
|
135
|
-
| `defaultSourceChainType` | string | - |
|
|
135
|
+
| `defaultSourceChainType` | string | - | Prefer source chain type in Transfer Crypto, Wallet Connect, and Connect Exchange (e.g. `"solana"`, `"ethereum"`). Must be paired with `defaultSourceChainId` + symbol or token address. If omitted or no match, each flow uses its normal ordering. |
|
|
136
136
|
| `defaultSourceChainId` | string | - | Source chain ID (e.g. `"mainnet"`, `"137"`). Paired with `defaultSourceChainType`. |
|
|
137
137
|
| `defaultSourceTokenAddress` | string | - | Source token contract address. Paired with chain type + chain ID. |
|
|
138
138
|
| `defaultSourceSymbol` | string | - | Source token symbol (e.g. `"USDC"`). Paired with chain type + chain ID. |
|
|
139
139
|
| `onSuccess` | function | - | Success callback (fired immediately) |
|
|
140
140
|
| `onError` | function | - | Error callback (fired immediately) |
|
|
141
|
-
| `initialScreen` | `'main' \| 'transfer' \| 'card' \| 'tracker'` | - | `main` (default) = deposit menu. `transfer` / `card` use the **same geo/validation gates** as the menu. `tracker` opens the list **without** those gates. If not `main`, the header **back** is hidden (standalone); from `main`, back returns to the menu.
|
|
141
|
+
| `initialScreen` | `'main' \| 'transfer' \| 'card' \| 'cashapp' \| 'tracker' \| 'pay_with_exchange' \| 'exchange_connect' \| 'wallet_connect'` | - | `main` (default) = deposit menu. `transfer` / `card` use the **same geo/validation gates** as the menu. `tracker` opens the list **without** those gates. `cashapp`, `pay_with_exchange`, `exchange_connect`, `wallet_connect` open their respective flows and **fall back to `main`** when the matching feature flag (`enableCashApp`, `enablePayWithExchange`, `enableConnectExchange`, `enableConnectWallet`) is disabled. If not `main`, the header **back** is hidden at the flow root (standalone); from `main`, back returns to the menu. Inner steps (card quotes/onramp, tracker detail, exchange pending, cashapp payment) still show back. |
|
|
142
142
|
|
|
143
143
|
**Returns:** `Promise<DepositResult>`
|
|
144
144
|
|
package/dist/index.d.mts
CHANGED
|
@@ -28,15 +28,17 @@ interface UnifoldConnectProviderConfig {
|
|
|
28
28
|
appearance?: ThemeMode | 'auto';
|
|
29
29
|
/** Transfer input variant: 'single_input' or 'double_input'. Defaults to 'double_input' */
|
|
30
30
|
transferInputVariant?: 'single_input' | 'double_input';
|
|
31
|
-
/** Enable
|
|
31
|
+
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
32
|
+
enableTransferCrypto?: boolean;
|
|
33
|
+
/** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
32
34
|
enableConnectWallet?: boolean;
|
|
33
|
-
/** Enable "Pay with Exchange" option. Overrides dashboard default.
|
|
35
|
+
/** Enable "Pay with Exchange" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
34
36
|
enablePayWithExchange?: boolean;
|
|
35
|
-
/** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default.
|
|
37
|
+
/** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
36
38
|
enableFiatOnramp?: boolean;
|
|
37
|
-
/** Enable "Connect Exchange" option for direct Coinbase Connect integration.
|
|
39
|
+
/** Enable "Connect Exchange" option for direct Coinbase Connect integration. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
38
40
|
enableConnectExchange?: boolean;
|
|
39
|
-
/** Enable "Pay with Cash App" option.
|
|
41
|
+
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
40
42
|
enableCashApp?: boolean;
|
|
41
43
|
/** Simple accent/primary color override (applies to both light and dark modes) */
|
|
42
44
|
accentColor?: string;
|
|
@@ -93,9 +95,9 @@ interface DepositConfig {
|
|
|
93
95
|
*/
|
|
94
96
|
contractCalls?: EvmContractCall[];
|
|
95
97
|
/**
|
|
96
|
-
*
|
|
98
|
+
* Prefer a source token/chain in Transfer Crypto, Wallet Connect, and Connect Exchange flows.
|
|
97
99
|
* All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
|
|
98
|
-
* If omitted or no match is found in `/supported_deposit_tokens`,
|
|
100
|
+
* If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
|
|
99
101
|
*/
|
|
100
102
|
defaultSourceChainType?: ChainType;
|
|
101
103
|
/** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` and a symbol or token address. */
|
|
@@ -113,10 +115,14 @@ interface DepositConfig {
|
|
|
113
115
|
/** Called when deposit lifecycle events occur. Use {@link DepositEventType} to narrow the event type. See {@link DepositEvent} for the full union. */
|
|
114
116
|
onEvent?: (event: DepositEvent) => void;
|
|
115
117
|
/**
|
|
116
|
-
* Which screen opens first:
|
|
118
|
+
* Which screen opens first. One of: `main` (menu, default), `transfer`, `card`, `cashapp`,
|
|
119
|
+
* `tracker`, `pay_with_exchange` (Pay with Exchange), `exchange_connect` (Connect Exchange), or
|
|
120
|
+
* `wallet_connect` (Connect Wallet).
|
|
117
121
|
* `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
|
|
118
|
-
* (deposit history is always reachable).
|
|
119
|
-
*
|
|
122
|
+
* (deposit history is always reachable). A screen falls back to `main` when its feature flag is disabled
|
|
123
|
+
* (e.g. `cashapp` without `enableCashApp`, `exchange_connect` without `enableConnectExchange`).
|
|
124
|
+
* If not `main`, the header back control is hidden at the flow's root (nothing to return to); inner steps
|
|
125
|
+
* (card quotes/onramp, tracker detail, exchange pending, cashapp payment, etc.) still show back for inner navigation.
|
|
120
126
|
*/
|
|
121
127
|
initialScreen?: DepositModalInitialScreen;
|
|
122
128
|
}
|
|
@@ -142,9 +148,9 @@ interface CheckoutConfig {
|
|
|
142
148
|
/** The client_secret from a PaymentIntent created on your server */
|
|
143
149
|
clientSecret: string;
|
|
144
150
|
/**
|
|
145
|
-
*
|
|
151
|
+
* Prefer a source token/chain in Transfer Crypto and Wallet Connect flows.
|
|
146
152
|
* All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
|
|
147
|
-
* If omitted or no match is found in `/supported_deposit_tokens`,
|
|
153
|
+
* If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
|
|
148
154
|
*/
|
|
149
155
|
defaultSourceChainType?: ChainType;
|
|
150
156
|
/** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
|
package/dist/index.d.ts
CHANGED
|
@@ -28,15 +28,17 @@ interface UnifoldConnectProviderConfig {
|
|
|
28
28
|
appearance?: ThemeMode | 'auto';
|
|
29
29
|
/** Transfer input variant: 'single_input' or 'double_input'. Defaults to 'double_input' */
|
|
30
30
|
transferInputVariant?: 'single_input' | 'double_input';
|
|
31
|
-
/** Enable
|
|
31
|
+
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
32
|
+
enableTransferCrypto?: boolean;
|
|
33
|
+
/** Enable browser wallet connection option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
32
34
|
enableConnectWallet?: boolean;
|
|
33
|
-
/** Enable "Pay with Exchange" option. Overrides dashboard default.
|
|
35
|
+
/** Enable "Pay with Exchange" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
34
36
|
enablePayWithExchange?: boolean;
|
|
35
|
-
/** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default.
|
|
37
|
+
/** Enable the fiat on-ramp option (shown as "Deposit with Card"). Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
36
38
|
enableFiatOnramp?: boolean;
|
|
37
|
-
/** Enable "Connect Exchange" option for direct Coinbase Connect integration.
|
|
39
|
+
/** Enable "Connect Exchange" option for direct Coinbase Connect integration. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
38
40
|
enableConnectExchange?: boolean;
|
|
39
|
-
/** Enable "Pay with Cash App" option.
|
|
41
|
+
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
40
42
|
enableCashApp?: boolean;
|
|
41
43
|
/** Simple accent/primary color override (applies to both light and dark modes) */
|
|
42
44
|
accentColor?: string;
|
|
@@ -93,9 +95,9 @@ interface DepositConfig {
|
|
|
93
95
|
*/
|
|
94
96
|
contractCalls?: EvmContractCall[];
|
|
95
97
|
/**
|
|
96
|
-
*
|
|
98
|
+
* Prefer a source token/chain in Transfer Crypto, Wallet Connect, and Connect Exchange flows.
|
|
97
99
|
* All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
|
|
98
|
-
* If omitted or no match is found in `/supported_deposit_tokens`,
|
|
100
|
+
* If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
|
|
99
101
|
*/
|
|
100
102
|
defaultSourceChainType?: ChainType;
|
|
101
103
|
/** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` and a symbol or token address. */
|
|
@@ -113,10 +115,14 @@ interface DepositConfig {
|
|
|
113
115
|
/** Called when deposit lifecycle events occur. Use {@link DepositEventType} to narrow the event type. See {@link DepositEvent} for the full union. */
|
|
114
116
|
onEvent?: (event: DepositEvent) => void;
|
|
115
117
|
/**
|
|
116
|
-
* Which screen opens first:
|
|
118
|
+
* Which screen opens first. One of: `main` (menu, default), `transfer`, `card`, `cashapp`,
|
|
119
|
+
* `tracker`, `pay_with_exchange` (Pay with Exchange), `exchange_connect` (Connect Exchange), or
|
|
120
|
+
* `wallet_connect` (Connect Wallet).
|
|
117
121
|
* `transfer` and `card` run the same geo / recipient checks as the menu before the flow. `tracker` does not
|
|
118
|
-
* (deposit history is always reachable).
|
|
119
|
-
*
|
|
122
|
+
* (deposit history is always reachable). A screen falls back to `main` when its feature flag is disabled
|
|
123
|
+
* (e.g. `cashapp` without `enableCashApp`, `exchange_connect` without `enableConnectExchange`).
|
|
124
|
+
* If not `main`, the header back control is hidden at the flow's root (nothing to return to); inner steps
|
|
125
|
+
* (card quotes/onramp, tracker detail, exchange pending, cashapp payment, etc.) still show back for inner navigation.
|
|
120
126
|
*/
|
|
121
127
|
initialScreen?: DepositModalInitialScreen;
|
|
122
128
|
}
|
|
@@ -142,9 +148,9 @@ interface CheckoutConfig {
|
|
|
142
148
|
/** The client_secret from a PaymentIntent created on your server */
|
|
143
149
|
clientSecret: string;
|
|
144
150
|
/**
|
|
145
|
-
*
|
|
151
|
+
* Prefer a source token/chain in Transfer Crypto and Wallet Connect flows.
|
|
146
152
|
* All four props are optional. To match a specific token, provide `chainType` + `chainId` + (`symbol` OR `tokenAddress`).
|
|
147
|
-
* If omitted or no match is found in `/supported_deposit_tokens`,
|
|
153
|
+
* If omitted or no match is found in `/supported_deposit_tokens`, each flow uses its normal ordering.
|
|
148
154
|
*/
|
|
149
155
|
defaultSourceChainType?: ChainType;
|
|
150
156
|
/** Source chain ID (e.g. `"mainnet"`, `"137"`). Must be paired with `defaultSourceChainType` + symbol or token address. */
|