Skip to content

Instantly share code, notes, and snippets.

@gregdhill
Created March 24, 2024 20:17
Show Gist options
  • Save gregdhill/0e342eff120f953609d631f08f0f4090 to your computer and use it in GitHub Desktop.
Save gregdhill/0e342eff120f953609d631f08f0f4090 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Bitcoin Core RPC client version v22.0.0
wallet="xxx-DOT-IBTC"
address="xxx"
redeemid="xxx"
rawtx=$(bitcoin-cli -rpcwallet=$wallet createrawtransaction "[]" "[{\"$address\":0.01},{\"data\":\"$redeemid\"}]")
echo $rawtx
fundedtx=$(bitcoin-cli -rpcwallet=$wallet fundrawtransaction $rawtx | jq -r .hex)
echo $fundedtx
signedtx=$(bitcoin-cli -rpcwallet=$wallet signrawtransactionwithwallet $fundedtx | jq -r .hex)
echo $signedtx
bitcoin-cli sendrawtransaction $signedtx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment