Skip to Content
dApp 接入
本页目录

sendBitcoin

发送 BTC

方法

declare function sendBitcoin( toAddress: string, satoshis: number, options?: { feeRate?: number; memo?: string; memos?: string[] } ): Promise<string>;

参数

  • toAddress — 必填 string,收款地址。
  • satoshis — 必填 number,发送金额,单位为 satoshi。
  • options — 可选。
    • feeRate — 可选 number,网络费率。

响应

txid — string

示例

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);

演示

打开示例 

最后更新于