createSignerFromWalletAccount
Creates a combined signer from a UiWalletAccount that exposes all signing capabilities the wallet account supports.
Unlike the more specific helpers (createTransactionSignerFromWalletAccount, createTransactionSendingSignerFromWalletAccount, createMessageSignerFromWalletAccount), this function inspects the wallet account's features at call time and returns a single signer object with whichever of the following methods are available:
modifyAndSignTransactions— present when thesolana:signTransactionfeature is available.signAndSendTransactions— present when thesolana:signAndSendTransactionfeature is available.modifyAndSignMessages— present when thesolana:signMessagefeature is available.
At least one of solana:signTransaction or solana:signAndSendTransaction must be present,
otherwise an error is thrown. solana:signMessage is optional.
Type Parameters
| Type Parameter |
|---|
TWalletAccount extends UiWalletAccount |
Parameters
| Parameter | Type | Description |
|---|---|---|
uiWalletAccount | TWalletAccount | The wallet account to create a signer from. |
chain | | "solana:mainnet" | "solana:devnet" | "solana:testnet" | "solana:localnet" | The Solana chain identifier (e.g., 'solana:devnet', 'solana:mainnet'). |
Returns
| TransactionSigner<TWalletAccount["address"]>
| MessageSigner<TWalletAccount["address"]> & TransactionSigner<TWalletAccount["address"]>
A TransactionSigner, optionally combined with a MessageSigner, depending on the features available on the wallet account.
Throws
If the wallet account does not support the specified chain.
Throws
If the wallet account supports neither solana:signTransaction
nor solana:signAndSendTransaction.