Skip to content

Instantly share code, notes, and snippets.

@RCasatta
Created December 14, 2020 14:50
Show Gist options
  • Save RCasatta/32a579630b04259d580ae6596c715411 to your computer and use it in GitHub Desktop.
Save RCasatta/32a579630b04259d580ae6596c715411 to your computer and use it in GitHub Desktop.
test create tx with send all
cargo run --example repl --features cli-utils,esplora,electrum -- --wallet single_change_deep --descriptor "wpkh(tpubD6NzVbkrYhZ4YmSHJMXPEvd6dnPgH55EwGBs2AJHyiBgnT7zJzQ1ywHDxxZveoApLeBeSFcjysjQ5PebSg4gsdrVdRxCLAgHK8jKUiydMrg/*)" sync --max_addresses 200
ADDRESS=$(cargo run --example repl --features cli-utils,esplora,electrum -- --wallet single_change_deep --descriptor "wpkh(tpubD6NzVbkrYhZ4YmSHJMXPEvd6dnPgH55EwGBs2AJHyiBgnT7zJzQ1ywHDxxZveoApLeBeSFcjysjQ5PebSg4gsdrVdRxCLAgHK8jKUiydMrg/*)" get_new_address | jq -r .address)
PSBT=$(cargo run --example repl --features cli-utils,esplora,electrum -- --wallet single_change_deep --descriptor "wpkh(tpubD6NzVbkrYhZ4YmSHJMXPEvd6dnPgH55EwGBs2AJHyiBgnT7zJzQ1ywHDxxZveoApLeBeSFcjysjQ5PebSg4gsdrVdRxCLAgHK8jKUiydMrg/*)" create_tx --to $ADDRESS:0 -a | jq -r .psbt)
bitcoin-cli decodepsbt $PSBT
OTHER_ADDRESS=$(cargo run --example repl --features cli-utils,esplora,electrum -- --wallet single_many_utxos --descriptor "wpkh(tpubD6NzVbkrYhZ4X2yy78HWrr1M9NT8dKeWfzNiQqDdMqqa9UmmGztGGz6TaLFGsLfdft5iu32gxq1T4eMNxExNNWzVCpf9Y6JZi5TnqoC9wJq/*)" get_new_address | jq -r .address)
OTHER_PSBT=$(cargo run --example repl --features cli-utils,esplora,electrum -- --wallet single_change_deep --descriptor "wpkh(tpubD6NzVbkrYhZ4YmSHJMXPEvd6dnPgH55EwGBs2AJHyiBgnT7zJzQ1ywHDxxZveoApLeBeSFcjysjQ5PebSg4gsdrVdRxCLAgHK8jKUiydMrg/*)" create_tx --to $OTHER_ADDRESS:0 -a | jq -r .psbt)
bitcoin-cli decodepsbt $OTHER_PSBT # there is nothing in outputs, because wallet creating the tx doesn't own the output (but tx build has 1 output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment