Skip to main content

Package: react-wallet-kit

Defined in: react-wallet-kit/src/providers/client/Types.tsx:678

Overview

Handles the connecting of an external wallet account to the user’s Turnkey account.
  • This function opens a modal with the ConnectWalletModal component, allowing the user to select and connect an external wallet provider (such as MetaMask, Phantom, etc.).
  • It fetches the list of available wallet providers (for all supported chains) and passes them to the modal for user selection.
  • After a successful wallet connection, the provider state is refreshed to include the newly connected wallet account.
  • Optionally, a success page is shown for the specified duration after connecting (default: 2000ms).
  • Supports both Ethereum and Solana wallet providers, and can be extended to additional chains as supported by Turnkey.
  • Handles all error cases and throws a TurnkeyError with appropriate error codes if the client is not initialized or no active session is found.

Parameters

params
HandleConnectExternalWalletParams

Response

A successful response returns the following fields:
returns
void | Promise<object>
required
A promise that resolves to an object describing the action:
  • { type: "connect", account: WalletAccount } when a wallet is successfully connected.
  • { type: "disconnect", account?: WalletAccount } when a wallet is disconnected.