According to https://github.com/blockchain/api-v1-client-node/tree/master/MyWallet#send-bitcoin wallet.send
doesn't require a from
field. When I run wallet.getBalance()
it states that I have BTC in my wallet (received days ago). However if I do:
const balanceResponse = await wallet.getBalance();
console.log(balanceResponse);
// { balance: 100000000 }
wallet.send("<receiving address>", 510000, {
fee: 10000
})
{"error":"Insufficient funds","available":0,"needed":0.0051,"sweep_amount_satoshi":0,"sweep_fee_satoshi":0}
I've only ever received BTC once in my wallet. If I use that address in the from
field:
wallet.send("<receiving address>", 510000, {
from: "<sending address>",
fee: 10000
})
I now get
{"error":"Error signing and pushing transaction"}
What am I doing wrong?