POSTcreaterawtransaction

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Creates an unsigned transaction from the given inputs and outputs and returns it as a serialized, hex-encoded string.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameters in order:

  1. inputs: The inputs to spend, as an array of objects. (required)
  2. outputs: The outputs to create, as an array of objects. (required)
  3. locktime: The raw locktime, as an integer. (optional, default 0)
  4. replaceable: Whether the transaction is BIP 125-replaceable, as a boolean. (optional, default true)
  5. version: The transaction version, as an integer. (optional, default 2)
params[0]object[]
params[1]object[]
params[2]integer

The raw locktime of the transaction. A non-zero value also locktime-activates the inputs.

params[3]boolean

Whether to mark the transaction as replaceable by a higher-fee transaction under BIP 125.

params[4]integer

The raw locktime of the transaction. A non-zero value also locktime-activates the inputs.

Responses

응답 본문이 없습니다.

X-API-KEY
RequestCU20
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "createrawtransaction",
  "params": [
    [
      {
        "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
        "vout": 0
      }
    ],
    [
      {
        "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh": 0.0125
      }
    ],
    0,
    true,
    2
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "02000000013ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a0000000000ffffffff0140d1120000000000160014"
}