Utxo
A confirmed Bitcoin output in the Esplora and mempool.space shape (txid, vout, value). BuildReclaimOpts takes it as utxo, the L1 lockup output that buildReclaim spends.
Usage
import { buildReclaim } from '@stacks/bitcoin-staking';
const tx = buildReclaim({
path: 'locktime',
utxo: {
txid, // display (big-endian) hex, as shown by explorers
vout: 0,
value: 100_000_000n, // sats
},
network: 'mainnet',
output: { address: 'bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4', feeSats: 2_000n },
lockScript: meta.lockScript, // from buildRegisterMetadata
});Notes
If you pass
scriptPubKey,buildReclaimcompares it with the P2WSH script derived fromlockScriptand on a mismatch throws anErrorwhose message starts withbuildReclaim: utxo.scriptPubKey does not match the lockScript. Omit it and the derived script is used.
Definition
Properties
Property
Type
Description
txid
string
Funding transaction ID, display (big-endian) hex
vout
number
Output index in the funding transaction
value
IntegerType
Output value in sats
scriptPubKey
Uint8Array (optional)
Output script, used as a cross-check against lockScript
Was this helpful?