Skip to Content
dApps
Sur cette page

sendBitcoin

Envoyer des BTC

Méthode

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

Paramètres

  • toAddress — obligatoire string l’adresse de destination
  • satoshis — obligatoire number le nombre de satoshis à envoyer
  • options — facultatif
    • feeRate — facultatif number le taux des frais réseau

Réponse

txid — string

Exemple

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

Démonstration

Ouvrir l’exemple 

Dernière mise à jour le