On this page
sendBitcoin
Send BTC
Method
declare function sendBitcoin(
toAddress: string,
satoshis: number,
options?: { feeRate?: number; memo?: string; memos?: string[] }
): Promise<string>;Params
toAddress— requiredstringthe address to sendsatoshis— requirednumberthe satoshis to sendoptions— optionalfeeRate— optionalnumberthe network fee rate
Response
txid — string
Example
const provider = (window.$onekey && window.$onekey.btc) || window.unisat;
const address = "<RECIPIENT_BITCOIN_ADDRESS>"; // Replace with a valid address
const txid = await provider.sendBitcoin(address, 1000);Demo
Last updated on