ExternalWalletClientImpl class

Connects to a wallet the user already has (MetaMask, ...) instead of an embedded WaaS wallet. Signs through WalletSigner, same as WaaS. Instances share the root client's state. NOTE: not yet thread-safe.

Implemented types

Properties

externalWallets → List<Wallet>
Every connected external wallet address, as a Wallet. Empty until awaitExternalWalletConnection resolves at least once.
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
name → String
no setteroverride
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.
override
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.
override
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.
override
disconnectExternalWallet(String address) → Future<void>
Disconnects one address. Other connected addresses stay connected.
override
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.
override
getActiveNetworkId(String chain, String accountAddress) → Future<String>
The network id the connected external wallet reports itself to be on, for chain/accountAddress.
override
install(DynamicClient client) → void
override
isProgrammaticNetworkSwitchAvailable(String chain) → bool
Whether the provider supports network add and switch operations.
override
linkExternalWallet(String address) → Future<SdkUser>
Links the connected wallet to the signed-in user and refreshes the user and session token.
override
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.
override
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.
override
signInWithExternalWallet(String address) → Future<SdkUser>
Signs in through SIWE with an already-connected wallet and creates a new Dynamic session.
override
signMessage(String chain, String accountAddress, String message) → Future<String>
Signs message for accountAddress on chain, through the connected external wallet.
override
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.
override
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.
override
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.
override

Operators

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