@swype-org/react-sdk 0.2.215 → 0.2.220
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.cjs +230 -254
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -4
- package/dist/index.d.ts +33 -4
- package/dist/index.js +230 -254
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -400,6 +400,17 @@ interface BlinkConfig {
|
|
|
400
400
|
* `useBlinkConfig().enableFullWidget ?? false`.
|
|
401
401
|
*/
|
|
402
402
|
enableFullWidget?: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* When true, the SDK is being rendered inside a native mobile app's in-app
|
|
405
|
+
* browser (e.g. via `deposit-mobile-sdk` opening an SFSafariViewController
|
|
406
|
+
* or Android Custom Tab). Hides the in-screen (X) close buttons (the host
|
|
407
|
+
* app's native chrome handles dismissal) and removes the rounded screen
|
|
408
|
+
* sheet corners so the widget renders edge-to-edge. Defaults to `false`.
|
|
409
|
+
*
|
|
410
|
+
* Optional for backwards compatibility; internal SDK code normalizes via
|
|
411
|
+
* `useBlinkConfig().isMobileApp ?? false`.
|
|
412
|
+
*/
|
|
413
|
+
isMobileApp?: boolean;
|
|
403
414
|
}
|
|
404
415
|
interface BlinkProviderProps {
|
|
405
416
|
/** Base URL for the Blink API (e.g. "http://localhost:3000") */
|
|
@@ -422,6 +433,12 @@ interface BlinkProviderProps {
|
|
|
422
433
|
* before login for unauthenticated users. Defaults to `false`.
|
|
423
434
|
*/
|
|
424
435
|
enableFullWidget?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* When true, the widget is hosted inside a native mobile app's in-app browser.
|
|
438
|
+
* Hides the in-screen (X) close buttons and removes rounded screen corners so
|
|
439
|
+
* the widget renders edge-to-edge. Defaults to `false`.
|
|
440
|
+
*/
|
|
441
|
+
isMobileApp?: boolean;
|
|
425
442
|
children: React.ReactNode;
|
|
426
443
|
}
|
|
427
444
|
/**
|
|
@@ -438,7 +455,7 @@ interface BlinkProviderProps {
|
|
|
438
455
|
* </BlinkProvider>
|
|
439
456
|
* ```
|
|
440
457
|
*/
|
|
441
|
-
declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
|
|
442
459
|
/** Access the Blink SDK configuration. Throws if used outside BlinkProvider. */
|
|
443
460
|
declare function useBlinkConfig(): BlinkConfig;
|
|
444
461
|
/**
|
|
@@ -647,7 +664,9 @@ type ProbeActionCompletionResult = {
|
|
|
647
664
|
* - `detected: false, reason: 'not-found'` — scan completed with no match
|
|
648
665
|
* (`DEPOSIT_TX_NOT_FOUND` for bridges, `APPROVE_NOT_DETECTED` for
|
|
649
666
|
* EVM approves, `APPROVE_SPL_NOT_DETECTED` for Solana approves); safe to
|
|
650
|
-
* prompt the wallet
|
|
667
|
+
* prompt the wallet only when no matching transaction may already have
|
|
668
|
+
* been submitted. Post-submit callers must treat an approve miss as
|
|
669
|
+
* inconclusive and avoid opening a duplicate approve prompt.
|
|
651
670
|
* - `detected: false, reason: 'invalid-state'` — transfer already advanced
|
|
652
671
|
* past CREATED (race); the next orchestrator loop will observe it.
|
|
653
672
|
* - `detected: false, reason: 'error'` — unexpected failure (network, 5xx);
|
|
@@ -1111,13 +1130,14 @@ interface OrchestratorRunOptions {
|
|
|
1111
1130
|
alwaysPauseForOneTap?: boolean;
|
|
1112
1131
|
/**
|
|
1113
1132
|
* When true (default), before presenting the wallet for any of
|
|
1114
|
-
*
|
|
1133
|
+
* SIGN_PERMIT2 / APPROVE_SPL on this run, probe
|
|
1115
1134
|
* the server to see if the action is already satisfied on-chain (e.g.
|
|
1116
1135
|
* user confirmed pre-reload but the PATCH never landed, signed in
|
|
1117
1136
|
* another tab, or the wallet returned a stale error after broadcasting).
|
|
1137
|
+
* APPROVE_PERMIT2 is probed only after the orchestrator has evidence an
|
|
1138
|
+
* approve transaction may already have been submitted.
|
|
1118
1139
|
*
|
|
1119
1140
|
* Probe semantics per action type:
|
|
1120
|
-
* - APPROVE_PERMIT2: backend re-checks ERC-20 allowance for Permit2.
|
|
1121
1141
|
* - SIGN_PERMIT2: backend re-checks Permit2 allowance (single &
|
|
1122
1142
|
* batched paths).
|
|
1123
1143
|
* - APPROVE_SPL: backend re-checks SPL delegate authority.
|
|
@@ -1414,6 +1434,7 @@ interface StepHandlers {
|
|
|
1414
1434
|
/** Leave funding subflow (setup / token picker) back to deposit: restore selection, cancel executor. */
|
|
1415
1435
|
onBackFromSubflow: () => void;
|
|
1416
1436
|
onLogin: () => void;
|
|
1437
|
+
onCancelLogin: () => void;
|
|
1417
1438
|
onSetDepositAmount: (amount: number) => void;
|
|
1418
1439
|
onSetDepositToken: (symbol: string, chainName: string, walletId?: string, tokenAddress?: string, chainId?: number) => void;
|
|
1419
1440
|
onConfirmSetupDeposit: () => void | Promise<void>;
|
|
@@ -1424,6 +1445,14 @@ interface StepRendererFlowProps {
|
|
|
1424
1445
|
authenticated: boolean;
|
|
1425
1446
|
passkeyLoading: boolean;
|
|
1426
1447
|
isDesktop: boolean;
|
|
1448
|
+
/**
|
|
1449
|
+
* True when the SDK is hosted inside a native mobile app's in-app browser.
|
|
1450
|
+
* Suppresses in-screen (X) close buttons (the host's native chrome handles
|
|
1451
|
+
* dismissal) and removes rounded screen corners. Optional for backwards
|
|
1452
|
+
* compatibility with pre-existing test fixtures; treated as `false` when
|
|
1453
|
+
* absent.
|
|
1454
|
+
*/
|
|
1455
|
+
isMobileApp?: boolean;
|
|
1427
1456
|
merchantName?: string;
|
|
1428
1457
|
onBack?: () => void;
|
|
1429
1458
|
onDismiss?: () => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -400,6 +400,17 @@ interface BlinkConfig {
|
|
|
400
400
|
* `useBlinkConfig().enableFullWidget ?? false`.
|
|
401
401
|
*/
|
|
402
402
|
enableFullWidget?: boolean;
|
|
403
|
+
/**
|
|
404
|
+
* When true, the SDK is being rendered inside a native mobile app's in-app
|
|
405
|
+
* browser (e.g. via `deposit-mobile-sdk` opening an SFSafariViewController
|
|
406
|
+
* or Android Custom Tab). Hides the in-screen (X) close buttons (the host
|
|
407
|
+
* app's native chrome handles dismissal) and removes the rounded screen
|
|
408
|
+
* sheet corners so the widget renders edge-to-edge. Defaults to `false`.
|
|
409
|
+
*
|
|
410
|
+
* Optional for backwards compatibility; internal SDK code normalizes via
|
|
411
|
+
* `useBlinkConfig().isMobileApp ?? false`.
|
|
412
|
+
*/
|
|
413
|
+
isMobileApp?: boolean;
|
|
403
414
|
}
|
|
404
415
|
interface BlinkProviderProps {
|
|
405
416
|
/** Base URL for the Blink API (e.g. "http://localhost:3000") */
|
|
@@ -422,6 +433,12 @@ interface BlinkProviderProps {
|
|
|
422
433
|
* before login for unauthenticated users. Defaults to `false`.
|
|
423
434
|
*/
|
|
424
435
|
enableFullWidget?: boolean;
|
|
436
|
+
/**
|
|
437
|
+
* When true, the widget is hosted inside a native mobile app's in-app browser.
|
|
438
|
+
* Hides the in-screen (X) close buttons and removes rounded screen corners so
|
|
439
|
+
* the widget renders edge-to-edge. Defaults to `false`.
|
|
440
|
+
*/
|
|
441
|
+
isMobileApp?: boolean;
|
|
425
442
|
children: React.ReactNode;
|
|
426
443
|
}
|
|
427
444
|
/**
|
|
@@ -438,7 +455,7 @@ interface BlinkProviderProps {
|
|
|
438
455
|
* </BlinkProvider>
|
|
439
456
|
* ```
|
|
440
457
|
*/
|
|
441
|
-
declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
|
|
442
459
|
/** Access the Blink SDK configuration. Throws if used outside BlinkProvider. */
|
|
443
460
|
declare function useBlinkConfig(): BlinkConfig;
|
|
444
461
|
/**
|
|
@@ -647,7 +664,9 @@ type ProbeActionCompletionResult = {
|
|
|
647
664
|
* - `detected: false, reason: 'not-found'` — scan completed with no match
|
|
648
665
|
* (`DEPOSIT_TX_NOT_FOUND` for bridges, `APPROVE_NOT_DETECTED` for
|
|
649
666
|
* EVM approves, `APPROVE_SPL_NOT_DETECTED` for Solana approves); safe to
|
|
650
|
-
* prompt the wallet
|
|
667
|
+
* prompt the wallet only when no matching transaction may already have
|
|
668
|
+
* been submitted. Post-submit callers must treat an approve miss as
|
|
669
|
+
* inconclusive and avoid opening a duplicate approve prompt.
|
|
651
670
|
* - `detected: false, reason: 'invalid-state'` — transfer already advanced
|
|
652
671
|
* past CREATED (race); the next orchestrator loop will observe it.
|
|
653
672
|
* - `detected: false, reason: 'error'` — unexpected failure (network, 5xx);
|
|
@@ -1111,13 +1130,14 @@ interface OrchestratorRunOptions {
|
|
|
1111
1130
|
alwaysPauseForOneTap?: boolean;
|
|
1112
1131
|
/**
|
|
1113
1132
|
* When true (default), before presenting the wallet for any of
|
|
1114
|
-
*
|
|
1133
|
+
* SIGN_PERMIT2 / APPROVE_SPL on this run, probe
|
|
1115
1134
|
* the server to see if the action is already satisfied on-chain (e.g.
|
|
1116
1135
|
* user confirmed pre-reload but the PATCH never landed, signed in
|
|
1117
1136
|
* another tab, or the wallet returned a stale error after broadcasting).
|
|
1137
|
+
* APPROVE_PERMIT2 is probed only after the orchestrator has evidence an
|
|
1138
|
+
* approve transaction may already have been submitted.
|
|
1118
1139
|
*
|
|
1119
1140
|
* Probe semantics per action type:
|
|
1120
|
-
* - APPROVE_PERMIT2: backend re-checks ERC-20 allowance for Permit2.
|
|
1121
1141
|
* - SIGN_PERMIT2: backend re-checks Permit2 allowance (single &
|
|
1122
1142
|
* batched paths).
|
|
1123
1143
|
* - APPROVE_SPL: backend re-checks SPL delegate authority.
|
|
@@ -1414,6 +1434,7 @@ interface StepHandlers {
|
|
|
1414
1434
|
/** Leave funding subflow (setup / token picker) back to deposit: restore selection, cancel executor. */
|
|
1415
1435
|
onBackFromSubflow: () => void;
|
|
1416
1436
|
onLogin: () => void;
|
|
1437
|
+
onCancelLogin: () => void;
|
|
1417
1438
|
onSetDepositAmount: (amount: number) => void;
|
|
1418
1439
|
onSetDepositToken: (symbol: string, chainName: string, walletId?: string, tokenAddress?: string, chainId?: number) => void;
|
|
1419
1440
|
onConfirmSetupDeposit: () => void | Promise<void>;
|
|
@@ -1424,6 +1445,14 @@ interface StepRendererFlowProps {
|
|
|
1424
1445
|
authenticated: boolean;
|
|
1425
1446
|
passkeyLoading: boolean;
|
|
1426
1447
|
isDesktop: boolean;
|
|
1448
|
+
/**
|
|
1449
|
+
* True when the SDK is hosted inside a native mobile app's in-app browser.
|
|
1450
|
+
* Suppresses in-screen (X) close buttons (the host's native chrome handles
|
|
1451
|
+
* dismissal) and removes rounded screen corners. Optional for backwards
|
|
1452
|
+
* compatibility with pre-existing test fixtures; treated as `false` when
|
|
1453
|
+
* absent.
|
|
1454
|
+
*/
|
|
1455
|
+
isMobileApp?: boolean;
|
|
1427
1456
|
merchantName?: string;
|
|
1428
1457
|
onBack?: () => void;
|
|
1429
1458
|
onDismiss?: () => void;
|