Skip to main content

createpsbt

Overview

The 'createpsbt' method is utilized to create a transaction in the Partially Signed Transaction format, implementing the Creator role in the transaction process. This method is essential for initiating transactions within the Bitcoin network through CoinAPI.

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":"createpsbt","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

  • Inputs: JSON array, required. Contains the JSON objects representing the transaction inputs.
  • Outputs: JSON array, required. Contains the outputs as key-value pairs where none of the keys are duplicated. Each address can only appear once and there can only be one 'data' object.
  • Locktime: Numeric, optional, default=0. Represents the raw locktime. A non-zero value also locktime-activates inputs.
  • Replaceable: Boolean, optional, default=false. Marks the transaction as BIP125 replaceable, allowing it to be replaced by a transaction with higher fees.

Response

{
"id": 1,
"result": {
"str": "string",
"description": "The resulting raw transaction (base64-encoded string)"
},
"error": null,
"jsonrpc": "2.0"
}