1

How can I construct a transaction using a watch only wallet RPC and cold sign using any nodejs library? In the end, I have to send this to the blockchain using the daemon or watch only wallet RPC.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54
intosKai
  • 69
  • 4

1 Answers1

1

Using the wallet RPC on your view only (hot) wallet, you can call transfer with get_tx_metadata: true and do_not_relay: true which will yield an unsigned_txset in the response.

Then on the spend wallet RPC (your cold wallet), call sign_transfer, passing in the unsigned_txset from above, which will yield a signed_txset in the response.

Back on the view only (hot) wallet RPC, call submit_transfer, passing the data from signed_txset above in the tx_data_hex parameter.

The linked methods all have examples of these steps using curl. The calls are just simple HTTP POST requests, so libraries are not really needed.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54