signPsbt

Sign PSBT

Method

async function signPsbt(
    psbtHex: string, 
    options: { autoFinalized: boolean },
): string

Params

  • psbtHex — required string the hex string of psbt to sign

  • options — optional object

    • autoFinalized — optional boolean: whether finalize psbt after signing, default is true

Response

signed — string

Example

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

const psbtHex = "010203"
const signed = async provider.signPsbt(psbtHex);

Demo

Last updated