Skip to content

API Calls List

BytzCK edited this page Nov 10, 2021 · 10 revisions

BYTZ API call list (as of version 3.1.99.0-f1309bf)

Table of Contents

Common operations

Listing my BYTZ addresses

Listing the BYTZ 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?
== Addressindex ==
getaddressbalance get balance of addresses N
getaddressdeltas Returns all changes for an address (requires addressindex to be enabled). N
getaddressmempool Returns all mempool deltas for an address (requires addressindex to be enabled). N
getaddresstxids Returns the txids for an address(es) (requires addressindex to be enabled). N
getaddressutxos Returns all unspent outputs for an address (requires addressindex to be enabled). N
== Blockchain ==
getbestblockhash Returns the hash of the best (tip) block in the longest block chain. N
getbestchainlock Returns information about the best chainlock. Throws an error if there is no known chainlock yet. N
getblock "blockhash" ( verbosity ) 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 height Returns hash of block in best-block-chain at index provided. N
getblockhashes timestamp Returns array of hashes of blocks within the timestamp range 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
getblockheaders "hash" ( count verbose ) Returns an array of items with information about blockheaders starting from . N
getblockstats hash_or_height ( stats )
getchaintips ( count branchlen ) Return information about all known tips in the block tree, including the main chain as well as orphaned branches. N
getchaintxstats ( nblocks blockhash ) Compute statistics about the total number and rate of transactions in the chain. N
getdifficulty Returns the proof-of-work difficulty as a multiple of the minimum difficulty. N
getmempoolancestors txid (verbose) If txid is in the mempool, returns all in-mempool ancestors. N
getmempooldescendants txid (verbose) If txid is in the mempool, returns all in-mempool descendants. N
getmempoolentry txid Returns mempool data for given transaction N
getmempoolinfo Returns details on the active state of the TX memory pool. N
getmerkleblocks "filter" "hash" ( count ) Returns an array of hex-encoded merkleblocks for blocks starting from which match . N
getrawmempool ( verbose ) Returns all transaction ids in memory pool as a json array of string transaction ids. N
getspecialtxes "blockhash" ( type count skip verbosity ) Returns an array of special transactions found in the specified block. N
getspentinfo Returns the txid and index where an output is spent. N
gettxout "txid" n ( include_mempool ) Returns details about an unspent transaction output. N
gettxoutproof ["txid",...] ( blockhash ) Returns a hex-encoded proof that "txid" was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included manually (by blockhash). N
gettxoutsetinfo Returns statistics about the unspent transaction output set. N
preciousblock "blockhash" Treats a block as if it were received before others with the same work. A later preciousblock call can override the effect of an earlier one. The effects of preciousblock are not retained across restarts. N
pruneblockchain "height" The block height to prune up to. May be set to a discrete height, or a unix timestamp to prune blocks whose block time is at least 2 hours older than the provided timestamp Y
savemempool Dumps the mempool to disk. It will fail until the previous dump is fully loaded. N
scantxoutset <action> ( <scanobjects> ) Scans the unspent transaction output set for possible entries that matches common scripts of given public keys. Using addresses as scanobjects will not detect unspent P2PK txouts N
verifychain ( checklevel nblocks ) Verifies blockchain database. N
verifytxoutproof "proof" Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain N
== Bytz ==
getgovernanceinfo Returns an object containing governance parameters. N
getsuperblockbudget index Returns the absolute maximum sum of superblock payments allowed. N
gobject "command" ...
gobject check Validate governance object data (proposal only) N
gobject prepare Prepare governance object by signing and creating tx N
gobject list-prepared Returns a list of governance objects prepared by this wallet with "gobject prepare" N
gobject submit Submit governance object to network N
gobject deserialize Deserialize governance object from hex string to JSON N
gobject count Count governance objects and votes (additional param: 'json' or 'all', default: 'json') N
gobject get Get governance object by hash N
gobject getcurrentvotes Get only current (tallying) votes for a governance object hash (does not include old votes) N
gobject list List governance objects (can be filtered by signal and/or object type) N
gobject diff List differences since last diff N
gobject vote-alias Vote on a governance object by masternode proTxHash N
gobject vote-conf Vote on a governance object by masternode configured in bytz.conf N
gobject vote-many Vote on a governance object by all masternodes for which the voting key is in the wallet N
masternode "command"
masternode count Get information about number of masternodes N
masternode current DEPRECATED Print info on current masternode winner to be paid the next block (calculated locally) N
masternode outputs Print masternode compatible outputs N
masternode status Print masternode status information N
masternode list Print list of all known masternodes (see masternodelist for more info) N
masternode payments Return information about masternode payments in a mined block N
masternode winner DEPRECATED Print info on next masternode winner to vote for N
masternode winners Print list of masternode winners N
masternodelist ( "mode" "filter" ) Get a list of masternodes in different modes. This call is identical to 'masternode list' call. N
mnsync [status|next|reset] Returns the sync status, updates to the next step or resets it entirely. N
spork "command"
spork show The value of the specific spork with the name SPORK_NAME N
spork active 'true' for time-based sporks if spork is active and 'false' otherwise N
spork SPORK_NAME spork_value set SPORK_NAME to start at spork_value block N
voteraw <mn-collateral-tx-hash> <mn-collateral-tx-index> <governance-hash> <vote-signal> [yes|no|abstain] <time> <vote-sig> Compile and relay a governance vote with provided external signature instead of signing vote internally N
uptime Returns the total uptime of the server. N
== Evo ==
bls "command" ...
bls generate Create a BLS secret/public key pair N
bls fromsecret Parse a BLS secret key and return the secret/public key pair N
protx "command"
protx register Create and send ProTx to network N
protx register_fund Fund, create and send ProTx to network N
protx register_prepare Create an unsigned ProTx N
protx register_submit Sign and submit a ProTx N
protx list List ProTxs N
protx info Return information about a ProTx N
protx update_service Create and send ProUpServTx to network N
protx update_registrar Create and send ProUpRegTx to network N
protx revoke Create and send ProUpRevTx to network N
protx diff Calculate a diff and a proof between two masternode lists N
quorum "command"
quorum list List of on-chain quorums N
quorum info Return information about a quorum N
quorum dkgsimerror Simulates DKG errors and malicious behavior N
quorum dkgstatus Return the status of the current DKG process N
quorum memberof Checks which quorums the given masternode is a member of N
quorum sign Threshold-sign a message N
quorum verify Test if a quorum signature is valid for a request id and a message hash N
quorum hasrecsig Test if a valid recovered signature is present N
quorum getrecsig Get a recovered signature N
quorum isconflicting Test if a conflict exists N
quorum selectquorum Return the quorum that would/should sign a request N
quorum getdata Request quorum data from other masternodes in the quorum N
verifychainlock "blockHash" "signature" ( blockHeight ) Test if a quorum signature is valid for a ChainLock. N
verifyislock "id" "txid" "signature" ( maxHeight ) Test if a quorum signature is valid for an InstantSend Lock N
== Generating ==
generate nblocks ( maxtries ) Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet. N
generatetoaddress nblocks address (maxtries) Mine blocks immediately to a specified address (before the RPC call returns) N
== Mining ==
getblocktemplate ( TemplateRequest ) PoW Only Returns data needed to construct a block to work on. N
getmininginfo PoW Only Returns a json object containing mining-related information. N
getnetworkhashps ( nblocks height ) PoW Only Returns the estimated network hashes per second based on the last n blocks. N
prioritisetransaction <txid> <fee delta> Accepts the transaction into mined blocks at a higher (or lower) priority N
submitblock "hexdata" ( "dummy" ) PoW Only Attempts to submit new block to network. N
== Network ==
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 Clear all banned IPs. N
disconnectnode "[address]" [nodeid] Immediately disconnects from the specified node. N
getaddednodeinfo ( "node" ) Returns the number of connections to other nodes. 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 List all banned IPs/Subnets. N
ping Requests that a ping be sent to all other nodes, to measure ping time. N
setban "subnet" "add|remove" (bantime) (absolute) Attempts add or remove a IP/Subnet from the banned list. N
setnetworkactive true|false Disable/enable all p2p network activity. N
== Rawtransactions ==
combinerawtransaction ["hexstring",...] Combine multiple partially signed transactions into one transaction.The combined transaction may be another partially signed transaction or a fully signed transaction. N
createrawtransaction [{"txid":"id","vout":n},...] [{"address":amount},{"data":"hex"},...] ( locktime ) Creates a Raw Transactions spending given inputs. N
decoderawtransaction "hexstring" Produces a human-readable JSON object for a Raw Transactions. N
decodescript "hexstring" Decode a hex-encoded script. N
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 Y
getrawtransaction "txid" ( verbose "blockhash" ) Returns Raw Transactions representation for given transaction id. N
sendrawtransaction "hexstring" ( allowhighfees instantsend bypasslimits) Submits raw transaction (serialized, hex-encoded) to local node and network. N
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype ) DEPRECATED. Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. N
signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype ) Adds signatures to a Raw Transactions and returns the resulting raw transaction. Y/N
== Tokens ==
configuremanagementtoken "ticker" "name" decimal_pos "metadata_url" metadata_hash "bls_pubkey" sticky_melt ( confirm_send ) Configures a new management token type. Currelty the only management tokens are MGT and GVN. N
configurenft "name" "mint_amount" "metadata_url" metadata_hash data data_filename ( confirm_send ) Configures a new token type.
configuretoken "ticker" "name" decimal_pos "metadata_url" metadata_hash ( confirm_send ) Configures a new token type. Y
createrawtokentransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} ( locktime ) Create a transaction spending the given inputs and creating new outputs. N
createtokenauthorities "groupid" "bytzaddress" authoritylist Creates new authorities and sends them to the specified address. N
decodetokenmetadata "data" Decode a hex-encoded token document to json N
droptokenauthorities "groupid" "transactionid" outputnr [ authority1 ( authority2 ... ) ] Drops a token group's authorities. N
encodetokenmetadata {"ticker":"ticker","name":"token name",...} reate the hash and hexadecimal representation of a token metadata document. N
getsubgroupid "groupid" "data" Translates a group and additional data into a subgroup identifier. N
gettokenbalance ( "groupid" ) ( "address" ) If groupID is not specified, returns all tokens with a balance (including token authorities). If a groupID is specified, returns the balance of the specified token group. N
gettokentransaction "txid" ( "blockhash" ) Return the token transaction data. N
listtokenauthorities ( "groupid" ) Lists the available token authorities. N
listtokenssinceblock "groupid" ( "blockhash" target-confirmations includeWatchonly ) Get all transactions in blocks since block [blockhash], or all transactions if omitted N
listtokentransactions ("groupid" count from includeWatchonly ) Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'. N
listunspenttokens ( minconf maxconf ["addresses",...] [include_unsafe] [query_options]) Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations.Optionally filter to only include txouts paid to specified addresses. N
melttoken "groupid" quantity Melts the specified amount of tokens. Y
minttoken "groupid" "bytzaddress" quantity Mint new tokens. Y
scantokens <action> ( <tokengroupid> ) Scans the unspent transaction output set for possible entries that belong to a specified token group. N
sendtoken "groupid" "address" amount ( "address" amount ) ( .. ) Sends token to a given address. Specify multiple addresses and amounts for multiple recipients. Y
signtokenmetadata "hex_data" "creation_address" Signs the raw token document using the supplied address. Y
tokeninfo [list, all, stats, groupid, ticker, name] ( "specifier " ) ( "creation_data" ) ( "nft_data" ) Returns information on all tokens configured on the blockchain. N
verifytokenmetadata "hex_data" "creation_address" "signature" Verifies that the given address is used to sign the token metadata document. N
== Util ==
createmultisig nrequired ["key",...] Creates a multi-signature address with n signature of m keys required. N
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. N
signmessagewithprivkey "privkey" "message" Sign a message with the private key of an address N
validateaddress "address" Return information about the given bytz address. N
verifymessage "address" "signature" "message" Verify a signed message. N
== Wallet ==
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 abandoned. Y
abortrescan Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call. N
addmultisigaddress nrequired ["key",...] ( "label" ) Add a nrequired-to-sign multisignature address to the wallet. Each key is a ION address or hex-encoded public key. If 'account' is specified, assign address to that account. Y/N
autocombinedust enable ( threshold ) Wallet will automatically monitor for any coins with value below the threshold amount, and combine them if they reside with the same ION address. Y
backupwallet "destination" Safely copies wallet.dat to destination, which can be a directory or a path with filename. N
createwallet "wallet_name" Creates and loads a new wallet. N
dumphdinfo Returns an object containing sensitive private info about this HD wallet. Y
dumpprivkey "address" Reveals the private key corresponding to 'address'. Y
dumpwallet "filename" Dumps all wallet keys in a human-readable format. Y
encryptwallet "passphrase" Encrypts the wallet with . N
getaccount (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) Returns the account associated with the given address. N
getaccountaddress (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) Returns the current bitcoin address for receiving payments to this account. If does not exist, it will be created along with an associated new address that will be returned. N
getaddressbyaccount (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) Returns the list of addresses for the given account. N
getaddressesbylabel "label" Returns the list of addresses assigned the specified label N
getaddressinfo "address" Return information about the given bytz address. Some information requires the address to be in the wallet. N
getbalance ( "(dummy)" minconf addlocked include_watchonly ) Returns the total available balance.The available balance is what the wallet considers currently spendable, and is thus affected by options which limit spendability such as -spendzeroconfchange.
Arguments:1. (dummy) (string, optional) Remains for backward compatibility. Must be excluded or set to "*"
2. minconf (numeric, optional, default=0) Only include transactions confirmed at least this many times.
3. addlocked (bool, optional, default=false) Whether to include the value of transactions locked via InstantSend in the wallet's balance.
4. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')
N
getnewaddress ( "label" ) Returns a new BYTZ address for receiving payments. If [account] is specified payments received with the address will be credited to [account]. Y
getrawchangeaddress Returns a new BYTZ address, for receiving change. This is for use with raw transactions, NOT normal use. N
getreceivedbyaccount (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) 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 "address" ( minconf addlocked ) Returns the amount received by "address" 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
getstakingstatus Returns an object containing various staking information. N
gettransaction "txid" ( include_watchonly ) 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 p2sh ) 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
importelectrumwallet "filename" index Imports keys from an Electrum wallet export file (.csv or .json) Y
importmulti "requests" ( "options" ) Import addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup. Y
importprivkey "privkey" ( "label" ) ( rescan ) Adds a private key (as returned by dumpprivkey) to your wallet. Y
importprunedfunds Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included. Y
importpubkey "pubkey" ( "label" rescan ) Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup. N
importwallet "filename" Imports keys from a wallet dump file (see dumpwallet). Y
keepass <genkey|init|setpassphrase> generate, initialize and set passphrase for keepass module N
keypoolrefill ( newsize ) Fills the keypool Y
listaccounts (Deprecated To use this command, start bytzd with -deprecatedrpc=accounts) Returns Object that has account names as keys, account balances as values. N
listaddressbalances ( minamount ) Lists addresses of this wallet and their balances N
listaddressgroupings Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions N
listlabels ( "purpose" ) Returns the list of all labels, or labels that are assigned to addresses with a specific purpose. N
listlockunspent Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending. N
listreceivedbyaccount (Deprecated To use this command, start bytzd with -deprecatedrpc=accounts) List incoming payments grouped by account. N
listreceivedbyaddress ( minconf addlocked include_empty include_watchonly address_filter ) List incoming payments grouped by receiving address N
listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed ) Get all transactions in blocks since block [blockhash], or all transactions if omitted. If "blockhash" is no longer a part of the main chain, transactions from the fork point onward are included. Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the "removed" array. N
listtransactions (label count skip include_watchonly) Returns up to 'count' most recent transactions skipping the first 'from' transactions.Note that the "account" argument and "otheraccount" return value have been removed. To use this RPC with an "account" argument, restart bytzd with -deprecatedrpc=accounts N
listunspent ( minconf maxconf ["addresses",...] [include_unsafe] [query_options]) Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses. N
listwallets Returns a list of currently loaded wallets. For full information on the wallet, use "getwalletinfo" N
loadwallet "filename" Loads a wallet from a wallet file or directory. Note that all wallet command-line options used when starting bytzd will be applied to the new wallet (eg -zapwallettxes, upgradewallet, rescan, etc). N
lockunspent unlock ([{"txid":"txid","vout":n},...]) Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending bytzs. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call Y
move (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) Move a specified amount from one account in your wallet to another. Y
removeprunedfunds "txid" Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances. Y
rescanblockchain ("start_height") ("stop_height") Rescan the local blockchain for wallet related transactions. N
sendfrom (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) (use sendtoaddress). Sent an amount from an account to a bytz address. Requires wallet passphrase to be set with walletpassphrase call. Y
sendmany "" {"address":amount,...} ( minconf addlocked "comment" ["address",...] subtractfeefrom |use_is use_cj conf_target "estimate_mode") Send multiple times. Amounts are double-precision floating point numbers Y
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount use_is use_cj conf_target "estimate_mode") Send an amount to a given address. Y
setaccount (Deprecated. To use this command, start bytzd with -deprecatedrpc=accounts) Sets the account associated with the given address. N
setstakesplitthreshold value This will set the output size of your stakes to never be below this number N
settxfee amount Set the transaction fee per kB. Overwrites the paytxfee parameter. Y
signmessage "address" "message" Sign a message with the private key of an address N
signrawtransactionwithwallet "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] sighashtype ) Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. Y
unloadwallet ( "wallet_name" ) Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument. Specifying the wallet name on a wallet endpoint is invalid. Y
upgradetohd ( "mnemonic" "mnemonicpassphrase" "walletpassphrase" ) Upgrades non-HD wallets to HD. Warning: You will need to make a new backup of your wallet after setting the HD wallet mnemonic. Y
walletlock Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked. Y
walletpassphrase "passphrase" timeout ( stakingonly ) Stores the wallet decryption key in memory for 'timeout' seconds. This is needed prior to performing transactions related to private keys such as sending bytzs N
walletpassphrasechange "oldpassphrase" "newpassphrase" hanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'. Y
== Zmq ==
getzmqnotifications Returns information about the active ZeroMQ notifications. N

Error Codes

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

See Also

References

Clone this wiki locally