@unifold/connect-react 0.1.68 → 0.1.70-beta.1

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 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',
@@ -0,0 +1 @@
1
+ export * from '@unifold/headless-react';
@@ -0,0 +1 @@
1
+ export * from '@unifold/headless-react';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/headless.ts
18
+ var headless_exports = {};
19
+ module.exports = __toCommonJS(headless_exports);
20
+ __reExport(headless_exports, require("@unifold/headless-react"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("@unifold/headless-react")
24
+ });
@@ -0,0 +1,2 @@
1
+ // src/headless.ts
2
+ export * from "@unifold/headless-react";
package/dist/index.d.mts CHANGED
@@ -47,6 +47,16 @@ interface UnifoldConnectProviderConfig {
47
47
  enableCashApp?: boolean;
48
48
  /** Enable "Pay with Link" headless onramp option. Defaults to false. */
49
49
  enableStripeLink?: boolean;
50
+ /**
51
+ * Notification UI feature flags grouped by concern.
52
+ */
53
+ notifications?: {
54
+ /**
55
+ * Opt in to showing the in-product incident banner UI.
56
+ * Defaults to false.
57
+ */
58
+ incidentBanner?: boolean;
59
+ };
50
60
  /**
51
61
  * Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides
52
62
  * dashboard default. Resolves as flag ?? dashboard `apple_pay.enabled` ??
@@ -144,6 +154,12 @@ interface DepositConfig {
144
154
  defaultSourceTokenAddress?: string;
145
155
  /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
146
156
  defaultSourceSymbol?: string;
157
+ /**
158
+ * Pre-fill USD amount inputs in deposit flows as initial typed input.
159
+ * Useful for "deposit mode" flows that skip Payment Intent and still want a
160
+ * suggested amount.
161
+ */
162
+ prefilledAmountUsd?: string;
147
163
  /** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
148
164
  depositConfirmationMode?: DepositConfirmationMode;
149
165
  onSuccess?: (data: DepositResult) => void;
package/dist/index.d.ts CHANGED
@@ -47,6 +47,16 @@ interface UnifoldConnectProviderConfig {
47
47
  enableCashApp?: boolean;
48
48
  /** Enable "Pay with Link" headless onramp option. Defaults to false. */
49
49
  enableStripeLink?: boolean;
50
+ /**
51
+ * Notification UI feature flags grouped by concern.
52
+ */
53
+ notifications?: {
54
+ /**
55
+ * Opt in to showing the in-product incident banner UI.
56
+ * Defaults to false.
57
+ */
58
+ incidentBanner?: boolean;
59
+ };
50
60
  /**
51
61
  * Enable "Pay with Apple Pay" (headless Coinbase) option. Overrides
52
62
  * dashboard default. Resolves as flag ?? dashboard `apple_pay.enabled` ??
@@ -144,6 +154,12 @@ interface DepositConfig {
144
154
  defaultSourceTokenAddress?: string;
145
155
  /** Source token symbol (e.g. `"USDC"`). Must be paired with `defaultSourceChainType` + `defaultSourceChainId` to match. */
146
156
  defaultSourceSymbol?: string;
157
+ /**
158
+ * Pre-fill USD amount inputs in deposit flows as initial typed input.
159
+ * Useful for "deposit mode" flows that skip Payment Intent and still want a
160
+ * suggested amount.
161
+ */
162
+ prefilledAmountUsd?: string;
147
163
  /** How to confirm deposit: 'auto_ui' (default), 'auto_silent', or 'manual' */
148
164
  depositConfirmationMode?: DepositConfirmationMode;
149
165
  onSuccess?: (data: DepositResult) => void;