Sign message
Before signing a message, you have to create a payload, which should be of type
AptosSignMessageInput from @aptos-labs/wallet-standard, like so.
import { type AptosSignMessageInput } from "@aptos-labs/wallet-standard";
const msgToSign: AptosSignMessageInput = {
message: "I love Nightly",
address: true,
nonce: "Anything",
};
To sign a message using the previously created adapter, we recommend you use the function
signMessage() from the adapter.
await adapter.features['aptos:signMessage'].signMessage(msgToSign)