signMessage

Sign message

Method

async function signMessage(message: string, type: string): string

Params

  • message — required string a string to sign

  • type — optional string "ecdsa" | "bip322-simple". default is "ecdsa"

Response

signature — string

Example

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

const message = "010203"
const signature = async provider.signMessage(message);

Demo

Last updated