@unifold/connect-react 0.1.68-beta.2 → 0.1.69
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 +12 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1380 -971
- package/dist/index.mjs +1536 -1127
- package/dist/styles-base.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -136,6 +136,7 @@ Launches the deposit modal with the specified configuration. **Returns a Promise
|
|
|
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
|
+
| `prefilledAmountUsd` | string | - | Optional USD amount prefilled for deposit amount inputs (Connect Wallet, Deposit with Card, Bank Transfer, Cash App). It is applied as initial typed input and does not enable checkout mode. |
|
|
139
140
|
| `onSuccess` | function | - | Success callback (fired immediately) |
|
|
140
141
|
| `onError` | function | - | Error callback (fired immediately) |
|
|
141
142
|
| `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. |
|
|
@@ -187,6 +188,17 @@ await beginDeposit({
|
|
|
187
188
|
initialScreen: 'transfer',
|
|
188
189
|
});
|
|
189
190
|
|
|
191
|
+
// Deposit mode with pre-filled amount (no Payment Intent required)
|
|
192
|
+
await beginDeposit({
|
|
193
|
+
externalUserId: 'user_123',
|
|
194
|
+
destinationChainId: '137',
|
|
195
|
+
destinationTokenAddress: '0x2791bca1f2de4661ed88a30c99a7a9449aa84174',
|
|
196
|
+
destinationTokenSymbol: 'USDC',
|
|
197
|
+
recipientAddress: '0x606C49ca2Fa4982F07016265040F777eD3DA3160',
|
|
198
|
+
initialScreen: 'wallet_connect',
|
|
199
|
+
prefilledAmountUsd: '25.00',
|
|
200
|
+
});
|
|
201
|
+
|
|
190
202
|
// Hybrid (promise + callbacks)
|
|
191
203
|
const depositPromise = beginDeposit({
|
|
192
204
|
userId: 'user_123',
|
package/dist/index.d.mts
CHANGED
|
@@ -144,6 +144,12 @@ interface DepositConfig {
|
|
|
144
144
|
defaultSourceTokenAddress?: string;
|
|
145
145
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
|
|
146
146
|
defaultSourceSymbol?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Pre-fill USD amount inputs in deposit flows as initial typed input.
|
|
149
|
+
* Useful for "deposit mode" flows that skip Payment Intent and still want a
|
|
150
|
+
* suggested amount.
|
|
151
|
+
*/
|
|
152
|
+
prefilledAmountUsd?: string;
|
|
147
153
|
/** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
|
|
148
154
|
depositConfirmationMode?: DepositConfirmationMode;
|
|
149
155
|
onSuccess?: (data: DepositResult) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -144,6 +144,12 @@ interface DepositConfig {
|
|
|
144
144
|
defaultSourceTokenAddress?: string;
|
|
145
145
|
/** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
|
|
146
146
|
defaultSourceSymbol?: string;
|
|
147
|
+
/**
|
|
148
|
+
* Pre-fill USD amount inputs in deposit flows as initial typed input.
|
|
149
|
+
* Useful for "deposit mode" flows that skip Payment Intent and still want a
|
|
150
|
+
* suggested amount.
|
|
151
|
+
*/
|
|
152
|
+
prefilledAmountUsd?: string;
|
|
147
153
|
/** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
|
|
148
154
|
depositConfirmationMode?: DepositConfirmationMode;
|
|
149
155
|
onSuccess?: (data: DepositResult) => void;
|