@swype-org/react-sdk 0.1.30 → 0.1.31

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.cts CHANGED
@@ -195,7 +195,7 @@ interface UserConfig {
195
195
  /** Theme mode */
196
196
  type ThemeMode = 'light' | 'dark';
197
197
  /** Steps in the payment flow */
198
- type PaymentStep = 'login' | 'register-passkey' | 'enter-amount' | 'ready' | 'processing' | 'complete';
198
+ type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'setup' | 'setup-status' | 'deposit' | 'low-balance' | 'processing' | 'success';
199
199
  /** User-selected advanced settings for chain/asset override */
200
200
  interface AdvancedSettings {
201
201
  /** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
@@ -223,6 +223,9 @@ interface ThemeTokens {
223
223
  successBg: string;
224
224
  error: string;
225
225
  errorBg: string;
226
+ warning: string;
227
+ warningBg: string;
228
+ warningText: string;
226
229
  shadow: string;
227
230
  shadowLg: string;
228
231
  radius: string;
@@ -356,40 +359,18 @@ declare namespace api {
356
359
  }
357
360
 
358
361
  interface SwypePaymentProps {
359
- /**
360
- * Where the funds go -- controlled by the host app (merchant).
361
- *
362
- * The merchant sets this prop and can update it at any time; the SDK
363
- * reads it reactively whenever a transfer is created.
364
- */
365
362
  destination: Destination;
366
- /** Called when the transfer reaches COMPLETED status */
367
363
  onComplete?: (transfer: Transfer) => void;
368
- /** Called on unrecoverable error */
369
364
  onError?: (error: string) => void;
370
- /**
371
- * Whether to use in-browser wallet connectors (wagmi) for authorization.
372
- *
373
- * - `true` — always use in-browser wallet connectors (desktop flow).
374
- * - `false` — always use deeplink redirects (webview / mobile flow).
375
- * - `undefined` (default) — auto-detect via user-agent (`isMobile()`).
376
- *
377
- * Set to `false` when rendering inside a WebView where browser-based
378
- * wallet extensions are unavailable.
379
- */
380
365
  useWalletConnector?: boolean;
381
- /**
382
- * Caller-supplied UUID v4 used as the transfer ID for idempotency.
383
- *
384
- * When provided, the transfer is created with this ID instead of a
385
- * randomly generated one. This allows callers to safely retry the payment
386
- * flow without creating duplicate transfers.
387
- */
388
366
  idempotencyKey?: string;
389
- /** Merchant-signed transfer authorization envelope required by the API. */
390
367
  merchantAuthorization?: CreateTransferParams['merchantAuthorization'];
368
+ /** Merchant display name shown in headers and summaries */
369
+ merchantName?: string;
370
+ /** Called when the user taps the back button */
371
+ onBack?: () => void;
391
372
  }
392
- declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
373
+ declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, merchantName, onBack, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
393
374
 
394
375
  type AccessTokenGetter = () => Promise<string | null | undefined>;
395
376
  /**
package/dist/index.d.ts CHANGED
@@ -195,7 +195,7 @@ interface UserConfig {
195
195
  /** Theme mode */
196
196
  type ThemeMode = 'light' | 'dark';
197
197
  /** Steps in the payment flow */
198
- type PaymentStep = 'login' | 'register-passkey' | 'enter-amount' | 'ready' | 'processing' | 'complete';
198
+ type PaymentStep = 'login' | 'otp-verify' | 'create-passkey' | 'wallet-picker' | 'setup' | 'setup-status' | 'deposit' | 'low-balance' | 'processing' | 'success';
199
199
  /** User-selected advanced settings for chain/asset override */
200
200
  interface AdvancedSettings {
201
201
  /** Override asset (e.g. 'USDC', 'USDT'). Null = let backend decide. */
@@ -223,6 +223,9 @@ interface ThemeTokens {
223
223
  successBg: string;
224
224
  error: string;
225
225
  errorBg: string;
226
+ warning: string;
227
+ warningBg: string;
228
+ warningText: string;
226
229
  shadow: string;
227
230
  shadowLg: string;
228
231
  radius: string;
@@ -356,40 +359,18 @@ declare namespace api {
356
359
  }
357
360
 
358
361
  interface SwypePaymentProps {
359
- /**
360
- * Where the funds go -- controlled by the host app (merchant).
361
- *
362
- * The merchant sets this prop and can update it at any time; the SDK
363
- * reads it reactively whenever a transfer is created.
364
- */
365
362
  destination: Destination;
366
- /** Called when the transfer reaches COMPLETED status */
367
363
  onComplete?: (transfer: Transfer) => void;
368
- /** Called on unrecoverable error */
369
364
  onError?: (error: string) => void;
370
- /**
371
- * Whether to use in-browser wallet connectors (wagmi) for authorization.
372
- *
373
- * - `true` — always use in-browser wallet connectors (desktop flow).
374
- * - `false` — always use deeplink redirects (webview / mobile flow).
375
- * - `undefined` (default) — auto-detect via user-agent (`isMobile()`).
376
- *
377
- * Set to `false` when rendering inside a WebView where browser-based
378
- * wallet extensions are unavailable.
379
- */
380
365
  useWalletConnector?: boolean;
381
- /**
382
- * Caller-supplied UUID v4 used as the transfer ID for idempotency.
383
- *
384
- * When provided, the transfer is created with this ID instead of a
385
- * randomly generated one. This allows callers to safely retry the payment
386
- * flow without creating duplicate transfers.
387
- */
388
366
  idempotencyKey?: string;
389
- /** Merchant-signed transfer authorization envelope required by the API. */
390
367
  merchantAuthorization?: CreateTransferParams['merchantAuthorization'];
368
+ /** Merchant display name shown in headers and summaries */
369
+ merchantName?: string;
370
+ /** Called when the user taps the back button */
371
+ onBack?: () => void;
391
372
  }
392
- declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
373
+ declare function SwypePayment({ destination, onComplete, onError, useWalletConnector, idempotencyKey, merchantAuthorization, merchantName, onBack, }: SwypePaymentProps): react_jsx_runtime.JSX.Element | null;
393
374
 
394
375
  type AccessTokenGetter = () => Promise<string | null | undefined>;
395
376
  /**