Skip to content

Documentation / react-auth / ConnectedWallet

Interface: ConnectedWallet

Object representation of a connected wallet.

Extends

  • BaseConnectedWallet

Properties

address

address: string

The wallet address.

Inherited from

BaseConnectedWallet.address


chainId

chainId: string

The current chain ID with CAIP-2 formatting.

Inherited from

BaseConnectedWallet.chainId


connectedAt

connectedAt: number

The first time this wallet was connected without break.

Inherited from

BaseConnectedWallet.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

BaseConnectedWallet.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

BaseConnectedWallet.disconnect


fund

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

Prompt the user to go through the fiat onramp flow.

This will open the modal with a prompt for the user to navigate to a third-party on-ramp provider.

Once the user continues to the on-ramp flow, Privy will display the on-ramp 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.

The current supported provider is Moonpay.

Parameters

fundWalletConfig?: FundWalletConfig

The configuration for the fiat onramp flow. *

Returns

Promise<void>


getEthereumProvider

getEthereumProvider: () => Promise<EIP1193Provider>

Helper methods to build providers for interfacing with this wallet.

Returns

Promise<EIP1193Provider>

Inherited from

BaseConnectedWallet.getEthereumProvider


getEthersProvider

getEthersProvider: () => Promise<Web3Provider>

Returns

Promise<Web3Provider>

Inherited from

BaseConnectedWallet.getEthersProvider


getWeb3jsProvider

getWeb3jsProvider: () => Promise<AbstractProvider>

Returns

Promise<AbstractProvider>

Inherited from

BaseConnectedWallet.getWeb3jsProvider


isConnected

isConnected: () => Promise<boolean>

Returns true if the wallet is connected, false otherwise

Returns

Promise<boolean>

Inherited from

BaseConnectedWallet.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.


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>


meta

meta: ConnectedWalletMetadata

Metadata for the wallet.

Inherited from

BaseConnectedWallet.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

BaseConnectedWallet.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

BaseConnectedWallet.switchChain


unlink: () => Promise<void>

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

Returns

Promise<void>


walletClientType

walletClientType: WalletClientType

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

Inherited from

BaseConnectedWallet.walletClientType