Rawtransactions RPC Commands
Documentation for Raptoreum Rawtransactions RPC calls.
combinerawtransaction
Combine multiple partially signed transactions into one transaction.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
"str" (string) The hex-encoded raw transaction with signature(s)
Examples
raptoreum-cli combinerawtransaction '["myhex1", "myhex2", "myhex3"]'
createrawtransaction
Create a transaction spending the given inputs and creating new outputs.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 3 | locktime |
numeric | Optional | 0 | See CLI help for details |
Result
"hex" (string) hex string of the transaction
Examples
raptoreum-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"address\":0.01}]"
raptoreum-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "[{\"data\":\"00010203\"}]"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"address\":0.01}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "[{\"data\":\"00010203\"}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
decoderawtransaction
Return a JSON object representing the serialized, hex-encoded transaction.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
{ (json object)
"txid" : "hex", (string) The transaction id
"size" : n, (numeric) The transaction size
"version" : n, (numeric) The version
"version" : n, (numeric) The type
"locktime" : xxx, (numeric) The lock time
"vin" : [ (json array)
{ (json object)
"txid" : "hex", (string) The transaction id
"vout" : n, (numeric) The output number
"scriptSig" : { (json object) The script
"asm" : "str", (string) asm
"hex" : "hex" (string) hex
},
"sequence" : n (numeric) The script sequence number
},
...
],
"vout" : [ (json array)
{ (json object)
"value" : n, (numeric) The value in RTM
"n" : n, (numeric) index
"scriptPubKey" : { (json object)
"asm" : "str", (string) the asm
"hex" : "hex", (string) the hex
"reqSigs" : n, (numeric) The required sigs
"type" : "str", (string) The type, eg 'pubkeyhash'
"addresses" : [ (json array)
"str", (string) Raptoreum address
...
]
}
},
...
],
"extraPayloadSize" : n, (numeric, optional) Size of DIP2 extra payload. Only present if it's a special TX
"extraPayload" : "hex" (string, optional) Hex-encoded DIP2 extra payload data. Only present if it's a special TX
}
Examples
raptoreum-cli decoderawtransaction "hexstring"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
decodescript
Decode a hex-encoded script.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
{ (json object)
"asm" : "str", (string) Script public key
"type" : "str", (string) The output type (e.g. nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata)
"reqSigs" : n, (numeric) The required signatures
"addresses" : [ (json array)
"str", (string) Raptoreum address
...
],
"p2sh" : "str" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH)
}
Examples
raptoreum-cli decodescript "hexstring"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
fundrawtransaction
Add inputs to a transaction until it has enough in value to meet its out value.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
Result
{ (json object)
"hex" : "hex", (string) The resulting raw transaction (hex-encoded string)
"fee" : n, (numeric) Fee in RTM the resulting transaction pays
"changepos" : n (numeric) The position of the added change output, or -1
}
Examples
Create a transaction with no inputs
raptoreum-cli createrawtransaction "[]" "{\"myaddress\":0.01}"
Add sufficient unsigned inputs to meet the output value
raptoreum-cli fundrawtransaction "rawtransactionhex"
Sign the transaction
raptoreum-cli signrawtransaction "fundedtransactionhex"
Send the transaction
raptoreum-cli sendrawtransaction "signedtransactionhex"
getrawtransaction
Return the raw transaction data.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 2 | verbose |
boolean | Optional | false | See CLI help for details |
Examples
raptoreum-cli getrawtransaction "mytxid"
raptoreum-cli getrawtransaction "mytxid" true
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["mytxid", true] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
raptoreum-cli getrawtransaction "mytxid" false "myblockhash"
raptoreum-cli getrawtransaction "mytxid" true "myblockhash"
sendrawtransaction
Submits raw transaction (serialized, hex-encoded) to local node and network.
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 2 | maxfeerate |
numeric or string | Optional | 0.10 | See CLI help for details |
| 4 | bypasslimits |
boolean | Optional | false | See CLI help for details |
Result
"hex" (string) The transaction hash in hex
Examples
Create a transaction
raptoreum-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}"
Sign the transaction, and get back the hex
raptoreum-cli signrawtransactionwithwallet "myhex"
Send the transaction (signed hex)
raptoreum-cli sendrawtransaction "signedhex"
As a json rpc call
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["signedhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/
signrawtransactionwithkey
Sign inputs for raw transaction (serialized, hex-encoded).
Arguments
| Position | Name | Type | Required | Default | Description |
|---|---|---|---|---|---|
| 4 | sighashtype |
string | Optional | ALL | See CLI help for details |
Result
{ (json object)
"hex" : "hex", (string) The hex-encoded raw transaction with signature(s)
"complete" : true|false, (boolean) If the transaction has a complete set of signatures
"errors" : [ (json array) Script verification errors (if there are any)
{ (json object)
"txid" : "hex", (string) The hash of the referenced, previous transaction
"vout" : n, (numeric) The index of the output to spent and used as input
"scriptSig" : "hex", (string) The hex-encoded signature script
"sequence" : n, (numeric) Script sequence number
"error" : "str" (string) Verification or signing error related to the input
},
...
]
}
Examples
raptoreum-cli signrawtransactionwithkey "myhex"
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransactionwithkey", "params": ["myhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:10225/