Skip to content
pineplatform edited this page Jul 24, 2019 · 6 revisions

PROT API call list (as of version 1.1.1)

Table of Contents

Common operations

Listing my PROT addresses

Listing the PROT addresses in your wallet is easily done via listreceivedbyaddress. It normally lists only addresses which already have received transactions, however you can list all the addresses by setting the first argument to 0, and the second one to true. Accounts are used to organize addresses.

Full list

Required arguments are denoted inside < and > Optional arguments are inside [and].

Command Parameters Description Requires unlocked wallet?
getbestblockhash   Returns the hash of the best (tip) block in the longest block chain. N
getblock <hash> [verbose] Returns information about the block with the given hash. N
getblockchaininfo   Returns an object containing various state info regarding block chain processing. N
getblockcount   Returns the number of blocks in the longest block chain. N
getblockhash <index> Returns hash of block in best-block-chain at index provided. N
getblockheader <hash> [verbose] If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash' header. If verbose is true, returns an Object with information about block <hash> header. N
getchaintips   Return information about all known tips in the block tree, including the main chain as well as orphaned branches. N
getdifficulty   Returns the proof-of-work difficulty as a multiple of the minimum difficulty. N
getmempoolinfo   Returns details on the active state of the TX memory pool. N
getrawmempool [verbose] Returns all transaction ids in memory pool as a json array of string transaction ids. N
gettxout <txid> <n> [includemempool=true] Returns details about an unspent transaction output. N
gettxoutsetinfo   Returns statistics about the unspent transaction output set. N
invalidateblock <hash> Permanently marks a block as invalid, as if it violated a consensus rule. N
reconsiderblock <hash> Removes invalidity status of a block and its descendants, reconsider them for activation. This can be used to undo the effects of invalidateblock. N
verifychain [numblocks=288] Verifies blockchain database. N
getinfo   Returns an object containing various state info. N
help [command] List all commands, or get help for a specified command. N
stop   Stop PROT server. N
prioritisetransaction <txid> <priority delta> <fee delta> Accepts the transaction into mined blocks at a higher (or lower) priority N
reservebalance [reserve] [amount] Show or set the reserve amount not participating in network protection. If no parameters provided current setting is printed. Y
addnode <node> <add|remove|onetry> Attempts add or remove a node from the addnode list. Or try a connection to a node once. N
clearbanned   version 1.1.1 Clear all banned IPs. N
getaddednodeinfo <dns> [node] Returns information about the given added node, or all added nodes. (note that onetry addnodes are not listed here) If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available. N
getconnectioncount   Returns the number of connections to other nodes. N
getnettotals   Returns information about network traffic, including bytes in, bytes out, and current time. N
getnetworkinfo   Returns an object containing various state info regarding P2P networking. N
getpeerinfo   Returns data about each connected network node as a json array of objects. N
listbanned   version 1.1.1 List all banned IPs/Subnets. N
ping   Requests that a ping be sent to all other nodes, to measure ping time. N
checkbudgets   Initiates a buddget check cycle manually. N
createmasternodekey   Create a new masternode private key. N
getbudgetinfo [proposal] Show current masternode budgets with optional filter by proposal name. N
getbudgetprojection   Show the projection of which proposals will be paid the next cycle. N
getbudgetvotes <proposal> Print vote information for a budget proposal. N
getmasternodecount   Get masternode count values. N
getmasternodeoutputs   Print all masternode transaction outputs. N
getmasternodescores [blocks=10] Print list of winning masternode by score. N
getmasternodestatus   Print masternode status. N
getmasternodewinners [blocks=10] [filter] Print the masternode winners for the last n blocks N
getnextsuperblock   Print the next super block height N
listmasternodeconf [filter] Print masternode.conf in JSON format. N
listmasternodes [filter] Get a ranked list of masternodes. Optional filter by txhash, status, or payment address. N
masternodeconnect <address> Attempts to connect to specified masternode address. N
masternodecurrent &nbsp Get current masternode winner. N
masternodedebug &nbsp Print masternode status. N
mnbudgetrawvote <masternode-tx-hash> <masternode-tx-index> <proposal-hash> <yes|no> <time> <vote-sig> Compile and relay a proposal vote with provided external signature instead of signing vote internally. N
mnbudgetvote <local|many|alias> <votehash> <yes|no> [alias] Vote on a budget proposal. N
mnfinalbudget <command> [passphrase] Vote or show current budgets. Y/N
mnsync <status|reset> Returns the sync status or resets sync. N
preparebudget <proposal-name> <url> <payment-count> <block-start> <PROT-address> <monthly-payment> Prepare proposal for network by signing and creating tx. Y
spork <show|active> Print raw value or active status of sporks. N
startmasternode <local|all|many|missing|disabled|alias> <lockwallet> [alias] Attempts to start one or more masternode(s). Y/N
submitbudget <proposal-name> <url> <payment-count> <block-start> <PROT-address> <monthly-payment> <fee-tx> Submit proposal to the network. N
Raw Transactions
createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...} Creates a Raw Transactions spending given inputs. N
decoderawtransaction <hex string> Produces a human-readable JSON object for a Raw Transactions. N
decodescript <hex> Decode a hex-encoded script. N
getrawtransaction <txid> [verbose=0] Returns Raw Transactions representation for given transaction id. N
sendrawtransaction <hexstring> [allowhighfees=false] [swiftx=false] Submits raw transaction (serialized, hex-encoded) to local node and network. N
signrawtransaction <hexstring&rt; [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighashtype=ALL] Adds signatures to a Raw Transactions and returns the resulting raw transaction. Y/N
createmultisig <nrequired> <'["key",...]'> Creates a multi-signature address with n signature of m keys required. N
estimatefee <nblocks> Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks. N
estimatepriority <nblocks> Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks. N
validateaddress <PROTaddress> Return information about the given PROT address. N
verifymessage <PROTaddress> <signature> <message> Verify a signed message. N
addmultisigaddress <nrequired> <'["key",...]'> [account] Add a nrequired-to-sign multisignature address to the wallet. Each key is a PROT address or hex-encoded public key. If 'account' is specified, assign address to that account. Y/N
autocombinerewards <true|false> [threshold] Wallet will automatically monitor for any coins with value below the threshold amount, and combine them if they reside with the same PROT address. Y
backupwallet <destination> Safely copies wallet.dat to destination, which can be a directory or a path with filename. N
bip38decrypt <PROTaddress> <passphrase> Decrypts and then imports password protected private key. Y
bip38encrypt <PROTaddress> <passphrase> Encrypts a private key corresponding to 'PROTaddress'. Y
dumpprivkey <PROTaddress> Reveals the private key corresponding to 'PROTaddress'. Y
dumpwallet <filename> Dumps all wallet keys in a human-readable format. Y
encryptwallet <passphrase> Encrypts the wallet with <passphrase>. N
getaccount <PROTaddress> Returns the account associated with the given address. N
getaccountaddress <account> Returns the current bitcoin address for receiving payments to this account. If <account> does not exist, it will be created along with an associated new address that will be returned. N
getaddressesbyaccount <account> Returns the list of addresses for the given account. N
getbalance [account] [minconf=1] [includeWatchonly=false] If [account] is not specified, returns the server's total available balance.
If [account] is specified, returns the balance in the account.
getnewaddress [account] Returns a new PROT address for receiving payments. If [account] is specified payments received with the address will be credited to [account]. Y
getrawchangeaddress   Returns a new PROT address, for receiving change. This is for use with raw transactions, NOT normal use. N
getreceivedbyaccount [account] [minconf=1] Returns the total amount received by addresses with [account] in transactions with at least [minconf] confirmations. If [account] not provided return will include all transactions to all accounts. N
getreceivedbyaddress <PROTaddress> [minconf=1] Returns the amount received by <PROTaddress> in transactions with at least [minconf] confirmations. It correctly handles the case where someone has sent to the address in multiple transactions. Keep in mind that addresses are only ever used for receiving transactions. Works only for addresses in the local wallet, external addresses will always show 0. N
getstakesplitthreshold &nbsp Returns the threshold for stake splitting. N
getstakingstatus &nbsp Returns an object containing various staking information. N
gettransaction <txid> [includeWatchonly] Get detailed information about in-wallet transaction <txid>. N
getunconfirmedbalance   Returns the server's total unconfirmed balance . N
getwalletinfo   Returns an object containing various wallet state info. N
importaddress <address> [label] [rescan=true] Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Y
importprivkey <PROTprivkey> [label] [rescan=true] Adds a private key (as returned by dumpprivkey) to your wallet. Y
importwallet <filename> Imports keys from a wallet dump file (see dumpwallet). Y
keypoolrefill <newsize> Fills the keypool. Y
listaccounts [minconf] [includeWatchonly=false] Returns Object that has account names as keys, account balances as values. N
listaddressgroupings   Returns all addresses in the wallet and info used for coincontrol. N
listlockunspent   Returns list of temporarily unspendable outputs. N
listreceivedbyaccount [minconf=1] [includeempty=false] [includeWatchonly=false] List balances by account. N
listreceivedbyaddress [minconf=1] [includeempty=false] [includeWatchonly=false] List balances by receiving address. N
listsinceblock [blockhash] [target-confirmations] [includeWatchonly=false] Get all transactions in blocks since block [blockhash], or all transactions if omitted. N
listtransactions [account] [count=10] [from=0] [includeWatchonly=false] Returns up to [count] most recent transactions skipping the first [from] transactions for account [account]. If [account] not provided it'll return recent transactions from all accounts. N
listunspent [minconf=1] [maxconf=9999999] ['["addresses",...]'] Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses. N
lockunspent <unlock> <'[{"txid":"txid","vout":n},...]'> Updates list of temporarily unspendable outputs. Y
move <fromaccount> <toaccount> <amount> [minconf=1] [comment] Move from one account in your wallet to another N
sendfrom <fromaccount> <toPROTaddress> <amount> [minconf=1] [comment] [comment-to] <amount> is a real and is rounded to 8 decimal places. Will send the given amount to the given address, ensuring the account has a valid balance using [minconf] confirmations. Returns the transaction ID if successful (not in JSON object). Y
sendmany <fromaccount> {address:amount,...} [minconf=1] [comment] Send multiple times. Amounts are double-precision floating point numbers Y
sendtoaddress <PROTaddress> <amount> [comment] [comment-to] Send an amount to a given address. <amount> is a real and is rounded to 8 decimal places. Returns the transaction ID <txid> if successful. Y
sendtoaddressix <PROTaddress> <amount> [comment] [comment-to] Send an amount to a given address using SwiftX. <amount> is a real and is rounded to 8 decimal places. Returns the transaction ID <txid> if successful. Y
setaccount <PROTaddress> <account> Sets the account associated with the given address. Assigning address that is already assigned to the same account will create a new address associated with that account. N
setstakesplitthreshold <value> This will set the output size of your stakes to never be below the given value. Y
settxfee <amount> Set the transaction fee per kB. N
signmessage <PROTaddress> <message> Sign a message with the private key of an address. Y
walletlock   Removes the wallet encryption key from memory, locking the wallet. Y
walletpassphrase <passphrase> <timeout> [anonymizeonly=false] Stores the wallet decryption key in memory for 'timeout' seconds. N
walletpassphrasechange <oldpassphrase> <newpassphrase> Changes the wallet passphrase from 'oldpassphrase' to 'newpassphrase'. N

Error Codes

See rpcprotocol.h for the list of error codes and their meanings.

See Also


    Clone this wiki locally
    You can’t perform that action at this time.