UNPKG

@ravenrebels/ravencoin-rpc

Version:

Helps you access your Ravencoin full node using RPC from JavaScript

1,015 lines (854 loc) 226 kB
var $g5Y9E$buffer = require("buffer"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } $parcel$export(module.exports, "getRPC", () => $80bd448eb6ea085b$export$eb94c228b080d168); $parcel$export(module.exports, "methods", () => $ca417a034047e18f$export$e13b82b2b0368a6a); const $ca417a034047e18f$export$e13b82b2b0368a6a = { /** abandontransaction "txid" Mark in-wallet transaction <txid> as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace "stuck" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned. Arguments: 1. "txid" (string, required) The transaction id Result: Examples: > raven-cli abandontransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ abandontransaction: "abandontransaction", /** abortrescan Stops current wallet rescan triggered e.g. by an importprivkey call. Examples: Import a private key > raven-cli importprivkey "mykey" Abort the running wallet rescan > raven-cli abortrescan As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abortrescan", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ abortrescan: "abortrescan", /** addmultisigaddress nrequired ["key",...] ( "account" ) Add a nrequired-to-sign multisignature address to the wallet. Each key is a Raven address or hex-encoded public key. If 'account' is specified (DEPRECATED), assign address to that account. Arguments: 1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses. 2. "keys" (string, required) A json array of raven addresses or hex-encoded public keys [ "address" (string) raven address or hex-encoded public key ..., ] 3. "account" (string, optional) DEPRECATED. An account to assign the addresses to. Result: "address" (string) A raven address associated with the keys. Examples: Add a multisig address from 2 addresses > raven-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" As json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ addmultisigaddress: "addmultisigaddress", /** addnode "node" "add|remove|onetry" Attempts to add or remove a node from the addnode list. Or try a connection to a node once. Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be full nodes/support SegWit as other outbound peers are (though such peers will not be synced from). Arguments: 1. "node" (string, required) The node (see getpeerinfo for nodes) 2. "command" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once Examples: > raven-cli addnode "192.168.0.6:8767" "onetry" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8767", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ addnode: "addnode", /** addtagtoaddress tag_name to_address (change_address) (asset_data) Assign a tag to a address Arguments: 1. "tag_name" (string, required) the name of the tag you are assigning to the address, if it doens't have '#' at the front it will be added 2. "to_address" (string, required) the address that will be assigned the tag 3. "change_address" (string, optional) The change address for the qualifier token to be sent to 4. "asset_data" (string, optional) The asset data (ipfs or a hash) to be applied to the transfer of the qualifier token Result: "txid" (string) The transaction id Examples: > raven-cli addtagtoaddress "#TAG" "to_address" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addtagtoaddress", "params": ["#TAG" "to_address"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > raven-cli addtagtoaddress "#TAG" "to_address" "change_address" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addtagtoaddress", "params": ["#TAG" "to_address" "change_address"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ addtagtoaddress: "addtagtoaddress", /** addwitnessaddress "address" Add a witness address for a script (with pubkey or redeemscript known). It returns the witness script. Arguments: 1. "address" (string, required) An address known to the wallet Result: "witnessaddress", (string) The value of the new address (P2SH of witness script). } **/ addwitnessaddress: "addwitnessaddress", /** backupwallet "destination" Safely copies current wallet file to destination, which can be a directory or a path with filename. Arguments: 1. "destination" (string) The destination directory or file Examples: > raven-cli backupwallet "backup.dat" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ backupwallet: "backupwallet", /** bumpfee has been deprecated on the RVN Wallet.**/ bumpfee: "bumpfee", /** cancelsnapshotrequest "asset_name" block_height Cancels the specified snapshot request. Arguments: 1. "asset_name" (string, required) The asset name for which the snapshot will be taken 2. "block_height" (number, required) The block height at which the snapshot will be take Result: { request_status: (string), } Examples: > raven-cli cancelsnapshotrequest "TRONCO" 12345 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "cancelsnapshotrequest", "params": ["PHATSTACKS" 34987] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ cancelsnapshotrequest: "cancelsnapshotrequest", /** checkaddressrestriction address restricted_name Checks to see if an address has been frozen by the given restricted asset Arguments: 1. "address" (string, required) the RVN address to search 1. "restricted_name" (string, required) the restricted asset to search Result: "true/false", (boolean) If the address is frozen Examples: > raven-cli checkaddressrestriction "address" "restricted_name" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "checkaddressrestriction", "params": ["address" "restricted_name"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ checkaddressrestriction: "checkaddressrestriction", /** checkaddresstag address tag_name Checks to see if an address has the given tag Arguments: 1. "address" (string, required) the RVN address to search 1. "tag_name" (string, required) the tag to search Result: "true/false", (boolean) If the address has the tag Examples: > raven-cli checkaddresstag "address" "tag_name" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "checkaddresstag", "params": ["address" "tag_name"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ checkaddresstag: "checkaddresstag", /** checkglobalrestriction restricted_name Checks to see if a restricted asset is globally frozen Arguments: 1. "restricted_name" (string, required) the restricted asset to search Result: "true/false", (boolean) If the restricted asset is frozen globally Examples: > raven-cli checkglobalrestriction "restricted_name" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "checkglobalrestriction", "params": ["restricted_name"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ checkglobalrestriction: "checkglobalrestriction", /** clearbanned Clear all banned IPs. Examples: > raven-cli clearbanned > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ clearbanned: "clearbanned", /** clearmempool Removes all transaction from the mempool Examples: > raven-cli clearmempool > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearmempool", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ clearmempool: "clearmempool", /** clearmessages Delete current database of messages Result:[ ] Examples: > raven-cli clearmessages > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearmessages", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ clearmessages: "clearmessages", /** combinerawtransaction ["hexstring",...] Combine multiple partially signed transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction. Arguments: 1. "txs" (string) A json array of hex strings of partially signed transactions [ "hexstring" (string) A transaction hash ,... ] Result: "hex" (string) The hex-encoded raw transaction with signature(s) Examples: > raven-cli combinerawtransaction ["myhex1", "myhex2", "myhex3"] **/ combinerawtransaction: "combinerawtransaction", /** createmultisig nrequired ["key",...] Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript. Arguments: 1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses. 2. "keys" (string, required) A json array of keys which are raven addresses or hex-encoded public keys [ "key" (string) raven address or hex-encoded public key ,... ] Result: { "address":"multisigaddress", (string) The value of the new multisig address. "redeemScript":"script" (string) The string value of the hex-encoded redemption script. } Examples: Create a multisig address from 2 addresses > raven-cli createmultisig 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ createmultisig: "createmultisig", /** 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: Operation Amount + Burn Address transfer 0 transferwithmessage 0 issue 500 to RXissueAssetXXXXXXXXXXXXXXXXXhhZGt issue (subasset) 100 to RXissueSubAssetXXXXXXXXXXXXXWcwhwL issue_unique 5 to RXissueUniqueAssetXXXXXXXXXXWEAe58 reissue 100 to RXReissueAssetXXXXXXXXXXXXXXVEFAWu issue_restricted 1500 to RXissueRestrictedXXXXXXXXXXXXzJZ1q reissue_restricted 100 to RXReissueAssetXXXXXXXXXXXXXXVEFAWu issue_qualifier 1000 to RXissueQuaLifierXXXXXXXXXXXXUgEDbC issue_qualifier (sub) 100 to RXissueSubQuaLifierXXXXXXXXXVTzvv5 tag_addresses 0.1 to RXaddTagBurnXXXXXXXXXXXXXXXXZQm5ya (per address) untag_addresses 0.1 to RXaddTagBurnXXXXXXXXXXXXXXXXZQm5ya (per address) freeze_addresses 0 unfreeze_addresses 0 freeze_asset 0 unfreeze_asset 0 Assets For Authorization: These operations require a specific asset input for authorization: Root Owner Token: reissue issue_unique issue_restricted reissue_restricted freeze_addresses unfreeze_addresses freeze_asset unfreeze_asset Root Qualifier Token: issue_qualifier (when issuing subqualifier) Qualifier Token: tag_addresses untag_addresses 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, 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, (number, required) The output number "sequence":n (number, 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 (number or string, required) The RVN amount or { (object) A json object of assets to send "transfer": { "asset-name": (string, required) asset name asset-quantity (number, required) the number of raw units to transfer ,... } } or { (object) A json object of describing the transfer and message contents to send "transferwithmessage": { "asset-name": (string, required) asset name asset-quantity, (number, required) the number of raw units to transfer "message":"hash", (string, required) ipfs hash or a txid hash "expire_time": n (number, required) utc time in seconds to expire the message } } 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. "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 "owner_change_address" (string, optional) the address where the owner token will be sent to. If not given, it will be sent to the output address } } or { (object) A json object describing how restricted asset to issue "issue_restricted": { "asset_name":"asset-name",(string, required) new asset name "asset_quantity":n, (number, required) the number of raw units to issue "verifier_string":"text", (string, required) the verifier string to be used for a restricted asset transfer verification "units":[0-8], (number, required) display units, between 0 (integral) and 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 "owner_change_address" (string, optional) the address where the owner token will be sent to. If not given, it will be sent to the output address } } or { (object) A json object describing follow-on asset issue. "reissue_restricted": { "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 "verifier_string":"text", (string, optional) the verifier string to be used for a restricted asset transfer verification "ipfs_hash":"hash", (string, optional) An ipfs hash for discovering asset metadata, Overrides the current ipfs hash if given "owner_change_address" (string, optional) the address where the owner token will be sent to. If not given, it will be sent to the output address } } or { (object) A json object describing a new qualifier to issue. "issue_qualifier": { "asset_name":"asset_name", (string, required) a qualifier name (starts with '#') "asset_quantity":n, (numeric, optional, default=1) the number of units to be issued (1 to 10) "has_ipfs":[0-1], (boolean, optional, default=false), whether ifps hash is going to be added to the asset "ipfs_hash":"hash", (string, optional but required if has_ipfs = 1), an ipfs hash or a txid hash once RIP5 is activated "root_change_address" (string, optional) Only applies when issuing subqualifiers. The address where the root qualifier will be sent. If not specified, it will be sent to the output address. "change_quantity":"qty" (numeric, optional) the asset change amount (defaults to 1) } } or { (object) A json object describing addresses to be tagged. The address in the key will used as the asset change address. "tag_addresses": { "qualifier":"qualifier", (string, required) a qualifier name (starts with '#') "addresses":["addr", ...], (array, required) the addresses to be tagged (up to 10) "change_quantity":"qty", (numeric, optional) the asset change amount (defaults to 1) } } or { (object) A json object describing addresses to be untagged. The address in the key will be used as the asset change address. "untag_addresses": { "qualifier":"qualifier", (string, required) a qualifier name (starts with '#') "addresses":["addr", ...], (array, required) the addresses to be untagged (up to 10) "change_quantity":"qty", (numeric, optional) the asset change amount (defaults to 1) } } or { (object) A json object describing addresses to be frozen. The address in the key will used as the owner change address. "freeze_addresses": { "asset_name":"asset_name", (string, required) a restricted asset name (starts with '$') "addresses":["addr", ...], (array, required) the addresses to be frozen (up to 10) } } or { (object) A json object describing addresses to be frozen. The address in the key will be used as the owner change address. "unfreeze_addresses": { "asset_name":"asset_name", (string, required) a restricted asset name (starts with '$') "addresses":["addr", ...], (array, required) the addresses to be untagged (up to 10) } } or { (object) A json object describing an asset to be frozen. The address in the key will used as the owner change address. "freeze_asset": { "asset_name":"asset_name", (string, required) a restricted asset name (starts with '$') } } or { (object) A json object describing an asset to be frozen. The address in the key will be used as the owner change address. "unfreeze_asset": { "asset_name":"asset_name", (string, required) a restricted asset name (starts with '$') } } 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}]" "{\"RXissueRestrictedXXXXXXXXXXXXzJZ1q\":1500,\"change_address\":change_amount,\"issuer_address\":{\"issue_restricted\":{\"asset_name\":\"$MYASSET\",\"asset_quantity\":1000000,\"verifier_string\":\"#TAG & !KYC\",\"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\":\"myasset\",\"vout\":0}]" "{\"address\":{\"transferwithmessage\":{\"MYASSET\":50,\"message\":\"hash\",\"expire_time\": utc_time}}}" > 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/ **/ createrawtransaction: "createrawtransaction", /** decodeblock "blockhex" Arguments: 1. "blockhex" (string, required) The block hex Result: { "hash" : "hash", (string) the block hash (same as provided) "size" : n, (numeric) The block size "strippedsize" : n, (numeric) The block size excluding witness data "weight" : n (numeric) The block weight as defined in BIP 141 "height" : n, (numeric) The block height or index "version" : n, (numeric) The block version "versionHex" : "00000000", (string) The block version formatted in hexadecimal "merkleroot" : "xxxx", (string) The merkle root "tx" : [ (array of string) The transaction ids "transactionid" (string) The transaction id ,... ], "time" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT) "nonce" : n, (numeric) The nonce "bits" : "1d00ffff", (string) The bits } Examples: > raven-cli decodeblock "xxxx" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodeblock", "params": ["xxxx"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ decodeblock: "decodeblock", /** decoderawtransaction "hexstring" Return a JSON object representing the serialized, hex-encoded transaction. Arguments: 1. "hexstring" (string, required) The transaction hex string Result: { "txid" : "id", (string) The transaction id "hash" : "id", (string) The transaction hash (differs from txid for witness transactions) "size" : n, (numeric) The transaction size "vsize" : n, (numeric) The virtual transaction size (differs from size for witness transactions) "version" : n, (numeric) The version "locktime" : ttt, (numeric) The lock time "vin" : [ (array of json objects) { "txid": "id", (string) The transaction id "vout": n, (numeric) The output number "scriptSig": { (json object) The script "asm": "asm", (string) asm "hex": "hex" (string) hex }, "txinwitness": ["hex", ...] (array of string) hex-encoded witness data (if any) "sequence": n (numeric) The script sequence number } ,... ], "vout" : [ (array of json objects) { "value" : x.xxx, (numeric) The value in RVN "n" : n, (numeric) index "scriptPubKey" : { (json object) "asm" : "asm", (string) the asm "hex" : "hex", (string) the hex "reqSigs" : n, (numeric) The required sigs "type" : "pubkeyhash", (string) The type, eg 'pubkeyhash' "asset" : { (json object) optional "name" : "name", (string) the asset name "amount" : n, (numeric) the amount of asset that was sent "message" : "message", (string optional) the message if one was sent "expire_time" : n, (numeric optional) the message epoch expiration time if one was set "addresses" : [ (json array of string) "12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc" (string) raven address ,... ] } } ,... ], } Examples: > raven-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:8766/ **/ decoderawtransaction: "decoderawtransaction", /** decodescript "hexstring" Decode a hex-encoded script. Arguments: 1. "hexstring" (string) the hex encoded script Result: { "asm":"asm", (string) Script public key "hex":"hex", (string) hex encoded public key "type":"type", (string) The output type "asset" : { (json object) optional "name" : "name", (string) the asset name "amount" : n, (numeric) the amount of asset that was sent "message" : "message", (string optional) the message if one was sent "expire_time" : n, (numeric optional ) the message epoch expiration time if one was set "reqSigs": n, (numeric) The required signatures "addresses": [ (json array of string) "address" (string) raven address ,... ], "p2sh":"address", (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH). "(The following only appears if the script is an asset script) "asset_name":"name", (string) Name of the asset. "amount":"x.xx", (numeric) The amount of assets interacted with. "units": n, (numeric) The units of the asset. (Only appears in the type (new_asset)) "reissuable": true|false, (boolean) If this asset is reissuable. (Only appears in type (new_asset|reissue_asset)) "hasIPFS": true|false, (boolean) If this asset has an IPFS hash. (Only appears in type (new_asset if hasIPFS is true)) "ipfs_hash": "hash", (string) The ipfs hash for the new asset. (Only appears in type (new_asset)) "new_ipfs_hash":"hash", (string) If new ipfs hash (Only appears in type. (reissue_asset)) } Examples: > raven-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:8766/ **/ decodescript: "decodescript", /** disconnectnode "[address]" [nodeid] Immediately disconnects from the specified peer node. Strictly one out of 'address' and 'nodeid' can be provided to identify the node. To disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only. Arguments: 1. "address" (string, optional) The IP address/port of the node 2. "nodeid" (number, optional) The node ID (see getpeerinfo for node IDs) Examples: > raven-cli disconnectnode "192.168.0.6:8767" > raven-cli disconnectnode "" 1 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8767"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ disconnectnode: "disconnectnode", /** distributereward "asset_name" snapshot_height "distribution_asset_name" gross_distribution_amount ( "exception_addresses" ) ("change_address") ("dry_run") Splits the specified amount of the distribution asset to all owners of asset_name that are not in the optional exclusion_addresses Arguments: 1. "asset_name" (string, required) The reward will be distributed all owners of this asset 2. "snapshot_height" (number, required) The block height of the ownership snapshot 3. "distribution_asset_name" (string, required) The name of the asset that will be distributed, or RVN 4. "gross_distribution_amount" (number, required) The amount of the distribution asset that will be split amongst all owners 5. "exception_addresses" (string, optional) Ownership addresses that should be excluded 6. "change_address" (string, optional) If the rewards can't be fully distributed. The change will be sent to this address Result: { error_txn_gen_failed: (string), error_nsf: (string), error_rejects: (string), error_db_update: (string), batch_results: [ { transaction_id: (string), error_txn_rejected: (string), total_amount: (number), fee: (number), expected_count: (number), actual_count: (number), } ] } Examples: > raven-cli distributereward "TRONCO" 12345 "RVN" 1000 > raven-cli distributereward "PHATSTACKS" 12345 "DIVIDENDS" 1000 "mwN7xC3yomYdvJuVXkVC7ymY9wNBjWNduD,n4Rf18edydDaRBh7t6gHUbuByLbWEoWUTg" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "distributereward", "params": ["TRONCO" 34987 "DIVIDENDS" 100000] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "distributereward", "params": ["PHATSTACKS" 34987 "RVN" 100000 "mwN7xC3yomYdvJuVXkVC7ymY9wNBjWNduD,n4Rf18edydDaRBh7t6gHUbuByLbWEoWUTg"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ distributereward: "distributereward", /** dumpprivkey "address" Reveals the private key corresponding to 'address'. Then the importprivkey can be used with this output Arguments: 1. "address" (string, required) The raven address for the private key Result: "key" (string) The private key Examples: > raven-cli dumpprivkey "myaddress" > raven-cli importprivkey "mykey" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["myaddress"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ dumpprivkey: "dumpprivkey", /** dumpwallet "filename" Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files. Arguments: 1. "filename" (string, required) The filename with path (either absolute or relative to ravend) Result: { (json object) "filename" : { (string) The filename with full absolute path } Examples: > raven-cli dumpwallet "test" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ dumpwallet: "dumpwallet", /** encryptwallet "passphrase" Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server. Arguments: 1. "passphrase" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long. Examples: Encrypt your wallet > raven-cli encryptwallet "my pass phrase" Now set the passphrase to use the wallet, such as for signing or sending raven > raven-cli walletpassphrase "my pass phrase" Now we can do something like sign > raven-cli signmessage "address" "test message" Now lock the wallet again by removing the passphrase > raven-cli walletlock As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ encryptwallet: "encryptwallet", /** estimatefee nblocks DEPRECATED. Please use estimatesmartfee for more intelligent estimates. Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks. Uses virtual transaction size of transaction as defined in BIP 141 (witness data is discounted). Arguments: 1. nblocks (numeric, required) Result: n (numeric) estimated fee-per-kilobyte A negative value is returned if not enough transactions and blocks have been observed to make an estimate. -1 is always returned for nblocks == 1 as it is impossible to calculate a fee that is high enough to get reliably included in the next block. Example: > raven-cli estimatefee 6 **/ estimatefee: "estimatefee", /** estimatesmartfee conf_target ("estimate_mode") Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within conf_target blocks if possible and return the number of blocks for which the estimate is valid. Uses virtual transaction size as defined in BIP 141 (witness data is discounted). Arguments: 1. conf_target (numeric) Confirmation target in blocks (1 - 1008) 2. "estimate_mode" (string, optional, default=CONSERVATIVE) The fee estimate mode. Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of: "UNSET" (defaults to CONSERVATIVE) "ECONOMICAL" "CONSERVATIVE" Result: { "feerate" : x.x, (numeric, optional) estimate fee rate in RVN/kB "errors": [ str... ] (json array of strings, optional) Errors encountered during processing "blocks" : n (numeric) block number where estimate was found } The request target will be clamped between 2 and the highest target fee estimation is able to return based on how long it has been running. An error is returned if not enough transactions and blocks have been observed to make an estimate for any number of blocks. Example: > raven-cli estimatesmartfee 6 **/ estimatesmartfee: "estimatesmartfee", /** freezeaddress asset_name address (change_address) (asset_data) Freeze an address from transferring a restricted asset Arguments: 1. "asset_name" (string, required) the name of the restricted asset you want to freeze 2. "address" (string, required) the address that will be frozen 3. "change_address" (string, optional) The change address for the owner token of the restricted asset 4. "asset_data" (string, optional) The asset data (ipfs or a hash) to be applied to the transfer of the owner token Result: "txid" (string) The transaction id Examples: > raven-cli freezeaddress "$RESTRICTED_ASSET" "address" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "freezeaddress", "params": ["$RESTRICTED_ASSET" "address"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > raven-cli freezeaddress "$RESTRICTED_ASSET" "address" "change_address" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "freezeaddress", "params": ["$RESTRICTED_ASSET" "address" "change_address"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ freezeaddress: "freezeaddress", /** freezerestrictedasset asset_name (change_address) (asset_data) Freeze all trading for a specific restricted asset Arguments: 1. "asset_name" (string, required) the name of the restricted asset you want to unfreeze 2. "change_address" (string, optional) The change address for the owner token of the restricted asset 3. "asset_data" (string, optional) The asset data (ipfs or a hash) to be applied to the transfer of the owner token Result: "txid" (string) The transaction id Examples: > raven-cli freezerestrictedasset "$RESTRICTED_ASSET" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "freezerestrictedasset", "params": ["$RESTRICTED_ASSET"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > raven-cli freezerestrictedasset "$RESTRICTED_ASSET" "change_address" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "freezerestrictedasset", "params": ["$RESTRICTED_ASSET" "change_address"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ freezerestrictedasset: "freezerestrictedasset", /** fundrawtransaction "hexstring" ( options ) Add inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add at most one change output to the outputs. No existing outputs will be modified unless "subtractFeeFromOutputs" is specified. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that. Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees). You can see whether this is the case by checking the "solvable" field in the listunspent output. Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only Arguments: 1. "hexstring" (string, required) The hex string of the raw transaction 2. options (object, optional) { "changeAddress" (string, optional, default pool address) The raven address to receive the change "changePosition" (numeric, optional, default random) The index of the change output "includeWatching" (boolean, optional, default false) Also select inputs which are watch only "lockUnspents" (boolean, optional, default false) Lock selected unspent outputs "feeRate" (numeric, optional, default not set: makes wallet determine the fee) Set a specific fee rate in RVN/kB "subtractFeeFromOutputs" (array, optional) A json array of integers. The fee will be equally deducted from the amount of each specified output. The outputs are specified by their zero-based index, before any change output is added. Those recipients will receive less ravens than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. [vout_index,...] Allows this transaction to be replaced by a transaction with higher fees "conf_target" (numeric, optional) Confirmation target (in blocks) "estimate_mode" (string, optional, default=UNSET) The fee estimate mode, must be one of: "UNSET" "ECONOMICAL" "CONSERVATIVE" } for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true} Result: { "hex": "value", (string) The resulting raw transaction (hex-encoded string) "fee": n, (numeric) Fee in RVN the resulting transaction pays "changepos": n (numeric) The position of the added change output, or -1 } Examples: Create a transaction with no inputs > raven-cli createrawtransaction "[]" "{\"myaddress\":0.01}" Add sufficient unsigned inputs to meet the output value > raven-cli fundrawtransaction "rawtransactionhex" Sign the transaction > raven-cli signrawtransaction "fundedtransactionhex" Send the transaction > raven-cli sendrawtransaction "signedtransactionhex" **/ fundrawtransaction: "fundrawtransaction", /** generate nblocks ( maxtries ) Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet. Arguments: 1. nblocks (numeric, required) How many blocks are generated immediately. 2. maxtries (numeric, optional) How many iterations to try (default = 1000000). Result: [ blockhashes ] (array) hashes of blocks generated Examples: Generate 11 blocks > raven-cli generate 11 **/ generate: "generate", /** generatetoaddress nblocks address (maxtries) Mine blocks immediately to a specified address (before the RPC call returns) Arguments: 1. nblocks (numeric, required) How many blocks are generated immediately. 2. address (string, required) The address to send the newly generated raven to. 3. maxtries (numeric, optional) How many iterations to try (default = 1000000). Result: [ blockhashes ] (array) hashes of blocks generated Examples: Generate 11 blocks to myaddress > raven-cli generatetoaddress 11 "myaddress" **/ generatetoaddress: "generatetoaddress", /** getaccount "address" DEPRECATED. Returns the account associated with the given address. Arguments: 1. "address" (string, required) The raven address for account lookup. Result: "accountname" (string) the account address Examples: > raven-cli getaccount "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccount", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ getaccount: "getaccount", /** getaccountaddress "account" DEPRECATED. Returns the current Raven address for receiving payments to this account. Arguments: 1. "account" (string, required) The account name for the address. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name. Result: "address" (string) The account raven address Examples: > raven-cli getaccountaddress > raven-cli getaccountaddress "" > raven-cli getaccountaddress "myaccount" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccountaddress", "params": ["myaccount"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ getaccountaddress: "getaccountaddress", /** getaddednodeinfo ( "node" ) Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here) Arguments: 1. "node" (string, optional) If provided, return information about this specific node, otherwise all nodes are returned. Result: [ { "addednode" : "192.168.0.201", (string) The node IP address or name (as provided to addnode) "connected" : true|false, (boolean) If connected "addresses" : [ (list of objects) Only when connected = true { "address" : "192.168.0.201:8767", (string) The raven server IP and port we're connected to "connected" : "outbound" (string) connection, inbound or outbound } ] } ,... ] Examples: > raven-cli getaddednodeinfo "192.168.0.201" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": ["192.168.0.201"] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ **/ getaddednodeinfo: "getaddednodeinfo", /** getaddressbalance Returns the balance for an address(es) (requires addressindex to be enabled). Arguments: { "addresses:" [ "address" (string) The base58check encoded address ,... ] }, "includeAssets" (boolean, optional, default false) If true this will return an expanded result which includes asset balances Result: { "balance" (string) The current balance in satoshis "received" (string) The total number of satoshis received (including change) } OR [ { "assetName" (string) The asset associated with the balance (RVN for Ravencoin) "balance" (string) The current balance in satoshis "received" (string) The total number of satoshis received (including change) },... ] Examples: > raven-cli getaddressbalance '{"addresses": ["12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"]}' > raven-cli getaddressbalance '{"addresses": ["12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"]}', true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:8766/ > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressbalance", "params": [{"addresses": ["12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"]}, true] }' -H 'content-type: text/plai