Skip to content

Documentation / react-auth / ConnectedWallet

Interface: ConnectedWallet

Object representation of a connected wallet.

Extends

  • BaseConnectedEthereumWallet.PrivyConnectedWallet

Properties

address

address: string

The wallet address.

Inherited from

BaseConnectedEthereumWallet.address


chainId

chainId: string

The current chain ID with CAIP-2 formatting.

Inherited from

BaseConnectedEthereumWallet.chainId


connectedAt

connectedAt: number

The first time this wallet was connected without break.

Inherited from

BaseConnectedEthereumWallet.connectedAt


connectorType

connectorType: string

The connector used to initiate the connection with the wallet client. e.g. injected, wallet_connect, coinbase_wallet, etc.

Inherited from

BaseConnectedEthereumWallet.connectorType


disconnect

disconnect: () => void

Experimental: This property is subject to change at any time.

Not all wallet clients support programmatic disconnects (e.g. MetaMask, Phantom). In kind, if the wallet's client does not support programmatic disconnects, this method will no-op.

Returns

void

Inherited from

BaseConnectedEthereumWallet.disconnect


fund

fund: (fundWalletConfig?) => Promise<void>

Prompt the user to go through the funding flow and for the connected wallet.

This will open the modal with a prompt for the user to select a funding method (if multiple are enabled).

Once the user continues to the funding flow, Privy will display the funding status screen, and wait for the transaction to complete.

Note: Even after a successful funding, funds can take a few minutes to arrive in the user's wallet.

Privy currently supports funding via external wallets and Moonpay.

Parameters

fundWalletConfig?: FundWalletConfig

Funding configuration to specify chain and funding amount (if enabled) *

Returns

Promise<void>


getEthereumProvider

getEthereumProvider: () => Promise<EIP1193Provider>

Helper methods to build providers for interfacing with this wallet.

Returns

Promise<EIP1193Provider>

Inherited from

BaseConnectedEthereumWallet.getEthereumProvider


getEthersProvider

getEthersProvider: () => Promise<Web3Provider>

Returns

Promise<Web3Provider>

Inherited from

BaseConnectedEthereumWallet.getEthersProvider


getWeb3jsProvider

getWeb3jsProvider: () => Promise<AbstractProvider>

Returns

Promise<AbstractProvider>

Inherited from

BaseConnectedEthereumWallet.getWeb3jsProvider


imported

imported: boolean

Whether the wallet is imported.

Inherited from

BaseConnectedEthereumWallet.imported


isConnected

isConnected: () => Promise<boolean>

Returns true if the wallet is connected, false otherwise

Returns

Promise<boolean>

Inherited from

BaseConnectedEthereumWallet.isConnected


linked

linked: boolean

True if this wallet is linked to the authenticated user. False if it is not yet linked or the user has not yet authenticated.

Inherited from

PrivyConnectedWallet.linked


loginOrLink: () => Promise<void>

Login with this wallet or link this wallet to the authenticated user.

Throws a PrivyClientError if the wallet is not connected.

Returns

Promise<void>

Inherited from

PrivyConnectedWallet.loginOrLink


meta

meta: ConnectedWalletMetadata

Metadata for the wallet.

Inherited from

BaseConnectedEthereumWallet.meta


sign

sign: (message) => Promise<string>

Perform personal_sign with the user's wallet.

Parameters

message: string

The message to sign.

Returns

Promise<string>

The resulting signature.

Inherited from

BaseConnectedEthereumWallet.sign


switchChain

switchChain: (targetChainId) => Promise<void>

Switch the network chain to a specified ID. Note: The chainId must be a supported network: https://docs.privy.io/guide/frontend/embedded/networks Note: This will not update any existing provider instances, re-request wallet.getEthersProvider (e.g.) to get a provider with the updated chainId.

Parameters

targetChainId: number | `0x${string}`

The specified chain ID to switch to, as a number or 0x prefixed string.

Returns

Promise<void>

void

Inherited from

BaseConnectedEthereumWallet.switchChain


unlink: () => Promise<void>

Unlink this wallet to the authenticated user. Throws a PrivyClientError if the user is not authenticated.

Returns

Promise<void>

Inherited from

PrivyConnectedWallet.unlink


walletClientType

walletClientType: WalletClientType

The wallet client where this key-pair is stored. e.g. metamask, rainbow, coinbase_wallet, etc.

Inherited from

BaseConnectedEthereumWallet.walletClientType


walletIndex?

walletIndex?: number

The HD wallet index

Inherited from

PrivyConnectedWallet.walletIndex