From c753a5825a5eaab5010fa229bc523014b3a1393a Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sun, 23 Sep 2018 23:22:25 -0400 Subject: [PATCH] switched all --account args to --account_id, fixed issues reported by @osilkin98 and regenerated api.json --- docs/api.json | 2376 +++++++++++++++++++--------------- lbrynet/daemon/Daemon.py | 113 +- scripts/generate_json_api.py | 3 +- 3 files changed, 1370 insertions(+), 1122 deletions(-) diff --git a/docs/api.json b/docs/api.json index 95ece3b92..441a44164 100644 --- a/docs/api.json +++ b/docs/api.json @@ -1,1273 +1,1519 @@ [ { + "name": "account_add", + "description": "Add a previously created account from a seed, private key or public key (read-only).\nSpecify --single_key for single address or vanity address accounts.", "arguments": [ { - "is_required": false, - "type": "str", - "name": "blob_hash", - "description": "announce a blob, specified by blob_hash" - }, + "name": "account_name", + "type": "str", + "description": "name of the account to add", + "is_required": true + }, { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "announce all blobs associated with stream_hash" - }, + "name": "seed", + "type": "str", + "description": "seed to generate new account from", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "announce all blobs associated with sd_hash and the sd_hash itself" + "name": "private_key", + "type": "str", + "description": "private key for new account", + "is_required": false + }, + { + "name": "public_key", + "type": "str", + "description": "public key for new account", + "is_required": false + }, + { + "name": "single_key", + "type": "bool", + "description": "create single key account, default is multi-key", + "is_required": false } - ], - "returns": "(bool) true if successful", - "name": "blob_announce", - "description": "Announce blobs to the DHT" - }, + ], + "returns": "(map) added account details" + }, { + "name": "account_balance", + "description": "Return the balance of an account", "arguments": [ { - "is_required": true, - "type": "str", - "name": "blob_hash", - "description": "check availability for this blob hash" - }, + "name": "account_id", + "type": "str", + "description": "If provided only the balance for this account will be given", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "search_timeout", - "description": "how long to search for peers for the blob in the dht" - }, + "name": "address", + "type": "str", + "description": "If provided only the balance for this address will be given", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "blob_timeout", - "description": "how long to try downloading from a peer" + "name": "include_unconfirmed", + "type": "bool", + "description": "Include unconfirmed", + "is_required": false } - ], - "returns": "(dict) {\n \"is_available\": \n \"reachable_peers\": [\":\"],\n \"unreachable_peers\": [\":\"]\n }", - "name": "blob_availability", - "description": "Get blob availability" - }, + ], + "returns": "(decimal) amount of lbry credits in wallet" + }, { + "name": "account_create", + "description": "Create a new account. Specify --single_key if you want to use\nthe same address for all transactions (not recommended).", "arguments": [ { - "is_required": true, - "type": "str", - "name": "blob_hash", - "description": "blob hash of the blob to delete" + "name": "account_name", + "type": "str", + "description": "name of the account to create", + "is_required": true + }, + { + "name": "single_key", + "type": "bool", + "description": "create single key account, default is multi-key", + "is_required": false } - ], - "returns": "(str) Success/fail message", - "name": "blob_delete", - "description": "Delete a blob" - }, + ], + "returns": "(map) new account details" + }, { + "name": "account_decrypt", + "description": "Decrypt an encrypted account, this will remove the wallet password", + "arguments": [], + "returns": "(bool) true if wallet is decrypted, otherwise false" + }, + { + "name": "account_encrypt", + "description": "Encrypt a wallet with a password, if the wallet is already encrypted this will update\nthe password", "arguments": [ { - "is_required": true, - "type": "str", - "name": "blob_hash", - "description": "blob hash of the blob to get" - }, - { - "is_required": false, - "type": "int", - "name": "timeout", - "description": "timeout in number of seconds" - }, - { - "is_required": false, - "type": "str", - "name": "encoding", - "description": "by default no attempt at decoding is made, can be set to one of the following decoders: 'json'" - }, - { - "is_required": false, - "type": "str", - "name": "payment_rate_manager", - "description": "if not given the default payment rate manager will be used. supported alternative rate managers: 'only-free'" + "name": "new_password", + "type": "str", + "description": "password string to be used for encrypting wallet", + "is_required": true } - ], - "returns": "(str) Success/Fail message or (dict) decoded data", - "name": "blob_get", - "description": "Download and return a blob" - }, + ], + "returns": "(bool) true if wallet is decrypted, otherwise false" + }, { + "name": "account_fund", + "description": "Transfer some amount (or --everything) to an account from another\naccount (can be the same account). Amounts are interpreted as LBC.\nYou can also spread the transfer across a number of --outputs (cannot\nbe used together with --everything).", "arguments": [ { - "is_required": false, - "type": "bool", - "name": "needed", - "description": "only return needed blobs" - }, + "name": "to_account", + "type": "str", + "description": "send to this account", + "is_required": true + }, { - "is_required": false, - "type": "bool", - "name": "finished", - "description": "only return finished blobs" - }, + "name": "from_account", + "type": "str", + "description": "spend from this account", + "is_required": true + }, { - "is_required": false, - "type": "str", - "name": "uri", - "description": "filter blobs by stream in a uri" - }, + "name": "amount", + "type": "str", + "description": "the amount to transfer lbc", + "is_required": true + }, { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "filter blobs by stream hash" - }, + "name": "everything", + "type": "bool", + "description": "transfer everything (excluding claims), default: false.", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "filter blobs by sd hash" - }, + "name": "outputs", + "type": "int", + "description": "split payment across many outputs, default: 1.", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "page_size", - "description": "results page size" - }, - { - "is_required": false, - "type": "int", - "name": "page", - "description": "page of results to return" + "name": "broadcast", + "type": "bool", + "description": "actually broadcast the transaction, default: false.", + "is_required": false } - ], - "returns": "(list) List of blob hashes", - "name": "blob_list", - "description": "Returns blob hashes. If not given filters, returns all blobs known by the blob manager" - }, + ], + "returns": "(map) transaction performing requested action" + }, { + "name": "account_list", + "description": "List details of all of the accounts or a specific account.", "arguments": [ { - "is_required": false, - "type": "str", - "name": "reflector_server", - "description": "reflector address" + "name": "account_id", + "type": "str", + "description": "If provided only the balance for this account will be given", + "is_required": false + }, + { + "name": "confirmations", + "type": "int", + "description": "required confirmations (default: 6)", + "is_required": false + }, + { + "name": "include_reserved", + "type": "bool", + "description": "include reserved UTXOs (default: false)", + "is_required": false + }, + { + "name": "include_claims", + "type": "bool", + "description": "include claims, requires than a LBC account is specified (default: false)", + "is_required": false + }, + { + "name": "show_seed", + "type": "bool", + "description": "show the seed for the account", + "is_required": false } - ], - "returns": "(list) reflected blob hashes", - "name": "blob_reflect", - "description": "Reflects specified blobs" - }, - { - "arguments": [], - "returns": "(bool) true if successful", - "name": "blob_reflect_all", - "description": "Reflects all saved blobs" - }, + ], + "returns": "(map) balance of account(s)" + }, { + "name": "account_max_address_gap", + "description": "Finds ranges of consecutive addresses that are unused and returns the length\nof the longest such range: for change and receiving address chains. This is\nuseful to figure out ideal values to set for 'receiving_gap' and 'change_gap'\naccount settings.", "arguments": [ { - "is_required": true, - "type": "str", - "name": "blockhash", - "description": "hash of the block to look up" - }, - { - "is_required": true, - "type": "int", - "name": "height", - "description": "height of the block to look up" + "name": "account_id", + "type": "str", + "description": "account for which to get max gaps", + "is_required": true } - ], - "returns": "(dict) Requested block", - "name": "block_show", - "description": "Get contents of a block" - }, + ], + "returns": "(map) maximum gap for change and receiving addresses" + }, { + "name": "account_remove", + "description": "Remove an existing account.", "arguments": [ { - "is_required": true, - "type": "str", - "name": "claim_id", - "description": "Claim ID to export information about" + "name": "account_id", + "type": "str", + "description": "id of the account to remove", + "is_required": true } - ], - "returns": "(str) Serialized certificate information", - "name": "channel_export", - "description": "Export serialized channel signing information for a given certificate claim id" - }, + ], + "returns": "(map) details of removed account" + }, { + "name": "account_set", + "description": "Change various settings on an account.", "arguments": [ { - "is_required": true, - "type": "str", - "name": "serialized_certificate_info", - "description": "certificate info" + "name": "account_id", + "type": "str", + "description": "id of the account to change", + "is_required": true + }, + { + "name": "default", + "type": "bool", + "description": "make this account the default", + "is_required": false + }, + { + "name": "new_name", + "type": "str", + "description": "new name for the account", + "is_required": false + }, + { + "name": "receiving_gap", + "type": "int", + "description": "set the gap for receiving addresses", + "is_required": false + }, + { + "name": "receiving_max_uses", + "type": "int", + "description": "set the maximum number of times to use a receiving address", + "is_required": false + }, + { + "name": "change_gap", + "type": "int", + "description": "set the gap for change addresses", + "is_required": false + }, + { + "name": "change_max_uses", + "type": "int", + "description": "set the maximum number of times to use a change address", + "is_required": false } - ], - "returns": "(dict) Result dictionary", - "name": "channel_import", - "description": "Import serialized channel signing information (to allow signing new claims to the channel)" - }, - { - "arguments": [], - "returns": "(list) ClaimDict, includes 'is_mine' field to indicate if the certificate claim\n is in the wallet.", - "name": "channel_list", - "description": "Get certificate claim infos for channels that can be published to" - }, + ], + "returns": "(map) updated account details" + }, { + "name": "account_unlock", + "description": "Unlock an encrypted account", "arguments": [ { - "is_required": true, - "type": "str", - "name": "channel_name", - "description": "name of the channel prefixed with '@'" - }, - { - "is_required": true, - "type": "float", - "name": "amount", - "description": "bid amount on the channel" + "name": "password", + "type": "str", + "description": "password for unlocking wallet", + "is_required": true } - ], - "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }", - "name": "channel_new", - "description": "Generate a publisher key and create a new '@' prefixed certificate claim" - }, + ], + "returns": "(bool) true if account is unlocked, otherwise false" + }, { + "name": "address_is_mine", + "description": "Checks if an address is associated with the current wallet.", "arguments": [ { - "is_required": false, - "type": "str", - "name": "claim_id", - "description": "claim_id of the claim to abandon" - }, + "name": "address", + "type": "str", + "description": "address to check", + "is_required": true + }, { - "is_required": false, - "type": "str", - "name": "txid", - "description": "txid of the claim to abandon" - }, - { - "is_required": false, - "type": "int", - "name": "nout", - "description": "nout of the claim to abandon" + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "(dict) Dictionary containing result of the claim\n {\n txid : (str) txid of resulting transaction\n fee : (float) fee paid for the transaction\n }", - "name": "claim_abandon", - "description": "Abandon a name and reclaim credits from the claim" - }, + ], + "returns": "(bool) true, if address is associated with current wallet" + }, { + "name": "address_list", + "description": "List account addresses", "arguments": [ { - "is_required": true, - "type": "str", - "name": "name", - "description": "name of the claim to list info about" + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "(dict) State of claims assigned for the name\n {\n 'claims': (list) list of claims for the name\n [\n {\n 'amount': (float) amount assigned to the claim\n 'effective_amount': (float) total amount assigned to the claim,\n including supports\n 'claim_id': (str) claim ID of the claim\n 'height': (int) height of block containing the claim\n 'txid': (str) txid of the claim\n 'nout': (int) nout of the claim\n 'permanent_url': (str) permanent url of the claim,\n 'supports': (list) a list of supports attached to the claim\n 'value': (str) the value of the claim\n },\n ]\n 'supports_without_claims': (list) supports without any claims attached to them\n 'last_takeover_height': (int) the height of last takeover for the name\n }", - "name": "claim_list", - "description": "List current claims and information about them for a given name" - }, + ], + "returns": "List of wallet addresses" + }, { + "name": "address_public_key", + "description": "Get public key from wallet address", "arguments": [ { - "is_required": true, - "type": "str", - "name": "uri", - "description": "uri of the channel" - }, - { - "is_required": false, - "type": "list", - "name": "uris", - "description": "uris of the channel" - }, - { - "is_required": false, - "type": "int", - "name": "page", - "description": "which page of results to return where page 1 is the first page, defaults to no pages" - }, - { - "is_required": false, - "type": "int", - "name": "page_size", - "description": "number of results in a page, default of 10" + "name": "address", + "type": "str", + "description": "address for which to get the public key", + "is_required": true } - ], - "returns": "{\n resolved channel uri: {\n If there was an error:\n 'error': (str) error message\n\n 'claims_in_channel': the total number of results for the channel,\n\n If a page of results was requested:\n 'returned_page': page number returned,\n 'claims_in_channel': [\n {\n 'absolute_channel_position': (int) claim index number in sorted list of\n claims which assert to be part of the\n channel\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}],\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n ],\n }\n }", - "name": "claim_list_by_channel", - "description": "Get paginated claims in a channel specified by a channel uri" - }, - { - "arguments": [], - "returns": "(list) List of name claims owned by user\n [\n {\n 'address': (str) address that owns the claim\n 'amount': (float) amount assigned to the claim\n 'blocks_to_expiration': (int) number of blocks until it expires\n 'category': (str) \"claim\", \"update\" , or \"support\"\n 'claim_id': (str) claim ID of the claim\n 'confirmations': (int) number of blocks of confirmations for the claim\n 'expiration_height': (int) the block height which the claim will expire\n 'expired': (bool) true if expired, false otherwise\n 'height': (int) height of the block containing the claim\n 'is_spent': (bool) true if claim is abandoned, false otherwise\n 'name': (str) name of the claim\n 'permanent_url': (str) permanent url of the claim,\n 'txid': (str) txid of the claim\n 'nout': (int) nout of the claim\n 'value': (str) value of the claim\n },\n ]", - "name": "claim_list_mine", - "description": "List my name claims" - }, + ], + "returns": "(list) list of public keys associated with address.\n Could contain more than one public key if multisig." + }, { + "name": "address_unused", + "description": "Return an address containing no balance, will create\na new address if there is none.", "arguments": [ { - "is_required": true, - "type": "str", - "name": "name", - "description": "name of the claim to support" - }, - { - "is_required": true, - "type": "str", - "name": "claim_id", - "description": "claim_id of the claim to support" - }, - { - "is_required": true, - "type": "float", - "name": "amount", - "description": "amount of support" + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "(dict) Dictionary containing result of the claim\n {\n txid : (str) txid of resulting support claim\n nout : (int) nout of the resulting support claim\n fee : (float) fee paid for the transaction\n }", - "name": "claim_new_support", - "description": "Support a name claim" - }, + ], + "returns": "(str) Unused wallet address in base58" + }, { + "name": "blob_announce", + "description": "Announce blobs to the DHT", "arguments": [ { - "is_required": true, - "type": "str", - "name": "outpoint", - "description": "outpoint of the claim to renew" - }, + "name": "blob_hash", + "type": "str", + "description": "announce a blob, specified by blob_hash", + "is_required": false + }, { - "is_required": true, - "type": "str", - "name": "height", - "description": "update claims expiring before or at this block height" + "name": "stream_hash", + "type": "str", + "description": "announce all blobs associated with stream_hash", + "is_required": false + }, + { + "name": "sd_hash", + "type": "str", + "description": "announce all blobs associated with sd_hash and the sd_hash itself", + "is_required": false } - ], - "returns": "(dict) Dictionary where key is the the original claim's outpoint and\n value is the result of the renewal\n {\n outpoint:{\n\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n },\n }", - "name": "claim_renew", - "description": "Renew claim(s) or support(s)" - }, + ], + "returns": "(bool) true if successful" + }, { + "name": "blob_availability", + "description": "Get blob availability", "arguments": [ { - "is_required": true, - "type": "str", - "name": "claim_id", - "description": "claim_id to send" - }, + "name": "blob_hash", + "type": "str", + "description": "check availability for this blob hash", + "is_required": true + }, { - "is_required": true, - "type": "str", - "name": "address", - "description": "address to send the claim to" - }, + "name": "search_timeout", + "type": "int", + "description": "how long to search for peers for the blob in the dht", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "amount", - "description": "Amount of credits to claim name for, defaults to the current amount on the claim" + "name": "blob_timeout", + "type": "int", + "description": "how long to try downloading from a peer", + "is_required": false } - ], - "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }", - "name": "claim_send_to_address", - "description": "Send a name claim to an address" - }, + ], + "returns": "(dict) {\n \"is_available\": \n \"reachable_peers\": [\":\"],\n \"unreachable_peers\": [\":\"]\n }" + }, { + "name": "blob_delete", + "description": "Delete a blob", "arguments": [ { - "is_required": false, - "type": "str", - "name": "txid", - "description": "look for claim with this txid, nout must also be specified" - }, - { - "is_required": false, - "type": "int", - "name": "nout", - "description": "look for claim with this nout, txid must also be specified" - }, - { - "is_required": false, - "type": "str", - "name": "claim_id", - "description": "look for claim with this claim id" + "name": "blob_hash", + "type": "str", + "description": "blob hash of the blob to delete", + "is_required": true } - ], - "returns": "(dict) Dictionary containing claim info as below,\n\n {\n 'txid': (str) txid of claim\n 'nout': (int) nout of claim\n 'amount': (float) amount of claim\n 'value': (str) value of claim\n 'height' : (int) height of claim takeover\n 'claim_id': (str) claim ID of claim\n 'supports': (list) list of supports associated with claim\n }\n\n if claim cannot be resolved, dictionary as below will be returned\n\n {\n 'error': (str) reason for error\n }", - "name": "claim_show", - "description": "Resolve claim info from txid/nout or with claim ID" - }, + ], + "returns": "(str) Success/fail message" + }, { + "name": "blob_get", + "description": "Download and return a blob", "arguments": [ { - "is_required": false, - "type": "bool", - "name": "a_arg", - "description": "a arg" - }, + "name": "blob_hash", + "type": "str", + "description": "blob hash of the blob to get", + "is_required": true + }, { - "is_required": false, - "type": "bool", - "name": "b_arg", - "description": "b arg" - }, + "name": "timeout", + "type": "int", + "description": "timeout in number of seconds", + "is_required": false + }, { - "is_required": true, - "type": "int", - "name": "pos_arg", - "description": "pos arg" - }, + "name": "encoding", + "type": "str", + "description": "by default no attempt at decoding is made, can be set to one of the following decoders: 'json'", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "pos_args", - "description": "pos args" - }, - { - "is_required": false, - "type": "int", - "name": "pos_arg2", - "description": "pos arg 2" - }, - { - "is_required": false, - "type": "int", - "name": "pos_arg3", - "description": "pos arg 3" + "name": "payment_rate_manager", + "type": "str", + "description": "if not given the default payment rate manager will be used. supported alternative rate managers: 'only-free'", + "is_required": false } - ], - "returns": "pos args", - "name": "cli_test_command", - "description": "This command is only for testing the CLI argument parsing" - }, - { - "arguments": [], - "returns": "(list) list of available commands", - "name": "commands", - "description": "Return a list of available commands" - }, - { - "arguments": [], - "returns": "(string) Shutdown message", - "name": "daemon_stop", - "description": "Stop lbrynet-daemon" - }, + ], + "returns": "(str) Success/Fail message or (dict) decoded data" + }, { + "name": "blob_list", + "description": "Returns blob hashes. If not given filters, returns all blobs known by the blob manager", "arguments": [ { - "is_required": false, - "type": "bool", - "name": "delete_from_download_dir", - "description": "delete file from download directory, instead of just deleting blobs" - }, + "name": "needed", + "type": "bool", + "description": "only return needed blobs", + "is_required": false + }, { - "is_required": false, - "type": "bool", - "name": "delete_all", - "description": "if there are multiple matching files, allow the deletion of multiple files. Otherwise do not delete anything." - }, + "name": "finished", + "type": "bool", + "description": "only return finished blobs", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "delete by file sd hash" - }, + "name": "uri", + "type": "str", + "description": "filter blobs by stream in a uri", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "file_name", - "description": "delete by file name in downloads folder" - }, + "name": "stream_hash", + "type": "str", + "description": "filter blobs by stream hash", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "delete by file stream hash" - }, + "name": "sd_hash", + "type": "str", + "description": "filter blobs by sd hash", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "rowid", - "description": "delete by file row id" - }, + "name": "page_size", + "type": "int", + "description": "results page size", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "claim_id", - "description": "delete by file claim id" - }, - { - "is_required": false, - "type": "str", - "name": "txid", - "description": "delete by file claim txid" - }, - { - "is_required": false, - "type": "int", - "name": "nout", - "description": "delete by file claim nout" - }, - { - "is_required": false, - "type": "str", - "name": "claim_name", - "description": "delete by file claim name" - }, - { - "is_required": false, - "type": "str", - "name": "channel_claim_id", - "description": "delete by file channel claim id" - }, - { - "is_required": false, - "type": "str", - "name": "channel_name", - "description": "delete by file channel claim name" + "name": "page", + "type": "int", + "description": "page of results to return", + "is_required": false } - ], - "returns": "(bool) true if deletion was successful", - "name": "file_delete", - "description": "Delete a LBRY file" - }, + ], + "returns": "(list) List of blob hashes" + }, { + "name": "blob_reflect", + "description": "Reflects specified blobs", "arguments": [ { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "get file with matching sd hash" - }, - { - "is_required": false, - "type": "str", - "name": "file_name", - "description": "get file with matching file name in the downloads folder" - }, - { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "get file with matching stream hash" - }, - { - "is_required": false, - "type": "int", - "name": "rowid", - "description": "get file with matching row id" - }, - { - "is_required": false, - "type": "str", - "name": "claim_id", - "description": "get file with matching claim id" - }, - { - "is_required": false, - "type": "str", - "name": "outpoint", - "description": "get file with matching claim outpoint" - }, - { - "is_required": false, - "type": "str", - "name": "txid", - "description": "get file with matching claim txid" - }, - { - "is_required": false, - "type": "int", - "name": "nout", - "description": "get file with matching claim nout" - }, - { - "is_required": false, - "type": "str", - "name": "channel_claim_id", - "description": "get file with matching channel claim id" - }, - { - "is_required": false, - "type": "str", - "name": "channel_name", - "description": "get file with matching channel name" - }, - { - "is_required": false, - "type": "str", - "name": "claim_name", - "description": "get file with matching claim name" - }, - { - "is_required": false, - "type": "bool", - "name": "full_status", - "description": "full status, populate the 'message' and 'size' fields" - }, - { - "is_required": false, - "type": "str", - "name": "sort", - "description": "sort by any property, like 'file_name' or 'metadata.author'; to specify direction append ',asc' or ',desc'" + "name": "reflector_server", + "type": "str", + "description": "reflector address", + "is_required": false } - ], - "returns": "(list) List of files\n\n [\n {\n 'completed': (bool) true if download is completed,\n 'file_name': (str) name of file,\n 'download_directory': (str) download directory,\n 'points_paid': (float) credit paid to download file,\n 'stopped': (bool) true if download is stopped,\n 'stream_hash': (str) stream hash of file,\n 'stream_name': (str) stream name ,\n 'suggested_file_name': (str) suggested file name,\n 'sd_hash': (str) sd hash of file,\n 'download_path': (str) download path of file,\n 'mime_type': (str) mime type of file,\n 'key': (str) key attached to file,\n 'total_bytes': (int) file size in bytes, None if full_status is false,\n 'written_bytes': (int) written size in bytes,\n 'blobs_completed': (int) num_completed, None if full_status is false,\n 'blobs_in_stream': (int) None if full_status is false,\n 'status': (str) downloader status, None if full_status is false,\n 'claim_id': (str) None if full_status is false or if claim is not found,\n 'outpoint': (str) None if full_status is false or if claim is not found,\n 'txid': (str) None if full_status is false or if claim is not found,\n 'nout': (int) None if full_status is false or if claim is not found,\n 'metadata': (dict) None if full_status is false or if claim is not found,\n 'channel_claim_id': (str) None if full_status is false or if claim is not found or signed,\n 'channel_name': (str) None if full_status is false or if claim is not found or signed,\n 'claim_name': (str) None if full_status is false or if claim is not found\n },\n ]", - "name": "file_list", - "description": "List files limited by optional filters" - }, + ], + "returns": "(list) reflected blob hashes" + }, { + "name": "blob_reflect_all", + "description": "Reflects all saved blobs", + "arguments": [], + "returns": "(bool) true if successful" + }, + { + "name": "block_show", + "description": "Get contents of a block", "arguments": [ { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "get file with matching sd hash" - }, + "name": "blockhash", + "type": "str", + "description": "hash of the block to look up", + "is_required": true + }, { - "is_required": false, - "type": "str", - "name": "file_name", - "description": "get file with matching file name in the downloads folder" - }, - { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "get file with matching stream hash" - }, - { - "is_required": false, - "type": "int", - "name": "rowid", - "description": "get file with matching row id" - }, - { - "is_required": false, - "type": "str", - "name": "reflector", - "description": "reflector server, ip address or url by default choose a server from the config" + "name": "height", + "type": "int", + "description": "height of the block to look up", + "is_required": true } - ], - "returns": "(list) list of blobs reflected", - "name": "file_reflect", - "description": "Reflect all the blobs in a file matching the filter criteria" - }, + ], + "returns": "(dict) Requested block" + }, { + "name": "channel_export", + "description": "Export serialized channel signing information for a given certificate claim id", "arguments": [ { - "is_required": true, - "type": "str", - "name": "status", - "description": "one of \"start\" or \"stop\"" - }, - { - "is_required": false, - "type": "str", - "name": "sd_hash", - "description": "set status of file with matching sd hash" - }, - { - "is_required": false, - "type": "str", - "name": "file_name", - "description": "set status of file with matching file name in the downloads folder" - }, - { - "is_required": false, - "type": "str", - "name": "stream_hash", - "description": "set status of file with matching stream hash" - }, - { - "is_required": false, - "type": "int", - "name": "rowid", - "description": "set status of file with matching row id" + "name": "claim_id", + "type": "str", + "description": "Claim ID to export information about", + "is_required": true } - ], - "returns": "(str) Confirmation message", - "name": "file_set_status", - "description": "Start or stop downloading a file" - }, + ], + "returns": "(str) Serialized certificate information" + }, { + "name": "channel_import", + "description": "Import serialized channel signing information (to allow signing new claims to the channel)", "arguments": [ { - "is_required": false, - "type": "str", - "name": "uri", - "description": "uri of the content to download" - }, - { - "is_required": false, - "type": "str", - "name": "file_name", - "description": "specified name for the downloaded file" - }, - { - "is_required": false, - "type": "int", - "name": "timeout", - "description": "download timeout in number of seconds" + "name": "serialized_certificate_info", + "type": "str", + "description": "certificate info", + "is_required": true } - ], - "returns": "(dict) Dictionary containing information about the stream\n {\n 'completed': (bool) true if download is completed,\n 'file_name': (str) name of file,\n 'download_directory': (str) download directory,\n 'points_paid': (float) credit paid to download file,\n 'stopped': (bool) true if download is stopped,\n 'stream_hash': (str) stream hash of file,\n 'stream_name': (str) stream name ,\n 'suggested_file_name': (str) suggested file name,\n 'sd_hash': (str) sd hash of file,\n 'download_path': (str) download path of file,\n 'mime_type': (str) mime type of file,\n 'key': (str) key attached to file,\n 'total_bytes': (int) file size in bytes, None if full_status is false,\n 'written_bytes': (int) written size in bytes,\n 'blobs_completed': (int) num_completed, None if full_status is false,\n 'blobs_in_stream': (int) None if full_status is false,\n 'status': (str) downloader status, None if full_status is false,\n 'claim_id': (str) claim id,\n 'outpoint': (str) claim outpoint string,\n 'txid': (str) claim txid,\n 'nout': (int) claim nout,\n 'metadata': (dict) claim metadata,\n 'channel_claim_id': (str) None if claim is not signed\n 'channel_name': (str) None if claim is not signed\n 'claim_name': (str) claim name\n }", - "name": "get", - "description": "Download stream from a LBRY name." - }, + ], + "returns": "(dict) Result dictionary" + }, { + "name": "channel_list", + "description": "Get certificate claim infos for channels that can be published to", + "arguments": [], + "returns": "(list) ClaimDict, includes 'is_mine' field to indicate if the certificate claim\n is in the wallet." + }, + { + "name": "channel_new", + "description": "Generate a publisher key and create a new '@' prefixed certificate claim", "arguments": [ { - "is_required": false, - "type": "str", - "name": "command", - "description": "command to retrieve documentation for" + "name": "channel_name", + "type": "str", + "description": "name of the channel prefixed with '@'", + "is_required": true + }, + { + "name": "amount", + "type": "decimal", + "description": "bid amount on the channel", + "is_required": true } - ], - "returns": "(str) Help message", - "name": "help", - "description": "Return a useful message for an API command" - }, + ], + "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }" + }, { + "name": "claim_abandon", + "description": "Abandon a name and reclaim credits from the claim", "arguments": [ { - "is_required": true, - "type": "str", - "name": "blob_hash", - "description": "find available peers for this blob hash" - }, + "name": "claim_id", + "type": "str", + "description": "claim_id of the claim to abandon", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "timeout", - "description": "peer search timeout in seconds" + "name": "txid", + "type": "str", + "description": "txid of the claim to abandon", + "is_required": false + }, + { + "name": "nout", + "type": "int", + "description": "nout of the claim to abandon", + "is_required": false + }, + { + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "(list) List of contact dictionaries {'host': , 'port': , 'node_id': }", - "name": "peer_list", - "description": "Get peers for blob hash" - }, + ], + "returns": "(dict) Dictionary containing result of the claim\n {\n success: (bool) True if txn is successful\n txid : (str) txid of resulting transaction\n }" + }, { + "name": "claim_list", + "description": "List current claims and information about them for a given name", "arguments": [ { - "is_required": false, - "type": "str", - "name": "address", - "description": "ip address of the peer" - }, - { - "is_required": false, - "type": "int", - "name": "port", - "description": "udp port of the peer" + "name": "name", + "type": "str", + "description": "name of the claim to list info about", + "is_required": true } - ], - "returns": "(str) pong, or {'error': } if an error is encountered", - "name": "peer_ping", - "description": "Send a kademlia ping to the specified peer. If address and port are provided the peer is directly pinged,\nif not provided the peer is located first." - }, + ], + "returns": "(dict) State of claims assigned for the name\n {\n 'claims': (list) list of claims for the name\n [\n {\n 'amount': (float) amount assigned to the claim\n 'effective_amount': (float) total amount assigned to the claim,\n including supports\n 'claim_id': (str) claim ID of the claim\n 'height': (int) height of block containing the claim\n 'txid': (str) txid of the claim\n 'nout': (int) nout of the claim\n 'permanent_url': (str) permanent url of the claim,\n 'supports': (list) a list of supports attached to the claim\n 'value': (str) the value of the claim\n },\n ]\n 'supports_without_claims': (list) supports without any claims attached to them\n 'last_takeover_height': (int) the height of last takeover for the name\n }" + }, { + "name": "claim_list_by_channel", + "description": "Get paginated claims in a channel specified by a channel uri", "arguments": [ { - "is_required": true, - "type": "str", - "name": "name", - "description": "name of the content" - }, + "name": "uri", + "type": "str", + "description": "uri of the channel", + "is_required": true + }, { - "is_required": true, - "type": "decimal", - "name": "bid", - "description": "amount to back the claim" - }, + "name": "uris", + "type": "list", + "description": "uris of the channel", + "is_required": false + }, { - "is_required": false, - "type": "dict", - "name": "metadata", - "description": "ClaimDict to associate with the claim." - }, + "name": "page", + "type": "int", + "description": "which page of results to return where page 1 is the first page, defaults to no pages", + "is_required": false + }, { - "is_required": false, - "type": "str", - "name": "file_path", - "description": "path to file to be associated with name. If provided, a lbry stream of this file will be used in 'sources'. If no path is given but a sources dict is provided, it will be used. If neither are provided, an error is raised." - }, - { - "is_required": false, - "type": "dict", - "name": "fee", - "description": "Dictionary representing key fee to download content: { 'currency': currency_symbol, 'amount': decimal, 'address': str, optional } supported currencies: LBC, USD, BTC If an address is not provided a new one will be automatically generated. Default fee is zero." - }, - { - "is_required": false, - "type": "str", - "name": "title", - "description": "title of the publication" - }, - { - "is_required": false, - "type": "str", - "name": "description", - "description": "description of the publication" - }, - { - "is_required": false, - "type": "str", - "name": "author", - "description": "author of the publication" - }, - { - "is_required": false, - "type": "str", - "name": "language", - "description": "language of the publication" - }, - { - "is_required": false, - "type": "str", - "name": "license", - "description": "publication license" - }, - { - "is_required": false, - "type": "str", - "name": "license_url", - "description": "publication license url" - }, - { - "is_required": false, - "type": "str", - "name": "thumbnail", - "description": "thumbnail url" - }, - { - "is_required": false, - "type": "str", - "name": "preview", - "description": "preview url" - }, - { - "is_required": false, - "type": "bool", - "name": "nsfw", - "description": "whether the content is nsfw" - }, - { - "is_required": false, - "type": "str", - "name": "sources", - "description": "{'lbry_sd_hash': sd_hash} specifies sd hash of file" - }, - { - "is_required": false, - "type": "str", - "name": "channel_name", - "description": "name of the publisher channel name in the wallet" - }, - { - "is_required": false, - "type": "str", - "name": "channel_id", - "description": "claim id of the publisher channel, does not check for channel claim being in the wallet. This allows publishing to a channel where only the certificate private key is in the wallet." - }, - { - "is_required": false, - "type": "str", - "name": "claim_address", - "description": "address where the claim is sent to, if not specified new address wil automatically be created" + "name": "page_size", + "type": "int", + "description": "number of results in a page, default of 10", + "is_required": false } - ], - "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (decimal) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }", - "name": "publish", - "description": "Make a new name claim and publish associated data to lbrynet,\nupdate over existing claim if user already has a claim for name.\n\nFields required in the final Metadata are:\n 'title'\n 'description'\n 'author'\n 'language'\n 'license'\n 'nsfw'\n\nMetadata can be set by either using the metadata argument or by setting individual arguments\nfee, title, description, author, language, license, license_url, thumbnail, preview, nsfw,\nor sources. Individual arguments will overwrite the fields specified in metadata argument." - }, + ], + "returns": "{\n resolved channel uri: {\n If there was an error:\n 'error': (str) error message\n\n 'claims_in_channel': the total number of results for the channel,\n\n If a page of results was requested:\n 'returned_page': page number returned,\n 'claims_in_channel': [\n {\n 'absolute_channel_position': (int) claim index number in sorted list of\n claims which assert to be part of the\n channel\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}],\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n ],\n }\n }" + }, { + "name": "claim_list_mine", + "description": "List my name claims", "arguments": [ { - "is_required": true, - "type": "str", - "name": "message", - "description": "Description of the bug" + "name": "account_id", + "type": "str", + "description": "id of the account to query", + "is_required": false } - ], - "returns": "(bool) true if successful", - "name": "report_bug", - "description": "Report a bug to slack" - }, + ], + "returns": "(list) List of name claims owned by user\n [\n {\n 'address': (str) address that owns the claim\n 'amount': (float) amount assigned to the claim\n 'blocks_to_expiration': (int) number of blocks until it expires\n 'category': (str) \"claim\", \"update\" , or \"support\"\n 'claim_id': (str) claim ID of the claim\n 'confirmations': (int) number of blocks of confirmations for the claim\n 'expiration_height': (int) the block height which the claim will expire\n 'expired': (bool) true if expired, false otherwise\n 'height': (int) height of the block containing the claim\n 'is_spent': (bool) true if claim is abandoned, false otherwise\n 'name': (str) name of the claim\n 'permanent_url': (str) permanent url of the claim,\n 'txid': (str) txid of the claim\n 'nout': (int) nout of the claim\n 'value': (str) value of the claim\n },\n ]" + }, { + "name": "claim_new_support", + "description": "Support a name claim", "arguments": [ { - "is_required": false, - "type": "bool", - "name": "force", - "description": "force refresh and ignore cache" - }, + "name": "name", + "type": "str", + "description": "name of the claim to support", + "is_required": true + }, { - "is_required": true, - "type": "str", - "name": "uri", - "description": "uri to resolve" - }, + "name": "claim_id", + "type": "str", + "description": "claim_id of the claim to support", + "is_required": true + }, { - "is_required": false, - "type": "list", - "name": "uris", - "description": "uris to resolve" + "name": "amount", + "type": "decimal", + "description": "amount of support", + "is_required": true + }, + { + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "Dictionary of results, keyed by uri\n '': {\n If a resolution error occurs:\n 'error': Error message\n\n If the uri resolves to a channel or a claim in a channel:\n 'certificate': {\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'permanent_url': (str) permanent url of the certificate claim,\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}],\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n\n If the uri resolves to a channel:\n 'claims_in_channel': (int) number of claims in the channel,\n\n If the uri resolves to a claim:\n 'claim': {\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'permanent_url': (str) permanent url of the claim,\n 'channel_name': (str) channel name if claim is in a channel\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}]\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n }", - "name": "resolve", - "description": "Resolve given LBRY URIs" - }, + ], + "returns": "(dict) Dictionary containing the transaction information\n {\n \"hex\": (str) raw transaction,\n \"inputs\": (list) inputs(dict) used for the transaction,\n \"outputs\": (list) outputs(dict) for the transaction,\n \"total_fee\": (int) fee in dewies,\n \"total_input\": (int) total of inputs in dewies,\n \"total_output\": (int) total of outputs in dewies(input - fees),\n \"txid\": (str) txid of the transaction,\n }" + }, { + "name": "claim_renew", + "description": "Renew claim(s) or support(s)", "arguments": [ { - "is_required": true, - "type": "str", - "name": "name", - "description": "the name to resolve" - }, + "name": "outpoint", + "type": "str", + "description": "outpoint of the claim to renew", + "is_required": true + }, { - "is_required": false, - "type": "bool", - "name": "force", - "description": "force refresh and do not check cache" + "name": "height", + "type": "str", + "description": "update claims expiring before or at this block height", + "is_required": true } - ], - "returns": "(dict) Metadata dictionary from name claim, None if the name is not\n resolvable", - "name": "resolve_name", - "description": "Resolve stream info from a LBRY name" - }, - { - "arguments": [], - "returns": "(dict) dictionary containing routing and contact information\n {\n \"buckets\": {\n : [\n {\n \"address\": (str) peer address,\n \"port\": (int) peer udp port\n \"node_id\": (str) peer node id,\n \"blobs\": (list) blob hashes announced by peer\n }\n ]\n },\n \"contacts\": (list) contact node ids,\n \"blob_hashes\": (list) all of the blob hashes stored by peers in the list of buckets,\n \"node_id\": (str) the local dht node id\n }", - "name": "routing_table_get", - "description": "Get DHT routing information" - }, - { - "arguments": [], - "returns": "(dict) Dictionary of daemon settings\n See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings", - "name": "settings_get", - "description": "Get daemon settings" - }, + ], + "returns": "(dict) Dictionary where key is the the original claim's outpoint and\n value is the result of the renewal\n {\n outpoint:{\n\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n },\n }" + }, { + "name": "claim_send_to_address", + "description": "Send a name claim to an address", "arguments": [ { - "is_required": false, - "type": "str", - "name": "download_directory", - "description": "path of download directory" - }, + "name": "claim_id", + "type": "str", + "description": "claim_id to send", + "is_required": true + }, { - "is_required": false, - "type": "float", - "name": "data_rate", - "description": "0.0001" - }, + "name": "address", + "type": "str", + "description": "address to send the claim to", + "is_required": true + }, { - "is_required": false, - "type": "int", - "name": "download_timeout", - "description": "180" - }, - { - "is_required": false, - "type": "int", - "name": "peer_port", - "description": "3333" - }, - { - "is_required": false, - "type": "dict", - "name": "max_key_fee", - "description": "maximum key fee for downloads, in the format: { 'currency': , 'amount': }. In the CLI, it must be an escaped JSON string Supported currency symbols: LBC, USD, BTC" - }, - { - "is_required": false, - "type": "bool", - "name": "disable_max_key_fee", - "description": "False" - }, - { - "is_required": false, - "type": "bool", - "name": "use_upnp", - "description": "True" - }, - { - "is_required": false, - "type": "bool", - "name": "run_reflector_server", - "description": "False" - }, - { - "is_required": false, - "type": "int", - "name": "cache_time", - "description": "150" - }, - { - "is_required": false, - "type": "bool", - "name": "reflect_uploads", - "description": "True" - }, - { - "is_required": false, - "type": "bool", - "name": "share_usage_data", - "description": "True" - }, - { - "is_required": false, - "type": "int", - "name": "peer_search_timeout", - "description": "3" - }, - { - "is_required": false, - "type": "int", - "name": "sd_download_timeout", - "description": "3" - }, - { - "is_required": false, - "type": "int", - "name": "auto_renew_claim_height_delta", - "description": "0 claims set to expire within this many blocks will be automatically renewed after startup (if set to 0, renews will not be made automatically)" + "name": "amount", + "type": "int", + "description": "Amount of credits to claim name for, defaults to the current amount on the claim", + "is_required": false } - ], - "returns": "(dict) Updated dictionary of daemon settings", - "name": "settings_set", - "description": "Set daemon settings" - }, - { - "arguments": [], - "returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'is_first_run': bool,\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'database': (bool),\n 'wallet': (bool),\n 'session': (bool),\n 'dht': (bool),\n 'hash_announcer': (bool),\n 'stream_identifier': (bool),\n 'file_manager': (bool),\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'peer_protocol_server': (bool),\n 'reflector': (bool),\n 'upnp': (bool),\n 'exchange_rate_manager': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'file_manager': {\n 'managed_files': (int) count of files in the file manager,\n }\n }", - "name": "status", - "description": "Get daemon status" - }, + ], + "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (float) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }" + }, { + "name": "claim_show", + "description": "Resolve claim info from txid/nout or with claim ID", "arguments": [ { - "is_required": true, - "type": "str", - "name": "uri", - "description": "check availability for this uri" - }, + "name": "txid", + "type": "str", + "description": "look for claim with this txid, nout must also be specified", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "search_timeout", - "description": "how long to search for peers for the blob in the dht" - }, + "name": "nout", + "type": "int", + "description": "look for claim with this nout, txid must also be specified", + "is_required": false + }, { - "is_required": false, - "type": "int", - "name": "blob_timeout", - "description": "how long to try downloading from a peer" + "name": "claim_id", + "type": "str", + "description": "look for claim with this claim id", + "is_required": false } - ], - "returns": "(dict) {\n 'is_available': ,\n 'did_decode': ,\n 'did_resolve': ,\n 'is_stream': ,\n 'num_blobs_in_stream': ,\n 'sd_hash': ,\n 'sd_blob_availability': see `blob_availability`,\n 'head_blob_hash': ,\n 'head_blob_availability': see `blob_availability`,\n 'use_upnp': ,\n 'upnp_redirect_is_set': ,\n 'error': | error message\n }", - "name": "stream_availability", - "description": "Get stream availability for lbry uri" - }, + ], + "returns": "(dict) Dictionary containing claim info as below,\n\n {\n 'txid': (str) txid of claim\n 'nout': (int) nout of claim\n 'amount': (float) amount of claim\n 'value': (str) value of claim\n 'height' : (int) height of claim takeover\n 'claim_id': (str) claim ID of claim\n 'supports': (list) list of supports associated with claim\n }\n\n if claim cannot be resolved, dictionary as below will be returned\n\n {\n 'error': (str) reason for error\n }" + }, { + "name": "claim_tip", + "description": "Tip the owner of the claim", "arguments": [ { - "is_required": true, - "type": "str", - "name": "uri", - "description": "uri to use" - }, + "name": "claim_id", + "type": "str", + "description": "claim_id of the claim to support", + "is_required": true + }, { - "is_required": false, - "type": "float", - "name": "size", - "description": "stream size in bytes. if provided an sd blob won't be downloaded." + "name": "amount", + "type": "decimal", + "description": "amount of support", + "is_required": true + }, + { + "name": "account_id", + "type": "str", + "description": "id of the account to use", + "is_required": false } - ], - "returns": "(float) Estimated cost in lbry credits, returns None if uri is not\n resolvable", - "name": "stream_cost_estimate", - "description": "Get estimated cost for a lbry stream" - }, + ], + "returns": "(dict) Dictionary containing the transaction information\n {\n \"hex\": (str) raw transaction,\n \"inputs\": (list) inputs(dict) used for the transaction,\n \"outputs\": (list) outputs(dict) for the transaction,\n \"total_fee\": (int) fee in dewies,\n \"total_input\": (int) total of inputs in dewies,\n \"total_output\": (int) total of outputs in dewies(input - fees),\n \"txid\": (str) txid of the transaction,\n }" + }, { - "arguments": [], - "returns": "(list) List of transactions\n\n {\n \"claim_info\": (list) claim info if in txn [{\n \"address\": (str) address of claim,\n \"balance_delta\": (float) bid amount,\n \"amount\": (float) claim amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"abandon_info\": (list) abandon info if in txn [{\n \"address\": (str) address of abandoned claim,\n \"balance_delta\": (float) returned amount,\n \"amount\": (float) claim amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"confirmations\": (int) number of confirmations for the txn,\n \"date\": (str) date and time of txn,\n \"fee\": (float) txn fee,\n \"support_info\": (list) support info if in txn [{\n \"address\": (str) address of support,\n \"balance_delta\": (float) support amount,\n \"amount\": (float) support amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"is_tip\": (bool),\n \"nout\": (int) nout\n }],\n \"timestamp\": (int) timestamp,\n \"txid\": (str) txn id,\n \"update_info\": (list) update info if in txn [{\n \"address\": (str) address of claim,\n \"balance_delta\": (float) credited/debited\n \"amount\": (float) absolute amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"value\": (float) value of txn\n }", - "name": "transaction_list", - "description": "List transactions belonging to wallet" - }, + "name": "commands", + "description": "Return a list of available commands", + "arguments": [], + "returns": "(list) list of available commands" + }, { + "name": "file_delete", + "description": "Delete a LBRY file", "arguments": [ { - "is_required": true, - "type": "str", - "name": "txid", - "description": "txid of the transaction" + "name": "delete_from_download_dir", + "type": "bool", + "description": "delete file from download directory, instead of just deleting blobs", + "is_required": false + }, + { + "name": "delete_all", + "type": "bool", + "description": "if there are multiple matching files, allow the deletion of multiple files. Otherwise do not delete anything.", + "is_required": false + }, + { + "name": "sd_hash", + "type": "str", + "description": "delete by file sd hash", + "is_required": false + }, + { + "name": "file_name", + "type": "str", + "description": "delete by file name in downloads folder", + "is_required": false + }, + { + "name": "stream_hash", + "type": "str", + "description": "delete by file stream hash", + "is_required": false + }, + { + "name": "rowid", + "type": "int", + "description": "delete by file row id", + "is_required": false + }, + { + "name": "claim_id", + "type": "str", + "description": "delete by file claim id", + "is_required": false + }, + { + "name": "txid", + "type": "str", + "description": "delete by file claim txid", + "is_required": false + }, + { + "name": "nout", + "type": "int", + "description": "delete by file claim nout", + "is_required": false + }, + { + "name": "claim_name", + "type": "str", + "description": "delete by file claim name", + "is_required": false + }, + { + "name": "channel_claim_id", + "type": "str", + "description": "delete by file channel claim id", + "is_required": false + }, + { + "name": "channel_name", + "type": "str", + "description": "delete by file channel claim name", + "is_required": false } - ], - "returns": "(dict) JSON formatted transaction", - "name": "transaction_show", - "description": "Get a decoded transaction from a txid" - }, - { - "arguments": [], - "returns": "(list) List of unspent transaction outputs (UTXOs)\n [\n {\n \"address\": (str) the output address\n \"amount\": (float) unspent amount\n \"height\": (int) block height\n \"is_claim\": (bool) is the tx a claim\n \"is_coinbase\": (bool) is the tx a coinbase tx\n \"is_support\": (bool) is the tx a support\n \"is_update\": (bool) is the tx an update\n \"nout\": (int) nout of the output\n \"txid\": (str) txid of the output\n },\n ...\n ]", - "name": "utxo_list", - "description": "List unspent transaction outputs" - }, - { - "arguments": [], - "returns": "(dict) Dictionary of lbry version information\n {\n 'build': (str) build type (e.g. \"dev\", \"rc\", \"release\"),\n 'ip': (str) remote ip, if available,\n 'lbrynet_version': (str) lbrynet_version,\n 'lbryum_version': (str) lbryum_version,\n 'lbryschema_version': (str) lbryschema_version,\n 'os_release': (str) os release string\n 'os_system': (str) os name\n 'platform': (str) platform string\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n }", - "name": "version", - "description": "Get lbry version information" - }, + ], + "returns": "(bool) true if deletion was successful" + }, { + "name": "file_list", + "description": "List files limited by optional filters", "arguments": [ { - "is_required": false, - "type": "str", - "name": "address", - "description": "If provided only the balance for this address will be given" - }, + "name": "sd_hash", + "type": "str", + "description": "get file with matching sd hash", + "is_required": false + }, { - "is_required": false, - "type": "bool", - "name": "include_unconfirmed", - "description": "Include unconfirmed" + "name": "file_name", + "type": "str", + "description": "get file with matching file name in the downloads folder", + "is_required": false + }, + { + "name": "stream_hash", + "type": "str", + "description": "get file with matching stream hash", + "is_required": false + }, + { + "name": "rowid", + "type": "int", + "description": "get file with matching row id", + "is_required": false + }, + { + "name": "claim_id", + "type": "str", + "description": "get file with matching claim id", + "is_required": false + }, + { + "name": "outpoint", + "type": "str", + "description": "get file with matching claim outpoint", + "is_required": false + }, + { + "name": "txid", + "type": "str", + "description": "get file with matching claim txid", + "is_required": false + }, + { + "name": "nout", + "type": "int", + "description": "get file with matching claim nout", + "is_required": false + }, + { + "name": "channel_claim_id", + "type": "str", + "description": "get file with matching channel claim id", + "is_required": false + }, + { + "name": "channel_name", + "type": "str", + "description": "get file with matching channel name", + "is_required": false + }, + { + "name": "claim_name", + "type": "str", + "description": "get file with matching claim name", + "is_required": false + }, + { + "name": "sort", + "type": "str", + "description": "sort by any property, like 'file_name' or 'metadata.author'; to specify direction append ',asc' or ',desc'", + "is_required": false } - ], - "returns": "(float) amount of lbry credits in wallet", - "name": "wallet_balance", - "description": "Return the balance of the wallet" - }, - { - "arguments": [], - "returns": "(bool) true if wallet is decrypted, otherwise false", - "name": "wallet_decrypt", - "description": "Decrypt an encrypted wallet, this will remove the wallet password" - }, + ], + "returns": "(list) List of files\n\n [\n {\n 'completed': (bool) true if download is completed,\n 'file_name': (str) name of file,\n 'download_directory': (str) download directory,\n 'points_paid': (float) credit paid to download file,\n 'stopped': (bool) true if download is stopped,\n 'stream_hash': (str) stream hash of file,\n 'stream_name': (str) stream name ,\n 'suggested_file_name': (str) suggested file name,\n 'sd_hash': (str) sd hash of file,\n 'download_path': (str) download path of file,\n 'mime_type': (str) mime type of file,\n 'key': (str) key attached to file,\n 'total_bytes': (int) file size in bytes,\n 'written_bytes': (int) written size in bytes,\n 'blobs_completed': (int) number of fully downloaded blobs,\n 'blobs_in_stream': (int) total blobs on stream,\n 'status': (str) downloader status\n 'claim_id': (str) None if claim is not found else the claim id,\n 'outpoint': (str) None if claim is not found else the tx and output,\n 'txid': (str) None if claim is not found else the transaction id,\n 'nout': (int) None if claim is not found else the transaction output index,\n 'metadata': (dict) None if claim is not found else the claim metadata,\n 'channel_claim_id': (str) None if claim is not found or not signed,\n 'channel_name': (str) None if claim is not found or not signed,\n 'claim_name': (str) None if claim is not found else the claim name\n },\n ]" + }, { + "name": "file_reflect", + "description": "Reflect all the blobs in a file matching the filter criteria", "arguments": [ { - "is_required": true, - "type": "str", - "name": "new_password", - "description": "password string to be used for encrypting wallet" + "name": "sd_hash", + "type": "str", + "description": "get file with matching sd hash", + "is_required": false + }, + { + "name": "file_name", + "type": "str", + "description": "get file with matching file name in the downloads folder", + "is_required": false + }, + { + "name": "stream_hash", + "type": "str", + "description": "get file with matching stream hash", + "is_required": false + }, + { + "name": "rowid", + "type": "int", + "description": "get file with matching row id", + "is_required": false + }, + { + "name": "reflector", + "type": "str", + "description": "reflector server, ip address or url by default choose a server from the config", + "is_required": false } - ], - "returns": "(bool) true if wallet is decrypted, otherwise false", - "name": "wallet_encrypt", - "description": "Encrypt a wallet with a password, if the wallet is already encrypted this will update\nthe password" - }, + ], + "returns": "(list) list of blobs reflected" + }, { + "name": "file_set_status", + "description": "Start or stop downloading a file", "arguments": [ { - "is_required": true, - "type": "str", - "name": "address", - "description": "address to check" + "name": "status", + "type": "str", + "description": "one of \"start\" or \"stop\"", + "is_required": true + }, + { + "name": "sd_hash", + "type": "str", + "description": "set status of file with matching sd hash", + "is_required": false + }, + { + "name": "file_name", + "type": "str", + "description": "set status of file with matching file name in the downloads folder", + "is_required": false + }, + { + "name": "stream_hash", + "type": "str", + "description": "set status of file with matching stream hash", + "is_required": false + }, + { + "name": "rowid", + "type": "int", + "description": "set status of file with matching row id", + "is_required": false } - ], - "returns": "(bool) true, if address is associated with current wallet", - "name": "wallet_is_address_mine", - "description": "Checks if an address is associated with the current wallet." - }, - { - "arguments": [], - "returns": "List of wallet addresses", - "name": "wallet_list", - "description": "List wallet addresses" - }, - { - "arguments": [], - "returns": "(str) New wallet address in base58", - "name": "wallet_new_address", - "description": "Generate a new wallet address" - }, + ], + "returns": "(str) Confirmation message" + }, { + "name": "get", + "description": "Download stream from a LBRY name.", "arguments": [ { - "is_required": false, - "type": "bool", - "name": "no_broadcast", - "description": "whether to broadcast or not" - }, + "name": "uri", + "type": "str", + "description": "uri of the content to download", + "is_required": false + }, { - "is_required": true, - "type": "int", - "name": "num_addresses", - "description": "num of addresses to create" - }, + "name": "file_name", + "type": "str", + "description": "specified name for the downloaded file", + "is_required": false + }, { - "is_required": true, - "type": "float", - "name": "amount", - "description": "initial amount in each address" + "name": "timeout", + "type": "int", + "description": "download timeout in number of seconds", + "is_required": false } - ], - "returns": "(dict) the resulting transaction", - "name": "wallet_prefill_addresses", - "description": "Create new addresses, each containing `amount` credits" - }, + ], + "returns": "(dict) Dictionary containing information about the stream\n {\n 'completed': (bool) true if download is completed,\n 'file_name': (str) name of file,\n 'download_directory': (str) download directory,\n 'points_paid': (float) credit paid to download file,\n 'stopped': (bool) true if download is stopped,\n 'stream_hash': (str) stream hash of file,\n 'stream_name': (str) stream name ,\n 'suggested_file_name': (str) suggested file name,\n 'sd_hash': (str) sd hash of file,\n 'download_path': (str) download path of file,\n 'mime_type': (str) mime type of file,\n 'key': (str) key attached to file,\n 'total_bytes': (int) file size in bytes,\n 'written_bytes': (int) written size in bytes,\n 'blobs_completed': (int) number of fully downloaded blobs,\n 'blobs_in_stream': (int) total blobs on stream,\n 'status': (str) downloader status,\n 'claim_id': (str) claim id,\n 'outpoint': (str) claim outpoint string,\n 'txid': (str) claim txid,\n 'nout': (int) claim nout,\n 'metadata': (dict) claim metadata,\n 'channel_claim_id': (str) None if claim is not signed\n 'channel_name': (str) None if claim is not signed\n 'claim_name': (str) claim name\n }" + }, { + "name": "help", + "description": "Return a useful message for an API command", "arguments": [ { - "is_required": true, - "type": "str", - "name": "address", - "description": "address for which to get the public key" + "name": "command", + "type": "str", + "description": "command to retrieve documentation for", + "is_required": false } - ], - "returns": "(list) list of public keys associated with address.\n Could contain more than one public key if multisig.", - "name": "wallet_public_key", - "description": "Get public key from wallet address" - }, + ], + "returns": "(str) Help message" + }, { + "name": "peer_list", + "description": "Get peers for blob hash", "arguments": [ { - "is_required": true, - "type": "Decimal", - "name": "amount", - "description": "amount of credit to send" - }, + "name": "blob_hash", + "type": "str", + "description": "find available peers for this blob hash", + "is_required": true + }, { - "is_required": true, - "type": "str", - "name": "address", - "description": "address to send credits to" - }, - { - "is_required": true, - "type": "str", - "name": "claim_id", - "description": "claim_id of the claim to send to tip to" + "name": "timeout", + "type": "int", + "description": "peer search timeout in seconds", + "is_required": false } - ], - "returns": "If sending to an address:\n (bool) true if payment successfully scheduled\n\n If sending a claim tip:\n (dict) Dictionary containing the result of the support\n {\n txid : (str) txid of resulting support claim\n nout : (int) nout of the resulting support claim\n fee : (float) fee paid for the transaction\n }", - "name": "wallet_send", - "description": "Send credits. If given an address, send credits to it. If given a claim id, send a tip\nto the owner of a claim specified by uri. A tip is a claim support where the recipient\nof the support is the claim address for the claim being supported." - }, + ], + "returns": "(list) List of contact dictionaries {'host': , 'port': , 'node_id': }" + }, { + "name": "peer_ping", + "description": "Send a kademlia ping to the specified peer. If address and port are provided the peer is directly pinged,\nif not provided the peer is located first.", "arguments": [ { - "is_required": true, - "type": "str", - "name": "password", - "description": "password for unlocking wallet" + "name": "address", + "type": "str", + "description": "ip address of the peer", + "is_required": false + }, + { + "name": "port", + "type": "int", + "description": "udp port of the peer", + "is_required": false } - ], - "returns": "(bool) true if wallet is unlocked, otherwise false", - "name": "wallet_unlock", - "description": "Unlock an encrypted wallet" - }, + ], + "returns": "(str) pong, or {'error': } if an error is encountered" + }, { - "arguments": [], - "returns": "(str) Unused wallet address in base58", - "name": "wallet_unused_address", - "description": "Return an address containing no balance, will create\na new address if there is none." + "name": "publish", + "description": "Make a new name claim and publish associated data to lbrynet,\nupdate over existing claim if user already has a claim for name.\n\nFields required in the final Metadata are:\n 'title'\n 'description'\n 'author'\n 'language'\n 'license'\n 'nsfw'\n\nMetadata can be set by either using the metadata argument or by setting individual arguments\nfee, title, description, author, language, license, license_url, thumbnail, preview, nsfw,\nor sources. Individual arguments will overwrite the fields specified in metadata argument.", + "arguments": [ + { + "name": "name", + "type": "str", + "description": "name of the content (can only consist of a-z A-Z 0-9 and -(dash))", + "is_required": true + }, + { + "name": "bid", + "type": "decimal", + "description": "amount to back the claim", + "is_required": true + }, + { + "name": "metadata", + "type": "dict", + "description": "ClaimDict to associate with the claim.", + "is_required": false + }, + { + "name": "file_path", + "type": "str", + "description": "path to file to be associated with name. If provided, a lbry stream of this file will be used in 'sources'. If no path is given but a sources dict is provided, it will be used. If neither are provided, an error is raised.", + "is_required": false + }, + { + "name": "fee", + "type": "dict", + "description": "Dictionary representing key fee to download content: { 'currency': currency_symbol, 'amount': decimal, 'address': str, optional } supported currencies: LBC, USD, BTC If an address is not provided a new one will be automatically generated. Default fee is zero.", + "is_required": false + }, + { + "name": "title", + "type": "str", + "description": "title of the publication", + "is_required": false + }, + { + "name": "description", + "type": "str", + "description": "description of the publication", + "is_required": false + }, + { + "name": "author", + "type": "str", + "description": "author of the publication. The usage for this field is not the same as for channels. The author field is used to credit an author who is not the publisher and is not represented by the channel. For example, a pdf file of 'The Odyssey' has an author of 'Homer' but may by published to a channel such as '@classics', or to no channel at all", + "is_required": false + }, + { + "name": "language", + "type": "str", + "description": "language of the publication", + "is_required": false + }, + { + "name": "license", + "type": "str", + "description": "publication license", + "is_required": false + }, + { + "name": "license_url", + "type": "str", + "description": "publication license url", + "is_required": false + }, + { + "name": "thumbnail", + "type": "str", + "description": "thumbnail url", + "is_required": false + }, + { + "name": "preview", + "type": "str", + "description": "preview url", + "is_required": false + }, + { + "name": "nsfw", + "type": "bool", + "description": "whether the content is nsfw", + "is_required": false + }, + { + "name": "sources", + "type": "str", + "description": "{'lbry_sd_hash': sd_hash} specifies sd hash of file", + "is_required": false + }, + { + "name": "channel_name", + "type": "str", + "description": "name of the publisher channel name in the wallet", + "is_required": false + }, + { + "name": "channel_id", + "type": "str", + "description": "claim id of the publisher channel, does not check for channel claim being in the wallet. This allows publishing to a channel where only the certificate private key is in the wallet.", + "is_required": false + }, + { + "name": "claim_address", + "type": "str", + "description": "address where the claim is sent to, if not specified new address wil automatically be created", + "is_required": false + } + ], + "returns": "(dict) Dictionary containing result of the claim\n {\n 'tx' : (str) hex encoded transaction\n 'txid' : (str) txid of resulting claim\n 'nout' : (int) nout of the resulting claim\n 'fee' : (decimal) fee paid for the claim transaction\n 'claim_id' : (str) claim ID of the resulting claim\n }" + }, + { + "name": "report_bug", + "description": "Report a bug to slack", + "arguments": [ + { + "name": "message", + "type": "str", + "description": "Description of the bug", + "is_required": true + } + ], + "returns": "(bool) true if successful" + }, + { + "name": "resolve", + "description": "Resolve given LBRY URIs", + "arguments": [ + { + "name": "force", + "type": "bool", + "description": "force refresh and ignore cache", + "is_required": false + }, + { + "name": "uri", + "type": "str", + "description": "uri to resolve", + "is_required": true + }, + { + "name": "uris", + "type": "list", + "description": "uris to resolve", + "is_required": false + } + ], + "returns": "Dictionary of results, keyed by uri\n '': {\n If a resolution error occurs:\n 'error': Error message\n\n If the uri resolves to a channel or a claim in a channel:\n 'certificate': {\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'permanent_url': (str) permanent url of the certificate claim,\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}],\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n\n If the uri resolves to a channel:\n 'claims_in_channel': (int) number of claims in the channel,\n\n If the uri resolves to a claim:\n 'claim': {\n 'address': (str) claim address,\n 'amount': (float) claim amount,\n 'effective_amount': (float) claim amount including supports,\n 'claim_id': (str) claim id,\n 'claim_sequence': (int) claim sequence number,\n 'decoded_claim': (bool) whether or not the claim value was decoded,\n 'height': (int) claim height,\n 'depth': (int) claim depth,\n 'has_signature': (bool) included if decoded_claim\n 'name': (str) claim name,\n 'permanent_url': (str) permanent url of the claim,\n 'channel_name': (str) channel name if claim is in a channel\n 'supports: (list) list of supports [{'txid': (str) txid,\n 'nout': (int) nout,\n 'amount': (float) amount}]\n 'txid': (str) claim txid,\n 'nout': (str) claim nout,\n 'signature_is_valid': (bool), included if has_signature,\n 'value': ClaimDict if decoded, otherwise hex string\n }\n }" + }, + { + "name": "resolve_name", + "description": "Resolve stream info from a LBRY name", + "arguments": [ + { + "name": "name", + "type": "str", + "description": "the name to resolve", + "is_required": true + }, + { + "name": "force", + "type": "bool", + "description": "force refresh and do not check cache", + "is_required": false + } + ], + "returns": "(dict) Metadata dictionary from name claim, None if the name is not\n resolvable" + }, + { + "name": "routing_table_get", + "description": "Get DHT routing information", + "arguments": [], + "returns": "(dict) dictionary containing routing and contact information\n {\n \"buckets\": {\n : [\n {\n \"address\": (str) peer address,\n \"port\": (int) peer udp port\n \"node_id\": (str) peer node id,\n \"blobs\": (list) blob hashes announced by peer\n }\n ]\n },\n \"contacts\": (list) contact node ids,\n \"blob_hashes\": (list) all of the blob hashes stored by peers in the list of buckets,\n \"node_id\": (str) the local dht node id\n }" + }, + { + "name": "settings_get", + "description": "Get daemon settings", + "arguments": [], + "returns": "(dict) Dictionary of daemon settings\n See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings" + }, + { + "name": "settings_set", + "description": "Set daemon settings", + "arguments": [ + { + "name": "download_directory", + "type": "str", + "description": "path of download directory", + "is_required": false + }, + { + "name": "data_rate", + "type": "float", + "description": "0.0001", + "is_required": false + }, + { + "name": "download_timeout", + "type": "int", + "description": "180", + "is_required": false + }, + { + "name": "peer_port", + "type": "int", + "description": "3333", + "is_required": false + }, + { + "name": "max_key_fee", + "type": "dict", + "description": "maximum key fee for downloads, in the format: { 'currency': , 'amount': }. In the CLI, it must be an escaped JSON string Supported currency symbols: LBC, USD, BTC", + "is_required": false + }, + { + "name": "disable_max_key_fee", + "type": "bool", + "description": "False", + "is_required": false + }, + { + "name": "use_upnp", + "type": "bool", + "description": "True", + "is_required": false + }, + { + "name": "run_reflector_server", + "type": "bool", + "description": "False", + "is_required": false + }, + { + "name": "cache_time", + "type": "int", + "description": "150", + "is_required": false + }, + { + "name": "reflect_uploads", + "type": "bool", + "description": "True", + "is_required": false + }, + { + "name": "share_usage_data", + "type": "bool", + "description": "True", + "is_required": false + }, + { + "name": "peer_search_timeout", + "type": "int", + "description": "3", + "is_required": false + }, + { + "name": "sd_download_timeout", + "type": "int", + "description": "3", + "is_required": false + }, + { + "name": "auto_renew_claim_height_delta", + "type": "int", + "description": "0 claims set to expire within this many blocks will be automatically renewed after startup (if set to 0, renews will not be made automatically)", + "is_required": false + } + ], + "returns": "(dict) Updated dictionary of daemon settings" + }, + { + "name": "status", + "description": "Get daemon status", + "arguments": [], + "returns": "(dict) lbrynet-daemon status\n {\n 'installation_id': (str) installation id - base58,\n 'is_running': (bool),\n 'is_first_run': bool,\n 'skipped_components': (list) [names of skipped components (str)],\n 'startup_status': { Does not include components which have been skipped\n 'database': (bool),\n 'wallet': (bool),\n 'session': (bool),\n 'dht': (bool),\n 'hash_announcer': (bool),\n 'stream_identifier': (bool),\n 'file_manager': (bool),\n 'blob_manager': (bool),\n 'blockchain_headers': (bool),\n 'peer_protocol_server': (bool),\n 'reflector': (bool),\n 'upnp': (bool),\n 'exchange_rate_manager': (bool),\n },\n 'connection_status': {\n 'code': (str) connection status code,\n 'message': (str) connection status message\n },\n 'blockchain_headers': {\n 'downloading_headers': (bool),\n 'download_progress': (float) 0-100.0\n },\n 'wallet': {\n 'blocks': (int) local blockchain height,\n 'blocks_behind': (int) remote_height - local_height,\n 'best_blockhash': (str) block hash of most recent block,\n 'is_encrypted': (bool),\n 'is_locked': (bool),\n },\n 'dht': {\n 'node_id': (str) lbry dht node id - hex encoded,\n 'peers_in_routing_table': (int) the number of peers in the routing table,\n },\n 'blob_manager': {\n 'finished_blobs': (int) number of finished blobs in the blob manager,\n },\n 'hash_announcer': {\n 'announce_queue_size': (int) number of blobs currently queued to be announced\n },\n 'file_manager': {\n 'managed_files': (int) count of files in the file manager,\n }\n }" + }, + { + "name": "stop", + "description": "Stop lbrynet", + "arguments": [], + "returns": "(string) Shutdown message" + }, + { + "name": "stream_availability", + "description": "Get stream availability for lbry uri", + "arguments": [ + { + "name": "uri", + "type": "str", + "description": "check availability for this uri", + "is_required": true + }, + { + "name": "search_timeout", + "type": "int", + "description": "how long to search for peers for the blob in the dht", + "is_required": false + }, + { + "name": "blob_timeout", + "type": "int", + "description": "how long to try downloading from a peer", + "is_required": false + } + ], + "returns": "(dict) {\n 'is_available': ,\n 'did_decode': ,\n 'did_resolve': ,\n 'is_stream': ,\n 'num_blobs_in_stream': ,\n 'sd_hash': ,\n 'sd_blob_availability': see `blob_availability`,\n 'head_blob_hash': ,\n 'head_blob_availability': see `blob_availability`,\n 'use_upnp': ,\n 'upnp_redirect_is_set': ,\n 'error': | error message\n }" + }, + { + "name": "stream_cost_estimate", + "description": "Get estimated cost for a lbry stream", + "arguments": [ + { + "name": "uri", + "type": "str", + "description": "uri to use", + "is_required": true + }, + { + "name": "size", + "type": "float", + "description": "stream size in bytes. if provided an sd blob won't be downloaded.", + "is_required": false + } + ], + "returns": "(float) Estimated cost in lbry credits, returns None if uri is not\n resolvable" + }, + { + "name": "transaction_list", + "description": "List transactions belonging to wallet", + "arguments": [ + { + "name": "account_id", + "type": "str", + "description": "id of the account to query", + "is_required": false + } + ], + "returns": "(list) List of transactions\n\n {\n \"claim_info\": (list) claim info if in txn [{\n \"address\": (str) address of claim,\n \"balance_delta\": (float) bid amount,\n \"amount\": (float) claim amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"abandon_info\": (list) abandon info if in txn [{\n \"address\": (str) address of abandoned claim,\n \"balance_delta\": (float) returned amount,\n \"amount\": (float) claim amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"confirmations\": (int) number of confirmations for the txn,\n \"date\": (str) date and time of txn,\n \"fee\": (float) txn fee,\n \"support_info\": (list) support info if in txn [{\n \"address\": (str) address of support,\n \"balance_delta\": (float) support amount,\n \"amount\": (float) support amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"is_tip\": (bool),\n \"nout\": (int) nout\n }],\n \"timestamp\": (int) timestamp,\n \"txid\": (str) txn id,\n \"update_info\": (list) update info if in txn [{\n \"address\": (str) address of claim,\n \"balance_delta\": (float) credited/debited\n \"amount\": (float) absolute amount,\n \"claim_id\": (str) claim id,\n \"claim_name\": (str) claim name,\n \"nout\": (int) nout\n }],\n \"value\": (float) value of txn\n }" + }, + { + "name": "transaction_show", + "description": "Get a decoded transaction from a txid", + "arguments": [ + { + "name": "txid", + "type": "str", + "description": "txid of the transaction", + "is_required": true + } + ], + "returns": "(dict) JSON formatted transaction" + }, + { + "name": "utxo_list", + "description": "List unspent transaction outputs", + "arguments": [ + { + "name": "account_id", + "type": "str", + "description": "id of the account to query", + "is_required": false + } + ], + "returns": "(list) List of unspent transaction outputs (UTXOs)\n [\n {\n \"address\": (str) the output address\n \"amount\": (float) unspent amount\n \"height\": (int) block height\n \"is_claim\": (bool) is the tx a claim\n \"is_coinbase\": (bool) is the tx a coinbase tx\n \"is_support\": (bool) is the tx a support\n \"is_update\": (bool) is the tx an update\n \"nout\": (int) nout of the output\n \"txid\": (str) txid of the output\n },\n ...\n ]" + }, + { + "name": "version", + "description": "Get lbry version information", + "arguments": [], + "returns": "(dict) Dictionary of lbry version information\n {\n 'build': (str) build type (e.g. \"dev\", \"rc\", \"release\"),\n 'ip': (str) remote ip, if available,\n 'lbrynet_version': (str) lbrynet_version,\n 'lbryum_version': (str) lbryum_version,\n 'lbryschema_version': (str) lbryschema_version,\n 'os_release': (str) os release string\n 'os_system': (str) os name\n 'platform': (str) platform string\n 'processor': (str) processor type,\n 'python_version': (str) python version,\n }" + }, + { + "name": "wallet_prefill_addresses", + "description": "Create new UTXOs, each containing `amount` credits", + "arguments": [ + { + "name": "no_broadcast", + "type": "bool", + "description": "whether to broadcast or not", + "is_required": false + }, + { + "name": "num_addresses", + "type": "int", + "description": "num of addresses to create", + "is_required": true + }, + { + "name": "amount", + "type": "decimal", + "description": "initial amount in each address", + "is_required": true + } + ], + "returns": "(dict) the resulting transaction" + }, + { + "name": "wallet_send", + "description": "Send credits. If given an address, send credits to it. If given a claim id, send a tip\nto the owner of a claim specified by uri. A tip is a claim support where the recipient\nof the support is the claim address for the claim being supported.", + "arguments": [ + { + "name": "amount", + "type": "decimal", + "description": "amount of credit to send", + "is_required": true + }, + { + "name": "address", + "type": "str", + "description": "address to send credits to", + "is_required": true + }, + { + "name": "claim_id", + "type": "str", + "description": "claim_id of the claim to send to tip to", + "is_required": true + }, + { + "name": "account_id", + "type": "str", + "description": "account to fund the transaction", + "is_required": false + } + ], + "returns": "If sending to an address:\n (dict) Dictionary containing the transaction information\n {\n \"hex\": (str) raw transaction,\n \"inputs\": (list) inputs(dict) used for the transaction,\n \"outputs\": (list) outputs(dict) for the transaction,\n \"total_fee\": (int) fee in dewies,\n \"total_input\": (int) total of inputs in dewies,\n \"total_output\": (int) total of outputs in dewies(input - fees),\n \"txid\": (str) txid of the transaction,\n }\n\n If sending a claim tip:\n (dict) Dictionary containing the result of the support\n {\n txid : (str) txid of resulting support claim\n nout : (int) nout of the resulting support claim\n fee : (float) fee paid for the transaction\n }" } ] \ No newline at end of file diff --git a/lbrynet/daemon/Daemon.py b/lbrynet/daemon/Daemon.py index 38b2e06f6..828b9903f 100644 --- a/lbrynet/daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -1035,13 +1035,13 @@ class Daemon(AuthJSONRPCServer): Usage: wallet_send ( | --amount=) ((
| --address=
) | ( | --claim_id=)) - [--account=] + [--account_id=] Options: - --amount= : (Decimal) amount of credit to send - --address=
: (str) address to send credits to - --claim_id= : (str) claim_id of the claim to send to tip to - --account= : (str) account to fund the transaction + --amount= : (decimal) amount of credit to send + --address=
: (str) address to send credits to + --claim_id= : (str) claim_id of the claim to send to tip to + --account_id= : (str) account to fund the transaction Returns: If sending to an address: @@ -1106,7 +1106,7 @@ class Daemon(AuthJSONRPCServer): Options: --no_broadcast : (bool) whether to broadcast or not --num_addresses= : (int) num of addresses to create - --amount= : (float) initial amount in each address + --amount= : (decimal) initial amount in each address Returns: (dict) the resulting transaction @@ -1131,7 +1131,7 @@ class Daemon(AuthJSONRPCServer): [--include_reserved] [--include_claims] [--show_seed] Options: - --account= : (str) If provided only the balance for this + --account_id= : (str) If provided only the balance for this account will be given --confirmations= : (int) required confirmations (default: 6) --include_reserved : (bool) include reserved UTXOs (default: false) @@ -1174,14 +1174,14 @@ class Daemon(AuthJSONRPCServer): account_balance [] [
| --address=
] [--include_unconfirmed] Options: - --account= : (str) If provided only the balance for this - account will be given - --address=
: (str) If provided only the balance for this - address will be given - --include_unconfirmed : (bool) Include unconfirmed + --account_id= : (str) If provided only the balance for this + account will be given + --address=
: (str) If provided only the balance for this + address will be given + --include_unconfirmed : (bool) Include unconfirmed Returns: - (float) amount of lbry credits in wallet + (decimal) amount of lbry credits in wallet """ if address is not None: raise NotImplementedError("Limiting by address needs to be re-implemented in new wallet.") @@ -1205,11 +1205,11 @@ class Daemon(AuthJSONRPCServer): [--single_key] Options: - --account_name= : (str) name of the account to add - --seed= : (str) seed to generate new account from - --private_key= : (str) private key for new account - --public_key= : (str) public key for new account - --single_key : (bool) create single key account, default is multi-key + --account_name= : (str) name of the account to add + --seed= : (str) seed to generate new account from + --private_key= : (str) private key for new account + --public_key= : (str) public key for new account + --single_key : (bool) create single key account, default is multi-key Returns: (map) added account details @@ -1250,8 +1250,8 @@ class Daemon(AuthJSONRPCServer): account_create ( | --account_name=) [--single_key] Options: - --account_name= : (str) name of the account to create - --single_key : (bool) create single key account, default is multi-key + --account_name= : (str) name of the account to create + --single_key : (bool) create single key account, default is multi-key Returns: (map) new account details @@ -1281,10 +1281,10 @@ class Daemon(AuthJSONRPCServer): Remove an existing account. Usage: - account ( | --account=) + account ( | --account_id=) Options: - --account= : (str) id of the account to remove + --account_id= : (str) id of the account to remove Returns: (map) details of removed account @@ -1307,13 +1307,13 @@ class Daemon(AuthJSONRPCServer): Change various settings on an account. Usage: - account ( | --account=) + account ( | --account_id=) [--default] [--new_name=] [--change_gap=] [--change_max_uses=] [--receiving_gap=] [--receiving_max_uses=] Options: - --account= : (str) id of the account to change + --account_id= : (str) id of the account to change --default : (bool) make this account the default --new_name= : (str) new name for the account --receiving_gap= : (int) set the gap for receiving addresses @@ -1429,10 +1429,10 @@ class Daemon(AuthJSONRPCServer): account settings. Usage: - account_max_address_gap ( | --account=) + account_max_address_gap ( | --account_id=) Options: - --account= : (str) account for which to get max gaps + --account_id= : (str) account for which to get max gaps Returns: (map) maximum gap for change and receiving addresses @@ -1486,11 +1486,11 @@ class Daemon(AuthJSONRPCServer): Usage: wallet_is_address_mine (
| --address=
) - [ | --account=] + [ | --account_id=] Options: - --address=
: (str) address to check - --account= : (str) id of the account to use + --address=
: (str) address to check + --account_id= : (str) id of the account to use Returns: (bool) true, if address is associated with current wallet @@ -1522,10 +1522,10 @@ class Daemon(AuthJSONRPCServer): List account addresses Usage: - address_list [ | --account=] + address_list [ | --account_id=] Options: - --account= : (str) id of the account to use + --account_id= : (str) id of the account to use Returns: List of wallet addresses @@ -1539,10 +1539,10 @@ class Daemon(AuthJSONRPCServer): a new address if there is none. Usage: - address_unused [--account=] + address_unused [--account_id=] Options: - --account= : (str) id of the account to use + --account_id= : (str) id of the account to use Returns: (str) Unused wallet address in base58 @@ -1931,7 +1931,7 @@ class Daemon(AuthJSONRPCServer): allow the deletion of multiple files. Otherwise do not delete anything. --sd_hash= : (str) delete by file sd hash - --file_name : (str) delete by file name in downloads folder + --file_name= : (str) delete by file name in downloads folder --stream_hash= : (str) delete by file stream hash --rowid= : (int) delete by file row id --claim_id= : (str) delete by file claim id @@ -2008,7 +2008,7 @@ class Daemon(AuthJSONRPCServer): Options: --channel_name= : (str) name of the channel prefixed with '@' - --amount= : (float) bid amount on the channel + --amount= : (decimal) bid amount on the channel Returns: (dict) Dictionary containing result of the claim @@ -2325,13 +2325,13 @@ class Daemon(AuthJSONRPCServer): Usage: claim_abandon [ | --claim_id=] [ | --txid=] [ | --nout=] - [--account=] + [--account_id=] Options: - --claim_id= : (str) claim_id of the claim to abandon - --txid= : (str) txid of the claim to abandon - --nout= : (int) nout of the claim to abandon - --account= : (str) id of the account to use + --claim_id= : (str) claim_id of the claim to abandon + --txid= : (str) txid of the claim to abandon + --nout= : (int) nout of the claim to abandon + --account_id= : (str) id of the account to use Returns: (dict) Dictionary containing result of the claim @@ -2364,13 +2364,13 @@ class Daemon(AuthJSONRPCServer): Usage: claim_new_support ( | --name=) ( | --claim_id=) - ( | --amount=) [--account=] + ( | --amount=) [--account_id=] Options: - --name= : (str) name of the claim to support - --claim_id= : (str) claim_id of the claim to support - --amount= : (float) amount of support - --account= : (str) id of the account to use + --name= : (str) name of the claim to support + --claim_id= : (str) claim_id of the claim to support + --amount= : (decimal) amount of support + --account_id= : (str) id of the account to use Returns: (dict) Dictionary containing the transaction information @@ -2397,12 +2397,13 @@ class Daemon(AuthJSONRPCServer): Tip the owner of the claim Usage: - claim_tip ( | --claim_id=) ( | --amount=) [--account=] + claim_tip ( | --claim_id=) ( | --amount=) + [--account_id=] Options: - --claim_id= : (str) claim_id of the claim to support - --amount= : (float) amount of support - --account= : (str) id of the account to use + --claim_id= : (str) claim_id of the claim to support + --amount= : (decimal) amount of support + --account_id= : (str) id of the account to use Returns: (dict) Dictionary containing the transaction information @@ -2480,8 +2481,8 @@ class Daemon(AuthJSONRPCServer): Options: --claim_id= : (str) claim_id to send --address=
: (str) address to send the claim to - --amount : (int) Amount of credits to claim name for, defaults to the current amount - on the claim + --amount= : (int) Amount of credits to claim name for, + defaults to the current amount on the claim Returns: (dict) Dictionary containing result of the claim @@ -2505,10 +2506,10 @@ class Daemon(AuthJSONRPCServer): List my name claims Usage: - claim_list_mine [ | --account=] + claim_list_mine [ | --account_id=] Options: - --account= : (str) id of the account to query + --account_id= : (str) id of the account to query Returns: (list) List of name claims owned by user @@ -2669,10 +2670,10 @@ class Daemon(AuthJSONRPCServer): List transactions belonging to wallet Usage: - transaction_list [ | --account=] + transaction_list [ | --account_id=] Options: - --account= : (str) id of the account to query + --account_id= : (str) id of the account to query Returns: (list) List of transactions @@ -2747,7 +2748,7 @@ class Daemon(AuthJSONRPCServer): utxo_list [] Options: - --account= : (str) id of the account to query + --account_id= : (str) id of the account to query Returns: (list) List of unspent transaction outputs (UTXOs) diff --git a/scripts/generate_json_api.py b/scripts/generate_json_api.py index 9de90191a..ea120aa67 100644 --- a/scripts/generate_json_api.py +++ b/scripts/generate_json_api.py @@ -61,6 +61,7 @@ def write_api(f): if __name__ == '__main__': - html_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'docs', 'api.json') + parent = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + html_file = os.path.join(parent, 'docs', 'api.json') with open(html_file, 'w+') as f: write_api(f)