sendBitcoin

Send BTC

Method

async function sendBitcoin(
    toAddress: string, 
    satoshis: number, 
    options?: { feeRate: number }
): string

Params

  • toAddressrequired string the address to send

  • satoshisrequired number the satoshis to send

  • optionsoptional

    • feeRaterequired number the network fee rate

Response

txidstring

Example

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

const address = "010203"
const txid = async provider.sendBitcoin(address, 1000);

Demo

Last updated