Skip to main content

createrawtransaction

Creates a new transaction and returns the encoded transaction along with the encoded records.

Protected Endpoint

Yes

Arguments

ParameterTypeRequiredDescription
old_recordsarrayYesAn array of hex encoded records to be spent
old_account_private_keysarrayYesAn array of private keys authorized to spend the records
recipientsarrayYesThe array of transaction recipient objects
memostringNoThe transaction memo
network_idnumberYesThe network id of the transaction

Transaction Recipient Object

ParameterTypeDescription
addressstringThe recipient address
valuenumberThe amount sent to the recipient

Response

ParameterTypeDescription
encoded_transactionstringThe hex encoding of the generated transaction
encoded_recordsarrayThe hex encodings of the generated records

Example

curl --user username:password --data-binary '{ 
"jsonrpc":"2.0",
"id": "1",
"method": "createrawtransaction",
"params": [
{
"old_records": ["record_hexstring"],
"old_account_private_keys": ["private_key_string"],
"recipients": [{
"address": "address_string",
"amount": amount
}],
"memo": "memo_hexstring",
"network_id": 0
}
]
}' -H 'content-type: application/json' http://127.0.0.1:3030/