createMessageSignerFromWalletAccount
Creates a MessageModifyingSigner from a UiWalletAccount.
This function provides a bridge between wallet-standard UiWalletAccount and the
MessageModifyingSigner interface, allowing any wallet that implements the
solana:signMessage feature to be used as a message signer.
Each signature returned by the wallet is verified against the account's address and the signed message, so a wallet cannot return a signature that was not made by the account.
Type Parameters
| Type Parameter |
|---|
TWalletAccount extends UiWalletAccount |
Parameters
| Parameter | Type | Description |
|---|---|---|
uiWalletAccount | TWalletAccount | The wallet account to create a signer from. |
Returns
MessageModifyingSigner<TWalletAccount["address"]>
A MessageModifyingSigner that signs messages using the wallet.
Throws
SOLANA_ERROR__WALLET__INVALID_NUMBER_OF_OUTPUTS from modifyAndSignMessages when the
wallet returns a different number of signed messages than it was asked to sign.
Throws
SOLANA_ERROR__WALLET__INVALID_MESSAGE_SIGNATURE from modifyAndSignMessages when the
wallet returns a signature that is not a valid signature of the signed message by the account.
Example
See
- MessageModifyingSigner
- SignableMessage