[ { "name": "abandonclaim", "namespace": "Claimtrie", "description": "Create a transaction which spends a txout which assigned a value to a name, effectively abandoning that claim.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction containing the unspent txout which should be spent.", "is_required": true }, { "name": "address", "type": "string", "description": "The lbrycrd address to send to.", "is_required": true } ], "examples": [], "returns": "\"transactionid\" (string) The new transaction id." }, { "name": "abandonsupport", "namespace": "Claimtrie", "description": "Create a transaction which spends a txout which supported a name claim, effectively abandoning that support.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction containing the unspent txout which should be spent.", "is_required": true }, { "name": "address", "type": "string", "description": "The lbrycrd address to send to.", "is_required": true } ], "examples": [], "returns": "\"transactionid\" (string) The new transaction id." }, { "name": "checknormalization", "namespace": "Claimtrie", "description": "Given an unnormalized name of a claim, return normalized version of it", "arguments": [ { "name": "name", "type": "string", "description": "the name to normalize", "is_required": true } ], "examples": [], "returns": "\"normalized\" (string) fully normalized name" }, { "name": "claimname", "namespace": "Claimtrie", "description": "Create a transaction which issues a claim assigning a value to a name. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no other greater unspent transactions issuing a claim over the same name. The amount is a real and is rounded to the nearest 0.00000001", "arguments": [ { "name": "name", "type": "string", "description": "The name to be assigned the value.", "is_required": true }, { "name": "value", "type": "string", "description": "The value to assign to the name encoded in hexadecimal.", "is_required": true }, { "name": "amount", "type": "number", "description": "The amount in LBRYcrd to send. eg 0.1", "is_required": true } ], "examples": [], "returns": "\"transactionid\" (string) The transaction id." }, { "name": "getclaimbyid", "namespace": "Claimtrie", "description": "Get a claim by claim id", "arguments": [ { "name": "claimId", "type": "string", "description": "the claimId of this claim", "is_required": true } ], "examples": [], "returns": "{\n \"name\" (string) the original name of the claim (before normalization)\n \"normalized_name\" (string) the name of this claim (after normalization)\n \"value\" (string) metadata of the claim\n \"claimId\" (string) the claimId of this claim\n \"txid\" (string) the hash of the transaction which has successfully claimed this name\n \"n\" (numeric) vout value\n \"amount\" (numeric) txout value\n \"effective amount\" (numeric) txout amount plus amount from all supports associated with the claim\n \"supports\" (array of object) supports for this claim\n [\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"height\" (numeric) the height at which the support was included in the blockchain\n \"valid at height\" (numeric) the height at which the support is valid\n \"amount\" (numeric) the amount of the support\n \"value\" (string) the metadata of the support if any\n ]\n \"height\" (numeric) the height of the block in which this claim transaction is located\n \"valid at height\" (numeric) the height at which the claim is valid\n}" }, { "name": "getclaimsforname", "namespace": "Claimtrie", "description": "Return all claims and supports for a name", "arguments": [ { "name": "name", "type": "string", "description": "the name for which to get claims and supports", "is_required": true }, { "name": "blockhash", "type": "string", "description": "get claims for name at the block specified by this block hash. If none is given, the latest active block will be used.", "is_required": false } ], "examples": [], "returns": "{\n \"nLastTakeoverHeight\" (numeric) the last height at which ownership of the name changed\n \"normalized_name\" (string) the name of these claims after normalization\n \"claims\": [ (array of object) claims for this name\n {\n \"claimId\" (string) the claimId of this claim\n \"txid\" (string) the txid of this claim\n \"n\" (numeric) the index of the claim in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the claim was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the claim became/becomes valid\n \"nAmount\" (numeric) the amount of the claim\n \"value\" (string) the metadata of the claim\n \"nEffectiveAmount\" (numeric) the total effective amount of the claim, taking into effect whether the claim or support has reached its nValidAtHeight\n \"supports\" : [ (array of object) supports for this claim\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the support was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the support became/becomes valid\n \"nAmount\" (numeric) the amount of the support\n \"value\" (string) the metadata of the support if any\n ]\n \"name\" (string) the original name of this claim before normalization\n }\n ],\n \"supports without claims\": [ (array of object) supports that did not match a claim for this name\n {\n \"txid\" (string) the txid of the support\n \"n\" (numeric) the index of the support in the transaction's list of outputs\n \"nHeight\" (numeric) the height at which the support was included in the blockchain\n \"nValidAtHeight\" (numeric) the height at which the support became/becomes valid\n \"nAmount\" (numeric) the amount of the support\n }\n ]\n}" }, { "name": "getclaimsfortx", "namespace": "Claimtrie", "description": "Return any claims or supports found in a transaction", "arguments": [ { "name": "txid", "type": "string", "description": "the txid of the transaction to check for unspent claims", "is_required": true } ], "examples": [], "returns": "[\n {\n \"nOut\" (numeric) the index of the claim or support in the transaction's list of outputs\n \"claim type\" (string) 'claim' or 'support'\n \"name\" (string) the name claimed or supported\n \"claimId\" (string) if a claim, its ID\n \"value\" (string) if a name claim, the value of the claim\n \"supported txid\" (string) if a support, the txid of the supported claim\n \"supported nout\" (numeric) if a support, the index of the supported claim in its transaction\n \"depth\" (numeric) the depth of the transaction in the main chain\n \"in claim trie\" (boolean) if a name claim, whether the claim is active, i.e. has made it into the trie\n \"is controlling\" (boolean) if a name claim, whether the claim is the current controlling claim for the name\n \"in support map\" (boolean) if a support, whether the support is active, i.e. has made it into the support map\n \"in queue\" (boolean) whether the claim is in a queue waiting to be inserted into the trie or support map\n \"blocks to valid\" (numeric) if in a queue, the number of blocks until it's inserted into the trie or support map\n }\n]" }, { "name": "getclaimsintrie", "namespace": "Claimtrie", "description": "Return all names in the trie.", "arguments": [ { "name": "blockhash", "type": "string", "description": "get claims in the trie at the block specified by this block hash. If none is given, the latest active block will be used.", "is_required": false } ], "examples": [], "returns": "\"names\" (array) all names in the trie that have claims" }, { "name": "getnameproof", "namespace": "Claimtrie", "description": "Return the cryptographic proof that a name maps to a value or doesn't.", "arguments": [ { "name": "name", "type": "string", "description": "the name to get a proof for", "is_required": true }, { "name": "blockhash", "type": "string", "description": "the hash of the block which is the basis of the proof. If none is given, the latest block will be used.", "is_required": false } ], "examples": [], "returns": "{\n \"nodes\" : [ (array of object) full nodes (i.e.\n those which lead to\n the requested name)\n \"children\" : [ (array of object) the children of\n this node\n \"child\" : { (object) a child node, either leaf or\n reference to a full node\n \"character\" : \"char\" (string) the character which\n leads from the parent\n to this child node\n \"nodeHash\" : \"hash\" (string, if exists) the hash of\n the node if\n this is a \n leaf node\n }\n ]\n \"valueHash\" (string, if exists) the hash of this\n node's value, if\n it has one. If \n this is the\n requested name\n this will not\n exist whether\n the node has a\n value or not\n ]\n \"txhash\" : \"hash\" (string, if exists) the txid of the\n claim which controls\n this name, if there\n is one.\n \"nOut\" : n, (numeric) the nOut of the claim which\n controls this name, if there\n is one.\n \"last takeover height\" (numeric) the most recent height at\n which the value of a name\n changed other than through\n an update to the winning\n bid\n }\n}" }, { "name": "gettotalclaimednames", "namespace": "Claimtrie", "description": "Return the total number of names that have been successfully claimed, and therefore exist in the trie", "arguments": [], "examples": [], "returns": "\"total names\" (numeric) the total number of\n names in the trie" }, { "name": "gettotalclaims", "namespace": "Claimtrie", "description": "Return the total number of active claims in the trie", "arguments": [], "examples": [], "returns": "\"total claims\" (numeric) the total number\n of active claims" }, { "name": "gettotalvalueofclaims", "namespace": "Claimtrie", "description": "Return the total value of the claims in the trie", "arguments": [ { "name": "controlling_only", "type": "boolean", "description": "only include the value of controlling claims", "is_required": true } ], "examples": [], "returns": "\"total value\" (numeric) the total value of the\n claims in the trie" }, { "name": "getvalueforname", "namespace": "Claimtrie", "description": "Return the winning value associated with a name, if one exists", "arguments": [ { "name": "name", "type": "string", "description": "the name to look up", "is_required": true }, { "name": "blockhash", "type": "string", "description": "get the value associated with the name at the block specified by this block hash. If none is given, the latest active block will be used.", "is_required": false } ], "examples": [], "returns": "\"value\" (string) the value of the name, if it exists\n\"claimId\" (string) the claimId for this name claim\n\"txid\" (string) the hash of the transaction which successfully claimed the name\n\"n\" (numeric) vout value\n\"amount\" (numeric) txout amount\n\"effective amount\" (numeric) txout amount plus amount from all supports associated with the claim\n\"height\" (numeric) the height of the block in which this transaction is located\n\"name\" (string) the original name of this claim (before normalization)" }, { "name": "listnameclaims", "namespace": "Claimtrie", "description": "Return a list of all transactions claiming names.", "arguments": [ { "name": "includesupports", "type": "boolean", "description": "Whether to also include claim supports. Default is true.", "is_required": false }, { "name": "activeonly", "type": "boolean", "description": "Whether to only include transactions which are still active, i.e. have not been spent. Default is false.", "is_required": false }, { "name": "minconf", "type": "number", "description": "Only include transactions confirmed at least this many times.", "is_required": false } ], "examples": [], "returns": "[\n {\n \"name\":\"claimedname\", (string) The name that is claimed.\n \"claimtype\":\"claimtype\", (string) CLAIM or SUPPORT.\n \"claimId\":\"claimId\", (string) The claimId of the claim.\n \"value\":\"value\" (string) The value assigned to the name, if claimtype is CLAIM.\n \"account\":\"accountname\", (string) The account name associated with the transaction. \n It will be \"\" for the default account.\n \"address\":\"lbrycrdaddress\", (string) The lbrycrd address of the transaction.\n \"category\":\"name\" (string) Always name\n \"amount\": x.xxx, (numeric) The amount in LBC.\n \"vout\": n, (numeric) The vout value\n \"fee\": x.xxx, (numeric) The amount of the fee in LBC.\n \"height\": n (numeric) The height of the block in which this transaction was included.\n \"confirmations\": n, (numeric) The number of confirmations for the transaction\n \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction.\n \"blockindex\": n, (numeric) The block index containing the transaction.\n \"txid\": \"transactionid\", (string) The transaction id.\n \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).\n \"comment\": \"...\", (string) If a comment is associated with the transaction.\n }\n]" }, { "name": "supportclaim", "namespace": "Claimtrie", "description": "Increase the value of a claim. Whichever claim has the greatest value, including all support values, will be the authoritative claim, according to the rest of the rules. The name is the name which is claimed by the claim that will be supported, the txid is the txid of the claim that will be supported, nout is the transaction output which contains the claim to be supported, and amount is the amount which will be added to the value of the claim. If the claim is currently the authoritative claim, this support will go into effect immediately . Otherwise, it will go into effect after 100 blocks. The support will be in effect until it is spent, and will lose its effect when the claim is spent or expires. The amount is a real and is rounded to the nearest .00000001", "arguments": [ { "name": "name", "type": "string", "description": "The name claimed by the claim to support.", "is_required": true }, { "name": "claimid", "type": "string", "description": "The claimid of the claim to support. This can be obtained by TODO PUT IN PLACE THAT SHOWS THIS.", "is_required": true }, { "name": "amount", "type": "number", "description": "The amount in LBC to use to support the claim.", "is_required": true }, { "name": "value", "type": "string", "description": "The metadata of the support encoded in hexadecimal.", "is_required": false } ], "examples": [], "returns": "\"transactionid\" (string) The transaction id of the support." }, { "name": "updateclaim", "namespace": "Claimtrie", "description": "Create a transaction which issues a claim assigning a value to a name, spending the previous txout which issued a claim over the same name and therefore superseding that claim. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no greater unspent transactions issuing a claim over the same name.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction containing the unspent txout which should be spent.", "is_required": true }, { "name": "value", "type": "string", "description": "The value to assign to the name encoded in hexadecimal.", "is_required": true }, { "name": "amount", "type": "number", "description": "The amount in LBRYcrd to use to bid for the name. eg 0.1", "is_required": true } ], "examples": [], "returns": "\"transactionid\" (string) The new transaction id." }, { "name": "getbestblockhash", "namespace": "Blockchain", "description": "Returns the hash of the best (tip) block in the longest blockchain.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getbestblockhash", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbestblockhash\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"hex\" (string) the block hash hex encoded" }, { "name": "getblock", "namespace": "Blockchain", "description": "If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'. If verbosity is 1, returns an Object with information about block . If verbosity is 2, returns an Object with information about block and information about each transaction.", "arguments": [ { "name": "blockhash", "type": "string", "description": "The block hash", "is_required": true }, { "name": "verbosity", "type": "number", "description": "0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getblock \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblock\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n\nResult (for verbosity = 1):\n{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"size\" : n, (numeric) The block size\n \"strippedsize\" : n, (numeric) The block size excluding witness data\n \"weight\" : n (numeric) The block weight as defined in BIP 141\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"nameclaimroot\" : \"xxxx\", (string) The hash of the root of the name claim trie\n \"tx\" : [ (array of string) The transaction ids\n \"transactionid\" (string) The transaction id\n ,...\n ],\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"chainwork\" : \"xxxx\", (string) Expected number of hashes required to produce the chain up to this block (in hex)\n \"nTx\" : n, (numeric) The number of transactions in the block.\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\" (string) The hash of the next block\n}\n\nResult (for verbosity = 2):\n{\n ..., Same output as verbosity = 1.\n \"tx\" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 \"tx\" result.\n ,...\n ],\n ,... Same output as verbosity = 1.\n}" }, { "name": "getblockchaininfo", "namespace": "Blockchain", "description": "Returns an object containing various state info regarding blockchain processing.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getblockchaininfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockchaininfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n \"bestblockhash\": \"...\", (string) the hash of the currently best block\n \"difficulty\": xxxxxx, (numeric) the current difficulty\n \"mediantime\": xxxxxx, (numeric) median time for the current best block\n \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n \"initialblockdownload\": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.\n \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n \"size_on_disk\": xxxxxx, (numeric) the estimated size of the block and undo files on disk\n \"pruned\": xx, (boolean) if the blocks are subject to pruning\n \"pruneheight\": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled)\n \"automatic_pruning\": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled)\n \"prune_target_size\": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled)\n \"softforks\": [ (array) status of softforks in progress\n {\n \"id\": \"xxxx\", (string) name of softfork\n \"version\": xx, (numeric) block version\n \"reject\": { (object) progress toward rejecting pre-softfork blocks\n \"status\": xx, (boolean) true if threshold reached\n },\n }, ...\n ],\n \"bip9_softforks\": { (object) status of BIP9 softforks in progress\n \"xxxx\" : { (string) name of the softfork\n \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"locked_in\", \"active\", \"failed\"\n \"bit\": xx, (numeric) the bit (0-28) in the block version field used to signal this softfork (only for \"started\" status)\n \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n \"timeout\": xx, (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n \"since\": xx, (numeric) height of the first block to which the status applies\n \"statistics\": { (object) numeric statistics about BIP9 signalling for a softfork (only for \"started\" status)\n \"period\": xx, (numeric) the length in blocks of the BIP9 signalling period \n \"threshold\": xx, (numeric) the number of blocks with the version bit set required to activate the feature \n \"elapsed\": xx, (numeric) the number of blocks elapsed since the beginning of the current period \n \"count\": xx, (numeric) the number of blocks with the version bit set in the current period \n \"possible\": xx (boolean) returns false if there are not enough blocks left in this period to pass activation threshold \n }\n }\n }\n \"warnings\" : \"...\", (string) any network and blockchain warnings.\n}" }, { "name": "getblockcount", "namespace": "Blockchain", "description": "Returns the number of blocks in the longest blockchain.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getblockcount", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockcount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "n (numeric) The current block count" }, { "name": "getblockhash", "namespace": "Blockchain", "description": "Returns hash of block in best-block-chain at height provided.", "arguments": [ { "name": "height", "type": "number", "description": "The height index", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getblockhash 1000", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockhash\", \"params\": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"hash\" (string) The block hash" }, { "name": "getblockheader", "namespace": "Blockchain", "description": "If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader .", "arguments": [ { "name": "hash", "type": "string", "description": "The block hash", "is_required": true }, { "name": "verbose", "type": "boolean", "description": "true for a json object, false for the hex encoded data", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getblockheader \"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockheader\", \"params\": [\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"hash\" : \"hash\", (string) the block hash (same as provided)\n \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n \"height\" : n, (numeric) The block height or index\n \"version\" : n, (numeric) The block version\n \"versionHex\" : \"00000000\", (string) The block version formatted in hexadecimal\n \"merkleroot\" : \"xxxx\", (string) The merkle root\n \"nameclaimroot\" : \"xxxx\", (string) The hash of the root of the name claim trie\n \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n \"mediantime\" : ttt, (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\n \"nonce\" : n, (numeric) The nonce\n \"bits\" : \"1d00ffff\", (string) The bits\n \"difficulty\" : x.xxx, (numeric) The difficulty\n \"chainwork\" : \"0000...1f3\" (string) Expected number of hashes required to produce the current chain (in hex)\n \"nTx\" : n, (numeric) The number of transactions in the block.\n \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n \"nextblockhash\" : \"hash\", (string) The hash of the next block\n}\n\nResult (for verbose=false):\n\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'." }, { "name": "getblockstats", "namespace": "Blockchain", "description": "Compute per block statistics for a given window. All amounts are in satoshis. It won't work for some heights with pruning. It won't work without -txindex for utxo_size_inc, *fee or *feerate stats.", "arguments": [ { "name": "hash_or_height", "type": "number", "description": "The block hash or height of the target block", "is_required": true }, { "name": "stats", "type": "array", "description": "Values to plot, by default all values (see result below) [ \"height\", (string, optional) Selected statistic \"time\", (string, optional) Selected statistic ,... ]", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getblockstats 1000 '[\"minfeerate\",\"avgfeerate\"]'", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblockstats\", \"params\": [1000 '[\"minfeerate\",\"avgfeerate\"]'] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{ (json object)\n \"avgfee\": xxxxx, (numeric) Average fee in the block\n \"avgfeerate\": xxxxx, (numeric) Average feerate (in satoshis per virtual byte)\n \"avgtxsize\": xxxxx, (numeric) Average transaction size\n \"blockhash\": xxxxx, (string) The block hash (to check for potential reorgs)\n \"feerate_percentiles\": [ (array of numeric) Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte)\n \"10th_percentile_feerate\", (numeric) The 10th percentile feerate\n \"25th_percentile_feerate\", (numeric) The 25th percentile feerate\n \"50th_percentile_feerate\", (numeric) The 50th percentile feerate\n \"75th_percentile_feerate\", (numeric) The 75th percentile feerate\n \"90th_percentile_feerate\", (numeric) The 90th percentile feerate\n ],\n \"height\": xxxxx, (numeric) The height of the block\n \"ins\": xxxxx, (numeric) The number of inputs (excluding coinbase)\n \"maxfee\": xxxxx, (numeric) Maximum fee in the block\n \"maxfeerate\": xxxxx, (numeric) Maximum feerate (in satoshis per virtual byte)\n \"maxtxsize\": xxxxx, (numeric) Maximum transaction size\n \"medianfee\": xxxxx, (numeric) Truncated median fee in the block\n \"mediantime\": xxxxx, (numeric) The block median time past\n \"mediantxsize\": xxxxx, (numeric) Truncated median transaction size\n \"minfee\": xxxxx, (numeric) Minimum fee in the block\n \"minfeerate\": xxxxx, (numeric) Minimum feerate (in satoshis per virtual byte)\n \"mintxsize\": xxxxx, (numeric) Minimum transaction size\n \"outs\": xxxxx, (numeric) The number of outputs\n \"subsidy\": xxxxx, (numeric) The block subsidy\n \"swtotal_size\": xxxxx, (numeric) Total size of all segwit transactions\n \"swtotal_weight\": xxxxx, (numeric) Total weight of all segwit transactions divided by segwit scale factor (4)\n \"swtxs\": xxxxx, (numeric) The number of segwit transactions\n \"time\": xxxxx, (numeric) The block time\n \"total_out\": xxxxx, (numeric) Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee])\n \"total_size\": xxxxx, (numeric) Total size of all non-coinbase transactions\n \"total_weight\": xxxxx, (numeric) Total weight of all non-coinbase transactions divided by segwit scale factor (4)\n \"totalfee\": xxxxx, (numeric) The fee total\n \"txs\": xxxxx, (numeric) The number of transactions (excluding coinbase)\n \"utxo_increase\": xxxxx, (numeric) The increase/decrease in the number of unspent outputs\n \"utxo_size_inc\": xxxxx, (numeric) The increase/decrease in size for the utxo index (not discounting op_return and similar)\n}" }, { "name": "getchaintips", "namespace": "Blockchain", "description": "Return information about all known tips in the block tree, including the main chain as well as orphaned branches.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getchaintips", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getchaintips\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[\n {\n \"height\": xxxx, (numeric) height of the chain tip\n \"hash\": \"xxxx\", (string) block hash of the tip\n \"branchlen\": 0 (numeric) zero for main chain\n \"status\": \"active\" (string) \"active\" for the main chain\n },\n {\n \"height\": xxxx,\n \"hash\": \"xxxx\",\n \"branchlen\": 1 (numeric) length of branch connecting the tip to the main chain\n \"status\": \"xxxx\" (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)\n }\n]\nPossible values for status:\n1. \"invalid\" This branch contains at least one invalid block\n2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n5. \"active\" This is the tip of the active main chain, which is certainly valid" }, { "name": "getchaintxstats", "namespace": "Blockchain", "description": "Compute statistics about the total number and rate of transactions in the chain.", "arguments": [ { "name": "nblocks", "type": "number", "description": "Size of the window in number of blocks (default: one month).", "is_required": false }, { "name": "blockhash", "type": "string", "description": "The hash of the block that ends the window.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getchaintxstats", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getchaintxstats\", \"params\": [2016] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"time\": xxxxx, (numeric) The timestamp for the final block in the window in UNIX format.\n \"txcount\": xxxxx, (numeric) The total number of transactions in the chain up to that point.\n \"window_final_block_hash\": \"...\", (string) The hash of the final block in the window.\n \"window_block_count\": xxxxx, (numeric) Size of the window in number of blocks.\n \"window_tx_count\": xxxxx, (numeric) The number of transactions in the window. Only returned if \"window_block_count\" is > 0.\n \"window_interval\": xxxxx, (numeric) The elapsed time in the window in seconds. Only returned if \"window_block_count\" is > 0.\n \"txrate\": x.xx, (numeric) The average rate of transactions per second in the window. Only returned if \"window_interval\" is > 0.\n}" }, { "name": "getdifficulty", "namespace": "Blockchain", "description": "Returns the proof-of-work difficulty as a multiple of the minimum difficulty.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getdifficulty", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getdifficulty\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty." }, { "name": "getmempoolancestors", "namespace": "Blockchain", "description": "If txid is in the mempool, returns all in-mempool ancestors.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id (must be in mempool)", "is_required": true }, { "name": "verbose", "type": "boolean", "description": "True for a json object, false for array of transaction ids", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getmempoolancestors \"mytxid\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolancestors\", \"params\": [\"mytxid\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[ (json array of strings)\n \"transactionid\" (string) The transaction id of an in-mempool ancestor transaction\n ,...\n]\n\nResult (for verbose=true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"size\" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\n \"fee\" : n, (numeric) transaction fee in LBC (DEPRECATED)\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)\n \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n \"fees\" : {\n \"base\" : n, (numeric) transaction fee in LBC\n \"modified\" : n, (numeric) transaction fee with fee deltas used for mining priority in LBC\n \"ancestor\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in LBC\n \"descendant\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in LBC\n }\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n \"spentby\" : [ (array) unconfirmed transactions spending outputs from this transaction\n \"transactionid\", (string) child transaction id\n ... ]\n }, ...\n}" }, { "name": "getmempooldescendants", "namespace": "Blockchain", "description": "If txid is in the mempool, returns all in-mempool descendants.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id (must be in mempool)", "is_required": true }, { "name": "verbose", "type": "boolean", "description": "True for a json object, false for array of transaction ids", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getmempooldescendants \"mytxid\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempooldescendants\", \"params\": [\"mytxid\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[ (json array of strings)\n \"transactionid\" (string) The transaction id of an in-mempool descendant transaction\n ,...\n]\n\nResult (for verbose=true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"size\" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\n \"fee\" : n, (numeric) transaction fee in LBC (DEPRECATED)\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)\n \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n \"fees\" : {\n \"base\" : n, (numeric) transaction fee in LBC\n \"modified\" : n, (numeric) transaction fee with fee deltas used for mining priority in LBC\n \"ancestor\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in LBC\n \"descendant\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in LBC\n }\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n \"spentby\" : [ (array) unconfirmed transactions spending outputs from this transaction\n \"transactionid\", (string) child transaction id\n ... ]\n }, ...\n}" }, { "name": "getmempoolentry", "namespace": "Blockchain", "description": "Returns mempool data for given transaction", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id (must be in mempool)", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getmempoolentry \"mytxid\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolentry\", \"params\": [\"mytxid\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{ (json object)\n \"size\" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\n \"fee\" : n, (numeric) transaction fee in LBC (DEPRECATED)\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)\n \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n \"fees\" : {\n \"base\" : n, (numeric) transaction fee in LBC\n \"modified\" : n, (numeric) transaction fee with fee deltas used for mining priority in LBC\n \"ancestor\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in LBC\n \"descendant\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in LBC\n }\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n \"spentby\" : [ (array) unconfirmed transactions spending outputs from this transaction\n \"transactionid\", (string) child transaction id\n ... ]\n}" }, { "name": "getmempoolinfo", "namespace": "Blockchain", "description": "Returns details on the active state of the TX memory pool.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getmempoolinfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmempoolinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"size\": xxxxx, (numeric) Current tx count\n \"bytes\": xxxxx, (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted\n \"usage\": xxxxx, (numeric) Total memory usage for the mempool\n \"maxmempool\": xxxxx, (numeric) Maximum memory usage for the mempool\n \"mempoolminfee\": xxxxx (numeric) Minimum fee rate in LBC/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee\n \"minrelaytxfee\": xxxxx (numeric) Current minimum relay fee for transactions\n}" }, { "name": "getrawmempool", "namespace": "Blockchain", "description": "Returns all transaction ids in memory pool as a json array of string transaction ids. Hint: use getmempoolentry to fetch a specific transaction from the mempool.", "arguments": [ { "name": "verbose", "type": "boolean", "description": "True for a json object, false for array of transaction ids", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getrawmempool true", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawmempool\", \"params\": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[ (json array of string)\n \"transactionid\" (string) The transaction id\n ,...\n]\n\nResult: (for verbose = true):\n{ (json object)\n \"transactionid\" : { (json object)\n \"size\" : n, (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\n \"fee\" : n, (numeric) transaction fee in LBC (DEPRECATED)\n \"modifiedfee\" : n, (numeric) transaction fee with fee deltas used for mining priority (DEPRECATED)\n \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n \"height\" : n, (numeric) block height when transaction entered pool\n \"descendantcount\" : n, (numeric) number of in-mempool descendant transactions (including this one)\n \"descendantsize\" : n, (numeric) virtual transaction size of in-mempool descendants (including this one)\n \"descendantfees\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) (DEPRECATED)\n \"ancestorcount\" : n, (numeric) number of in-mempool ancestor transactions (including this one)\n \"ancestorsize\" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)\n \"ancestorfees\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) (DEPRECATED)\n \"wtxid\" : hash, (string) hash of serialized transaction, including witness data\n \"fees\" : {\n \"base\" : n, (numeric) transaction fee in LBC\n \"modified\" : n, (numeric) transaction fee with fee deltas used for mining priority in LBC\n \"ancestor\" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one) in LBC\n \"descendant\" : n, (numeric) modified fees (see above) of in-mempool descendants (including this one) in LBC\n }\n \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n \"transactionid\", (string) parent transaction id\n ... ]\n \"spentby\" : [ (array) unconfirmed transactions spending outputs from this transaction\n \"transactionid\", (string) child transaction id\n ... ]\n }, ...\n}" }, { "name": "gettxout", "namespace": "Blockchain", "description": "Returns details about an unspent transaction output.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id", "is_required": true }, { "name": "n", "type": "number", "description": "vout number", "is_required": true }, { "name": "include_mempool", "type": "boolean", "description": "Whether to include the mempool. Default: true. Note that an unspent output that is spent in the mempool won't appear.", "is_required": false } ], "examples": [ { "title": "Get unspent transactions", "cli": "> lbrycrd-cli listunspent" }, { "title": "View the details", "cli": "> lbrycrd-cli gettxout \"txid\" 1" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxout\", \"params\": [\"txid\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"bestblock\": \"hash\", (string) The hash of the block at the tip of the chain\n \"confirmations\" : n, (numeric) The number of confirmations\n \"value\" : x.xxx, (numeric) The transaction value in LBC\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"code\", (string) \n \"hex\" : \"hex\", (string) \n \"reqSigs\" : n, (numeric) Number of required signatures\n \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n \"addresses\" : [ (array of string) array of lbrycrd addresses\n \"address\" (string) lbrycrd address\n ,...\n ]\n },\n \"coinbase\" : true|false (boolean) Coinbase or not\n}" }, { "name": "gettxoutproof", "namespace": "Blockchain", "description": "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).", "arguments": [ { "name": "txids", "type": "string", "description": "A json array of txids to filter [ \"txid\" (string) A transaction hash ,... ]", "is_required": true }, { "name": "blockhash", "type": "string", "description": "If specified, looks for txid in the block with this hash", "is_required": false } ], "examples": [], "returns": "\"data\" (string) A string that is a serialized, hex-encoded data for the proof." }, { "name": "gettxoutsetinfo", "namespace": "Blockchain", "description": "Returns statistics about the unspent transaction output set. Note this call may take some time.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli gettxoutsetinfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"gettxoutsetinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"height\":n, (numeric) The current block height (index)\n \"bestblock\": \"hex\", (string) The hash of the block at the tip of the chain\n \"transactions\": n, (numeric) The number of transactions with unspent outputs\n \"txouts\": n, (numeric) The number of unspent transaction outputs\n \"bogosize\": n, (numeric) A meaningless metric for UTXO set size\n \"hash_serialized_2\": \"hash\", (string) The serialized hash\n \"disk_size\": n, (numeric) The estimated size of the chainstate on disk\n \"total_amount\": x.xxx (numeric) The total amount\n}" }, { "name": "preciousblock", "namespace": "Blockchain", "description": "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.", "arguments": [ { "name": "blockhash", "type": "string", "description": "the hash of the block to mark as precious", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli preciousblock \"blockhash\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"preciousblock\", \"params\": [\"blockhash\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "" }, { "name": "pruneblockchain", "namespace": "Blockchain", "description": "", "arguments": [ { "name": "height", "type": "number", "description": "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.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli pruneblockchain 1000", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"pruneblockchain\", \"params\": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "n (numeric) Height of the last block pruned." }, { "name": "savemempool", "namespace": "Blockchain", "description": "Dumps the mempool to disk. It will fail until the previous dump is fully loaded.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli savemempool", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"savemempool\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "scantxoutset", "namespace": "Blockchain", "description": "EXPERIMENTAL warning: this call may be removed or changed in future releases. Scans the unspent transaction output set for entries that match certain output descriptors.", "arguments": [], "examples": [ { "title": "addr(
) Outputs whose scriptPubKey corresponds to the specified address (does not include P2PK)" }, { "title": "raw() Outputs whose scriptPubKey equals the specified hex scripts" }, { "title": "combo() P2PK, P2PKH, P2WPKH, and P2SH-P2WPKH outputs for the given pubkey" }, { "title": "pkh() P2PKH outputs for the given pubkey" }, { "title": "sh(multi(,,,...)) P2SH-multisig outputs for the given threshold and pubkeys" }, { "title": "In the above, either refers to a fixed public key in hexadecimal notation, or to an xpub/xprv optionally followed by one" }, { "title": "or more path elements separated by \"/\", and optionally ending in \"/*\" (unhardened), or \"/*'\" or \"/*h\" (hardened) to specify all" }, { "title": "unhardened or hardened child keys." }, { "title": "In the latter case, a range needs to be specified by below if different from 1000." }, { "title": "For more information on output descriptors, see the documentation in the doc/descriptors.md file." }, { "title": "Arguments:" }, { "title": "1. \"action\" (string, required) The action to execute" }, { "title": "\"start\" for starting a scan" }, { "title": "\"abort\" for aborting the current scan (returns true when abort was successful)" }, { "title": "\"status\" for progress report (in %) of the current scan" }, { "title": "2. \"scanobjects\" (array, required) Array of scan objects" }, { "title": "[ Every scan object is either a string descriptor or an object:" }, { "title": "\"descriptor\", (string, optional) An output descriptor" }, { "title": "{ (object, optional) An object with output descriptor and metadata" }, { "title": "\"desc\": \"descriptor\", (string, required) An output descriptor" }, { "title": "\"range\": n, (numeric, optional) Up to what child index HD chains should be explored (default: 1000)" }, { "title": "}," }, { "title": "..." }, { "title": "]" }, { "title": "Result:" }, { "title": "{" }, { "title": "\"unspents\": [" }, { "title": "{" }, { "title": "\"txid\" : \"transactionid\", (string) The transaction id" }, { "title": "\"vout\": n, (numeric) the vout value" }, { "title": "\"scriptPubKey\" : \"script\", (string) the script key" }, { "title": "\"amount\" : x.xxx, (numeric) The total amount in LBC of the unspent output" }, { "title": "\"height\" : n, (numeric) Height of the unspent transaction output" }, { "title": "}" }, { "title": ",...]," }, { "title": "\"total_amount\" : x.xxx, (numeric) The total amount of all found unspent outputs in LBC" }, { "title": "]" } ] }, { "name": "verifychain", "namespace": "Blockchain", "description": "Verifies blockchain database.", "arguments": [ { "name": "checklevel", "type": "number", "description": "How thorough the block verification is.", "is_required": false }, { "name": "nblocks", "type": "number", "description": "The number of blocks to check.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli verifychain", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifychain\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "true|false (boolean) Verified or not" }, { "name": "verifytxoutproof", "namespace": "Blockchain", "description": "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", "arguments": [ { "name": "proof", "type": "string", "description": "The hex-encoded proof generated by gettxoutproof", "is_required": true } ], "examples": [], "returns": "[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof can not be validated." }, { "name": "getmemoryinfo", "namespace": "Control", "description": "Returns an object containing information about memory usage.", "arguments": [ { "name": "\"mode\" determines what kind of information is returned. This argument is optional, the default mode is \"stats\".\n - \"stats\" returns general statistics about memory usage in the daemon.\n - \"mallocinfo\" returns an XML string describing low-level heap state", "type": "only available if compiled with glibc 2.10+", "description": ".", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getmemoryinfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmemoryinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"locked\": { (json object) Information about locked memory manager\n \"used\": xxxxx, (numeric) Number of bytes used\n \"free\": xxxxx, (numeric) Number of bytes available in current arenas\n \"total\": xxxxxxx, (numeric) Total number of bytes managed\n \"locked\": xxxxxx, (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\n \"chunks_used\": xxxxx, (numeric) Number allocated chunks\n \"chunks_free\": xxxxx, (numeric) Number unused chunks\n }\n}\n\nResult (mode \"mallocinfo\"):\n\"...\"" }, { "name": "help", "namespace": "Control", "description": "List all commands, or get help for a specified command.", "arguments": [ { "name": "command", "type": "string", "description": "The command to get help on", "is_required": false } ], "examples": [], "returns": "\"text\" (string) The help text" }, { "name": "logging", "namespace": "Control", "description": "Gets and sets the logging configuration. When called without an argument, returns the list of categories with status that are currently being debug logged or not. When called with arguments, adds or removes categories from debug logging and return the lists above. The arguments are evaluated in order \"include\", \"exclude\". If an item is both included and excluded, it will thus end up being excluded. The valid logging categories are: net, tor, mempool, http, bench, zmq, db, rpc, estimatefee, addrman, selectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej, libevent, coindb, qt, leveldb In addition, the following are available as category names with special meanings: - \"all\", \"1\" : represent all logging categories. - \"none\", \"0\" : even if other logging categories are specified, ignore all of them.", "arguments": [ { "name": "include", "type": "array", "description": "A json array of categories to add debug logging [ \"category\" (string) the valid logging category ,... ]", "is_required": false }, { "name": "exclude", "type": "array", "description": "A json array of categories to remove debug logging [ \"category\" (string) the valid logging category ,... ]", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli logging \"[\\\"all\\\"]\" \"[\\\"http\\\"]\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"logging\", \"params\": [[\"all\"], \"[libevent]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{ (json object where keys are the logging categories, and values indicates its status\n \"category\": 0|1, (numeric) if being debug logged or not. 0:inactive, 1:active\n ...\n}" }, { "name": "stop", "namespace": "Control", "description": "Stop lbrycrd server.", "arguments": [], "examples": [] }, { "name": "uptime", "namespace": "Control", "description": "Returns the total uptime of the server.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli uptime", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"uptime\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "ttt (numeric) The number of seconds that the server has been running" }, { "name": "generate", "namespace": "Generating", "description": "Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.", "arguments": [ { "name": "nblocks", "type": "number", "description": "How many blocks are generated immediately.", "is_required": true }, { "name": "maxtries", "type": "number", "description": "How many iterations to try (default = 1000000).", "is_required": false } ], "examples": [ { "title": "Generate 11 blocks", "cli": "> lbrycrd-cli generate 11" } ], "returns": "[ blockhashes ] (array) hashes of blocks generated" }, { "name": "generatetoaddress", "namespace": "Generating", "description": "Mine blocks immediately to a specified address (before the RPC call returns)", "arguments": [ { "name": "nblocks", "type": "number", "description": "How many blocks are generated immediately.", "is_required": true }, { "name": "address", "type": "string", "description": "The address to send the newly generated lbry to.", "is_required": true }, { "name": "maxtries", "type": "number", "description": "How many iterations to try (default = 1000000).", "is_required": false } ], "examples": [ { "title": "Generate 11 blocks to myaddress", "cli": "> lbrycrd-cli generatetoaddress 11 \"myaddress\"" } ], "returns": "[ blockhashes ] (array) hashes of blocks generated" }, { "name": "getblocktemplate", "namespace": "Mining", "description": "If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. For full specification, see BIPs 22, 23, 9, and 145: https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki", "arguments": [ { "name": "template_request", "type": "object", "description": "A json object in the following spec { \"mode\":\"template\" (string, optional) This must be set to \"template\", \"proposal\" (see BIP 23), or omitted \"capabilities\":[ (array, optional) A list of strings \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ,... ], \"rules\":[ (array, optional) A list of strings \"support\" (string) client side supported softfork deployment ,... ] }", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getblocktemplate {\"rules\": [\"segwit\"]}", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getblocktemplate\", \"params\": [{\"rules\": [\"segwit\"]}] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"version\" : n, (numeric) The preferred block version\n \"rules\" : [ \"rulename\", ... ], (array of strings) specific block rules that are to be enforced\n \"vbavailable\" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments\n \"rulename\" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule\n ,...\n },\n \"vbrequired\" : n, (numeric) bit mask of versionbits the server requires set in submissions\n \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n {\n \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n \"txid\" : \"xxxx\", (string) transaction id encoded in little-endian hexadecimal\n \"hash\" : \"xxxx\", (string) hash encoded in little-endian hexadecimal (including witness data)\n \"depends\" : [ (array) array of numbers \n n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n ,...\n ],\n \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n \"weight\" : n, (numeric) total transaction weight, as counted for purposes of block limits\n }\n ,...\n ],\n \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n \"flags\" : \"xx\" (string) key name is to be ignored, and value included in scriptSig\n },\n \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)\n \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n \"target\" : \"xxxx\", (string) The hash target\n \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n \"mutable\" : [ (array of string) list of ways the block template may be changed \n \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n ,...\n ],\n \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n \"sizelimit\" : n, (numeric) limit of block size\n \"weightlimit\" : n, (numeric) limit of block weight\n \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n \"bits\" : \"xxxxxxxx\", (string) compressed target of next block\n \"height\" : n (numeric) The height of the next block\n \"claimtrie\" : \"00000000ffffffff\", (string) The root hash of the claim trie in hex\n}" }, { "name": "getmininginfo", "namespace": "Mining", "description": "Returns a json object containing mining-related information.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getmininginfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getmininginfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"blocks\": nnn, (numeric) The current block\n \"currentblockweight\": nnn, (numeric) The last block weight\n \"currentblocktx\": nnn, (numeric) The last block transaction\n \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n \"networkhashps\": nnn, (numeric) The network hashes per second\n \"pooledtx\": n (numeric) The size of the mempool\n \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n \"warnings\": \"...\" (string) any network and blockchain warnings\n}" }, { "name": "getnetworkhashps", "namespace": "Mining", "description": "Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found.", "arguments": [ { "name": "nblocks", "type": "number", "description": "The number of blocks, or -1 for blocks since last difficulty change.", "is_required": false }, { "name": "height", "type": "number", "description": "To estimate at the time of the given height.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getnetworkhashps", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkhashps\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "x (numeric) Hashes per second estimated" }, { "name": "prioritisetransaction", "namespace": "Mining", "description": "Accepts the transaction into mined blocks at a higher (or lower) priority", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id.", "is_required": true }, { "name": "dummy", "type": "number", "description": "API-Compatibility for previous API. Must be zero or null. DEPRECATED. For forward compatibility use named arguments and omit this parameter.", "is_required": false }, { "name": "fee_delta", "type": "number", "description": "The fee value (in satoshis) to add (or subtract, if negative). Note, that this value is not a fee rate. It is a value to modify absolute fee of the TX. The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli prioritisetransaction \"txid\" 0.0 10000", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"prioritisetransaction\", \"params\": [\"txid\", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "true (boolean) Returns true" }, { "name": "submitblock", "namespace": "Mining", "description": "Attempts to submit new block to network. See https://en.bitcoin.it/wiki/BIP_0022 for full specification.", "arguments": [ { "name": "hexdata", "type": "string", "description": "the hex-encoded block data to submit", "is_required": true }, { "name": "dummy", "type": "optional", "description": "dummy value, for compatibility with BIP", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli submitblock \"mydata\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"submitblock\", \"params\": [\"mydata\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "" }, { "name": "addnode", "namespace": "Network", "description": "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": [ { "name": "node", "type": "string", "description": "The node (see getpeerinfo for nodes)", "is_required": true }, { "name": "command", "type": "string", "description": "'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", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli addnode \"192.168.0.6:8333\" \"onetry\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"addnode\", \"params\": [\"192.168.0.6:8333\", \"onetry\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "clearbanned", "namespace": "Network", "description": "Clear all banned IPs.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli clearbanned", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"clearbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "disconnectnode", "namespace": "Network", "description": "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": [ { "name": "address", "type": "string", "description": "The IP address/port of the node", "is_required": false }, { "name": "nodeid", "type": "number", "description": "The node ID (see getpeerinfo for node IDs)", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli disconnectnode \"\" 1", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"disconnectnode\", \"params\": [\"\", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "getaddednodeinfo", "namespace": "Network", "description": "Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)", "arguments": [ { "name": "node", "type": "string", "description": "If provided, return information about this specific node, otherwise all nodes are returned.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getaddednodeinfo \"192.168.0.201\"", "curl": "> 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:9245/" } ], "returns": "[\n {\n \"addednode\" : \"192.168.0.201\", (string) The node IP address or name (as provided to addnode)\n \"connected\" : true|false, (boolean) If connected\n \"addresses\" : [ (list of objects) Only when connected = true\n {\n \"address\" : \"192.168.0.201:8333\", (string) The lbrycrd server IP and port we're connected to\n \"connected\" : \"outbound\" (string) connection, inbound or outbound\n }\n ]\n }\n ,...\n]" }, { "name": "getconnectioncount", "namespace": "Network", "description": "Returns the number of connections to other nodes.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getconnectioncount", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getconnectioncount\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "n (numeric) The connection count" }, { "name": "getnettotals", "namespace": "Network", "description": "Returns information about network traffic, including bytes in, bytes out, and current time.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getnettotals", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnettotals\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"totalbytesrecv\": n, (numeric) Total bytes received\n \"totalbytessent\": n, (numeric) Total bytes sent\n \"timemillis\": t, (numeric) Current UNIX time in milliseconds\n \"uploadtarget\":\n {\n \"timeframe\": n, (numeric) Length of the measuring timeframe in seconds\n \"target\": n, (numeric) Target in bytes\n \"target_reached\": true|false, (boolean) True if target is reached\n \"serve_historical_blocks\": true|false, (boolean) True if serving historical blocks\n \"bytes_left_in_cycle\": t, (numeric) Bytes left in current time cycle\n \"time_left_in_cycle\": t (numeric) Seconds left in current time cycle\n }\n}" }, { "name": "getnetworkinfo", "namespace": "Network", "description": "Returns an object containing various state info regarding P2P networking.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getnetworkinfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnetworkinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"version\": xxxxx, (numeric) the server version\n \"subversion\": \"/Satoshi:x.x.x/\", (string) the server subversion string\n \"protocolversion\": xxxxx, (numeric) the protocol version\n \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n \"localrelay\": true|false, (bool) true if transaction relay is requested from peers\n \"timeoffset\": xxxxx, (numeric) the time offset\n \"connections\": xxxxx, (numeric) the number of connections\n \"networkactive\": true|false, (bool) whether p2p networking is enabled\n \"networks\": [ (array) information per network\n {\n \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n \"limited\": true|false, (boolean) is the network limited using -onlynet?\n \"reachable\": true|false, (boolean) is the network reachable?\n \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n \"proxy_randomize_credentials\": true|false, (string) Whether randomized credentials are used\n }\n ,...\n ],\n \"relayfee\": x.xxxxxxxx, (numeric) minimum relay fee for transactions in LBC/kB\n \"incrementalfee\": x.xxxxxxxx, (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in LBC/kB\n \"localaddresses\": [ (array) list of local addresses\n {\n \"address\": \"xxxx\", (string) network address\n \"port\": xxx, (numeric) network port\n \"score\": xxx (numeric) relative score\n }\n ,...\n ]\n \"warnings\": \"...\" (string) any network and blockchain warnings\n}" }, { "name": "getpeerinfo", "namespace": "Network", "description": "Returns data about each connected network node as a json array of objects.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli getpeerinfo", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getpeerinfo\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[\n {\n \"id\": n, (numeric) Peer index\n \"addr\":\"host:port\", (string) The IP address and port of the peer\n \"addrbind\":\"ip:port\", (string) Bind address of the connection to the peer\n \"addrlocal\":\"ip:port\", (string) Local address as reported by the peer\n \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n \"bytessent\": n, (numeric) The total bytes sent\n \"bytesrecv\": n, (numeric) The total bytes received\n \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n \"timeoffset\": ttt, (numeric) The time offset in seconds\n \"pingtime\": n, (numeric) ping time (if available)\n \"minping\": n, (numeric) minimum observed ping time (if any at all)\n \"pingwait\": n, (numeric) ping wait (if non-zero)\n \"version\": v, (numeric) The peer version, such as 70001\n \"subver\": \"/Satoshi:0.8.5/\", (string) The string version\n \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n \"addnode\": true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n \"startingheight\": n, (numeric) The starting height (block) of the peer\n \"banscore\": n, (numeric) The ban score\n \"synced_headers\": n, (numeric) The last header we have in common with this peer\n \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n \"inflight\": [\n n, (numeric) The heights of blocks we're currently asking from this peer\n ...\n ],\n \"whitelisted\": true|false, (boolean) Whether the peer is whitelisted\n \"bytessent_per_msg\": {\n \"addr\": n, (numeric) The total bytes sent aggregated by message type\n ...\n },\n \"bytesrecv_per_msg\": {\n \"addr\": n, (numeric) The total bytes received aggregated by message type\n ...\n }\n }\n ,...\n]" }, { "name": "listbanned", "namespace": "Network", "description": "List all banned IPs/Subnets.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli listbanned", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"listbanned\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "ping", "namespace": "Network", "description": "Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.", "arguments": [], "examples": [ { "cli": "> lbrycrd-cli ping", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"ping\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "setban", "namespace": "Network", "description": "Attempts to add or remove an IP/Subnet from the banned list.", "arguments": [ { "name": "subnet", "type": "string", "description": "The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)", "is_required": true }, { "name": "command", "type": "string", "description": "'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list", "is_required": true }, { "name": "bantime", "type": "number", "description": "time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)", "is_required": false }, { "name": "absolute", "type": "boolean", "description": "If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT)", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli setban \"192.168.0.0/24\" \"add\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"setban\", \"params\": [\"192.168.0.6\", \"add\", 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "setnetworkactive", "namespace": "Network", "description": "Disable/enable all p2p network activity.", "arguments": [ { "name": "state", "type": "boolean", "description": "true to enable networking, false to disable", "is_required": true } ], "examples": [] }, { "name": "combinepsbt", "namespace": "Rawtransactions", "description": "Combine multiple partially signed LBRY transactions into one transaction. Implements the Combiner role.", "arguments": [ { "name": "txs", "type": "string", "description": "A json array of base64 strings of partially signed transactions [ \"psbt\" (string) A base64 string of a PSBT ,... ]", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli combinepsbt [\"mybase64_1\", \"mybase64_2\", \"mybase64_3\"]" } ], "returns": "\"psbt\" (string) The base64-encoded partially signed transaction" }, { "name": "combinerawtransaction", "namespace": "Rawtransactions", "description": "Combine multiple partially signed transactions into one transaction. The combined transaction may be another partially signed transaction or a fully signed transaction.", "arguments": [ { "name": "txs", "type": "string", "description": "A json array of hex strings of partially signed transactions [ \"hexstring\" (string) A transaction hash ,... ]", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli combinerawtransaction [\"myhex1\", \"myhex2\", \"myhex3\"]" } ], "returns": "\"hex\" (string) The hex-encoded raw transaction with signature(s)" }, { "name": "converttopsbt", "namespace": "Rawtransactions", "description": "Converts a network serialized transaction to a PSBT. This should be used only with createrawtransaction and fundrawtransaction createpsbt and walletcreatefundedpsbt should be used for new applications.", "arguments": [ { "name": "hexstring", "type": "string", "description": "The hex string of a raw transaction", "is_required": true }, { "name": "permitsigdata", "type": "boolean", "description": "If true, any signatures in the input will be discarded and conversion. will continue. If false, RPC will fail if any signatures are present.", "is_required": false }, { "name": "iswitness", "type": "boolean", "description": "Whether the transaction hex is a serialized witness transaction. If iswitness is not present, heuristic tests will be used in decoding. If true, only witness deserializaion will be tried. If false, only non-witness deserialization wil be tried. Only has an effect if permitsigdata is true.", "is_required": false } ], "examples": [ { "title": "Create a transaction", "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"[{\\\"data\\\":\\\"00010203\\\"}]\"" }, { "title": "Convert the transaction to a PSBT", "cli": "> lbrycrd-cli converttopsbt \"rawtransaction\"" } ], "returns": "\"psbt\" (string) The resulting raw transaction (base64-encoded string)" }, { "name": "createpsbt", "namespace": "Rawtransactions", "description": "Creates a transaction in the Partially Signed Transaction format. Implements the Creator role.", "arguments": [ { "name": "inputs", "type": "array", "description": "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 } ,... ]", "is_required": true }, { "name": "outputs", "type": "array", "description": "a json array with outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. [ { \"address\": x.xxx, (obj, optional) A key-value pair. The key (string) is the lbry address, the value (float or string) is the amount in LBC }, { \"data\": \"hex\" (obj, optional) A key-value pair. The key must be \"data\", the value is hex encoded data } ,... More key-value pairs of the above form. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. ]", "is_required": true }, { "name": "locktime", "type": "number", "description": "Raw locktime. Non-0 value also locktime-activates inputs", "is_required": false }, { "name": "replaceable", "type": "boolean", "description": "Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli createpsbt \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"[{\\\"data\\\":\\\"00010203\\\"}]\"" } ], "returns": "\"psbt\" (string) The resulting raw transaction (base64-encoded string)" }, { "name": "createrawtransaction", "namespace": "Rawtransactions", "description": "Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses 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.", "arguments": [ { "name": "inputs", "type": "array", "description": "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 } ,... ]", "is_required": true }, { "name": "outputs", "type": "array", "description": "a json array with outputs (key-value pairs), where none of the keys are duplicated. That is, each address can only appear once and there can only be one 'data' object. [ { \"address\": x.xxx, (obj, optional) A key-value pair. The key (string) is the lbry address, the value (float or string) is the amount in LBC }, { \"data\": \"hex\" (obj, optional) A key-value pair. The key must be \"data\", the value is hex encoded data } ,... More key-value pairs of the above form. For compatibility reasons, a dictionary, which holds the key-value pairs directly, is also accepted as second parameter. ]", "is_required": true }, { "name": "locktime", "type": "number", "description": "Raw locktime. Non-0 value also locktime-activates inputs", "is_required": false }, { "name": "replaceable", "type": "boolean", "description": "Marks this transaction as BIP125 replaceable. Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"[{\\\"data\\\":\\\"00010203\\\"}]\"", "curl": "> 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:9245/" } ], "returns": "\"transaction\" (string) hex string of the transaction" }, { "name": "decodepsbt", "namespace": "Rawtransactions", "description": "Return a JSON object representing the serialized, base64-encoded partially signed LBRY transaction.", "arguments": [ { "name": "psbt", "type": "string", "description": "The PSBT base64 string", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli decodepsbt \"psbt\"" } ], "returns": "{\n \"tx\" : { (json object) The decoded network-serialized unsigned transaction.\n ... The layout is the same as the output of decoderawtransaction.\n },\n \"unknown\" : { (json object) The unknown global fields\n \"key\" : \"value\" (key-value pair) An unknown key-value pair\n ...\n },\n \"inputs\" : [ (array of json objects)\n {\n \"non_witness_utxo\" : { (json object, optional) Decoded network transaction for non-witness UTXOs\n ...\n },\n \"witness_utxo\" : { (json object, optional) Transaction output for witness UTXOs\n \"amount\" : x.xxx, (numeric) The value in LBC\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n \"address\" : \"address\" (string) LBRY address if there is one\n }\n },\n \"partial_signatures\" : { (json object, optional)\n \"pubkey\" : \"signature\", (string) The public key and signature that corresponds to it.\n ,...\n }\n \"sighash\" : \"type\", (string, optional) The sighash type to be used\n \"redeem_script\" : { (json object, optional)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n }\n \"witness_script\" : { (json object, optional)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n }\n \"bip32_derivs\" : { (json object, optional)\n \"pubkey\" : { (json object, optional) The public key with the derivation path as the value.\n \"master_fingerprint\" : \"fingerprint\" (string) The fingerprint of the master key\n \"path\" : \"path\", (string) The path\n }\n ,...\n }\n \"final_scriptsig\" : { (json object, optional)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n }\n \"final_scriptwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n \"unknown\" : { (json object) The unknown global fields\n \"key\" : \"value\" (key-value pair) An unknown key-value pair\n ...\n },\n }\n ,...\n ]\n \"outputs\" : [ (array of json objects)\n {\n \"redeem_script\" : { (json object, optional)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n }\n \"witness_script\" : { (json object, optional)\n \"asm\" : \"asm\", (string) The asm\n \"hex\" : \"hex\", (string) The hex\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n }\n \"bip32_derivs\" : [ (array of json objects, optional)\n {\n \"pubkey\" : \"pubkey\", (string) The public key this path corresponds to\n \"master_fingerprint\" : \"fingerprint\" (string) The fingerprint of the master key\n \"path\" : \"path\", (string) The path\n }\n }\n ,...\n ],\n \"unknown\" : { (json object) The unknown global fields\n \"key\" : \"value\" (key-value pair) An unknown key-value pair\n ...\n },\n }\n ,...\n ]\n \"fee\" : fee (numeric, optional) The transaction fee paid if all UTXOs slots in the PSBT have been filled.\n}" }, { "name": "decoderawtransaction", "namespace": "Rawtransactions", "description": "Return a JSON object representing the serialized, hex-encoded transaction.", "arguments": [ { "name": "hexstring", "type": "string", "description": "The transaction hex string", "is_required": true }, { "name": "iswitness", "type": "boolean", "description": "Whether the transaction hex is a serialized witness transaction If iswitness is not present, heuristic tests will be used in decoding", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli decoderawtransaction \"hexstring\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decoderawtransaction\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"txid\" : \"id\", (string) The transaction id\n \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n \"size\" : n, (numeric) The transaction size\n \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n \"weight\" : n, (numeric) The transaction's weight (between vsize*4 - 3 and vsize*4)\n \"version\" : n, (numeric) The version\n \"locktime\" : ttt, (numeric) The lock time\n \"vin\" : [ (array of json objects)\n {\n \"txid\": \"id\", (string) The transaction id\n \"vout\": n, (numeric) The output number\n \"scriptSig\": { (json object) The script\n \"asm\": \"asm\", (string) asm\n \"hex\": \"hex\" (string) hex\n },\n \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n \"sequence\": n (numeric) The script sequence number\n }\n ,...\n ],\n \"vout\" : [ (array of json objects)\n {\n \"value\" : x.xxx, (numeric) The value in LBC\n \"n\" : n, (numeric) index\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"asm\", (string) the asm\n \"hex\" : \"hex\", (string) the hex\n \"reqSigs\" : n, (numeric) The required sigs\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n \"addresses\" : [ (json array of string)\n \"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) lbry address\n ,...\n ]\n }\n }\n ,...\n ],\n}" }, { "name": "decodescript", "namespace": "Rawtransactions", "description": "Decode a hex-encoded script.", "arguments": [ { "name": "hexstring", "type": "string", "description": "the hex encoded script", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli decodescript \"hexstring\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"decodescript\", \"params\": [\"hexstring\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"asm\":\"asm\", (string) Script public key\n \"hex\":\"hex\", (string) hex encoded public key\n \"type\":\"type\", (string) The output type\n \"reqSigs\": n, (numeric) The required signatures\n \"addresses\": [ (json array of string)\n \"address\" (string) lbry address\n ,...\n ],\n \"p2sh\",\"address\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\n}" }, { "name": "finalizepsbt", "namespace": "Rawtransactions", "description": "Finalize the inputs of a PSBT. If the transaction is fully signed, it will produce a network serialized transaction which can be broadcast with sendrawtransaction. Otherwise a PSBT will be created which has the final_scriptSig and final_scriptWitness fields filled for inputs that are complete. Implements the Finalizer and Extractor roles.", "arguments": [ { "name": "psbt", "type": "string", "description": "A base64 string of a PSBT", "is_required": true }, { "name": "extract", "type": "boolean", "description": "If true and the transaction is complete, extract and return the complete transaction in normal network serialization instead of the PSBT.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli finalizepsbt \"psbt\"" } ], "returns": "{\n \"psbt\" : \"value\", (string) The base64-encoded partially signed transaction if not extracted\n \"hex\" : \"value\", (string) The hex-encoded network transaction if extracted\n \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n ]\n}" }, { "name": "fundrawtransaction", "namespace": "Rawtransactions", "description": "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": [ { "name": "hexstring", "type": "string", "description": "The hex string of the raw transaction", "is_required": true }, { "name": "options", "type": "object", "description": "{ \"changeAddress\" (string, optional, default pool address) The bitcoin address to receive the change \"changePosition\" (numeric, optional, default random) The index of the change output \"change_type\" (string, optional) The output type to use. Only valid if changeAddress is not specified. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\". Default is set by -changetype. \"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 LBC/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 bitcoins than you enter in their corresponding amount field. If no outputs are specified here, the sender pays the fee. [vout_index,...] \"replaceable\" (boolean, optional) Marks this transaction as BIP125 replaceable. 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}", "is_required": false }, { "name": "iswitness", "type": "boolean", "description": "Whether the transaction hex is a serialized witness transaction If iswitness is not present, heuristic tests will be used in decoding", "is_required": false } ], "examples": [ { "title": "Create a transaction with no inputs", "cli": "> lbrycrd-cli createrawtransaction \"[]\" \"{\\\"myaddress\\\":0.01}\"" }, { "title": "Add sufficient unsigned inputs to meet the output value", "cli": "> lbrycrd-cli fundrawtransaction \"rawtransactionhex\"" }, { "title": "Sign the transaction", "cli": "> lbrycrd-cli signrawtransaction \"fundedtransactionhex\"" }, { "title": "Send the transaction", "cli": "> lbrycrd-cli sendrawtransaction \"signedtransactionhex\"" } ], "returns": "{\n \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n \"fee\": n, (numeric) Fee in LBC the resulting transaction pays\n \"changepos\": n (numeric) The position of the added change output, or -1\n}" }, { "name": "getrawtransaction", "namespace": "Rawtransactions", "description": "NOTE: By default this function only works for mempool transactions. If the -txindex option is enabled, it also works for blockchain transactions. If the block which contains the transaction is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is provided, only that block will be searched and if the transaction is in the mempool or other blocks, or if this node does not have the given block available, the transaction will not be found. DEPRECATED: for now, it also works for transactions with unspent outputs. Return the raw transaction data. If verbose is 'true', returns an Object with information about 'txid'. If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id", "is_required": true }, { "name": "verbose", "type": "boolean", "description": "If false, return a string, otherwise return a json object", "is_required": false }, { "name": "blockhash", "type": "string", "description": "The block in which to look for the transaction", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getrawtransaction \"mytxid\" true \"myblockhash\"", "curl": "> 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:9245/" } ], "returns": "\"data\" (string) The serialized, hex-encoded data for 'txid'\n\nResult (if verbose is set to true):\n{\n \"in_active_chain\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \"blockhash\" argument)\n \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n \"txid\" : \"id\", (string) The transaction id (same as provided)\n \"hash\" : \"id\", (string) The transaction hash (differs from txid for witness transactions)\n \"size\" : n, (numeric) The serialized transaction size\n \"vsize\" : n, (numeric) The virtual transaction size (differs from size for witness transactions)\n \"weight\" : n, (numeric) The transaction's weight (between vsize*4-3 and vsize*4)\n \"version\" : n, (numeric) The version\n \"locktime\" : ttt, (numeric) The lock time\n \"vin\" : [ (array of json objects)\n {\n \"txid\": \"id\", (string) The transaction id\n \"vout\": n, (numeric) \n \"scriptSig\": { (json object) The script\n \"asm\": \"asm\", (string) asm\n \"hex\": \"hex\" (string) hex\n },\n \"sequence\": n (numeric) The script sequence number\n \"txinwitness\": [\"hex\", ...] (array of string) hex-encoded witness data (if any)\n }\n ,...\n ],\n \"vout\" : [ (array of json objects)\n {\n \"value\" : x.xxx, (numeric) The value in LBC\n \"n\" : n, (numeric) index\n \"scriptPubKey\" : { (json object)\n \"asm\" : \"asm\", (string) the asm\n \"hex\" : \"hex\", (string) the hex\n \"reqSigs\" : n, (numeric) The required sigs\n \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n \"addresses\" : [ (json array of string)\n \"address\" (string) lbry address\n ,...\n ]\n }\n }\n ,...\n ],\n \"blockhash\" : \"hash\", (string) the block hash\n \"confirmations\" : n, (numeric) The confirmations\n \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n}" }, { "name": "sendrawtransaction", "namespace": "Rawtransactions", "description": "Submits raw transaction (serialized, hex-encoded) to local node and network. Also see createrawtransaction and signrawtransaction calls.", "arguments": [ { "name": "hexstring", "type": "string", "description": "The hex string of the raw transaction)", "is_required": true }, { "name": "allowhighfees", "type": "boolean", "description": "Allow high fees", "is_required": false } ], "examples": [ { "title": "Create a transaction", "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"" }, { "title": "Sign the transaction, and get back the hex", "cli": "> lbrycrd-cli signrawtransaction \"myhex\"" }, { "title": "Send the transaction (signed hex)", "cli": "> lbrycrd-cli sendrawtransaction \"signedhex\"" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendrawtransaction\", \"params\": [\"signedhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"hex\" (string) The transaction hash in hex" }, { "name": "signrawtransaction", "namespace": "Rawtransactions", "description": "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.", "arguments": [ { "name": "hexstring", "type": "string", "description": "The transaction hex string", "is_required": true }, { "name": "prevtxs", "type": "string", "description": "An json array of previous dependent transaction outputs [ (json array of json objects, or 'null' if none provided) { \"txid\":\"id\", (string, required) The transaction id \"vout\":n, (numeric, required) The output number \"scriptPubKey\": \"hex\", (string, required) script key \"redeemScript\": \"hex\", (string, required for P2SH or P2WSH) redeem script \"amount\": value (numeric, required) The amount spent } ,... ]", "is_required": false }, { "name": "privkeys", "type": "string", "description": "A json array of base58-encoded private keys for signing [ (json array of strings, or 'null' if none provided) \"privatekey\" (string) private key in base58-encoding ,... ]", "is_required": false }, { "name": "sighashtype", "type": "string", "description": "The signature hash type. Must be one of \"ALL\" \"NONE\" \"SINGLE\" \"ALL|ANYONECANPAY\" \"NONE|ANYONECANPAY\" \"SINGLE|ANYONECANPAY\"", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli signrawtransaction \"myhex\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signrawtransaction\", \"params\": [\"myhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n {\n \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n \"vout\" : n, (numeric) The index of the output to spent and used as input\n \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n \"sequence\" : n, (numeric) Script sequence number\n \"error\" : \"text\" (string) Verification or signing error related to the input\n }\n ,...\n ]\n}" }, { "name": "signrawtransactionwithkey", "namespace": "Rawtransactions", "description": "Sign inputs for raw transaction (serialized, hex-encoded). The second argument is an array of base58-encoded private keys that will be the only keys used to sign the transaction. The third 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.", "arguments": [ { "name": "hexstring", "type": "string", "description": "The transaction hex string", "is_required": true }, { "name": "privkeys", "type": "string", "description": "A json array of base58-encoded private keys for signing [ (json array of strings) \"privatekey\" (string) private key in base58-encoding ,... ]", "is_required": true }, { "name": "prevtxs", "type": "string", "description": "An json array of previous dependent transaction outputs [ (json array of json objects, or 'null' if none provided) { \"txid\":\"id\", (string, required) The transaction id \"vout\":n, (numeric, required) The output number \"scriptPubKey\": \"hex\", (string, required) script key \"redeemScript\": \"hex\", (string, required for P2SH or P2WSH) redeem script \"amount\": value (numeric, required) The amount spent } ,... ]", "is_required": false }, { "name": "sighashtype", "type": "string", "description": "The signature hash type. Must be one of \"ALL\" \"NONE\" \"SINGLE\" \"ALL|ANYONECANPAY\" \"NONE|ANYONECANPAY\" \"SINGLE|ANYONECANPAY\"", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli signrawtransactionwithkey \"myhex\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signrawtransactionwithkey\", \"params\": [\"myhex\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n {\n \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n \"vout\" : n, (numeric) The index of the output to spent and used as input\n \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n \"sequence\" : n, (numeric) Script sequence number\n \"error\" : \"text\" (string) Verification or signing error related to the input\n }\n ,...\n ]\n}" }, { "name": "testmempoolaccept", "namespace": "Rawtransactions", "description": "Returns if raw transaction (serialized, hex-encoded) would be accepted by mempool. This checks if the transaction violates the consensus or policy rules. See sendrawtransaction call.", "arguments": [ { "name": "[\"rawtxs\"]", "type": "array", "description": "An array of hex strings of raw transactions. Length must be one for now.", "is_required": true }, { "name": "allowhighfees", "type": "boolean", "description": "Allow high fees", "is_required": false } ], "examples": [ { "title": "Create a transaction", "cli": "> lbrycrd-cli createrawtransaction \"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"" }, { "title": "Sign the transaction, and get back the hex", "cli": "> lbrycrd-cli signrawtransaction \"myhex\"" }, { "title": "Test acceptance of the transaction (signed hex)", "cli": "> lbrycrd-cli testmempoolaccept [\"signedhex\"]" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"testmempoolaccept\", \"params\": [[\"signedhex\"]] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[ (array) The result of the mempool acceptance test for each raw transaction in the input array.\n Length is exactly one for now.\n {\n \"txid\" (string) The transaction hash in hex\n \"allowed\" (boolean) If the mempool allows this tx to be inserted\n \"reject-reason\" (string) Rejection string (only present when 'allowed' is false)\n }\n]" }, { "name": "createmultisig", "namespace": "Util", "description": "Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript.", "arguments": [ { "name": "nrequired", "type": "number", "description": "The number of required signatures out of the n keys.", "is_required": true }, { "name": "keys", "type": "string", "description": "A json array of hex-encoded public keys [ \"key\" (string) The hex-encoded public key ,... ]", "is_required": true }, { "name": "address_type", "type": "string", "description": "The address type to use. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\". Default is legacy.", "is_required": false } ], "examples": [ { "title": "Create a multisig address from 2 public keys", "cli": "> lbrycrd-cli createmultisig 2 \"[\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\\\",\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\\\"]\"" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createmultisig\", \"params\": [2, \"[\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\\\",\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\\\"]\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n}" }, { "name": "estimatesmartfee", "namespace": "Util", "description": "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": [ { "name": "conf_target", "type": "number", "description": "Confirmation target in blocks (1 - 1008)", "is_required": true }, { "name": "estimate_mode", "type": "string", "description": "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\"", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli estimatesmartfee 6" } ], "returns": "{\n \"feerate\" : x.x, (numeric, optional) estimate fee rate in LBC/kB\n \"errors\": [ str... ] (json array of strings, optional) Errors encountered during processing\n \"blocks\" : n (numeric) block number where estimate was found\n}\n\nThe request target will be clamped between 2 and the highest target\nfee estimation is able to return based on how long it has been running.\nAn error is returned if not enough transactions and blocks\nhave been observed to make an estimate for any number of blocks." }, { "name": "signmessagewithprivkey", "namespace": "Util", "description": "Sign a message with the private key of an address", "arguments": [ { "name": "privkey", "type": "string", "description": "The private key to sign the message with.", "is_required": true }, { "name": "message", "type": "string", "description": "The message to create a signature of.", "is_required": true } ], "examples": [ { "title": "Create the signature", "cli": "> lbrycrd-cli signmessagewithprivkey \"privkey\" \"my message\"" }, { "title": "Verify the signature", "cli": "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"" }, { "title": "As json rpc", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"signmessagewithprivkey\", \"params\": [\"privkey\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"signature\" (string) The signature of the message encoded in base 64" }, { "name": "validateaddress", "namespace": "Util", "description": "Return information about the given lbry address. DEPRECATION WARNING: Parts of this command have been deprecated and moved to getaddressinfo. Clients must transition to using getaddressinfo to access this information before upgrading to v0.18. The following deprecated fields have moved to getaddressinfo and will only be shown here with -deprecatedrpc=validateaddress: ismine, iswatchonly, script, hex, pubkeys, sigsrequired, pubkey, addresses, embedded, iscompressed, account, timestamp, hdkeypath, kdmasterkeyid.", "arguments": [ { "name": "address", "type": "string", "description": "The lbry address to validate", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli validateaddress \"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"validateaddress\", \"params\": [\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n \"address\" : \"address\", (string) The lbry address validated\n \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n \"isscript\" : true|false, (boolean) If the key is a script\n \"iswitness\" : true|false, (boolean) If the address is a witness address\n \"witness_version\" : version (numeric, optional) The version number of the witness program\n \"witness_program\" : \"hex\" (string, optional) The hex value of the witness program\n}" }, { "name": "verifymessage", "namespace": "Util", "description": "Verify a signed message", "arguments": [ { "name": "address", "type": "string", "description": "The lbry address to use for the signature.", "is_required": true }, { "name": "signature", "type": "string", "description": "The signature provided by the signer in base 64 encoding (see signmessage).", "is_required": true }, { "name": "message", "type": "string", "description": "The message that was signed.", "is_required": true } ], "examples": [ { "title": "Unlock the wallet for 30 seconds", "cli": "> lbrycrd-cli walletpassphrase \"mypassphrase\" 30" }, { "title": "Create the signature", "cli": "> lbrycrd-cli signmessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"my message\"" }, { "title": "Verify the signature", "cli": "> lbrycrd-cli verifymessage \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" \"signature\" \"my message\"" }, { "title": "As json rpc", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"verifymessage\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", \"signature\", \"my message\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "true|false (boolean) If the signature is verified or not." }, { "name": "abandontransaction", "namespace": "Wallet", "description": "Mark in-wallet transaction 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.", "arguments": [ { "name": "txid", "type": "string", "description": "The transaction id", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli abandontransaction \"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"abandontransaction\", \"params\": [\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "" }, { "name": "abortrescan", "namespace": "Wallet", "description": "Stops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.", "arguments": [], "examples": [ { "title": "Import a private key", "cli": "> lbrycrd-cli importprivkey \"mykey\"" }, { "title": "Abort the running wallet rescan", "cli": "> lbrycrd-cli abortrescan" }, { "title": "As a JSON-RPC call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"abortrescan\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ] }, { "name": "addmultisigaddress", "namespace": "Wallet", "description": "Add a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup. Each key is a Bitcoin address or hex-encoded public key. This functionality is only intended for use with non-watchonly addresses. See `importaddress` for watchonly p2sh address support. If 'label' is specified, assign address to that label.", "arguments": [ { "name": "nrequired", "type": "number", "description": "The number of required signatures out of the n keys or addresses.", "is_required": true }, { "name": "keys", "type": "string", "description": "A json array of bitcoin addresses or hex-encoded public keys [ \"address\" (string) bitcoin address or hex-encoded public key ..., ]", "is_required": true }, { "name": "label", "type": "string", "description": "A label to assign the addresses to.", "is_required": false }, { "name": "address_type", "type": "string", "description": "The address type to use. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\". Default is set by -addresstype.", "is_required": false } ], "examples": [ { "title": "Add a multisig address from 2 addresses", "cli": "> lbrycrd-cli addmultisigaddress 2 \"[\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"" }, { "title": "As json rpc call", "curl": "> 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:9245/" } ], "returns": "{\n \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n}" }, { "name": "backupwallet", "namespace": "Wallet", "description": "Safely copies current wallet file to destination, which can be a directory or a path with filename.", "arguments": [ { "name": "destination", "type": "string", "description": "The destination directory or file", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli backupwallet \"backup.dat\"", "curl": "> 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:9245/" } ] }, { "name": "bumpfee", "namespace": "Wallet", "description": "Bumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B. An opt-in RBF transaction with the given txid must be in the wallet. The command will pay the additional fee by decreasing (or perhaps removing) its change output. If the change output is not big enough to cover the increased fee, the command will currently fail instead of adding new inputs to compensate. (A future implementation could improve this.) The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs. By default, the new fee will be calculated automatically using estimatesmartfee. The user can specify a confirmation target for estimatesmartfee. Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate. At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee returned by getnetworkinfo) to enter the node's mempool.", "arguments": [ { "name": "txid", "type": "string", "description": "The txid to be bumped", "is_required": true }, { "name": "options", "type": "object", "description": "{ \"confTarget\" (numeric, optional) Confirmation target (in blocks) \"totalFee\" (numeric, optional) Total fee (NOT feerate) to pay, in satoshis. In rare cases, the actual fee paid might be slightly higher than the specified totalFee if the tx change output has to be removed because it is too close to the dust threshold. \"replaceable\" (boolean, optional, default true) Whether the new transaction should still be marked bip-125 replaceable. If true, the sequence numbers in the transaction will be left unchanged from the original. If false, any input sequence numbers in the original transaction that were less than 0xfffffffe will be increased to 0xfffffffe so the new transaction will not be explicitly bip-125 replaceable (though it may still be replaceable in practice, for example if it has unconfirmed ancestors which are replaceable). \"estimate_mode\" (string, optional, default=UNSET) The fee estimate mode, must be one of: \"UNSET\" \"ECONOMICAL\" \"CONSERVATIVE\" }", "is_required": false } ], "examples": [ { "title": "Bump the fee, get the new transaction's txid", "cli": "> lbrycrd-cli bumpfee " } ], "returns": "{\n \"txid\": \"value\", (string) The id of the new transaction\n \"origfee\": n, (numeric) Fee of the replaced transaction\n \"fee\": n, (numeric) Fee of the new transaction\n \"errors\": [ str... ] (json array of strings) Errors encountered during processing (may be empty)\n}" }, { "name": "createwallet", "namespace": "Wallet", "description": "Creates and loads a new wallet.", "arguments": [ { "name": "wallet_name", "type": "string", "description": "The name for the new wallet. If this is a path, the wallet will be created at the path location.", "is_required": true }, { "name": "disable_private_keys", "type": "boolean", "description": "Disable the possibility of private keys (only watchonlys are possible in this mode).", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli createwallet \"testwallet\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createwallet\", \"params\": [\"testwallet\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"name\" : , (string) The wallet name if created successfully. If the wallet was created using a full path, the wallet_name will be the full path.\n \"warning\" : , (string) Warning message if wallet was not loaded cleanly.\n}" }, { "name": "dumpprivkey", "namespace": "Wallet", "description": "Reveals the private key corresponding to 'address'. Then the importprivkey can be used with this output", "arguments": [ { "name": "address", "type": "string", "description": "The bitcoin address for the private key", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli importprivkey \"mykey\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpprivkey\", \"params\": [\"myaddress\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"key\" (string) The private key" }, { "name": "dumpwallet", "namespace": "Wallet", "description": "Dumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files. Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet. Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).", "arguments": [ { "name": "filename", "type": "string", "description": "The filename with path (either absolute or relative to bitcoind)", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli dumpwallet \"test\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"dumpwallet\", \"params\": [\"test\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{ (json object)\n \"filename\" : { (string) The filename with full absolute path\n}" }, { "name": "encryptwallet", "namespace": "Wallet", "description": "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.", "arguments": [ { "name": "passphrase", "type": "string", "description": "The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.", "is_required": true } ], "examples": [ { "title": "Encrypt your wallet", "cli": "> lbrycrd-cli encryptwallet \"my pass phrase\"" }, { "title": "Now set the passphrase to use the wallet, such as for signing or sending bitcoin", "cli": "> lbrycrd-cli walletpassphrase \"my pass phrase\"" }, { "title": "Now we can do something like sign", "cli": "> lbrycrd-cli signmessage \"address\" \"test message\"" }, { "title": "Now lock the wallet again by removing the passphrase", "cli": "> lbrycrd-cli walletlock" }, { "title": "As a json rpc call", "curl": "> 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:9245/" } ] }, { "name": "getaccount", "namespace": "Wallet", "description": "DEPRECATED. Returns the account associated with the given address.", "arguments": [ { "name": "address", "type": "string", "description": "The bitcoin address for account lookup.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getaccount \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccount\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"accountname\" (string) the account address" }, { "name": "getaccountaddress", "namespace": "Wallet", "description": "DEPRECATED. Returns the current Bitcoin address for receiving payments to this account.", "arguments": [ { "name": "account", "type": "string", "description": "The account 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.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getaccountaddress \"myaccount\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaccountaddress\", \"params\": [\"myaccount\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"address\" (string) The account bitcoin address" }, { "name": "getaddressesbyaccount", "namespace": "Wallet", "description": "DEPRECATED. Returns the list of addresses for the given account.", "arguments": [ { "name": "account", "type": "string", "description": "The account name.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getaddressesbyaccount \"tabby\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddressesbyaccount\", \"params\": [\"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "[ (json array of string)\n \"address\" (string) a bitcoin address associated with the given account\n ,...\n]" }, { "name": "getaddressesbylabel", "namespace": "Wallet", "description": "Returns the list of addresses assigned the specified label.", "arguments": [ { "name": "label", "type": "string", "description": "The label.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getaddressesbylabel \"tabby\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddressesbylabel\", \"params\": [\"tabby\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{ (json object with addresses as keys)\n \"address\": { (json object with information about address)\n \"purpose\": \"string\" (string) Purpose of address (\"send\" for sending address, \"receive\" for receiving address)\n },...\n}" }, { "name": "getaddressinfo", "namespace": "Wallet", "description": "Return information about the given bitcoin address. Some information requires the address to be in the wallet.", "arguments": [ { "name": "address", "type": "string", "description": "The bitcoin address to get the information of.", "is_required": true } ], "examples": [ { "cli": "> lbrycrd-cli getaddressinfo \"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getaddressinfo\", \"params\": [\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "{\n \"address\" : \"address\", (string) The bitcoin address validated\n \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n \"ismine\" : true|false, (boolean) If the address is yours or not\n \"iswatchonly\" : true|false, (boolean) If the address is watchonly\n \"isscript\" : true|false, (boolean) If the key is a script\n \"iswitness\" : true|false, (boolean) If the address is a witness address\n \"witness_version\" : version (numeric, optional) The version number of the witness program\n \"witness_program\" : \"hex\" (string, optional) The hex value of the witness program\n \"script\" : \"type\" (string, optional) The output script type. Only if \"isscript\" is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash, witness_unknown\n \"hex\" : \"hex\", (string, optional) The redeemscript for the p2sh address\n \"pubkeys\" (string, optional) Array of pubkeys associated with the known redeemscript (only if \"script\" is \"multisig\")\n [\n \"pubkey\"\n ,...\n ]\n \"sigsrequired\" : xxxxx (numeric, optional) Number of signatures required to spend multisig output (only if \"script\" is \"multisig\")\n \"pubkey\" : \"publickeyhex\", (string, optional) The hex value of the raw public key, for single-key addresses (possibly embedded in P2SH or P2WSH)\n \"embedded\" : {...}, (object, optional) Information about the address embedded in P2SH or P2WSH, if relevant and known. It includes all getaddressinfo output fields for the embedded address, excluding metadata (\"timestamp\", \"hdkeypath\", \"hdseedid\") and relation to the wallet (\"ismine\", \"iswatchonly\", \"account\").\n \"iscompressed\" : true|false, (boolean) If the address is compressed\n \"label\" : \"label\" (string) The label associated with the address, \"\" is the default account\n \"account\" : \"account\" (string) DEPRECATED. This field will be removed in V0.18. To see this deprecated field, start bitcoind with -deprecatedrpc=accounts. The account associated with the address, \"\" is the default account\n \"timestamp\" : timestamp, (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)\n \"hdkeypath\" : \"keypath\" (string, optional) The HD keypath if the key is HD and available\n \"hdseedid\" : \"\" (string, optional) The Hash160 of the HD seed\n \"hdmasterkeyid\" : \"\" (string, optional) alias for hdseedid maintained for backwards compatibility. Will be removed in V0.18.\n \"labels\" (object) Array of labels associated with the address.\n [\n { (json object of label data)\n \"name\": \"labelname\" (string) The label\n \"purpose\": \"string\" (string) Purpose of address (\"send\" for sending address, \"receive\" for receiving address)\n },...\n ]\n}" }, { "name": "getbalance", "namespace": "Wallet", "description": "If account is not specified, returns the server's 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. If account is specified (DEPRECATED), returns the balance in the account. Note that the account \"\" is not the same as leaving the parameter out. The server total may be different to the balance in the default \"\" account.", "arguments": [ { "name": "account", "type": "string", "description": "DEPRECATED. This argument will be removed in V0.", "is_required": false }, { "name": "To use this deprecated argument, start bitcoind with -deprecatedrpc=accounts. The account string may be given as a\n specific account name to find the balance associated with wallet keys in\n a named account, or as the empty string", "type": "\"\"", "description": "to find the balance associated with wallet keys not in any named account, or as \"*\" to find the balance associated with all wallet keys regardless of account. When this option is specified, it calculates the balance in a different way than when it is not specified, and which can count spends twice when there are conflicting pending transactions (such as those created by the bumpfee command), temporarily resulting in low or even negative balances. In general, account balance calculation is not considered reliable and has resulted in confusing outcomes, so it is recommended to avoid passing this argument.", "is_required": true }, { "name": "minconf", "type": "number", "description": "Only include transactions confirmed at least this many times. The default is 1 if an account is provided or 0 if no account is provided", "is_required": false }, { "name": "include_watchonly", "type": "boolean", "description": "Also include balance in watch-only addresses (see 'importaddress')", "is_required": false } ], "examples": [ { "title": "The total amount in the wallet with 1 or more confirmations", "cli": "> lbrycrd-cli getbalance" }, { "title": "The total amount in the wallet at least 6 blocks confirmed", "cli": "> lbrycrd-cli getbalance \"*\" 6" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getbalance\", \"params\": [\"*\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "amount (numeric) The total amount in LBC received for this account." }, { "name": "getnewaddress", "namespace": "Wallet", "description": "Returns a new Bitcoin address for receiving payments. If 'label' is specified, it is added to the address book so payments received with the address will be associated with 'label'.", "arguments": [ { "name": "label", "type": "string", "description": "The label name for the address to be linked to. If not provided, the default label \"\" is used. It can also be set to the empty string \"\" to represent the default label. The label does not need to exist, it will be created if there is no label by the given name.", "is_required": false }, { "name": "address_type", "type": "string", "description": "The address type to use. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\". Default is set by -addresstype.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getnewaddress", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getnewaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"address\" (string) The new bitcoin address" }, { "name": "getrawchangeaddress", "namespace": "Wallet", "description": "Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use.", "arguments": [ { "name": "address_type", "type": "string", "description": "The address type to use. Options are \"legacy\", \"p2sh-segwit\", and \"bech32\". Default is set by -changetype.", "is_required": false } ], "examples": [ { "cli": "> lbrycrd-cli getrawchangeaddress", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getrawchangeaddress\", \"params\": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "\"address\" (string) The address" }, { "name": "getreceivedbyaddress", "namespace": "Wallet", "description": "Returns the total amount received by the given address in transactions with at least minconf confirmations.", "arguments": [ { "name": "address", "type": "string", "description": "The bitcoin address for transactions.", "is_required": true }, { "name": "minconf", "type": "number", "description": "Only include transactions confirmed at least this many times.", "is_required": false } ], "examples": [ { "title": "The amount from transactions with at least 1 confirmation", "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\"" }, { "title": "The amount including unconfirmed transactions, zero confirmations", "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 0" }, { "title": "The amount with at least 6 confirmations", "cli": "> lbrycrd-cli getreceivedbyaddress \"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\" 6" }, { "title": "As a json rpc call", "curl": "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"getreceivedbyaddress\", \"params\": [\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/" } ], "returns": "amount (numeric) The total amount in LBC received at this address." }, { "name": "getreceivedbylabel", "namespace": "Wallet", "description": "Returns the total amount received by addresses with