The client to use AvalancheWalletCoreClient
The parameters for the message SignXPMessageParameters
The signature of the message with double checksum SignXPMessageReturnType encoded in CB58 format The signature is for the following string: "0x1A" + "Avalanche Signed Message:\n" + "size of message represented in 4 bytes" + message
import { createWalletCoreClient, http } from '@avalanche-sdk/client'
import { avalanche } from '@avalanche-sdk/client/chains'
import { signXPMessage } from '@avalanche-sdk/client/methods/wallet'
const client = createWalletCoreClient({
chain: avalanche,
transport: {
type: "custom",
provider: window.avalanche!,
},
})
const signature = await signXPMessage(client, {
message: "Hello, world!",
})
Sign a message with the account