menu curl lbrynet python

lbry-sdk master Methods and signatures provided by the lbry-sdk daemon are documented below. To build, download, or run the daemon, see the project README.

You can find the repo for this API on GitHub: https://github.com/lbryio/lbry-sdk

ffmpeg_find Get ffmpeg installation information Arguments Returns (dict) Dictionary of ffmpeg information { 'available': (bool) found ffmpeg, 'which': (str) path to ffmpeg, 'analyze_audio_volume': (bool) should ffmpeg analyze audio }

// example(s) to come later

get Download stream from a LBRY name. Arguments uri

optional str uri of the content to download

file_name

optional str specified name for the downloaded file, overrides the stream file name

download_directory

optional str full path to the directory to download into

timeout

optional int download timeout in number of seconds

save_file

optional bool save the file to the downloads directory

wallet_id

optional str wallet to check for claim purchase reciepts Returns { "streaming_url": "(str) url to stream the file using range requests", "completed": "(bool) true if download is completed", "file_name": "(str) name of file", "download_directory": "(str) download directory", "points_paid": "(float) credit paid to download file", "stopped": "(bool) true if download is stopped", "stream_hash": "(str) stream hash of file", "stream_name": "(str) stream name", "suggested_file_name": "(str) suggested file name", "sd_hash": "(str) sd hash of file", "download_path": "(str) download path of file", "mime_type": "(str) mime type of file", "key": "(str) key attached to file", "total_bytes_lower_bound": "(int) lower bound file size in bytes", "total_bytes": "(int) file upper bound size in bytes", "written_bytes": "(int) written size in bytes", "blobs_completed": "(int) number of fully downloaded blobs", "blobs_in_stream": "(int) total blobs on stream", "blobs_remaining": "(int) total blobs remaining to download", "status": "(str) downloader status", "claim_id": "(str) None if claim is not found else the claim id", "txid": "(str) None if claim is not found else the transaction id", "nout": "(int) None if claim is not found else the transaction output index", "outpoint": "(str) None if claim is not found else the tx and output", "metadata": "(dict) None if claim is not found else the claim metadata", "channel_claim_id": "(str) None if claim is not found or not signed", "channel_name": "(str) None if claim is not found or not signed", "claim_name": "(str) None if claim is not found else the claim name", "reflector_progress": "(int) reflector upload progress, 0 to 100", "uploading_to_reflector": "(bool) set to True when currently uploading to reflector" }

Get a file

curl -d'{"method": "get", "params": {"uri": "astream#b184691589549834b2ec8119b6a274387eec23c8"}}' http://localhost:5279/ lbrynet get astream#b184691589549834b2ec8119b6a274387eec23c8 requests.post("http://localhost:5279", json={"method": "get", "params": {"uri": "astream#b184691589549834b2ec8119b6a274387eec23c8"}}).json() Output

{ "jsonrpc": "2.0", "result": { "added_on": 1597866369, "blobs_completed": 1, "blobs_in_stream": 1, "blobs_remaining": 0, "channel_claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "channel_name": "@channel", "claim_id": "b184691589549834b2ec8119b6a274387eec23c8", "claim_name": "astream", "completed": true, "confirmations": 3, "content_fee": null, "download_directory": "/tmp/tmph2bve0mo", "download_path": "/tmp/tmph2bve0mo/tmp0fr7f0o8", "file_name": "tmp0fr7f0o8", "height": 214, "is_fully_reflected": false, "key": "41aedeefe018836b56f90c7f87e3b574", "metadata": { "source": { "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd", "media_type": "application/octet-stream", "name": "tmp0fr7f0o8", "sd_hash": "4457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "size": "11" }, "stream_type": "binary" }, "mime_type": "application/octet-stream", "nout": 0, "outpoint": "9bbe86e113fbd12ac4e2c66cfbcc791f7c4f9e4ac564ac9333380c07d63d6f35:0", "points_paid": 0.0, "protobuf": "0124a8681d197afe8682c609c007fc6505574d04e447a791d193947f9f328863ee26d3efc4cd689151518bf1502d8cd5ce65465c792f8c71ea596eb32f51d7413a499550faeceb6da14356f76043bef26a8367a6740a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d703066723766306f38180b22186170706c69636174696f6e2f6f637465742d73747265616d32304457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "purchase_receipt": null, "reflector_progress": 0, "sd_hash": "4457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "status": "finished", "stopped": true, "stream_hash": "510c7e9b97633e816e2b91845b410a99d3bb7b9c0e81e6af398bdf0a7faca9072674913fc997bc6378445db9c9f70aae", "stream_name": "tmp0fr7f0o8", "streaming_url": "http://localhost:5280/stream/4457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "suggested_file_name": "tmp0fr7f0o8", "timestamp": 1597866389, "total_bytes": 16, "total_bytes_lower_bound": 0, "txid": "9bbe86e113fbd12ac4e2c66cfbcc791f7c4f9e4ac564ac9333380c07d63d6f35", "uploading_to_reflector": false, "written_bytes": 11 } }

publish Create or replace a stream claim at a given name (use 'stream create/update' for more control). Arguments name

str name of the content (can only consist of a-z A-Z 0-9 and -(dash))

bid

optional decimal amount to back the claim

file_path

optional str path to file to be associated with name.

validate_file

optional bool validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required

optimize_file

optional bool transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required

fee_currency

optional string specify fee currency

fee_amount

optional decimal content download fee

fee_address

optional str address where to send fee payments, will use value from --claim_address if not provided

title

optional str title of the publication

description

optional str description of the publication

author

optional str 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

tags

optional list add content tags

languages

optional list languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`

locations

optional list locations relevant to the stream, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"

license

optional str publication license

license_url

optional str publication license url

thumbnail_url

optional str thumbnail url

release_time

optional int original public release of content, seconds since UNIX epoch

width

optional int image/video width, automatically calculated from media file

height

optional int image/video height, automatically calculated from media file

duration

optional int audio/video duration in seconds, automatically calculated

channel_id

optional str claim id of the publisher channel

channel_name

optional str name of publisher channel

channel_account_id

optional str one or more account ids for accounts to look in for channel certificates, defaults to all accounts.

account_id

optional str account to use for holding the transaction

wallet_id

optional str restrict operation to specific wallet

funding_account_ids

optional list ids of accounts to fund this transaction

claim_address

optional str address where the claim is sent to, if not specified it will be determined automatically from the account

preview

optional bool do not broadcast the transaction

blocking

optional bool wait until transaction is in mempool Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "total_input": "sum of inputs as a decimal", "total_output": "sum of outputs, sans fee, as a decimal", "total_fee": "fee amount", "hex": "entire transaction encoded in hex" }

Publish a file

curl -d'{"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/tmp/tmplzrrnpu1", "validate_file": false, "optimize_file": false, "tags": [], "languages": [], "locations": [], "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/ lbrynet publish a-new-stream --bid=1.0 --file_path=/tmp/tmplzrrnpu1 requests.post("http://localhost:5279", json={"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/tmp/tmplzrrnpu1", "validate_file": false, "optimize_file": false, "tags": [], "languages": [], "locations": [], "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "010000000156d3155e92eef85a65efd3b6bbb9405731753ba7f228ce8ca7ffd06cd3b66173010000006a473044022064cd0fc2200a9395b33b060d5eb35924614ae7563c88083847e0a9ac85b5712a02207bec94489f3513366e19b2c5ba86c26e59fdbfb7fb5d6e95574a74186a1d13d7012102d675898ddf4f28f9429e012a40cb986c2508ac79e3e9f930f972c0c130512569ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706c7a72726e707531180b22186170706c69636174696f6e2f6f637465742d73747265616d3230c7a5bb2db6ce4ed09e0f302d866418c8f03ecd36dfbc0d02e0573210a07181c97f2a23372d6c82fd6717a8a7ddb340a26d7576a9144624c3e1d6709a6e11a167f133bdf9e0077019a388ace0b46217000000001976a914d3616404186faad4a58ae595c782a1c1d817077688ac00000000", "inputs": [ { "address": "mi7FN9G3gxFKZm7B18hRumzwUwfN6DNuZ4", "amount": "4.947555", "confirmations": 4, "height": 215, "nout": 1, "timestamp": 1597866389, "txid": "7361b6d36cd0ffa78cce28f2a73b75315740b9bbb6d3ef655af8ee925e15d356", "type": "payment" } ], "outputs": [ { "address": "mmuqdyFHfwt9dCBcoDobCmAYCTFcyFmUBA", "amount": "1.0", "claim_id": "59497906a75ec42d4f38e1db2911c5e88b5808cb", "claim_op": "create", "confirmations": -2, "height": -2, "meta": {}, "name": "a-new-stream", "normalized_name": "a-new-stream", "nout": 0, "permanent_url": "lbry://a-new-stream#59497906a75ec42d4f38e1db2911c5e88b5808cb", "timestamp": null, "txid": "c3a149dfeda639404a0d2bed59c983fb831a71e50bed71ee8c83c9ee7ec2a053", "type": "claim", "value": { "source": { "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd", "media_type": "application/octet-stream", "name": "tmplzrrnpu1", "sd_hash": "c7a5bb2db6ce4ed09e0f302d866418c8f03ecd36dfbc0d02e0573210a07181c97f2a23372d6c82fd6717a8a7ddb340a2", "size": "11" }, "stream_type": "binary" }, "value_type": "stream" }, { "address": "mzndYMUZUuCQA5nwSUGtZV5zqkDLfbSbZ2", "amount": "3.923448", "confirmations": -2, "height": -2, "nout": 1, "timestamp": null, "txid": "c3a149dfeda639404a0d2bed59c983fb831a71e50bed71ee8c83c9ee7ec2a053", "type": "payment" } ], "total_fee": "0.024107", "total_input": "4.947555", "total_output": "4.923448", "txid": "c3a149dfeda639404a0d2bed59c983fb831a71e50bed71ee8c83c9ee7ec2a053" } }

resolve Get the claim that a URL refers to. Arguments urls

optional str, list one or more urls to resolve

wallet_id

optional str wallet to check for claim purchase reciepts

new_sdk_server

optional str URL of the new SDK server (EXPERIMENTAL)

include_purchase_receipt

optional bool lookup and include a receipt if this wallet has purchased the claim being resolved

include_is_my_output

optional bool lookup and include a boolean indicating if claim being resolved is yours

include_sent_supports

optional bool lookup and sum the total amount of supports you've made to this claim

include_sent_tips

optional bool lookup and sum the total amount of tips you've made to this claim (only makes sense when claim is not yours)

include_received_tips

optional bool lookup and sum the total amount of tips you've received to this claim (only makes sense when claim is yours) Returns Dictionary of results, keyed by url ' ': { If a resolution error occurs: 'error': Error message If the url resolves to a channel or a claim in a channel: 'certificate': { 'address': (str) claim address, 'amount': (float) claim amount, 'effective_amount': (float) claim amount including supports, 'claim_id': (str) claim id, 'claim_sequence': (int) claim sequence number (or -1 if unknown), 'decoded_claim': (bool) whether or not the claim value was decoded, 'height': (int) claim height, 'confirmations': (int) claim depth, 'timestamp': (int) timestamp of the block that included this claim tx, 'has_signature': (bool) included if decoded_claim 'name': (str) claim name, 'permanent_url': (str) permanent url of the certificate claim, 'supports: (list) list of supports [{'txid': (str) txid, 'nout': (int) nout, 'amount': (float) amount}], 'txid': (str) claim txid, 'nout': (str) claim nout, 'signature_is_valid': (bool), included if has_signature, 'value': ClaimDict if decoded, otherwise hex string } If the url resolves to a channel: 'claims_in_channel': (int) number of claims in the channel, If the url resolves to a claim: 'claim': { 'address': (str) claim address, 'amount': (float) claim amount, 'effective_amount': (float) claim amount including supports, 'claim_id': (str) claim id, 'claim_sequence': (int) claim sequence number (or -1 if unknown), 'decoded_claim': (bool) whether or not the claim value was decoded, 'height': (int) claim height, 'depth': (int) claim depth, 'has_signature': (bool) included if decoded_claim 'name': (str) claim name, 'permanent_url': (str) permanent url of the claim, 'channel_name': (str) channel name if claim is in a channel 'supports: (list) list of supports [{'txid': (str) txid, 'nout': (int) nout, 'amount': (float) amount}] 'txid': (str) claim txid, 'nout': (str) claim nout, 'signature_is_valid': (bool), included if has_signature, 'value': ClaimDict if decoded, otherwise hex string } }

Resolve a claim

curl -d'{"method": "resolve", "params": {"urls": ["astream#b184691589549834b2ec8119b6a274387eec23c8"], "include_purchase_receipt": false, "include_is_my_output": false, "include_sent_supports": false, "include_sent_tips": false, "include_received_tips": false}}' http://localhost:5279/ lbrynet resolve astream#b184691589549834b2ec8119b6a274387eec23c8 requests.post("http://localhost:5279", json={"method": "resolve", "params": {"urls": ["astream#b184691589549834b2ec8119b6a274387eec23c8"], "include_purchase_receipt": false, "include_is_my_output": false, "include_sent_supports": false, "include_sent_tips": false, "include_received_tips": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "astream#b184691589549834b2ec8119b6a274387eec23c8": { "address": "n1bJZ8YbonCVPZpV3xaym9fX5HzQriaqRA", "amount": "1.0", "canonical_url": "lbry://@channel#e/astream#b", "claim_id": "b184691589549834b2ec8119b6a274387eec23c8", "claim_op": "update", "confirmations": 3, "height": 214, "is_channel_signature_valid": true, "meta": { "activation_height": 213, "creation_height": 213, "creation_timestamp": 1597866389, "effective_amount": "1.0", "expiration_height": 263187, "is_controlling": true, "reposted": 0, "support_amount": "0.0", "take_over_height": 213, "trending_global": 0.0, "trending_group": 0, "trending_local": 0.0, "trending_mixed": 0.0 }, "name": "astream", "normalized_name": "astream", "nout": 0, "permanent_url": "lbry://astream#b184691589549834b2ec8119b6a274387eec23c8", "short_url": "lbry://astream#b", "signing_channel": { "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "amount": "1.0", "canonical_url": "lbry://@channel#e", "claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "claim_op": "update", "confirmations": 7, "has_signing_key": false, "height": 210, "meta": { "activation_height": 209, "claims_in_channel": 1, "creation_height": 209, "creation_timestamp": 1597866388, "effective_amount": "1.0", "expiration_height": 263183, "is_controlling": true, "reposted": 0, "support_amount": "0.0", "take_over_height": 209, "trending_global": 0.0, "trending_group": 0, "trending_local": 0.0, "trending_mixed": 0.0 }, "name": "@channel", "normalized_name": "@channel", "nout": 0, "permanent_url": "lbry://@channel#e4044d570565fc07c009c68286fe7a191d68a824", "short_url": "lbry://@channel#e", "timestamp": 1597866388, "txid": "f79df39221f9e3e38eeff798bcef1e8706dc24e2bff646ea104c4ad800093f28", "type": "claim", "value": { "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac936", "public_key_id": "mp9t5BD8eQptVccCQZDoHpqKgc6Z35mtXb", "title": "New Channel" }, "value_type": "channel" }, "timestamp": 1597866389, "txid": "9bbe86e113fbd12ac4e2c66cfbcc791f7c4f9e4ac564ac9333380c07d63d6f35", "type": "claim", "value": { "source": { "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd", "media_type": "application/octet-stream", "name": "tmp0fr7f0o8", "sd_hash": "4457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "size": "11" }, "stream_type": "binary" }, "value_type": "stream" } } }

routing_table_get Get DHT routing information Arguments Returns (dict) dictionary containing routing and peer information { "buckets": { : [ { "address": (str) peer address, "udp_port": (int) peer udp port, "tcp_port": (int) peer tcp port, "node_id": (str) peer node id, } ] }, "node_id": (str) the local dht node id }

// example(s) to come later

status Get daemon status Arguments Returns (dict) lbrynet-daemon status { 'installation_id': (str) installation id - base58, 'is_running': (bool), 'skipped_components': (list) [names of skipped components (str)], 'startup_status': { Does not include components which have been skipped 'blob_manager': (bool), 'blockchain_headers': (bool), 'database': (bool), 'dht': (bool), 'exchange_rate_manager': (bool), 'hash_announcer': (bool), 'peer_protocol_server': (bool), 'file_manager': (bool), 'libtorrent_component': (bool), 'upnp': (bool), 'wallet': (bool), }, 'connection_status': { 'code': (str) connection status code, 'message': (str) connection status message }, 'blockchain_headers': { 'downloading_headers': (bool), 'download_progress': (float) 0-100.0 }, 'wallet': { 'connected': (str) host and port of the connected spv server, 'blocks': (int) local blockchain height, 'blocks_behind': (int) remote_height - local_height, 'best_blockhash': (str) block hash of most recent block, 'is_encrypted': (bool), 'is_locked': (bool), 'connected_servers': (list) [ { 'host': (str) server hostname, 'port': (int) server port, 'latency': (int) milliseconds } ], }, 'libtorrent_component': { 'running': (bool) libtorrent was detected and started successfully, }, 'dht': { 'node_id': (str) lbry dht node id - hex encoded, 'peers_in_routing_table': (int) the number of peers in the routing table, }, 'blob_manager': { 'finished_blobs': (int) number of finished blobs in the blob manager, 'connections': { 'incoming_bps': { : (int) bytes per second received, }, 'outgoing_bps': { : (int) bytes per second sent, }, 'total_outgoing_mps': (float) megabytes per second sent, 'total_incoming_mps': (float) megabytes per second received, 'time': (float) timestamp } }, 'hash_announcer': { 'announce_queue_size': (int) number of blobs currently queued to be announced }, 'file_manager': { 'managed_files': (int) count of files in the stream manager, }, 'upnp': { 'aioupnp_version': (str), 'redirects': { : (int) external_port, }, 'gateway': (str) manufacturer and model, 'dht_redirect_set': (bool), 'peer_redirect_set': (bool), 'external_ip': (str) external ip address, } }

Get status

curl -d'{"method": "status", "params": {}}' http://localhost:5279/ lbrynet status requests.post("http://localhost:5279", json={"method": "status", "params": {}}).json() Output

{ "jsonrpc": "2.0", "result": { "blob_manager": { "connections": { "incoming_bps": {}, "max_incoming_mbs": 0.0, "max_outgoing_mbs": 0.0, "outgoing_bps": {}, "total_incoming_mbs": 0.0, "total_outgoing_mbs": 0.0, "total_received": 0, "total_sent": 0 }, "finished_blobs": 0 }, "connection_status": { "code": "network_connection", "message": "Your internet connection appears to have been interrupted" }, "ffmpeg_status": { "analyze_audio_volume": true, "available": true, "which": "/usr/bin/ffmpeg" }, "file_manager": { "managed_files": 0 }, "installation_id": "8adXM7ef6bkDUeAZDDKHvMUQdBYjWDfdJ2PxV4fiExUzRr6Kk8gyY3XJDnn1pdTmBD", "is_running": true, "skipped_components": [ "dht", "upnp", "hash_announcer", "peer_protocol_server" ], "startup_status": { "blob_manager": true, "database": true, "exchange_rate_manager": true, "file_manager": true, "libtorrent_component": true, "wallet": true, "wallet_server_payments": true }, "wallet": { "available_servers": 1, "best_blockhash": "f3ef3e1c91557ddc1d4d5de648599213ca44c10f09994b2c7583afb0447fc823", "blocks": 206, "blocks_behind": 0, "connected": "127.0.0.1:50002", "connected_features": { "daily_fee": "0", "description": "", "donation_address": "", "genesis_hash": "6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556", "hash_function": "sha256", "hosts": {}, "payment_address": "", "protocol_max": "0.99.0", "protocol_min": "0.54.0", "pruning": null, "server_version": "0.80.0", "trending_algorithm": "zscore" }, "headers_synchronization_progress": 100, "known_servers": 1, "servers": [ { "availability": true, "host": "localhost", "latency": 0.010011468082666397, "port": 50002 } ] }, "wallet_server_payments": { "max_fee": "0.0", "running": false } } }

stop Stop lbrynet API server. Arguments Returns (string) Shutdown message

// example(s) to come later

version Get lbrynet API server version information Arguments Returns (dict) Dictionary of lbry version information { 'processor': (str) processor type, 'python_version': (str) python version, 'platform': (str) platform string, 'os_release': (str) os release string, 'os_system': (str) os name, 'version': (str) lbrynet version, 'build': (str) "dev" | "qa" | "rc" | "release", }

Get version

curl -d'{"method": "version", "params": {}}' http://localhost:5279/ lbrynet version requests.post("http://localhost:5279", json={"method": "version", "params": {}}).json() Output

{ "jsonrpc": "2.0", "result": { "build": "dev", "desktop": "GNOME", "distro": { "codename": "xenial", "id": "ubuntu", "like": "debian", "version": "16.04", "version_parts": { "build_number": "", "major": "16", "minor": "04" } }, "lbrynet_version": "0.80.0", "os_release": "4.4.0-116-generic", "os_system": "Linux", "platform": "Linux-4.4.0-116-generic-x86_64-with-Ubuntu-16.04-xenial", "processor": "x86_64", "python_version": "3.7.5", "version": "0.80.0" } }

account_add Add a previously created account from a seed, private key or public key (read-only). Specify --single_key for single address or vanity address accounts. Arguments account_name

str name of the account to add

seed

optional str seed to generate new account from

private_key

optional str private key for new account

public_key

optional str public key for new account

single_key

optional bool create single key account, default is multi-key

wallet_id

optional str restrict operation to specific wallet Returns { "id": "account_id", "is_default": "this account is used by default", "ledger": "name of crypto currency and network", "name": "optional account name", "seed": "human friendly words from which account can be recreated", "encrypted": "if account is encrypted", "private_key": "extended private key", "public_key": "extended public key", "address_generator": "settings for generating addresses", "modified_on": "date of last modification to account settings" }

Add an account from seed

curl -d'{"method": "account_add", "params": {"account_name": "new account", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon", "single_key": false}}' http://localhost:5279/ lbrynet account add "new account" --seed="prepare pulse mesh road divorce require agent broken prison happy write salon" requests.post("http://localhost:5279", json={"method": "account_add", "params": {"account_name": "new account", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon", "single_key": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "address_generator": { "change": { "gap": 6, "maximum_uses_per_address": 1 }, "name": "deterministic-chain", "receiving": { "gap": 20, "maximum_uses_per_address": 1 } }, "encrypted": false, "id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "is_default": false, "ledger": "lbc_regtest", "modified_on": 1597866356, "name": "new account", "private_key": "tprv8ZgxMBicQKsPeSt89b7pkVtx9aYaHDshUGV4UWFjYSqj14JgcMV8F4z67x2XmJ7bGbF7MYXwDDWU49MerBgCV1ZCeMdDCEcgu7QToo48Gx6", "public_key": "tpubD6NzVbkrYhZ4Xuuv3EnR9uZ4ic4WSZ4c3a5qm2J2xie7qYZTEkJiRZbxJ514gUt7gYGcCUJ7NPrg6AXsHZnp2DM81EBgXbvkFmbXcu5KTy3", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon" } }

account_balance Return the balance of an account Arguments account_id

optional str If provided only the balance for this account will be given. Otherwise default account.

wallet_id

optional str balance for specific wallet

confirmations

optional int Only include transactions with this many confirmed blocks. Returns (decimal) amount of lbry credits in wallet

Get default account balance

curl -d'{"method": "account_balance", "params": {}}' http://localhost:5279/ lbrynet account balance requests.post("http://localhost:5279", json={"method": "account_balance", "params": {}}).json() Output

{ "jsonrpc": "2.0", "result": { "available": "7.999876", "reserved": "0.0", "reserved_subtotals": { "claims": "0.0", "supports": "0.0", "tips": "0.0" }, "total": "7.999876" } } Get balance for specific account by id

curl -d'{"method": "account_balance", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}' http://localhost:5279/ lbrynet account balance "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" requests.post("http://localhost:5279", json={"method": "account_balance", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}).json() Output

{ "jsonrpc": "2.0", "result": { "available": "2.0", "reserved": "0.0", "reserved_subtotals": { "claims": "0.0", "supports": "0.0", "tips": "0.0" }, "total": "2.0" } }

account_create Create a new account. Specify --single_key if you want to use the same address for all transactions (not recommended). Arguments account_name

str name of the account to create

single_key

optional bool create single key account, default is multi-key

wallet_id

optional str restrict operation to specific wallet Returns { "id": "account_id", "is_default": "this account is used by default", "ledger": "name of crypto currency and network", "name": "optional account name", "seed": "human friendly words from which account can be recreated", "encrypted": "if account is encrypted", "private_key": "extended private key", "public_key": "extended public key", "address_generator": "settings for generating addresses", "modified_on": "date of last modification to account settings" }

Create an account

curl -d'{"method": "account_create", "params": {"account_name": "generated account", "single_key": false}}' http://localhost:5279/ lbrynet account create "generated account" requests.post("http://localhost:5279", json={"method": "account_create", "params": {"account_name": "generated account", "single_key": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "address_generator": { "change": { "gap": 6, "maximum_uses_per_address": 1 }, "name": "deterministic-chain", "receiving": { "gap": 20, "maximum_uses_per_address": 1 } }, "encrypted": false, "id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "is_default": false, "ledger": "lbc_regtest", "modified_on": 1597866356, "name": "generated account", "private_key": "tprv8ZgxMBicQKsPeSt89b7pkVtx9aYaHDshUGV4UWFjYSqj14JgcMV8F4z67x2XmJ7bGbF7MYXwDDWU49MerBgCV1ZCeMdDCEcgu7QToo48Gx6", "public_key": "tpubD6NzVbkrYhZ4Xuuv3EnR9uZ4ic4WSZ4c3a5qm2J2xie7qYZTEkJiRZbxJ514gUt7gYGcCUJ7NPrg6AXsHZnp2DM81EBgXbvkFmbXcu5KTy3", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon" } }

account_fund Transfer some amount (or --everything) to an account from another account (can be the same account). Amounts are interpreted as LBC. You can also spread the transfer across a number of --outputs (cannot be used together with --everything). Arguments to_account

optional str send to this account

from_account

optional str spend from this account

amount

str the amount to transfer lbc

everything

optional bool transfer everything (excluding claims), default: false.

outputs

optional int split payment across many outputs, default: 1.

wallet_id

optional str limit operation to specific wallet.

broadcast

optional bool actually broadcast the transaction, default: false. Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "total_input": "sum of inputs as a decimal", "total_output": "sum of outputs, sans fee, as a decimal", "total_fee": "fee amount", "hex": "entire transaction encoded in hex" }

Transfer 2 LBC from default account to specific account

curl -d'{"method": "account_fund", "params": {"to_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "amount": "2.0", "everything": false, "broadcast": true}}' http://localhost:5279/ lbrynet account fund --to_account="mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" --amount=2.0 --broadcast requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "amount": "2.0", "everything": false, "broadcast": true}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "01000000015f9ed58e575fbc62d191803c721f63cccdc49184a423b36710a99574b0035d33010000006b483045022100ee40915faf91a51f48b0a428485de4ef7177da6a86ad01fdfd270d89b4762f67022030bad3c81dc46daf7eac0e438e69fed9dd6c3c9b698398529989dfadcdf4959d0121025f3cf8c08e8d7fb4955970baa481fc0d3d9eb6abc41813a2734bb9d828d829b9ffffffff0200c2eb0b000000001976a914ce8a55c5b5e115be2edefc986d3b4b57c5025e6588ac90d7ae2f000000001976a9140e2231630fc2d43feffd0e50e512ebecc7945d5488ac00000000", "inputs": [ { "address": "n4gSQsJHoqoQj6uZDbM9kJJG1LnJLRN8hL", "amount": "10.0", "confirmations": 6, "height": 201, "nout": 1, "timestamp": 1597866387, "txid": "335d03b07495a91067b323a48491c4cdcc631f723c8091d162bc5f578ed59e5f", "type": "payment" } ], "outputs": [ { "address": "mzM3DFxdKyJUeCdSRGUstNhXobDiSC4muT", "amount": "2.0", "confirmations": -2, "height": -2, "nout": 0, "timestamp": null, "txid": "798dde8e56514ad3fb770211be109e7bba57b09d9040a019468e81336749ff28", "type": "payment" }, { "address": "mgogiWFqNSXn5a8ye6DxsRG4Ki8BubGyB4", "amount": "7.999876", "confirmations": -2, "height": -2, "nout": 1, "timestamp": null, "txid": "798dde8e56514ad3fb770211be109e7bba57b09d9040a019468e81336749ff28", "type": "payment" } ], "total_fee": "0.000124", "total_input": "10.0", "total_output": "9.999876", "txid": "798dde8e56514ad3fb770211be109e7bba57b09d9040a019468e81336749ff28" } } Spread LBC between multiple addresses

curl -d'{"method": "account_fund", "params": {"to_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "from_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "amount": "1.5", "everything": false, "outputs": 2, "broadcast": true}}' http://localhost:5279/ lbrynet account fund --to_account="mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" --from_account="mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" --amount=1.5 --outputs=2 --broadcast requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "from_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "amount": "1.5", "everything": false, "outputs": 2, "broadcast": true}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "010000000128ff496733818e4619a040909db057ba7b9e10be110277fbd34a51568ede8d79000000006b483045022100f29837311356c53ac5d9481c62987abe5de1430b78b6cf31b124e5f982c52ca202207cc572b91d133152e347ed6f46ddd39629335d9b7ec62a723bfc37d3e8b61843012102a1306b9b854c082de2937132067f93a5c7fd395bf196675e5270936eeb66002fffffffff03c0687804000000001976a914778ba7b61bd606fc1c4092904479a27cd06e3aac88acc0687804000000001976a914778ba7b61bd606fc1c4092904479a27cd06e3aac88ac6cb9fa02000000001976a914f10c3814cfecc2c5e709e2e8eb9775f0fe4c6ac488ac00000000", "inputs": [ { "address": "mzM3DFxdKyJUeCdSRGUstNhXobDiSC4muT", "amount": "2.0", "confirmations": 1, "height": 207, "nout": 0, "timestamp": 1597866388, "txid": "798dde8e56514ad3fb770211be109e7bba57b09d9040a019468e81336749ff28", "type": "payment" } ], "outputs": [ { "address": "mrR41HmMotDdSDWDo6QpgJ7f3SvUpZVzzp", "amount": "0.75", "confirmations": -2, "height": -2, "nout": 0, "timestamp": null, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" }, { "address": "mrR41HmMotDdSDWDo6QpgJ7f3SvUpZVzzp", "amount": "0.75", "confirmations": -2, "height": -2, "nout": 1, "timestamp": null, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" }, { "address": "n3VVnHF31hvH9LPx17jj7RWU3V2ba8UeKF", "amount": "0.499859", "confirmations": -2, "height": -2, "nout": 2, "timestamp": null, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" } ], "total_fee": "0.000141", "total_input": "2.0", "total_output": "1.999859", "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7" } } Transfer all LBC to a specified account

curl -d'{"method": "account_fund", "params": {"from_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "everything": true, "broadcast": true}}' http://localhost:5279/ lbrynet account fund --from_account="mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" --everything --broadcast requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"from_account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "everything": true, "broadcast": true}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "0100000003c7720b601685e1b5d264eacfee9bc4eb6a89e97f0af21621211f69716e16d485000000006b483045022100ecb97cbf809988203479da48db14b9951a49b5ea9dc3d7091a1eaf98d5e06f3002206d0c0f6a9acdd54d07e8e06d806883c371b31ffc312d04df68240f73badc74fa01210251957b321e5a9dcdf8ef72058840e040865278e7a6e96ee1e008721bfbae3fceffffffffc7720b601685e1b5d264eacfee9bc4eb6a89e97f0af21621211f69716e16d485010000006a473044022007dc831519e7983cfab11794464b2245907f8084a27f5a0ae4db7eaba2bef574022062cc95d926c24624bd4d9c20629c98dd715360d7bc91dbf3ac0c83e02b3993cf01210251957b321e5a9dcdf8ef72058840e040865278e7a6e96ee1e008721bfbae3fceffffffffc7720b601685e1b5d264eacfee9bc4eb6a89e97f0af21621211f69716e16d485020000006b4830450221009fd31e2d8bd24833b5fc34181733950a44c569fcce350e5ff00c3250b39046f3022062db72f5280c169ef8eccd21ca46f7aa8700e2dc01ea9b05a5e17ea1870c5e4801210378df2c238713f02ffd3a69c340c5110b7a88af35b4b34c8b13b0dc39c399a31effffffff015027eb0b000000001976a9144db861118922966fe8b8594c3d47528683358d6188ac00000000", "inputs": [ { "address": "mrR41HmMotDdSDWDo6QpgJ7f3SvUpZVzzp", "amount": "0.75", "confirmations": 1, "height": 208, "nout": 0, "timestamp": 1597866388, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" }, { "address": "mrR41HmMotDdSDWDo6QpgJ7f3SvUpZVzzp", "amount": "0.75", "confirmations": 1, "height": 208, "nout": 1, "timestamp": 1597866388, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" }, { "address": "n3VVnHF31hvH9LPx17jj7RWU3V2ba8UeKF", "amount": "0.499859", "confirmations": 1, "height": 208, "nout": 2, "timestamp": 1597866388, "txid": "85d4166e71691f212116f20a7fe9896aebc49beecfea64d2b5e18516600b72c7", "type": "payment" } ], "outputs": [ { "address": "mnbuCiQ13svik8qg4UZHbFE8PusQVMGWtY", "amount": "1.999604", "confirmations": -2, "height": -2, "nout": 0, "timestamp": null, "txid": "77097343ff5b384097cb294d8d13a6c629c45579c97f90ae4300057bed1c2888", "type": "payment" } ], "total_fee": "0.000255", "total_input": "1.999859", "total_output": "1.999604", "txid": "77097343ff5b384097cb294d8d13a6c629c45579c97f90ae4300057bed1c2888" } }

account_list List details of all of the accounts or a specific account. Arguments account_id

optional str If provided only the balance for this account will be given

wallet_id

optional str accounts in specific wallet

confirmations

optional int required confirmations (default: 0)

include_claims

optional bool include claims, requires than a LBC account is specified (default: false)

show_seed

optional bool show the seed for the account

page

optional int page to return during paginating

page_size

optional int number of items on page during pagination Returns { "page": "Page number of the current items.", "page_size": "Number of items to show on a page.", "total_pages": "Total number of pages.", "total_items": "Total number of items.", "items": [ { "id": "account_id", "is_default": "this account is used by default", "ledger": "name of crypto currency and network", "name": "optional account name", "seed": "human friendly words from which account can be recreated", "encrypted": "if account is encrypted", "private_key": "extended private key", "public_key": "extended public key", "address_generator": "settings for generating addresses", "modified_on": "date of last modification to account settings" } ] }

List your accounts

curl -d'{"method": "account_list", "params": {"include_claims": false, "show_seed": false}}' http://localhost:5279/ lbrynet account list requests.post("http://localhost:5279", json={"method": "account_list", "params": {"include_claims": false, "show_seed": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ { "address_generator": { "change": { "gap": 6, "maximum_uses_per_address": 1 }, "name": "deterministic-chain", "receiving": { "gap": 20, "maximum_uses_per_address": 1 } }, "certificates": 0, "coins": 10.0, "encrypted": false, "id": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "is_default": true, "ledger": "lbc_regtest", "name": "Account #mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "public_key": "tpubD6NzVbkrYhZ4YYCvV2Fz9WHkeaFWUFE4B5zqBvV4buvpKqu66AZrbBQg7zfSw7M9ts6zs4Kbx1i2KVLgy5w71TMcKAjPm1owaoKrNHTGa4H", "satoshis": 1000000000 } ], "page": 1, "page_size": 20, "total_items": 1, "total_pages": 1 } }

account_max_address_gap Finds ranges of consecutive addresses that are unused and returns the length of the longest such range: for change and receiving address chains. This is useful to figure out ideal values to set for 'receiving_gap' and 'change_gap' account settings. Arguments account_id

str account for which to get max gaps

wallet_id

optional str restrict operation to specific wallet Returns (map) maximum gap for change and receiving addresses

// example(s) to come later

account_remove Remove an existing account. Arguments account_id

str id of the account to remove

wallet_id

optional str restrict operation to specific wallet Returns { "id": "account_id", "is_default": "this account is used by default", "ledger": "name of crypto currency and network", "name": "optional account name", "seed": "human friendly words from which account can be recreated", "encrypted": "if account is encrypted", "private_key": "extended private key", "public_key": "extended public key", "address_generator": "settings for generating addresses", "modified_on": "date of last modification to account settings" }

Remove an account

curl -d'{"method": "account_remove", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}' http://localhost:5279/ lbrynet account remove mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh requests.post("http://localhost:5279", json={"method": "account_remove", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}).json() Output

{ "jsonrpc": "2.0", "result": { "address_generator": { "change": { "gap": 6, "maximum_uses_per_address": 1 }, "name": "deterministic-chain", "receiving": { "gap": 20, "maximum_uses_per_address": 1 } }, "encrypted": false, "id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "is_default": false, "ledger": "lbc_regtest", "modified_on": 1597866356, "name": "generated account", "private_key": "tprv8ZgxMBicQKsPeSt89b7pkVtx9aYaHDshUGV4UWFjYSqj14JgcMV8F4z67x2XmJ7bGbF7MYXwDDWU49MerBgCV1ZCeMdDCEcgu7QToo48Gx6", "public_key": "tpubD6NzVbkrYhZ4Xuuv3EnR9uZ4ic4WSZ4c3a5qm2J2xie7qYZTEkJiRZbxJ514gUt7gYGcCUJ7NPrg6AXsHZnp2DM81EBgXbvkFmbXcu5KTy3", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon" } }

account_send Send the same number of credits to multiple addresses from a specific account (or default account). Arguments account_id

optional str account to fund the transaction

wallet_id

optional str restrict operation to specific wallet

preview

optional bool do not broadcast the transaction

blocking

optional bool wait until tx has synced Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "total_input": "sum of inputs as a decimal", "total_output": "sum of outputs, sans fee, as a decimal", "total_fee": "fee amount", "hex": "entire transaction encoded in hex" }

// example(s) to come later

account_set Change various settings on an account. Arguments account_id

str id of the account to change

wallet_id

optional str restrict operation to specific wallet

default

optional bool make this account the default

new_name

optional str new name for the account

receiving_gap

optional int set the gap for receiving addresses

receiving_max_uses

optional int set the maximum number of times to use a receiving address

change_gap

optional int set the gap for change addresses

change_max_uses

optional int set the maximum number of times to use a change address Returns { "id": "account_id", "is_default": "this account is used by default", "ledger": "name of crypto currency and network", "name": "optional account name", "seed": "human friendly words from which account can be recreated", "encrypted": "if account is encrypted", "private_key": "extended private key", "public_key": "extended public key", "address_generator": "settings for generating addresses", "modified_on": "date of last modification to account settings" }

Modify maximum number of times a change address can be reused

curl -d'{"method": "account_set", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "default": false, "change_max_uses": 10}}' http://localhost:5279/ lbrynet account set mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh --change_max_uses=10 requests.post("http://localhost:5279", json={"method": "account_set", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "default": false, "change_max_uses": 10}}).json() Output

{ "jsonrpc": "2.0", "result": { "address_generator": { "change": { "gap": 6, "maximum_uses_per_address": 10 }, "name": "deterministic-chain", "receiving": { "gap": 20, "maximum_uses_per_address": 1 } }, "encrypted": false, "id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "is_default": false, "ledger": "lbc_regtest", "modified_on": 1597866356, "name": "new account", "private_key": "tprv8ZgxMBicQKsPeSt89b7pkVtx9aYaHDshUGV4UWFjYSqj14JgcMV8F4z67x2XmJ7bGbF7MYXwDDWU49MerBgCV1ZCeMdDCEcgu7QToo48Gx6", "public_key": "tpubD6NzVbkrYhZ4Xuuv3EnR9uZ4ic4WSZ4c3a5qm2J2xie7qYZTEkJiRZbxJ514gUt7gYGcCUJ7NPrg6AXsHZnp2DM81EBgXbvkFmbXcu5KTy3", "seed": "prepare pulse mesh road divorce require agent broken prison happy write salon" } }

address_is_mine Checks if an address is associated with the current wallet. Arguments address

str address to check

account_id

optional str id of the account to use

wallet_id

optional str restrict operation to specific wallet Returns (bool) true, if address is associated with current wallet

Check if address is mine

curl -d'{"method": "address_is_mine", "params": {"address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC"}}' http://localhost:5279/ lbrynet address is_mine mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC requests.post("http://localhost:5279", json={"method": "address_is_mine", "params": {"address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC"}}).json() Output

{ "jsonrpc": "2.0", "result": true }

address_list List account addresses or details of single address. Arguments address

optional str just show details for single address

account_id

optional str id of the account to use

wallet_id

optional str restrict operation to specific wallet

page

optional int page to return during paginating

page_size

optional int number of items on page during pagination Returns { "page": "Page number of the current items.", "page_size": "Number of items to show on a page.", "total_pages": "Total number of pages.", "total_items": "Total number of items.", "items": [ "an address in base58" ] }

List addresses in default account

curl -d'{"method": "address_list", "params": {}}' http://localhost:5279/ lbrynet address list requests.post("http://localhost:5279", json={"method": "address_list", "params": {}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mgYpu7Esst9gb7QS11o5ENd2LnLxYYQKcs", "pubkey": "tpubDA9GDAntyJu4Q7sdrsaMcTUXziqgHoe927bLCMEgf4ji4ebM8oTBim5wym3xm57HA3MvtxpaAGzNFLtZMsAabp6414sHtGwebS3JeMVo8Bz", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mgogiWFqNSXn5a8ye6DxsRG4Ki8BubGyB4", "pubkey": "tpubDA9GDAntyJu4NdwHhAK42gACFtDncwHuL9Go86pzFLc5gg6kLbnEF2sgLCSkjyVhJdJYrmb9uW9Gq9rUH2952F3URJzeTQghMqC8AzptkT8", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mh5NusKhwpRqWwncMEdcxoih6CcwwsN2Qg", "pubkey": "tpubDA9GDAntyJu4LNLMfZWmy3dQDgvPDFdaCzoDu92jCPCbHv9rU2uH4dxH3o35LUwHCmv5uhwqRGLXQ6m9GgYmhiLBXP5tkv8KmEhETGjh4ZM", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mhKhoeBZyAjfFcdDdzHevFo8MP4iemSe5Y", "pubkey": "tpubDA9GDAntyJu4GH23CM9HNhH3wu8acndq4JfNVPh33YQvRksPfpkjqXcJRycHaUx2gwkWwSsx8hv5sUmCTwiWyoXhNP49ihG9irWysUhbF8K", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mhfcFjDYLL22aVGt8iAbsm8FQPdbZm9PRo", "pubkey": "tpubDA9GDAntyJu4QtbLvSN1wsYyRAz6pcD2JVVmTr2Y2vfWRFdxVUxKz3PZSMByicmYVRuZ4JQXMoBokyobrfuUV7PVDzuY5rGmkfZwsuiSvwF", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mi2wEaGgSrsGW9uNwGJ2C59WWZv2LeyCb4", "pubkey": "tpubDA9GDAntyJu4nrSmJj5wwm7tiBnRvgAQh3bfYBdetSUzWh2GYax93VYx8BXgHjhEbTsDwCfnEff76jJMSbKzUR28ady632gESZhoZRFWRuJ", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mi925aQ5S135nM3QLp2LmPu4uvRYUQCBKB", "pubkey": "tpubDA9GDAntyJu4HuhgEDLJpHh16x32CWMzHLS8N2QPYhSA7PpK28hoxdySxAvVcJDnerMGr4JoD8Kuc1uD9PyZwVzo7tWJDszERCZNfxq36N3", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mjQ78zC5zG29VLLJnfsuTE6gutffmAv5QQ", "pubkey": "tpubDA9GDAntyJu4Ha8dKt77sJXeZSLTnEBAWhcAkpdVAP2povEBE4XfdLkcxBLH58TDvxDvc97kCtTLuvZP7SFv5HGTqtsq8jVYf4sF7ueVucc", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mkDGnN6bg7aiS7qyn5g1NujpzcZyDhh7sX", "pubkey": "tpubDA9GDAntyJu4vG6rJ3AHw2tUL8iq1TAC5pFjRWPmL6WGZ4Gm16J2ZLA5KmSR1yDCj7k56HxnamZEuqPUbB79N7CAryio8NtMKFBd5sqYifh", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mkPgRzTPeZ9HzS3btvJV81M7VgFRFTPBpL", "pubkey": "tpubDA9GDAntyJu4qb2EDqwxVHHsiFZUVZHPow7oT8Qjeavfw1Loe1UYVKqy3wrLjGYj38UV3FoLPjckZebtV6KAz57RozmeqowyKDCujSnZ6tf", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mmoeAquW8TwxzWhThkQSrDhn5GLqbYcqAd", "pubkey": "tpubDA9GDAntyJu4cZffkM1iAJ4ynH6ERP96rJc3yqnwGiqYboXN1uXc3BaWGqfRF6AcBL9EJ4UpLpCJERXeX1W39xwM3wmen1rqLeEopi755z2", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mmuqdyFHfwt9dCBcoDobCmAYCTFcyFmUBA", "pubkey": "tpubDA9GDAntyJu4iG5a3cZtEY8zgdiYbrmn89GQqmar2zfuVCBQyCKAi9pZ1sbchKWC3LxX5mzfmwNmv7QKZPnADpgCC5PgEhGcPc84S1LYZ6F", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mnbuCiQ13svik8qg4UZHbFE8PusQVMGWtY", "pubkey": "tpubDA9GDAntyJu4T7zjR9Lzo5PHQKAVYcQRNYbDiJoPQEAqiZFz758v6yTj4L5v83G1vtNDgaPg82ym6punMVWwupJgkrzn9oqB8UpVG6u77n9", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mpAGxUiNUPtnDAtgjWGjzaGZeqYpE11h11", "pubkey": "tpubDA9GDAntyJu4zbEmdpZXkDGEL7Znzjg5htvXHFk9YE8q4Z1dVK2m3J2A8axKHQfvBGKcYPC23CX32jUmnXbj3YAa4sFpEpT1dy5yVYXTSvL", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mq9RtmDzzGXea2iUT4VdagwLgSmn9qtbiQ", "pubkey": "tpubDA9GDAntyJu4g9KzAwRsGLGFugbX2RF5F3pSufeFHRpkjvMeVyrziESH76Vw5By6b7FPmqJJdmZ7DFY3Z7ZCGZUpVV7pprxHcM6TVpjuXLC", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mqc1USBhBFoHPNpKjQmbV5ggEAPDJbx3Sk", "pubkey": "tpubDA9GDAntyJu4YPDKB9G6STSgfAVuhxTdxBDrmb9BjqzBWUc3eNbJ2r5ogybnBk9tpCarw97aLM5aU4U1DpovRDhMv9oK1LmFdtjC5vgKeJ3", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mqkdF1KQ4P5dy8dxR6jwGwPdEgAYnu5Ud4", "pubkey": "tpubDA9GDAntyJu4dkWQDRtJVouDNEApVoUaQACwdx2RviWhZL7ugtqG97MAQfEzzPD9tGgyQDma7eoxhTuJ6tvvPkaE8GeUseQkQeNVPHMToZH", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "msPnxw9p6nR8wmLF4GTSwuzm2MjZbNGYDn", "pubkey": "tpubDA9GDAntyJu4ofXrkG327BVmVAgPPBWiiwv9JfzfjtFe3cFHC2Wa4Lc3tu1zFXpWQSEHVkW6S4TnyRbq93Ntqj6wfvgaHHf1DMPJ4o82baB", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "pubkey": "tpubDA9GDAntyJu4Xepx6QEhB646R3vCiqK4aZ1vWWs5RNoMuTM778qb9ZXxFZpHmnFndi3hmUJAHKQ8oRmwLyiZwRf1keZ4vFTv5BJd7BwXhSu", "used_times": 0 }, { "account": "mvyCPwzFoXudUJ3Z7jzVhyPQh7y2DhkJ5h", "address": "mtXtWdyBdZ9vw6Q31gRb6y6hsMA6Z7ADYS", "pubkey": "tpubDA9GDAntyJu4UHLS8TY2nTEU5feM8bHXfinxnD6sgY97ShabiXS9Bf9TqWS8XXsHPaFSHt6BstD84cYELRKCJhzDcqRhbzC6By9nboXQscc", "used_times": 0 } ], "page": 1, "page_size": 20, "total_items": 53, "total_pages": 3 } } List addresses in specified account

curl -d'{"method": "address_list", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}' http://localhost:5279/ lbrynet address list --account_id="mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh" requests.post("http://localhost:5279", json={"method": "address_list", "params": {"account_id": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh"}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mfyyqrgoE2NEz1pDATfRmTCkArVse1AUg8", "pubkey": "tpubDA9GDAntyJu4UjQCZZ1kNpYSCWih1d3j7nUyJJ5xnGEQv2N1McHM3vmReNJBf1Z4oQQVc34e6zFVyw5wJivydzx2Ws8U9L9mMZmcesUSnt2", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mgnrPYXwpVQjkmLEqju6eRUTRWuwaCQqpe", "pubkey": "tpubDA9GDAntyJu4rMhgtuR9UAK8hUpVKu2Cz7byhFXJLw4vsV7tZsUwSzhPXm8r9dodSeDCuGuPKsSTGx38MYdyGa4K62sNRUdbPa7icucysde", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mhu1f3cmkjwPF1DvyWTALsNEkBYw7BN5B7", "pubkey": "tpubDA9GDAntyJu4LpQe9EkGsuAKkUAn4SjvBonuUgjcNZdn386GHjNNL5N7DyUjt45EJsNUonzmgSvLRWAjJZZ1U3LCi6m873WD9TfxpVcRnrK", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mjxeke5SrEcEeJutVNduUYMMwH7wobhzGJ", "pubkey": "tpubDA9GDAntyJu53uAxGiAoi3sgoSXJu2boz25RerdU1FLAFpegxja9r7vNvZoGhttu54kbiogYZgu57LwyHJ9MbNRmC6Jkwnjbqhw8QQVdRFR", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mkAsgzRQ5BETKHBCMRjFYsvz4xkErjxWw1", "pubkey": "tpubDA9GDAntyJu4i4q8xNgFQ8Rvwfw4xHsJdw9KTJSN6WZJFhNViH9tCYTa1ZsW8QqbjfCJxm1CM7mzTArjUuS5GTb2vvDxBkhzZpYFeXFkeqg", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mkjRLd1VrfWQtymnps9erW88F34ttJorXT", "pubkey": "tpubDA9GDAntyJu4FECDwFq74Cqn4xqZoZSmptGHWtjFBLtC221m4mDW9NcYoaviNNgzPkLfBGAcgELSf59a5JFNPYYCDu4EYJKwXfHQSf3cWF8", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mnjktVxtYNEb2D7MYYgiQUxW3gVKoxUTB5", "pubkey": "tpubDA9GDAntyJu4XL7b9VdmuqY74io7Qec1PHmo1MnPToQTvirrr44gJhz8eXz5oTMxCiwnS2m1ebyUN4qpHofARpJD1twX7KFYM24aJSZiUsK", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "modxZuRAZfmTyCHLGAfeCAamgRZ8pLMhEh", "pubkey": "tpubDA9GDAntyJu4L21UoZxjFaAhmd7Hvf4dM87m8tPEmvtpw4cMPtMu67KniGtPoXRL69P5Fz9dhdBZaEyqvbikreDpwi4kcybQ8NeBiuPyhDv", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mpJYGfUQXxQ5aezyG8iuhEbqM8AkR7aHMR", "pubkey": "tpubDA9GDAntyJu4ohU3zpm7wDsPgTnVUEborTvzEwCyGYX3kkBunTvs3WZMK1bTLUEyD7bENddrnuQuL9TMsQpdZ5uEtGgHd3W4tGwnigxwrLj", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mpxXCTJdmnAWB1TRnD4L7Dyn1J8jE7jm9g", "pubkey": "tpubDA9GDAntyJu4ceokUUxmx71UpJ1j6XABukb6sqAbyaCbWiqAQTWMqgaBdQGHhtGcZcEwYZPPNynNY3jpXd6BEB6gbQf47XdMFCWYeGwiUZu", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mrGNLdWJR3C4dvQo5ajRsMBL1hnZQoJs72", "pubkey": "tpubDA9GDAntyJu4JQ9WvsX7WkjM9jULEub8ECcob8YDM5ztb97uZrErk9pK8GgkiTYEaHMfCyc4dWfLrrRqLFwcjeBKjcTeHndb5z953amfBEr", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mrd9sBK8qqpDf16Lpb1maigLVd1PFMN7yP", "pubkey": "tpubDA9GDAntyJu4nWzQoD6si7pjYDgmZQy9qxHUMXFd8eoJGxVKYiNQjSp8XJkiZoFX8nm65gawLqZqkcjjQJvbwquXrLEUFurV2SxjjxpbhCy", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mrr1PU4WGNqnZ8Urn3Kz5WGffsAmNAmTQQ", "pubkey": "tpubDA9GDAntyJu4TPpqAaTKTMhHnUfDodwXKq6rSkePLxZcCpQ8zP3p7TxjxvvFqLimtKAYUiBEqqkmQ7fdUHKUc4JksYv4EM7E5nzvoRpo6Er", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mtkjunmHM5scmkpjR74bGHJmpqzFWiFPGv", "pubkey": "tpubDA9GDAntyJu4fk6TDyNehuTsQJsMg4VhJMw6yLT4Ykhsg3TY2o3eTnPghjB9FxWR4AdhdXyCTnSR2Lw4qkZyGjhCKTSS4X8wjCnG4XP7kTp", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "muuCpYatVc6JnzCsTL9rVB3CfoQKLmr2P6", "pubkey": "tpubDA9GDAntyJu56V1xSiutUPgSmdA7o2BHt5dc3stdSqTizfd2F1quwEB9ub5e9SNXM7d3z3rHEyHggiv4zjmaDvefa6C3GfmvGVmh31roCk4", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "muw3V4TUZVdUPjYVTxPfkt9YKH6PZYSPm6", "pubkey": "tpubDA9GDAntyJu4HwRyVuFFjYrLEx8jgBaA85W7QQGRX2tLMm5AWUdaKygYSjBDuujyhkcArtZAvPbfR1HVCxLTfZoNLugYLWF6JYZV8YHs6m7", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mvg5McRgfMYXTJZpnD7ECfx3tkiNbXLAj7", "pubkey": "tpubDA9GDAntyJu4F8b96R36DnwQz77N9woJtscLwLv96mgX875ac84cUgqvEaYy8xRsHdftVUf7i4ohPBaKQg3yWNdQJH1TtsygN6xRce7MvJM", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mwGT9BCUgF5KgTawout8MGUXRCHyaXFyed", "pubkey": "tpubDA9GDAntyJu4RcivpdJc5SvnHdYCyjHp7Wr9J12jmwjJLSD9PCevqfMxd4BHiW3E4YqNhgCJBcnNtdb2b4Z1Acar7dvAz2D4MKjyuTjRNK1", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mwRSKpxu3kLuFPzZz63FCvaPH6m3aoFizS", "pubkey": "tpubDA9GDAntyJu4xaKcndgEM1sTGbw9GwraDCaHJBguqKxs6Xc8P5nHcPFVNH1vHBA2L2uS9YdJZRnfwrBkFfwXrqE2vr6qbqhXMcaX3NeWWKL", "used_times": 0 }, { "account": "mz5N2t8sStwfiB5Re3msfmCoxZDqHYvtAh", "address": "mx878TN6D6j7mG7oGb4PUspFfmvSB5eLUn", "pubkey": "tpubDA9GDAntyJu4PUDaNpAzXf562p6ypSNFQYT2xMb8Aa7Dsmx2R9Cny83E3FH2aSS5ykbP45DyU7kDhe2mAawuM83As6S8DCXn55rQbwvTYpp", "used_times": 0 } ], "page": 1, "page_size": 20, "total_items": 26, "total_pages": 2 } }

address_unused Return an address containing no balance, will create a new address if there is none. Arguments account_id

optional str id of the account to use

wallet_id

optional str restrict operation to specific wallet Returns "an address in base58"

Get an unused address

curl -d'{"method": "address_unused", "params": {}}' http://localhost:5279/ lbrynet address unused requests.post("http://localhost:5279", json={"method": "address_unused", "params": {}}).json() Output

{ "jsonrpc": "2.0", "result": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC" }

blob_announce Announce blobs to the DHT Arguments blob_hash

optional str announce a blob, specified by blob_hash

stream_hash

optional str announce all blobs associated with stream_hash

sd_hash

optional str announce all blobs associated with sd_hash and the sd_hash itself Returns (bool) true if successful

// example(s) to come later

blob_delete Delete a blob Arguments blob_hash

str blob hash of the blob to delete Returns (str) Success/fail message

Delete a blob

curl -d'{"method": "blob_delete", "params": {"blob_hash": "549d438a485b6e05c5bcc0ec7ebac909c6713a1098d3f0dc95f6e2640351d496d568e0b10b8f61e7df184b90f90abac9"}}' http://localhost:5279/ lbrynet blob delete 549d438a485b6e05c5bcc0ec7ebac909c6713a1098d3f0dc95f6e2640351d496d568e0b10b8f61e7df184b90f90abac9 requests.post("http://localhost:5279", json={"method": "blob_delete", "params": {"blob_hash": "549d438a485b6e05c5bcc0ec7ebac909c6713a1098d3f0dc95f6e2640351d496d568e0b10b8f61e7df184b90f90abac9"}}).json() Output

{ "jsonrpc": "2.0", "result": "Deleted 549d438a485b6e05c5bcc0ec7ebac909c6713a1098d3f0dc95f6e2640351d496d568e0b10b8f61e7df184b90f90abac9" }

blob_get Download and return a blob Arguments blob_hash

str blob hash of the blob to get

timeout

optional int timeout in number of seconds Returns (str) Success/Fail message or (dict) decoded data

// example(s) to come later

blob_list Returns blob hashes. If not given filters, returns all blobs known by the blob manager Arguments needed

optional bool only return needed blobs

finished

optional bool only return finished blobs

uri

optional str filter blobs by stream in a uri

stream_hash

optional str filter blobs by stream hash

sd_hash

optional str filter blobs by sd hash

page

optional int page to return during paginating

page_size

optional int number of items on page during pagination Returns (list) List of blob hashes

List your local blobs

curl -d'{"method": "blob_list", "params": {"needed": false, "finished": false}}' http://localhost:5279/ lbrynet blob list requests.post("http://localhost:5279", json={"method": "blob_list", "params": {"needed": false, "finished": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ "549d438a485b6e05c5bcc0ec7ebac909c6713a1098d3f0dc95f6e2640351d496d568e0b10b8f61e7df184b90f90abac9", "3b00cc6de0dd4eb10ea9000ab0056a3e747111af63caf9ecdad9d7557e5c22d82a55883fc7507685c66875b20e61a6f2", "4457718829dc6b0b0384ca382fa4de7cb26ab1c7d2116bded6d8c52f6cbb842f3104305927d62d5fff47ae46cb78a7a4", "79ab5a7aba060f748469d6a2e9eeb9ca81164fd79f5a7980fa89c14fe49d58b0e1f9b26323ab1379ab4b472cb42a9f4f" ], "page": 1, "page_size": 20, "total_items": 4, "total_pages": 1 } }

blob_reflect Reflects specified blobs Arguments reflector_server

optional str reflector address Returns (list) reflected blob hashes

// example(s) to come later

blob_reflect_all Reflects all saved blobs Arguments Returns (bool) true if successful

// example(s) to come later

channel_abandon Abandon one of my channel claims. Arguments claim_id

optional str claim_id of the claim to abandon

txid

optional str txid of the claim to abandon

nout

optional int nout of the claim to abandon

account_id

optional str id of the account to use

wallet_id

optional str restrict operation to specific wallet

preview

optional bool do not broadcast the transaction

blocking

optional bool wait until abandon is in mempool Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "total_input": "sum of inputs as a decimal", "total_output": "sum of outputs, sans fee, as a decimal", "total_fee": "fee amount", "hex": "entire transaction encoded in hex" }

Abandon a channel claim

curl -d'{"method": "channel_abandon", "params": {"claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "preview": false, "blocking": false}}' http://localhost:5279/ lbrynet channel abandon e4044d570565fc07c009c68286fe7a191d68a824 requests.post("http://localhost:5279", json={"method": "channel_abandon", "params": {"claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "preview": false, "blocking": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "0100000001283f0900d84a4c10ea46f6bfe224dc06871eefbc98f7ef8ee3e3f92192f39df70000000069463043021f27cf05c6ad0c5ff5304aa5d78823fb23317b42edb1ab5b9a2408408b98cebc02202b0ca937a156e46fcc9b54783cd43d4fccb6f2cc97982c45094d02abff91a715012102218ee204dae11e1c6215c8b6901271e8bd51d04c3d20ba8ed21d69a71acd8630ffffffff0134b7f505000000001976a914eba754a69a91bb06dcd7127a8e9ef4c68e501b9288ac00000000", "inputs": [ { "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "amount": "1.0", "claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "claim_op": "update", "confirmations": 8, "has_signing_key": true, "height": 210, "meta": {}, "name": "@channel", "normalized_name": "@channel", "nout": 0, "permanent_url": "lbry://@channel#e4044d570565fc07c009c68286fe7a191d68a824", "timestamp": 1597866388, "txid": "f79df39221f9e3e38eeff798bcef1e8706dc24e2bff646ea104c4ad800093f28", "type": "claim", "value": { "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac936", "public_key_id": "mp9t5BD8eQptVccCQZDoHpqKgc6Z35mtXb", "title": "New Channel" }, "value_type": "channel" } ], "outputs": [ { "address": "n2zyYUNaVxjw8u1iEwAYj3xpgSPCtMjvcx", "amount": "0.999893", "confirmations": -2, "height": -2, "nout": 0, "timestamp": null, "txid": "1ca850df78b709e7935319643a546110a136176b4e146e6c3a9c72ff667d8e1f", "type": "payment" } ], "total_fee": "0.000107", "total_input": "1.0", "total_output": "0.999893", "txid": "1ca850df78b709e7935319643a546110a136176b4e146e6c3a9c72ff667d8e1f" } }

channel_create Create a new channel by generating a channel private key and establishing an '@' prefixed claim. Arguments name

str name of the channel prefixed with '@'

bid

decimal amount to back the claim

allow_duplicate_name

optional bool create new channel even if one already exists with given name. default: false.

title

optional str title of the publication

description

optional str description of the publication

email

optional str email of channel owner

website_url

optional str website url

featured

optional list claim_ids of featured content in channel

tags

optional list content tags

languages

optional list languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`

locations

optional list locations of the channel, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"

thumbnail_url

optional str thumbnail url

cover_url

optional str url of cover image

account_id

optional str account to use for holding the transaction

wallet_id

optional str restrict operation to specific wallet

funding_account_ids

optional list ids of accounts to fund this transaction

claim_address

optional str address where the channel is sent to, if not specified it will be determined automatically from the account

preview

optional bool do not broadcast the transaction

blocking

optional bool wait until transaction is in mempool Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "total_input": "sum of inputs as a decimal", "total_output": "sum of outputs, sans fee, as a decimal", "total_fee": "fee amount", "hex": "entire transaction encoded in hex" }

Create a channel claim without metadata

curl -d'{"method": "channel_create", "params": {"name": "@channel", "bid": "1.0", "featured": [], "tags": [], "languages": [], "locations": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/ lbrynet channel create @channel 1.0 requests.post("http://localhost:5279", json={"method": "channel_create", "params": {"name": "@channel", "bid": "1.0", "featured": [], "tags": [], "languages": [], "locations": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "010000000128ff496733818e4619a040909db057ba7b9e10be110277fbd34a51568ede8d79010000006a47304402201fd45f3a6bd241cf703fbc62b2e51530fcde1cc1c16f27bdfee203c9adbf9c9b02207af871c389077bf06a4ff4f3c773b31a88471387a95ad5cb6a736634590f9ff90121028aa5f727c2be308e7dce3393bb8ff606ad3f777c715c6875a13ec2c0335fc4bfffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac9366d7576a9148dddb1558bd8d5eddddf53bc9b3fdfb52242392788acc462a029000000001976a914e191380ed2cfc250b492b43729046979c947993788ac00000000", "inputs": [ { "address": "mgogiWFqNSXn5a8ye6DxsRG4Ki8BubGyB4", "amount": "7.999876", "confirmations": 2, "height": 207, "nout": 1, "timestamp": 1597866388, "txid": "798dde8e56514ad3fb770211be109e7bba57b09d9040a019468e81336749ff28", "type": "payment" } ], "outputs": [ { "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "amount": "1.0", "claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "claim_op": "create", "confirmations": -2, "has_signing_key": true, "height": -2, "meta": {}, "name": "@channel", "normalized_name": "@channel", "nout": 0, "permanent_url": "lbry://@channel#e4044d570565fc07c009c68286fe7a191d68a824", "timestamp": null, "txid": "77a5e4bfab44767e51f68a50dd68db8eba20eb9b9b04a732084d8a0706ece435", "type": "claim", "value": { "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac936", "public_key_id": "mp9t5BD8eQptVccCQZDoHpqKgc6Z35mtXb" }, "value_type": "channel" }, { "address": "n25eJCyLrddcGzpp7nCjhpckUJT2xUQHkJ", "amount": "6.983769", "confirmations": -2, "height": -2, "nout": 1, "timestamp": null, "txid": "77a5e4bfab44767e51f68a50dd68db8eba20eb9b9b04a732084d8a0706ece435", "type": "payment" } ], "total_fee": "0.016107", "total_input": "7.999876", "total_output": "7.983769", "txid": "77a5e4bfab44767e51f68a50dd68db8eba20eb9b9b04a732084d8a0706ece435" } } Create a channel claim with all metadata

curl -d'{"method": "channel_create", "params": {"name": "@bigchannel", "bid": "1.0", "title": "Big Channel", "description": "A channel with lots of videos.", "email": "creator@smallmedia.com", "website_url": "http://smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/ lbrynet channel create @bigchannel 1.0 --title="Big Channel" --description="A channel with lots of videos." --email="creator@smallmedia.com" --tags=music --tags=art --languages=pt-BR --languages=uk --locations=BR --locations=UA::Kiyv --website_url="http://smallmedia.com" --thumbnail_url="http://smallmedia.com/logo.jpg" --cover_url="http://smallmedia.com/logo.jpg" requests.post("http://localhost:5279", json={"method": "channel_create", "params": {"name": "@bigchannel", "bid": "1.0", "title": "Big Channel", "description": "A channel with lots of videos.", "email": "creator@smallmedia.com", "website_url": "http://smallmedia.com", "featured": [], "tags": ["music", "art"], "languages": ["pt-BR", "uk"], "locations": ["BR", "UA::Kiyv"], "thumbnail_url": "http://smallmedia.com/logo.jpg", "cover_url": "http://smallmedia.com/logo.jpg", "funding_account_ids": [], "preview": false, "blocking": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "height": -2, "hex": "0100000001283f0900d84a4c10ea46f6bfe224dc06871eefbc98f7ef8ee3e3f92192f39df7010000006a47304402200458835079a4844a11504576ed637e2eb0531a1d50ff939c665b2d9c5b46770602202e911c80f06e87331deb8cd2cad914f3922ad797bad2d7d92c62f5fd72f6b997012103c86a72461e5b6da62a80b29c1626dd4758ae5b4c8a70d54b3db312f574f3da64ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a034200045b76ea16a17a22cdcaf67add274be8e68bce77bf2cf3cd56fa1709df1d3d2da8ac217a6a5557a7e3b5940bde3232a508b277252c9128060bb8fad3f491f03ecb121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a91470472d52527fba2bfbc0f2740cf9523f973e371e88ace221d305000000001976a9144d53d57bee3223717dc13f700600766db4eb8e9a88ac00000000", "inputs": [ { "address": "mjX9uJdwhS6eAQ7tFN1LyEWksgnbcchpKv", "amount": "1.9993355", "confirmations": 1, "height": 210, "nout": 1, "timestamp": 1597866388, "txid": "f79df39221f9e3e38eeff798bcef1e8706dc24e2bff646ea104c4ad800093f28", "type": "payment" } ], "outputs": [ { "address": "mqkdF1KQ4P5dy8dxR6jwGwPdEgAYnu5Ud4", "amount": "1.0", "claim_id": "7ec5ebe2c8a52cc7198ea4ee71a86060ed1e1eaf", "claim_op": "create", "confirmations": -2, "has_signing_key": true, "height": -2, "meta": {}, "name": "@bigchannel", "normalized_name": "@bigchannel", "nout": 0, "permanent_url": "lbry://@bigchannel#7ec5ebe2c8a52cc7198ea4ee71a86060ed1e1eaf", "timestamp": null, "txid": "5aa6db46a11ddbb38edf9746b41b618e5b0a0fdd4aabe86110b3accdce6e4067", "type": "claim", "value": { "cover": { "url": "http://smallmedia.com/logo.jpg" }, "description": "A channel with lots of videos.", "email": "creator@smallmedia.com", "languages": [ "pt-BR", "uk" ], "locations": [ { "country": "BR" }, { "city": "Kiyv", "country": "UA" } ], "public_key": "3056301006072a8648ce3d020106052b8104000a034200045b76ea16a17a22cdcaf67add274be8e68bce77bf2cf3cd56fa1709df1d3d2da8ac217a6a5557a7e3b5940bde3232a508b277252c9128060bb8fad3f491f03ecb", "public_key_id": "mrj5RW3SZqsMGY49APqhnuPZFACDjCyw7u", "tags": [ "music", "art" ], "thumbnail": { "url": "http://smallmedia.com/logo.jpg" }, "title": "Big Channel", "website_url": "http://smallmedia.com" }, "value_type": "channel" }, { "address": "mnZpki1y23zrcfmGcaUa9kHUmQw4hNJgpg", "amount": "0.9772285", "confirmations": -2, "height": -2, "nout": 1, "timestamp": null, "txid": "5aa6db46a11ddbb38edf9746b41b618e5b0a0fdd4aabe86110b3accdce6e4067", "type": "payment" } ], "total_fee": "0.022107", "total_input": "1.9993355", "total_output": "1.9772285", "txid": "5aa6db46a11ddbb38edf9746b41b618e5b0a0fdd4aabe86110b3accdce6e4067" } }

channel_export Export channel private key. Arguments channel_id

str claim id of channel to export

channel_name

optional str name of channel to export

account_id

optional str one or more account ids for accounts to look in for channels, defaults to all accounts.

wallet_id

optional str restrict operation to specific wallet Returns (str) serialized channel private key

// example(s) to come later

channel_import Import serialized channel private key (to allow signing new streams to the channel) Arguments channel_data

str serialized channel, as exported by channel export

wallet_id

optional str import into specific wallet Returns (dict) Result dictionary

// example(s) to come later

channel_list List my channel claims. Arguments name

optional str or list channel name

claim_id

optional str or list channel id

is_spent

optional bool shows previous channel updates and abandons

account_id

optional str id of the account to use

wallet_id

optional str restrict results to specific wallet

page

optional int page to return during paginating

page_size

optional int number of items on page during pagination

resolve

optional bool resolves each channel to provide additional metadata

no_totals

optional bool do not calculate the total number of pages and items in result set (significant performance boost) Returns { "page": "Page number of the current items.", "page_size": "Number of items to show on a page.", "total_pages": "Total number of pages.", "total_items": "Total number of items.", "items": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ] }

List your channel claims

curl -d'{"method": "channel_list", "params": {"name": [], "claim_id": [], "is_spent": false, "resolve": false, "no_totals": false}}' http://localhost:5279/ lbrynet channel list requests.post("http://localhost:5279", json={"method": "channel_list", "params": {"name": [], "claim_id": [], "is_spent": false, "resolve": false, "no_totals": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ { "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "amount": "1.0", "claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "claim_op": "create", "confirmations": 1, "has_signing_key": true, "height": 209, "is_internal_transfer": false, "is_my_input": true, "is_my_output": true, "is_spent": false, "meta": {}, "name": "@channel", "normalized_name": "@channel", "nout": 0, "permanent_url": "lbry://@channel#e4044d570565fc07c009c68286fe7a191d68a824", "timestamp": 1597866388, "txid": "77a5e4bfab44767e51f68a50dd68db8eba20eb9b9b04a732084d8a0706ece435", "type": "claim", "value": { "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac936", "public_key_id": "mp9t5BD8eQptVccCQZDoHpqKgc6Z35mtXb" }, "value_type": "channel" } ], "page": 1, "page_size": 20, "total_items": 1, "total_pages": 1 } } Paginate your channel claims

curl -d'{"method": "channel_list", "params": {"name": [], "claim_id": [], "is_spent": false, "page": 1, "page_size": 20, "resolve": false, "no_totals": false}}' http://localhost:5279/ lbrynet channel list --page=1 --page_size=20 requests.post("http://localhost:5279", json={"method": "channel_list", "params": {"name": [], "claim_id": [], "is_spent": false, "page": 1, "page_size": 20, "resolve": false, "no_totals": false}}).json() Output

{ "jsonrpc": "2.0", "result": { "items": [ { "address": "mtT59ahGUX47L6Zw5vR64KRGY2eWAKRmqC", "amount": "1.0", "claim_id": "e4044d570565fc07c009c68286fe7a191d68a824", "claim_op": "create", "confirmations": 1, "has_signing_key": true, "height": 209, "is_internal_transfer": false, "is_my_input": true, "is_my_output": true, "is_spent": false, "meta": {}, "name": "@channel", "normalized_name": "@channel", "nout": 0, "permanent_url": "lbry://@channel#e4044d570565fc07c009c68286fe7a191d68a824", "timestamp": 1597866388, "txid": "77a5e4bfab44767e51f68a50dd68db8eba20eb9b9b04a732084d8a0706ece435", "type": "claim", "value": { "public_key": "3056301006072a8648ce3d020106052b8104000a03420004ca584d5434e5427946c605d9f99ac28db0753580896d8aa9b56e3e3da970a1dafd81cbacc899b7b8b151c253651686b21c6749b7e83dd8206513e7f30dfac936", "public_key_id": "mp9t5BD8eQptVccCQZDoHpqKgc6Z35mtXb" }, "value_type": "channel" } ], "page": 1, "page_size": 20, "total_items": 1, "total_pages": 1 } }

Update an existing channel claim. Arguments claim_id

str claim_id of the channel to update

bid

optional decimal amount to back the claim

title

optional str title of the publication

description

optional str description of the publication

email

optional str email of channel owner

website_url

optional str website url

featured

optional list claim_ids of featured content in channel

clear_featured

optional bool clear existing featured content (prior to adding new ones)

tags

optional list add content tags

clear_tags

optional bool clear existing tags (prior to adding new ones)

languages

optional list languages used by the channel, using RFC 5646 format, eg: for English `--languages=en` for Spanish (Spain) `--languages=es-ES` for Spanish (Mexican) `--languages=es-MX` for Chinese (Simplified) `--languages=zh-Hans` for Chinese (Traditional) `--languages=zh-Hant`

clear_languages

optional bool clear existing languages (prior to adding new ones)

locations

optional list locations of the channel, consisting of 2 letter `country` code and a `state`, `city` and a postal `code` along with a `latitude` and `longitude`. for JSON RPC: pass a dictionary with aforementioned attributes as keys, eg: ... "locations": [{'country': 'US', 'state': 'NH'}] ... for command line: pass a colon delimited list with values in the following order: "COUNTRY:STATE:CITY:CODE:LATITUDE:LONGITUDE" making sure to include colon for blank values, for example to provide only the city: ... --locations="::Manchester" with all values set: ... --locations="US:NH:Manchester:03101:42.990605:-71.460989" optionally, you can just pass the "LATITUDE:LONGITUDE": ... --locations="42.990605:-71.460989" finally, you can also pass JSON string of dictionary on the command line as you would via JSON RPC ... --locations="{'country': 'US', 'state': 'NH'}"

clear_locations

optional bool clear existing locations (prior to adding new ones)

thumbnail_url

optional str thumbnail url

cover_url

optional str url of cover image

account_id

optional str account in which to look for channel (default: all)

wallet_id

optional str restrict operation to specific wallet

funding_account_ids

optional list ids of accounts to fund this transaction

claim_address

optional str address where the channel is sent

new_signing_key

optional bool generate a new signing key, will invalidate all previous publishes

preview

optional bool do not broadcast the transaction

blocking

optional bool wait until transaction is in mempool

replace

optional bool instead of modifying specific values on the channel, this will clear all existing values and only save passed in values, useful for form submissions where all values are always set Returns { "txid": "hash of transaction in hex", "height": "block where transaction was recorded", "inputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL", "claim": "for purchase outputs only, metadata of purchased claim", "reposted_claim": "for repost claims only, metadata of claim being reposted", "signing_channel": "for signed claims only, metadata of signing channel", "is_channel_signature_valid": "for signed claims only, whether signature is valid", "purchase_receipt": "metadata for the purchase transaction associated with this claim" } ], "outputs": [ { "txid": "hash of transaction in hex", "nout": "position in the transaction", "height": "block where transaction was recorded", "amount": "value of the txo as a decimal", "address": "address of who can spend the txo", "confirmations": "number of confirmed blocks", "is_change": "payment to change address, only available when it can be determined", "is_received": "true if txo was sent from external account to this account", "is_spent": "true if txo is spent", "is_mine": "payment to one of your accounts, only available when it can be determined", "type": "one of 'claim', 'support' or 'purchase'", "name": "when type is 'claim' or 'support', this is the claim name", "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id", "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'", "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload", "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc", "protobuf": "hex encoded raw protobuf version of 'value' field", "permanent_url": "when type is 'claim' or 'support', this