@swype-org/react-sdk 0.2.186 → 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.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode, MouseEvent, HTMLAttributeAnchorTarget } from 'react';
3
3
 
4
- type ChainFamily = 'evm' | 'svm';
4
+ type ChainFamily = 'evm' | 'svm' | 'tvm';
5
5
  /** Wallet provider (e.g. MetaMask or Phantom) */
6
6
  interface Provider {
7
7
  id: string;
@@ -64,6 +64,8 @@ interface Account {
64
64
  name: string;
65
65
  /** Optional user-chosen display name for this account. */
66
66
  nickname?: string | null;
67
+ /** Optional display logo URL, e.g. the selected Reown wallet icon. */
68
+ logoURI?: string;
67
69
  wallets: Wallet[];
68
70
  /** Remaining One-Tap allowance in USD, or null when not configured. */
69
71
  remainingAllowance?: number | null;
@@ -92,6 +94,14 @@ interface AuthorizationAction {
92
94
  orderIndex: number;
93
95
  metadata?: Record<string, unknown>;
94
96
  }
97
+ interface WalletConnectAccountMetadata {
98
+ reownWalletId: string;
99
+ name: string;
100
+ imageUrl?: string;
101
+ mobileNativeLink?: string;
102
+ mobileUniversalLink?: string;
103
+ desktopNativeLink?: string;
104
+ }
95
105
  /** Full authorization session with ordered actions */
96
106
  interface AuthorizationSessionDetail {
97
107
  id: string;
@@ -194,7 +204,18 @@ interface ErrorResponse {
194
204
  interface ActionExecutionResult {
195
205
  actionId: string;
196
206
  type: string;
197
- status: 'success' | 'error';
207
+ /**
208
+ * `pending` is a soft-halt sentinel: the action did not succeed, but it
209
+ * also did not produce a user-visible error. Used by `OPEN_PROVIDER` on
210
+ * desktop when no wallet extension is installed (or the user dismissed
211
+ * the connect prompt) and a parallel cross-device QR / auth-app path is
212
+ * still in flight. The session executor unwinds without throwing and
213
+ * the caller should not restore selection — `useDesktopWaitPollingEffect`
214
+ * (or the merchant's own polling) drives eventual completion.
215
+ */
216
+ status: 'success' | 'error' | 'pending';
217
+ /** When `status === 'pending'`, identifies the soft-halt reason. */
218
+ pendingReason?: 'awaiting-external-authorization';
198
219
  message: string;
199
220
  data?: unknown;
200
221
  }
@@ -210,6 +231,8 @@ interface SourceOption {
210
231
  rawBalance: string;
211
232
  walletId?: string;
212
233
  status?: string;
234
+ walletName?: string;
235
+ walletLogoUrl?: string;
213
236
  }
214
237
  /** User's chain+token selection for the SELECT_SOURCE action. */
215
238
  interface SourceSelection {
@@ -224,6 +247,49 @@ interface Destination {
224
247
  address: string;
225
248
  };
226
249
  }
250
+ type ManualTransferStatus = 'awaiting_deposit' | 'deposit_received' | 'routing' | 'completed' | 'refunded' | 'failed' | 'wrong_token';
251
+ interface ManualTransferSourceOption {
252
+ chainId: number;
253
+ chainName: string;
254
+ chainFamily: 'evm' | 'svm' | 'tvm';
255
+ tokenSymbol: string;
256
+ tokenAddress: string;
257
+ decimals: number;
258
+ minAmountUsd: string;
259
+ }
260
+ interface ManualTransferSlippageSnapshot {
261
+ estimatedOutput: string;
262
+ slippageValue: string;
263
+ slippagePercentage: string;
264
+ slippageValueCurrency: string;
265
+ createdAt: string;
266
+ }
267
+ interface ManualTransferSession {
268
+ sessionId: string;
269
+ idempotencyKey: string;
270
+ merchantId: string;
271
+ destination: Destination;
272
+ source: {
273
+ chainId: number;
274
+ tokenAddress: string;
275
+ tokenSymbol: string;
276
+ };
277
+ refundTo: string | null;
278
+ depositAddress: string;
279
+ requestId: string;
280
+ status: ManualTransferStatus;
281
+ minAmountUsd: string;
282
+ slippage: ManualTransferSlippageSnapshot | null;
283
+ quoteValidUntil: string;
284
+ depositTxHashes: string[];
285
+ destinationTxHash: string | null;
286
+ refundTxHashes: string[];
287
+ deliveredAmountUsd: string | null;
288
+ errorCode: string | null;
289
+ errorMessage: string | null;
290
+ createDate: string;
291
+ updateDate: string;
292
+ }
227
293
  /** Merchant-signed authorization envelope required for transfer creation. */
228
294
  interface MerchantAuthorization {
229
295
  merchantId: string;
@@ -300,6 +366,7 @@ interface ThemeTokens {
300
366
  shadowLg: string;
301
367
  radius: string;
302
368
  radiusLg: string;
369
+ fontFamily: string;
303
370
  }
304
371
  declare const darkTheme: ThemeTokens;
305
372
  declare const lightTheme: ThemeTokens;
@@ -323,6 +390,27 @@ interface BlinkConfig {
323
390
  depositAmount: number | null;
324
391
  /** Update the deposit amount from a host-app component */
325
392
  setDepositAmount: (amount: number | null) => void;
393
+ /**
394
+ * When true, render the new full-widget entry experience (Deposit Options
395
+ * screen with Crypto/Cash toggle and source rows) before the login flow for
396
+ * unauthenticated users. Defaults to `false` for backwards compatibility.
397
+ *
398
+ * Optional on `BlinkConfig` so consumers of this type that pre-date the flag
399
+ * keep type-checking. Internal SDK code should normalize via
400
+ * `useBlinkConfig().enableFullWidget ?? false`.
401
+ */
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;
326
414
  }
327
415
  interface BlinkProviderProps {
328
416
  /** Base URL for the Blink API (e.g. "http://localhost:3000") */
@@ -340,6 +428,17 @@ interface BlinkProviderProps {
340
428
  privyAppId?: string;
341
429
  /** Minimum USD amount accepted when no payment-specific deposit amount is set. */
342
430
  minTransferAmountUsd?: number;
431
+ /**
432
+ * When true, render the new full-widget entry experience (DepositOptionsScreen)
433
+ * before login for unauthenticated users. Defaults to `false`.
434
+ */
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;
343
442
  children: React.ReactNode;
344
443
  }
345
444
  /**
@@ -356,7 +455,7 @@ interface BlinkProviderProps {
356
455
  * </BlinkProvider>
357
456
  * ```
358
457
  */
359
- declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
458
+ declare function BlinkProvider({ apiBaseUrl, theme, privyAppId, minTransferAmountUsd, enableFullWidget, isMobileApp, children, }: BlinkProviderProps): react_jsx_runtime.JSX.Element;
360
459
  /** Access the Blink SDK configuration. Throws if used outside BlinkProvider. */
361
460
  declare function useBlinkConfig(): BlinkConfig;
362
461
  /**
@@ -395,6 +494,8 @@ interface CreateAccountParams {
395
494
  * {@link setAuthorizationSessionProvider} once the user taps a wallet.
396
495
  */
397
496
  providerId?: string;
497
+ connectionTransport?: 'walletconnect';
498
+ walletConnect?: WalletConnectAccountMetadata;
398
499
  /** Optional user-chosen display name. */
399
500
  nickname?: string;
400
501
  paymentIntent?: {
@@ -515,7 +616,29 @@ declare function setAuthorizationSessionProvider(apiBaseUrl: string, sessionId:
515
616
  declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string, config: {
516
617
  defaultAllowance: number;
517
618
  }): Promise<void>;
619
+ interface FetchManualTransferSourcesParams {
620
+ merchantAuthorization: MerchantAuthorization;
621
+ destination: Destination;
622
+ }
623
+ declare function fetchManualTransferSources(apiBaseUrl: string, params: FetchManualTransferSourcesParams): Promise<ManualTransferSourceOption[]>;
624
+ interface CreateManualTransferParams {
625
+ merchantAuthorization: MerchantAuthorization;
626
+ destination: Destination;
627
+ source: {
628
+ chainId: number;
629
+ tokenAddress: string;
630
+ };
631
+ idempotencyKey?: string;
632
+ }
633
+ declare function createManualTransfer(apiBaseUrl: string, params: CreateManualTransferParams): Promise<ManualTransferSession>;
634
+ declare function fetchManualTransferSession(apiBaseUrl: string, sessionId: string): Promise<ManualTransferSession>;
518
635
  declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
636
+ interface ActionTransactionReceiptWaitResult {
637
+ txHash: string;
638
+ chainName: string;
639
+ status: 'success';
640
+ }
641
+ declare function waitForActionTransactionReceipt(apiBaseUrl: string, actionId: string, txHash: string): Promise<ActionTransactionReceiptWaitResult>;
519
642
  type ProbeActionCompletionResult = {
520
643
  detected: true;
521
644
  session: AuthorizationSessionDetail;
@@ -541,7 +664,9 @@ type ProbeActionCompletionResult = {
541
664
  * - `detected: false, reason: 'not-found'` — scan completed with no match
542
665
  * (`DEPOSIT_TX_NOT_FOUND` for bridges, `APPROVE_NOT_DETECTED` for
543
666
  * EVM approves, `APPROVE_SPL_NOT_DETECTED` for Solana approves); safe to
544
- * 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.
545
670
  * - `detected: false, reason: 'invalid-state'` — transfer already advanced
546
671
  * past CREATED (race); the next orchestrator loop will observe it.
547
672
  * - `detected: false, reason: 'error'` — unexpected failure (network, 5xx);
@@ -555,20 +680,26 @@ type ProbeActionCompletionResult = {
555
680
  */
556
681
  declare function probeActionCompletion(apiBaseUrl: string, actionId: string): Promise<ProbeActionCompletionResult>;
557
682
 
683
+ type api_ActionTransactionReceiptWaitResult = ActionTransactionReceiptWaitResult;
558
684
  type api_BridgeCall = BridgeCall;
559
685
  type api_CreateAccountAuthorizationSessionOptions = CreateAccountAuthorizationSessionOptions;
560
686
  type api_CreateAccountParams = CreateAccountParams;
687
+ type api_CreateManualTransferParams = CreateManualTransferParams;
561
688
  type api_CreateTransferParams = CreateTransferParams;
689
+ type api_FetchManualTransferSourcesParams = FetchManualTransferSourcesParams;
562
690
  type api_ProbeActionCompletionResult = ProbeActionCompletionResult;
563
691
  type api_TransferQuote = TransferQuote;
564
692
  declare const api_createAccount: typeof createAccount;
565
693
  declare const api_createAccountAuthorizationSession: typeof createAccountAuthorizationSession;
694
+ declare const api_createManualTransfer: typeof createManualTransfer;
566
695
  declare const api_createTransfer: typeof createTransfer;
567
696
  declare const api_fetchAccount: typeof fetchAccount;
568
697
  declare const api_fetchAccounts: typeof fetchAccounts;
569
698
  declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
570
699
  declare const api_fetchAuthorizationSessionByToken: typeof fetchAuthorizationSessionByToken;
571
700
  declare const api_fetchChains: typeof fetchChains;
701
+ declare const api_fetchManualTransferSession: typeof fetchManualTransferSession;
702
+ declare const api_fetchManualTransferSources: typeof fetchManualTransferSources;
572
703
  declare const api_fetchMerchantPublicKey: typeof fetchMerchantPublicKey;
573
704
  declare const api_fetchProviders: typeof fetchProviders;
574
705
  declare const api_fetchTransfer: typeof fetchTransfer;
@@ -583,12 +714,16 @@ declare const api_setTransferSource: typeof setTransferSource;
583
714
  declare const api_signTransfer: typeof signTransfer;
584
715
  declare const api_updateUserConfig: typeof updateUserConfig;
585
716
  declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
717
+ declare const api_waitForActionTransactionReceipt: typeof waitForActionTransactionReceipt;
586
718
  declare namespace api {
587
- export { type api_BridgeCall as BridgeCall, type api_CreateAccountAuthorizationSessionOptions as CreateAccountAuthorizationSessionOptions, type api_CreateAccountParams as CreateAccountParams, type api_CreateTransferParams as CreateTransferParams, type api_ProbeActionCompletionResult as ProbeActionCompletionResult, type api_TransferQuote as TransferQuote, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchAuthorizationSessionByToken as fetchAuthorizationSessionByToken, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_postTransferQuote as postTransferQuote, api_probeActionCompletion as probeActionCompletion, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAuthorizationSessionProvider as setAuthorizationSessionProvider, api_setTransferSource as setTransferSource, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
719
+ export { type api_ActionTransactionReceiptWaitResult as ActionTransactionReceiptWaitResult, type api_BridgeCall as BridgeCall, type api_CreateAccountAuthorizationSessionOptions as CreateAccountAuthorizationSessionOptions, type api_CreateAccountParams as CreateAccountParams, type api_CreateManualTransferParams as CreateManualTransferParams, type api_CreateTransferParams as CreateTransferParams, type api_FetchManualTransferSourcesParams as FetchManualTransferSourcesParams, type api_ProbeActionCompletionResult as ProbeActionCompletionResult, type api_TransferQuote as TransferQuote, api_createAccount as createAccount, api_createAccountAuthorizationSession as createAccountAuthorizationSession, api_createManualTransfer as createManualTransfer, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchAuthorizationSessionByToken as fetchAuthorizationSessionByToken, api_fetchChains as fetchChains, api_fetchManualTransferSession as fetchManualTransferSession, api_fetchManualTransferSources as fetchManualTransferSources, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_postTransferQuote as postTransferQuote, api_probeActionCompletion as probeActionCompletion, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_setAuthorizationSessionProvider as setAuthorizationSessionProvider, api_setTransferSource as setTransferSource, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession, api_waitForActionTransactionReceipt as waitForActionTransactionReceipt };
588
720
  }
589
721
 
590
722
  interface BlinkPaymentProps {
591
723
  destination: Destination;
724
+ /** Dev/testing shortcut: skip directly to a specific screen on first render. */
725
+ initialScreen?: 'manual-transfer';
726
+ mock?: boolean;
592
727
  onComplete?: (transfer: Transfer) => void;
593
728
  onError?: (error: string) => void;
594
729
  useWalletConnector?: boolean;
@@ -608,18 +743,35 @@ interface SelectSourceChainChoice {
608
743
  tokens: {
609
744
  tokenSymbol: string;
610
745
  balance: number;
746
+ walletName?: string;
747
+ walletLogoUrl?: string;
611
748
  }[];
612
749
  }
613
750
 
614
- type ScreenName = 'loading' | 'login' | 'success' | 'processing' | 'confirm-sign' | 'select-source' | 'setup' | 'open-wallet' | 'setup-deposit' | 'passkey-ready' | 'wallet-picker' | 'token-picker' | 'guest-source-picker' | 'amount-too-low' | 'deposit';
751
+ type ScreenName = 'loading' | 'manual-transfer' | 'login' | 'success' | 'processing' | 'confirm-sign' | 'select-source' | 'setup' | 'open-wallet' | 'setup-deposit' | 'passkey-ready' | 'wallet-picker' | 'token-picker' | 'guest-source-picker' | 'amount-too-low' | 'deposit' | 'deposit-options';
615
752
  interface MobileFlowState {
616
753
  deeplinkUri: string;
617
754
  providerId: string | null;
618
755
  }
756
+ /**
757
+ * Desktop wait state — populated while the inline wagmi authorization executor
758
+ * is running and we want OpenWalletScreen to render a QR fallback so a user
759
+ * who has the wallet on their phone can complete via auth-app instead.
760
+ */
761
+ interface DesktopWaitState {
762
+ sessionId: string;
763
+ sessionUri: string;
764
+ walletDeeplinks: WalletDeeplink[] | null;
765
+ providerId: string | null;
766
+ }
619
767
  type PaymentPhase = {
620
768
  step: 'initializing';
769
+ } | {
770
+ step: 'manual-transfer';
621
771
  } | {
622
772
  step: 'login';
773
+ } | {
774
+ step: 'deposit-options';
623
775
  } | {
624
776
  step: 'data-loading';
625
777
  } | {
@@ -630,6 +782,7 @@ type PaymentPhase = {
630
782
  } | {
631
783
  step: 'wallet-setup';
632
784
  mobile: MobileFlowState | null;
785
+ desktopWait?: DesktopWaitState | null;
633
786
  accountId: string | null;
634
787
  } | {
635
788
  step: 'select-source';
@@ -664,7 +817,10 @@ type PaymentPhase = {
664
817
  declare function screenForPhase(phase: PaymentPhase): ScreenName;
665
818
 
666
819
  type WalletClient = {
667
- request: (...args: any[]) => Promise<unknown>;
820
+ request: (args: {
821
+ method: string;
822
+ params?: unknown[];
823
+ }) => Promise<unknown>;
668
824
  };
669
825
  /**
670
826
  * Wallets report atomic batching support in two known formats:
@@ -703,7 +859,7 @@ interface WalletCapabilitiesDebugSnapshot {
703
859
  * Queries wallet_getCapabilities for the given address.
704
860
  * Returns an empty record if the wallet doesn't support EIP-5792.
705
861
  */
706
- declare function getWalletCapabilities(walletClient: WalletClient, address: string): Promise<WalletCapabilities>;
862
+ declare function getWalletCapabilities(walletClient: WalletClient, address: string, chainId?: number | null): Promise<WalletCapabilities>;
707
863
  declare function getAtomicBatchSupportDebugInfo(capabilities: WalletCapabilities, chainId: number): AtomicBatchSupportDebugInfo;
708
864
  declare function supportsAtomicBatch(capabilities: WalletCapabilities, chainId: number): boolean;
709
865
  declare function supportsPaymasterService(capabilities: WalletCapabilities, chainId: number): boolean;
@@ -747,16 +903,44 @@ interface BatchedActionExecutionInput {
747
903
  action: AuthorizationAction;
748
904
  sessionId: string | null;
749
905
  }
750
-
906
+ /**
907
+ * Result resolved by an external (non-WC) connect that may race the WalletConnect
908
+ * pairing — currently a wagmi `connectAsync` against an EIP-6963 extension that
909
+ * matches the picked Reown wallet. When this Promise resolves before WC pairs,
910
+ * the WC `connect()` is invalidated and we report the extension's wallet to the
911
+ * backend instead. The action result carries `transport: 'wagmi'` so the
912
+ * dispatcher flips `activeEvmTransportRef` to `'wagmi'` and the rest of the
913
+ * session's actions run through the wagmi branch (extension popups) rather than
914
+ * the WC runtime.
915
+ */
916
+ interface WalletConnectExternalConnectResult {
917
+ accounts: readonly string[];
918
+ /** Numeric chain id (e.g. 8453 for Base). The executor formats it as 0x-hex. */
919
+ chainId: number;
920
+ }
751
921
  type ExecutionResult = {
752
922
  status: 'completed';
753
923
  } | {
754
924
  status: 'cancelled';
925
+ }
926
+ /**
927
+ * Returned when an action returned a soft `pending` sentinel (e.g.
928
+ * desktop wait active and no wallet extension installed). The wagmi
929
+ * inline path has stopped without error; an external path
930
+ * (cross-device QR → auth-app → session polling) is expected to drive
931
+ * completion. Callers should leave `state.desktopWait` pinned and not
932
+ * restore selection.
933
+ */
934
+ | {
935
+ status: 'awaiting-external';
936
+ reason: string;
755
937
  };
756
938
 
757
939
  interface ExecuteActionOptions {
758
940
  /** Forwarded to actions that may need server polling (e.g. SIGN_PERMIT2 typedData). */
759
941
  sessionId?: string;
942
+ /** WalletConnect account/runtime key that owns this action. */
943
+ walletConnectRuntimeKey?: string;
760
944
  /**
761
945
  * Forwarded to APPROVE_SPL: invoked once after the Phantom signature is
762
946
  * returned and before client-side on-chain confirmation begins. The
@@ -764,6 +948,18 @@ interface ExecuteActionOptions {
764
948
  * cue while the SDK polls for `confirmed`.
765
949
  */
766
950
  onApproveSplConfirming?: (action: AuthorizationAction) => void;
951
+ /** Emits the WalletConnect pairing URI so UI can render a QR/deeplink while connect is pending. */
952
+ onWalletConnectDisplayUri?: (uri: string) => void;
953
+ /**
954
+ * Optional Promise resolved by an external (non-WC) connection that races the
955
+ * WalletConnect pairing for `OPEN_PROVIDER`. Currently used by
956
+ * `handleSelectWalletConnectWallet` to race a wagmi `connectAsync` against an
957
+ * EIP-6963 extension matching the picked Reown wallet. When this resolves
958
+ * before WC pairs, the executor invalidates the WC runtime and returns the
959
+ * extension's address with `transport: 'wagmi'`, which causes the dispatcher
960
+ * to flip `activeEvmTransportRef` so the rest of the session runs on wagmi.
961
+ */
962
+ walletConnectExternalConnect?: Promise<WalletConnectExternalConnectResult>;
767
963
  }
768
964
  interface UseAuthorizationExecutorResult {
769
965
  executing: boolean;
@@ -786,6 +982,8 @@ interface UseAuthorizationExecutorResult {
786
982
  resolveSelectSource: (selection: SourceSelection) => void;
787
983
  /** Reject paused SELECT_SOURCE and reset executor flags (e.g. user backed to deposit). */
788
984
  cancelPendingExecution: () => void;
985
+ /** Clear the persisted WalletConnect session so the next connection re-pairs. */
986
+ resetWalletConnect: (runtimeKey?: string) => Promise<void>;
789
987
  /** Transaction hash of the batched wallet_sendCalls, available after a successful batch. */
790
988
  batchTxHash: string | null;
791
989
  /**
@@ -803,6 +1001,8 @@ interface UseAuthorizationExecutorResult {
803
1001
  */
804
1002
  executeBatch: (actions: BatchedActionExecutionInput[], options?: {
805
1003
  paymasterUrl?: string;
1004
+ walletConnectRuntimeKey?: string;
1005
+ onWalletConnectDisplayUri?: (uri: string) => void;
806
1006
  }) => Promise<BatchedWalletCallsResult>;
807
1007
  /**
808
1008
  * SVM first-transfer combined path: signs the leading APPROVE_SPL +
@@ -842,6 +1042,14 @@ interface UseAuthorizationExecutorResult {
842
1042
  addResult: (result: ActionExecutionResult) => void;
843
1043
  /** Set the error message. */
844
1044
  setError: (error: string | null) => void;
1045
+ /**
1046
+ * Toggle the soft-halt path for `OPEN_PROVIDER` no-connector / user-rejection
1047
+ * outcomes. When `true`, those failure modes return a `pending` sentinel
1048
+ * instead of an error so a parallel cross-device authorization (desktop
1049
+ * QR scan → auth-app) can drive completion. `BlinkPayment` mirrors
1050
+ * `state.desktopWait != null` into this flag.
1051
+ */
1052
+ setExternalAuthorizationAvailable: (available: boolean) => void;
845
1053
  /**
846
1054
  * Convenience wrapper: fetches a single session's actions, executes them,
847
1055
  * and reports completions. Suitable for simple single-session flows.
@@ -880,6 +1088,19 @@ type OrchestratorResult = {
880
1088
  status: 'completed';
881
1089
  } | {
882
1090
  status: 'cancelled';
1091
+ }
1092
+ /**
1093
+ * Returned when an action returned a soft `pending` sentinel (currently
1094
+ * only `OPEN_PROVIDER` on desktop when `state.desktopWait` is active and
1095
+ * either no matching wallet extension is installed or the user dismissed
1096
+ * the connect prompt). The wagmi inline loop has stopped without
1097
+ * surfacing an error; an external path (cross-device QR / auth-app /
1098
+ * session polling) is expected to drive completion. Callers should leave
1099
+ * `state.desktopWait` pinned and not restore selection.
1100
+ */
1101
+ | {
1102
+ status: 'awaiting-external';
1103
+ reason: string;
883
1104
  };
884
1105
  interface OrchestratorRunOptions {
885
1106
  /**
@@ -909,13 +1130,14 @@ interface OrchestratorRunOptions {
909
1130
  alwaysPauseForOneTap?: boolean;
910
1131
  /**
911
1132
  * When true (default), before presenting the wallet for any of
912
- * APPROVE_PERMIT2 / SIGN_PERMIT2 / APPROVE_SPL / EXECUTE_BRIDGE on this run, probe
1133
+ * SIGN_PERMIT2 / APPROVE_SPL on this run, probe
913
1134
  * the server to see if the action is already satisfied on-chain (e.g.
914
1135
  * user confirmed pre-reload but the PATCH never landed, signed in
915
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.
916
1139
  *
917
1140
  * Probe semantics per action type:
918
- * - APPROVE_PERMIT2: backend re-checks ERC-20 allowance for Permit2.
919
1141
  * - SIGN_PERMIT2: backend re-checks Permit2 allowance (single &
920
1142
  * batched paths).
921
1143
  * - APPROVE_SPL: backend re-checks SPL delegate authority.
@@ -941,6 +1163,21 @@ interface OrchestratorRunOptions {
941
1163
  * surface for SDK consumers that drive their own UI.
942
1164
  */
943
1165
  onApproveSplConfirming?: (action: AuthorizationAction) => void;
1166
+ /** Emits the direct WalletConnect pairing URI while OPEN_PROVIDER is connecting. */
1167
+ onWalletConnectDisplayUri?: (uri: string) => void;
1168
+ /**
1169
+ * Optional Promise that races the WalletConnect pairing for OPEN_PROVIDER.
1170
+ * Used by `handleSelectWalletConnectWallet` when the picked Reown wallet is
1171
+ * also installed as an EIP-6963 extension: the SDK kicks off a wagmi
1172
+ * `connectAsync` against the extension in parallel with the WC orchestrator
1173
+ * run. Whichever resolves first wins; if the extension wins, the executor
1174
+ * invalidates the WC runtime and the rest of the session executes via the
1175
+ * wagmi branch.
1176
+ */
1177
+ walletConnectExternalConnect?: Promise<{
1178
+ accounts: readonly string[];
1179
+ chainId: number;
1180
+ }>;
944
1181
  }
945
1182
  interface UseAuthorizationOrchestratorResult {
946
1183
  /**
@@ -983,6 +1220,8 @@ interface UseAuthorizationOrchestratorResult {
983
1220
  resolveOneTapPause: () => void;
984
1221
  /** The awaiting-limit action currently waiting on one-tap setup. */
985
1222
  pendingOneTapAction: AuthorizationAction | null;
1223
+ /** True after the most recent run drained all authorization actions. */
1224
+ orchestratorCompleted: boolean;
986
1225
  /** Cancel any paused setup flow and reject the current orchestrator run. */
987
1226
  cancelPendingFlow: () => void;
988
1227
  }
@@ -992,6 +1231,26 @@ interface UseAuthorizationOrchestratorDeps {
992
1231
  }
993
1232
  declare function useAuthorizationOrchestrator(deps: UseAuthorizationOrchestratorDeps): UseAuthorizationOrchestratorResult;
994
1233
 
1234
+ interface ReownWallet {
1235
+ id: string;
1236
+ name: string;
1237
+ imageUrl?: string;
1238
+ mobile?: ReownWalletLinks;
1239
+ desktop?: ReownWalletLinks;
1240
+ rdns?: string;
1241
+ injected?: ReownInjectedWallet[];
1242
+ chains?: string[];
1243
+ sdks?: string[];
1244
+ }
1245
+ interface ReownWalletLinks {
1246
+ native?: string;
1247
+ universal?: string;
1248
+ }
1249
+ interface ReownInjectedWallet {
1250
+ namespace?: string;
1251
+ injectedId: string;
1252
+ }
1253
+
995
1254
  interface PreparedSession {
996
1255
  uri: string;
997
1256
  transferId?: string;
@@ -1057,6 +1316,24 @@ interface PaymentState {
1057
1316
  * (after setup Approve / token reauth). Cleared when the executor idles.
1058
1317
  */
1059
1318
  standardDesktopInlineOpenWallet: boolean;
1319
+ /**
1320
+ * Desktop standard flow: per-provider session URI and walletDeeplinks captured when the
1321
+ * inline executor is dispatched. Drives the QR fallback on `OpenWalletScreen` so a
1322
+ * desktop user with the wallet on their phone can complete via auth-app instead.
1323
+ * Cleared when `standardDesktopInlineOpenWallet` is unpinned.
1324
+ *
1325
+ * `sessionId` is captured separately from `sessionUri` so the desktop polling
1326
+ * effect can call `fetchAuthorizationSession(sessionId)` directly without
1327
+ * having to parse the URI.
1328
+ */
1329
+ desktopWait: {
1330
+ sessionId: string;
1331
+ sessionUri: string;
1332
+ walletDeeplinks: WalletDeeplink[] | null;
1333
+ providerId: string | null;
1334
+ walletName?: string;
1335
+ walletLogoUrl?: string;
1336
+ } | null;
1060
1337
  /**
1061
1338
  * Mobile flow: pin OpenWalletScreen (in loading mode) while
1062
1339
  * `createAccountAuthorizationSession` is in flight, i.e. between the
@@ -1102,10 +1379,19 @@ interface PaymentState {
1102
1379
  amountTooLow: {
1103
1380
  minAmountUsd: number;
1104
1381
  } | null;
1382
+ /**
1383
+ * When true, route unauthenticated users to `DepositOptionsScreen` (the new
1384
+ * full-widget entry point) before login. Mirrored from `BlinkConfig` and
1385
+ * preserved across `LOGOUT` so post-logout users still land on the
1386
+ * options screen.
1387
+ */
1388
+ enableFullWidget: boolean;
1105
1389
  }
1106
1390
  interface InitialStateConfig {
1107
1391
  depositAmount: number | null;
1108
1392
  activeCredentialId: string | null;
1393
+ initialPhase?: PaymentPhase;
1394
+ enableFullWidget?: boolean;
1109
1395
  }
1110
1396
  declare function createInitialState(config: InitialStateConfig): PaymentState;
1111
1397
 
@@ -1114,6 +1400,7 @@ interface StepHandlers {
1114
1400
  onSignupWithPasskey: () => void;
1115
1401
  onPrepareProvider: (providerId: string) => Promise<PreparedSession | null>;
1116
1402
  onSelectProvider: (providerId: string, preparedSession?: PreparedSession) => Promise<void>;
1403
+ onSelectWalletConnectWallet?: (wallet: ReownWallet) => Promise<void>;
1117
1404
  onContinueConnection: (accountId: string) => void;
1118
1405
  onSelectAccount: (accountId: string) => void;
1119
1406
  onPay: (amount: number, overrides?: {
@@ -1147,6 +1434,7 @@ interface StepHandlers {
1147
1434
  /** Leave funding subflow (setup / token picker) back to deposit: restore selection, cancel executor. */
1148
1435
  onBackFromSubflow: () => void;
1149
1436
  onLogin: () => void;
1437
+ onCancelLogin: () => void;
1150
1438
  onSetDepositAmount: (amount: number) => void;
1151
1439
  onSetDepositToken: (symbol: string, chainName: string, walletId?: string, tokenAddress?: string, chainId?: number) => void;
1152
1440
  onConfirmSetupDeposit: () => void | Promise<void>;
@@ -1157,11 +1445,28 @@ interface StepRendererFlowProps {
1157
1445
  authenticated: boolean;
1158
1446
  passkeyLoading: boolean;
1159
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;
1160
1456
  merchantName?: string;
1161
1457
  onBack?: () => void;
1162
1458
  onDismiss?: () => void;
1163
1459
  depositAmount: number | null;
1164
1460
  minTransferAmountUsd: number;
1461
+ /** Needed to render ManualTransferFlow when phase is manual-transfer. */
1462
+ destination: Destination;
1463
+ merchantAuthorization?: CreateManualTransferParams['merchantAuthorization'];
1464
+ idempotencyKey?: string;
1465
+ mock?: boolean;
1466
+ /** Host-level completion callback, forwarded to ManualTransferFlow. */
1467
+ onComplete?: (transfer: Transfer) => void;
1468
+ /** Host-level error callback, forwarded to ManualTransferFlow. */
1469
+ onError?: (error: string) => void;
1165
1470
  }
1166
1471
  /** Polling, signing, and auth-executor surface. */
1167
1472
  interface StepRendererRemoteProps {
@@ -1173,6 +1478,8 @@ interface StepRendererRemoteProps {
1173
1478
  authExecutorCurrentAction?: AuthorizationAction | null;
1174
1479
  /** SIGN_PERMIT2 action paused for one-tap setup; null until the limit screen is actionable. */
1175
1480
  pendingOneTapSetup?: AuthorizationAction | null;
1481
+ /** True when all setup authorization actions for the active account/session are complete. */
1482
+ setupAuthorizationComplete?: boolean;
1176
1483
  transferSigningSigning: boolean;
1177
1484
  transferSigningError: string | null;
1178
1485
  transferSigningPasskeyDismissed?: boolean;
@@ -1562,11 +1869,12 @@ interface WalletPickerScreenProps {
1562
1869
  directLinkCards?: boolean;
1563
1870
  onPrepareProvider: (providerId: string) => Promise<PreparedSession | null>;
1564
1871
  onSelectProvider: (providerId: string, preparedSession?: PreparedSession) => Promise<void>;
1872
+ onSelectWalletConnectWallet?: (wallet: ReownWallet) => Promise<void>;
1565
1873
  onBack?: () => void;
1566
1874
  onLogout?: () => void;
1567
1875
  isDesktop?: boolean;
1568
1876
  }
1569
- declare function WalletPickerScreen({ providers, loading, useDeeplink, error, preparedSessionsByProvider, preparingLinks, directLinkCards, onPrepareProvider, onSelectProvider, onBack, onLogout, isDesktop, }: WalletPickerScreenProps): react_jsx_runtime.JSX.Element;
1877
+ declare function WalletPickerScreen({ providers, loading, useDeeplink, error, preparedSessionsByProvider, preparingLinks, directLinkCards, onPrepareProvider, onSelectProvider, onSelectWalletConnectWallet, onBack, onLogout, isDesktop, }: WalletPickerScreenProps): react_jsx_runtime.JSX.Element;
1570
1878
 
1571
1879
  interface SetupScreenProps {
1572
1880
  onSetupOneTap: (limit: number) => void;
@@ -1732,6 +2040,8 @@ interface ChainChoice$1 {
1732
2040
  tokens: {
1733
2041
  tokenSymbol: string;
1734
2042
  balance: number;
2043
+ walletName?: string;
2044
+ walletLogoUrl?: string;
1735
2045
  }[];
1736
2046
  }
1737
2047
  interface SelectSourceScreenProps {
@@ -1756,6 +2066,8 @@ interface DepositSourceAccount {
1756
2066
  id: string;
1757
2067
  /** Provider / account name (e.g. "MetaMask"). Used to look up a logo via KNOWN_LOGOS. */
1758
2068
  name: string;
2069
+ /** Optional account display logo, e.g. the selected Reown wallet icon. */
2070
+ logoURI?: string;
1759
2071
  /** Full wallet address; a shortened suffix "...abcd" is shown on the right. */
1760
2072
  address?: string | null;
1761
2073
  }
@@ -1837,7 +2149,7 @@ type TransferPhase = 'creating' | 'signing' | 'submitting' | 'sent';
1837
2149
  interface TransferStatusBaseProps {
1838
2150
  phase: TransferPhase;
1839
2151
  error: string | null;
1840
- onLogout: () => void;
2152
+ onLogout?: () => void;
1841
2153
  /**
1842
2154
  * Optional retry hook. Setup flows wire this to `orchestrator.restart()`;
1843
2155
  * deposit flows wire it only after the first passkey signing attempt fails.
@@ -1851,8 +2163,9 @@ interface TransferStatusBaseProps {
1851
2163
  interface SetupTransferStatusScreenProps extends TransferStatusBaseProps {
1852
2164
  depositAmount: number;
1853
2165
  tokenSymbol: string;
2166
+ authorizationComplete?: boolean;
1854
2167
  }
1855
- declare function SetupTransferStatusScreen({ phase, depositAmount, tokenSymbol, error, onLogout, onRetry, }: SetupTransferStatusScreenProps): react_jsx_runtime.JSX.Element;
2168
+ declare function SetupTransferStatusScreen({ phase, depositAmount, tokenSymbol, authorizationComplete, error, onLogout, onRetry, }: SetupTransferStatusScreenProps): react_jsx_runtime.JSX.Element;
1856
2169
 
1857
2170
  interface DepositTransferStatusScreenProps extends TransferStatusBaseProps {
1858
2171
  visibleError?: string | null;
@@ -1867,20 +2180,21 @@ interface OpenWalletScreenProps {
1867
2180
  * When false (desktop), shows inline authorization progress instead. */
1868
2181
  useDeeplink?: boolean;
1869
2182
  error?: string | null;
2183
+ walletLogoUrl?: string;
1870
2184
  onRetryStatus?: () => void;
1871
2185
  /** Soft-retry the orchestrator (calls `orchestrator.restart()`). Desktop only —
1872
2186
  * shown alongside the error banner when set so the user can recover from a
1873
2187
  * dismissed wallet popup without reloading the iframe. */
1874
2188
  onRetryAuthorization?: () => void;
1875
2189
  onBack?: () => void;
1876
- onLogout: () => void;
2190
+ onLogout?: () => void;
1877
2191
  }
1878
2192
  /**
1879
2193
  * Wallet authorization screen. On mobile, provides a user-tappable button
1880
2194
  * that triggers the deeplink via window.open. On desktop, shows inline
1881
2195
  * authorization progress while wallet extension popups handle the flow.
1882
2196
  */
1883
- declare function OpenWalletScreen({ walletName, deeplinkUri, loading, useDeeplink, error, onRetryStatus, onRetryAuthorization, onBack, onLogout, }: OpenWalletScreenProps): react_jsx_runtime.JSX.Element;
2197
+ declare function OpenWalletScreen({ walletName, deeplinkUri, loading, walletLogoUrl, useDeeplink, error, onRetryStatus, onRetryAuthorization, onBack, onLogout, }: OpenWalletScreenProps): react_jsx_runtime.JSX.Element;
1884
2198
 
1885
2199
  interface ConfirmSignScreenProps {
1886
2200
  walletName: string | null;