Looking to fetch the UTXOs for a given address and can't seem to find the correct command syntax.
Here is an implementation in bitcoin-core via javascript, but I also experience the same on bitcoin-cli
const descriptorAttempts = [
'{ desc: addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo) }',
'{ "desc": "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)" }',
'"desc": "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)"',
"addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)",
"addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)",
"addr=34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo",
"34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo",
"{ addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo) }",
"{ addr: 34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo }",
"{\"desc\": \"addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)\"}",
'\"{\"desc": \"addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)\"}\"',
'"{"desc": "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)"}"',
'"{"desc": "addr("34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo")"}"',
'\"{\"desc": \"addr(\"34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo\")\"}\"',
'"desc" => "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)"',
'[ "desc" => "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)" ]',
{ "desc" : "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)" },
{ desc : "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)" }
]
descriptorAttempts.forEach(attempt => {
client.command('scantxoutset', 'start', [ attempt ])
.then((res) => {
console.log("Success! 🙌")
console.log(res)
})
.catch((error) => {
console.log("Failed attempt of -> " + attempt)
// console.log(error)
})
})
All result in RpcError: Invalid descriptor
client.command('scantxoutset', 'start', [[ "desc" => "addr(34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo)" ]])
work?command('scantxoutset', 'start', [{"desc":"addr(...)"}])
.