RavenDoc 2.5.1

raven-cli help createrawtransaction

createrawtransaction [{"txid":"id","vout":n},...] {"address":(amount or object),"data":"hex",...} ( locktime ) ( replaceable )
Create a transaction spending the given inputs and creating new outputs.
Outputs are addresses (paired with a RVN amount, data or object specifying an asset operation) or data.
Returns 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.
Paying for Asset Operations:
Some operations require an amount of RVN to be sent to a burn address:
transfer: 0
issue: 500 to Issue Burn Address
issue_unique 5 to Issue Unique Burn Address
reissue: 100 to Reissue Burn Address
Ownership:
These operations require an ownership token input for the asset being operated upon:
issue_unique
reissue
Output Ordering:
Asset operations require the following:
1) All coin outputs come first (including the burn output).
2) The owner token change output comes next (if required).
3) An issue, issue_unique, reissue or any number of transfers comes last
(different types can't be mixed in a single transaction).
Arguments:
1. "inputs" (array, required) A json array of json objects
[
{
"txid":"id", (string, required) The transaction id
"vout":n, (numeric, required) The output number
"sequence":n (numeric, optional) The sequence number
}
,...
]
2. "outputs" (object, required) a json object with outputs
{
"address": (string, required) The destination raven address. Each output must have a different address.
x.xxx (numeric or string, required) The RVN amount
or
{ (object) A json object of assets to send
"transfer":
{
"asset-name": (string, required) asset name
asset-quantity (numeric, required) the number of raw units to transfer
,...
}
}
or
{ (object) A json object describing new assets to issue
"issue":
{
"asset_name":"asset-name", (string, required) new asset name
"asset_quantity":n, (number, required) the number of raw units to issue
"units":[1-8], (number, required) display units, between 1 (integral) to 8 (max precision)
"reissuable":[0-1], (number, required) 1=reissuable asset
"has_ipfs":[0-1], (number, required) 1=passing ipfs_hash
"ipfs_hash":"hash" (string, optional) an ipfs hash for discovering asset metadata
}
}
or
{ (object) A json object describing new unique assets to issue
"issue_unique":
{
"root_name":"root-name", (string, required) name of the asset the unique asset(s) are being issued under
"asset_tags":["asset_tag", ...], (array, required) the unique tag for each asset which is to be issued
"ipfs_hashes":["hash", ...], (array, optional) ipfs hashes corresponding to each supplied tag (should be same size as "asset_tags")
}
}
or
{ (object) A json object describing follow-on asset issue. Requires matching ownership input.
"reissue":
{
"asset_name":"asset-name", (string, required) name of asset to be reissued
"asset_quantity":n, (number, required) the number of raw units to issue
"reissuable":[0-1], (number, optional) default is 1, 1=reissuable asset
"ipfs_hash":"hash" (string, optional) An ipfs hash for discovering asset metadata, Overrides the current ipfs hash if given
}
}
or
"data": "hex" (string, required) The key is "data", the value is hex encoded data
,...
}
3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs
Result:
"transaction" (string) hex string of the transaction
Examples:
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0}]" "{\"address\":0.01}"
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0}]" "{\"data\":\"00010203\"}"
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0}]" "{\"RXissueAssetXXXXXXXXXXXXXXXXXhhZGt\":500,\"change_address\":change_amount,\"issuer_address\":{\"issue\":{\"asset_name\":\"MYASSET\",\"asset_quantity\":1000000,\"units\":1,\"reissuable\":0,\"has_ipfs\":1,\"ipfs_hash\":\"43f81c6f2c0593bde5a85e09ae662816eca80797\"}}}"
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0}]" "{\"RXissueUniqueAssetXXXXXXXXXXWEAe58\":20,\"change_address\":change_amount,\"issuer_address\":{\"issue_unique\":{\"root_name\":\"MYASSET\",\"asset_tags\":[\"ALPHA\",\"BETA\"],\"ipfs_hashes\":[\"43f81c6f2c0593bde5a85e09ae662816eca80797\",\"43f81c6f2c0593bde5a85e09ae662816eca80797\"]}}}"
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0},{\"txid\":\"myasset\",\"vout\":0}]" "{\"address\":{\"transfer\":{\"MYASSET\":50}}}"
> raven-cli createrawtransaction "[{\"txid\":\"mycoin\",\"vout\":0},{\"txid\":\"myownership\",\"vout\":0}]" "{\"issuer_address\":{\"reissue\":{\"asset_name\":\"MYASSET\",\"asset_quantity\":2000000}}}"
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"mycoin\",\"vout\":0}]", "{\"data\":\"00010203\"}"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/

By JonPizza! RavenVotes!