Skip to content

Documentation / react-auth / EthereumWalletConnector

Class: abstract EthereumWalletConnector ​

Extends ​

  • WalletConnector

Constructors ​

new EthereumWalletConnector(walletClientType, chains, defaultChain, rpcConfig) ​

new EthereumWalletConnector(walletClientType, chains, defaultChain, rpcConfig): EthereumWalletConnector

Parameters ​

• walletClientType: WalletClientType

• chains: Chain[]

• defaultChain: Chain

• rpcConfig: RpcConfig

Returns ​

EthereumWalletConnector

Overrides ​

WalletConnector.constructor

Properties ​

chainType ​

chainType: "ethereum"

Overrides ​

WalletConnector.chainType


chains ​

chains: Chain[]


connected ​

connected: boolean

Inherited from ​

WalletConnector.connected


abstract connectorType ​

abstract connectorType: string

Inherited from ​

WalletConnector.connectorType


defaultChain ​

defaultChain: Chain


initialized ​

initialized: boolean

Inherited from ​

WalletConnector.initialized


abstract proxyProvider ​

abstract proxyProvider: PrivyProxyProvider | Embedded1193Provider


rpcConfig ​

rpcConfig: RpcConfig


rpcTimeoutDuration ​

rpcTimeoutDuration: number


walletClientType ​

walletClientType: WalletClientType

Inherited from ​

WalletConnector.walletClientType


wallets ​

wallets: BaseConnectedEthereumWallet[]

Overrides ​

WalletConnector.wallets

Accessors ​

abstract walletBranding ​

get abstract walletBranding(): WalletBranding

Returns ​

WalletBranding

Methods ​

buildConnectedWallet() ​

buildConnectedWallet(address, chainId, meta, imported): BaseConnectedEthereumWallet

Builds a connected wallet object to be exposed to the developer. This object contains the address, chainId, and a few helper methods.

Provider methods share the PrivyProxyProvider instance. This means that multiple wallets may share the same provider if one wallet was disconnected and another wallet was connected.

A wallet is considered connected if it is present in the wallets array and is in a connected state.

Parameters ​

• address: string

• chainId: string

• meta: ConnectedWalletMetadata

• imported: boolean

Returns ​

BaseConnectedEthereumWallet


abstract connect() ​

abstract connect(options): Promise<null | BaseConnectedWallet>

Parameters ​

• options: Object

• options.chainId?: number

• options.showPrompt?: boolean

Returns ​

Promise<null | BaseConnectedWallet>

Inherited from ​

WalletConnector.connect


abstract disconnect() ​

abstract disconnect(): void

Returns ​

void

Inherited from ​

WalletConnector.disconnect


getConnectedWallet() ​

getConnectedWallet(): Promise<null | BaseConnectedEthereumWallet>

Get the most recently connected wallet.

Returns ​

Promise<null | BaseConnectedEthereumWallet>


abstract initialize() ​

abstract initialize(): Promise<void>

Returns ​

Promise<void>

Inherited from ​

WalletConnector.initialize


isConnected() ​

isConnected(): Promise<boolean>

As a proxy for "connected", we call eth_accounts and consider the client connected if at least one account is returned.

Returns ​

Promise<boolean>

Overrides ​

WalletConnector.isConnected


onAccountsChanged() ​

protected onAccountsChanged(accounts): void

Parameters ​

• accounts: string[]

Returns ​

void


onChainChanged() ​

protected onChainChanged(chainId): void

Parameters ​

• chainId: string

Returns ​

void


onConnect() ​

protected onConnect(): Promise<void>

Returns ​

Promise<void>


onDisconnect() ​

protected onDisconnect(): void

Returns ​

void


abstract promptConnection() ​

abstract promptConnection(walletClientType): void

Parameters ​

• walletClientType: WalletClientType

Returns ​

void

Inherited from ​

WalletConnector.promptConnection


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.


subscribeListeners() ​

subscribeListeners(): void

Returns ​

void

Overrides ​

WalletConnector.subscribeListeners


syncAccounts() ​

syncAccounts(prefetchedAccounts?): Promise<void>

Sync all accounts available via the provider if the wallet is connected.

Parameters ​

• prefetchedAccounts?: string[]

pass in an accounts array from eth_accounts if already fetched to avoid a repeated call

Returns ​

Promise<void>


unsubscribeListeners() ​

unsubscribeListeners(): void

Returns ​

void

Overrides ​

WalletConnector.unsubscribeListeners