Get Wallet UTXOs

After establishing a connection, you can grab the wallet's UTXOs (unspent transaction outputs)

const wallet = initProvider(); // see "Detecting the Provider"
try {
    const utxos = await wallet.getPaymentUtxos();
    console.log(utxos);
    // see response object below
} catch (err) {
    console.log(err);
}

Responds with an array of UTXOs

[
    {
        satoshis: 205551
        script: "76a914b681d8032b448405d44e82807fab2c8894eed57788ac"
        txid: "c58e8b0dd25e56af0696b026c1961dccd0cab3fe42fb2f3ac934ebdc3accbb40"
        vout: 0
    },
    {
        satoshis: 19909
        script: "76a914b681d8032b448405d44e82807fab2c8894eed57788ac"
        txid: "4c52add57a2c9cda29501a810a1312eaee9423d28440a09acbf5d9d8d0467382"
        vout: 0
    }
]

Last updated