signMessage

Request that the user signs an string message.

Method

async function signMessage(message: string): SignMessageResponse

Response

interface SignMessageResponse {
  message: string;
  signature: string;
}

Example

const provider = (window.$onekey && window.$onekey.webln) || window.webln;

const message = "Plain Message";
await provider.enable();
const signature = await provider.signMessage(message);

Demo

Last updated