Skip to main content

createrawtransaction

Overview

The 'createrawtransaction' method llows you to create a transaction by specifying the inputs and outputs. This method returns a hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

Request

wget --no-check-certificate --quiet \
-method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 4303fb63-adec-42dc-b571-74bc2f2a5167' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"createrawtransaction","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'-

Request Parameters

  • txid (string, required): The transaction ID.
  • vout (numeric, required): The output number.
  • sequence (numeric, optional): The sequence number, default value depends on the 'replaceable' and 'locktime' arguments.
  • address (numeric or string, required): A key-value pair where the key is the Bitcoin address and the value is the amount in BTC.
  • data (string, required): A key-value pair where the key must be "data" and the value is hex-encoded data.
  • locktime (raw, optional): Non-0 value also locktime-activates inputs.
  • replaceable (boolean, optional): Marks this transaction as BIP125-replaceable. Allows this transaction to be replaced by a transaction with higher fees

Response

{
"result": "hex-encoded raw transaction",
"error": null,
"id": "coinapi_test"
}