UNPKG

@avalanche-sdk/client

Version:

A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transa

31 lines 1.3 kB
import { AvalancheWalletCoreClient } from "../../clients/createAvalancheWalletCoreClient.js"; import { SignXPMessageParameters, SignXPMessageReturnType } from "./types/signXPMessage.js"; /** * Sign a message with the account * @param client - The client to use {@link AvalancheWalletCoreClient} * @param params - The parameters for the message {@link SignXPMessageParameters} * @returns The signature of the message with double checksum {@link 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 * * @example * * 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!", * }) * */ export declare function signXPMessage(client: AvalancheWalletCoreClient, params: SignXPMessageParameters): Promise<SignXPMessageReturnType>; //# sourceMappingURL=signXPMessage.d.ts.map