sendBitcoin
Send BTC
Method
async function sendBitcoin(
toAddress: string,
satoshis: number,
options?: { feeRate: number }
): string
Params
toAddress
— requiredstring
the address to sendsatoshis
— requirednumber
the satoshis to sendoptions
— optionalfeeRate
— requirednumber
the network fee rate
Response
txid
— string
Example
const provider = (window.$onekey && window.$onekey.btc) || window.unisat;
const address = "010203"
const txid = async provider.sendBitcoin(address, 1000);
Demo
Last updated
Was this helpful?