ExternalWalletClient class abstract

Connects to a wallet the user already has (MetaMask, ...) instead of an embedded WaaS wallet. Signs through WalletSigner, same as WaaS. Implemented by ExternalWalletClientImpl; hosts can substitute this interface in tests.

Implementers

Constructors

ExternalWalletClient()

Properties

externalWallets → List<Wallet>
Every connected external wallet address, as a Wallet. Empty until awaitExternalWalletConnection resolves at least once.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addNetwork(String chain, String accountAddress, NetworkConfiguration network) → Future<void>
Adds an EVM network using EIP-3085. Other chains throw NetworkAddingUnavailableError.
awaitExternalWalletConnection() → Future<List<Wallet>>
Waits for the wallet to approve the pairing started by beginExternalWalletConnect. Resolves once approved, with every address the wallet exposed, each as a Wallet.
beginExternalWalletConnect(List<String> chains, [String? walletKey]) → Future<ExternalWalletConnectionHandle>
Starts a connection for SDK chain codes or CAIP-2 IDs. walletKey selects a wallet; null uses generic pairing. The URI can be null, but awaitExternalWalletConnection is still required.
disconnectExternalWallet(String address) → Future<void>
Disconnects one address. Other connected addresses stay connected.
getActiveNetworkData(String chain, String accountAddress) → Future<NetworkConfiguration?>
The full configuration of whichever network the connected external wallet is currently on, for chain/accountAddress — null when that network isn't in getNetworksData's dashboard list or (for EVM) getEvmHostNetworks' host-registered one. Checks the dashboard list first, then the EVM host list, so a host-added network the user's wallet happens to be on is still found. One provider round trip (getActiveNetworkId); everything else is a local lookup.
getActiveNetworkId(String chain, String accountAddress) → Future<String>
The network id the connected external wallet reports itself to be on, for chain/accountAddress.
isProgrammaticNetworkSwitchAvailable(String chain) → bool
Whether the provider supports network add and switch operations.
linkExternalWallet(String address) → Future<SdkUser>
Links the connected wallet to the signed-in user and refreshes the user and session token.
listExternalWallets() → Future<List<ExternalWalletOption>>
Returns cached registry wallets in priority order across all chains. Requires neither a connection nor a project ID; an empty list lets the host fall back to QR.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeWalletAccount(String chain, String accountAddress) → Future<void>
Unlinks verified wallets on the server and refreshes the session. Unverified wallets are disconnected locally only.
signInWithExternalWallet(String address) → Future<SdkUser>
Signs in through SIWE with an already-connected wallet and creates a new Dynamic session.
signMessage(String chain, String accountAddress, String message) → Future<String>
Signs message for accountAddress on chain, through the connected external wallet.
signTransaction(String chain, String accountAddress, String transaction, String? chainId, [List<int>? signingIndexes, List<int>? allowedSighash]) → Future<String>
Signs the serialized unsigned transaction for accountAddress on chain, through the connected external wallet. Same shape as WalletSigner.signTransaction.
switchActiveNetwork(String chain, String accountAddress, String networkId) → Future<void>
Switches an EVM network using EIP-3326. Error 4902 becomes NetworkNotAddedError; add the network and retry. Other chains are unsupported.
toString() → String
A string representation of this object.
inherited
transferWalletAccount(String address) → Future<SdkUser>
Transfers another user's wallet to the signed-in user and refreshes the user and session token.

Operators

operator ==(Object other) → bool
The equality operator.
inherited