lbry-sdk master
Methods and signatures provided by lbry-sdk are documented below. To build, download, or run the daemon, see the project README.
main
ffmpeg_find
Get ffmpeg installation information
Returns:
↓
(dict) Dictionary of ffmpeg information
{
'available': (bool) found ffmpeg,
'which': (str) path to ffmpeg,
'analyze_audio_volume': (bool) should ffmpeg analyze audio
}
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 receipts |
Examples
Get a file
curl -d'{"method": "get", "params": {"uri": "astream#ad25e05aa7dc5e9994869040c6103f9a8728db46"}}' http://localhost:5279/
lbrynet get astream#ad25e05aa7dc5e9994869040c6103f9a8728db46
requests.post("http://localhost:5279", json={"method": "get", "params": {"uri": "astream#ad25e05aa7dc5e9994869040c6103f9a8728db46"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"added_on": 1655141677,
"blobs_completed": 1,
"blobs_in_stream": 1,
"blobs_remaining": 0,
"channel_claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"channel_name": "@channel",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_name": "astream",
"completed": true,
"confirmations": 4,
"content_fee": null,
"download_directory": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd",
"download_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd/tmpr832hp1x",
"file_name": "tmpr832hp1x",
"height": 214,
"is_fully_reflected": false,
"key": "66f888fe00cf558494c2fcbd5903d00d",
"metadata": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"mime_type": "application/octet-stream",
"nout": 0,
"outpoint": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234:0",
"points_paid": 0.0,
"protobuf": "01a2795714b0923650b7fa288618591f0c2f2e5c5961baf110460a527e38b68f0653c1c79f2cae1f57ade55c009fb7578175c9d93d7edb0546d1378e1d33d99df8df0d5cfe9e7a5b63053a4e7ce003f95f5890b27f0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707238333268703178180b22186170706c69636174696f6e2f6f637465742d73747265616d32309ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"purchase_receipt": null,
"reflector_progress": 0,
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"status": "finished",
"stopped": true,
"stream_hash": "c48ff9950efbcb78b20d311467b1b0e321069ef5ece96898eb08a27a62d1ef2594cd24f1e8d6993f00c48fd6a4221490",
"stream_name": "tmpr832hp1x",
"streaming_url": "http://localhost:5280/stream/9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"suggested_file_name": "tmpr832hp1x",
"timestamp": 1655141671,
"total_bytes": 16,
"total_bytes_lower_bound": 0,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"uploading_to_reflector": false,
"written_bytes": 11
}
}
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"
}
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. |
file_name optional str | name of file to be associated with stream. |
file_hash optional str | hash of file to be associated with stream. |
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 |
sd_hash optional str | sd_hash of stream |
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 |
Examples
Publish a file
curl -d'{"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmp1wt4ndjd", "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=/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmp1wt4ndjd
requests.post("http://localhost:5279", json={"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmp1wt4ndjd", "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": "0100000001c701b5f207fe0b1abd990f0899a8c8bc4bf6c8ce07d0eafc8a59e44bce4f95a9010000006b483045022100fb66c628da4fb63d7f1ae98d3c2bd15b5e4ae4aa7863891b943989f92c1aed0902202362799eb6f3d1cd66bd230c6710fafa248ad48073a7070e1ba51d24b7c7f453012102f272fd093af2228160e96af70d809c329d9c547375b6d838498880f7c3051290ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d70317774346e646a64180b22186170706c69636174696f6e2f6f637465742d73747265616d32304e61ee6b6a7810750982faa6c805323e33b5d21d2798d4add70c7588640ed8c5f70c822382be5fe87fd5ae356e26896e6d7576a9147ec6c9961e0d398d337699d566702f0ffe1ea07888ac54826311000000001976a914bf0468b0a4fd815b9a4bef7d7c3cd59a67e35a9b88ac00000000",
"inputs": [
{
"address": "n2qN5bEHEQ1keWyR6GbNd15dbHE6z1FoZb",
"amount": "3.941448",
"confirmations": 3,
"height": 217,
"nout": 1,
"timestamp": 1655141675,
"txid": "a9954fce4be4598afcead007cec8f64bbcc8a899080f99bd1a0bfe07f2b501c7",
"type": "payment"
}
],
"outputs": [
{
"address": "ms5HaDddaUyAAMczcdCbYuTFkuBdAgQxeY",
"amount": "1.0",
"claim_id": "006db49526758cf95dc2d9cd2354114e67441baa",
"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#006db49526758cf95dc2d9cd2354114e67441baa",
"timestamp": null,
"txid": "0c646996c6c30899690e4536037c21e1f2190b89be07af626b3b61f17c4fc431",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmp1wt4ndjd",
"sd_hash": "4e61ee6b6a7810750982faa6c805323e33b5d21d2798d4add70c7588640ed8c5f70c822382be5fe87fd5ae356e26896e",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "mxvxe2qg1xUdSoMWFch86uZKS5X3t2Sj3t",
"amount": "2.917341",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "0c646996c6c30899690e4536037c21e1f2190b89be07af626b3b61f17c4fc431",
"type": "payment"
}
],
"total_fee": "0.024107",
"total_input": "3.941448",
"total_output": "3.917341",
"txid": "0c646996c6c30899690e4536037c21e1f2190b89be07af626b3b61f17c4fc431"
}
}
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"
}
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 receipts |
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) |
Examples
Resolve a claim
curl -d'{"method": "resolve", "params": {"urls": ["astream#ad25e05aa7dc5e9994869040c6103f9a8728db46"], "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#ad25e05aa7dc5e9994869040c6103f9a8728db46
requests.post("http://localhost:5279", json={"method": "resolve", "params": {"urls": ["astream#ad25e05aa7dc5e9994869040c6103f9a8728db46"], "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#ad25e05aa7dc5e9994869040c6103f9a8728db46": {
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"canonical_url": "lbry://@channel#5/astream#a",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 4,
"height": 214,
"is_channel_signature_valid": true,
"meta": {
"activation_height": 214,
"creation_height": 213,
"creation_timestamp": 1655141671,
"effective_amount": "1.0",
"expiration_height": 714,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 213
},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"short_url": "lbry://astream#a",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"canonical_url": "lbry://@channel#5",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 8,
"has_signing_key": false,
"height": 210,
"meta": {
"activation_height": 210,
"claims_in_channel": 2,
"creation_height": 209,
"creation_timestamp": 1655141670,
"effective_amount": "1.0",
"expiration_height": 710,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 209
},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"short_url": "lbry://@channel#5",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
}
}
}
Returns:
↓
Dictionary of results, keyed by url
'<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
}
}
routing_table_get
Get DHT routing information
Returns:
↓
(dict) dictionary containing routing and peer information
{
"buckets": {
<bucket index>: [
{
"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
"prefix_neighbors_count": (int) the amount of peers sharing the same byte prefix of the local node id
}
status
Get daemon status
Examples
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": {
"background_downloader": {
"available_free_space_mb": null,
"ongoing_download": false,
"running": false
},
"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
},
"disk_space": {
"content_blobs_storage_used_mb": 0,
"published_blobs_storage_used_mb": 0,
"running": true,
"seed_blobs_storage_used_mb": 0,
"total_used_mb": 0
},
"ffmpeg_status": {
"analyze_audio_volume": true,
"available": true,
"which": "/opt/homebrew/bin/ffmpeg"
},
"file_manager": {
"managed_files": 0
},
"installation_id": "3a1UGocRVHs9fAYWhNTRGoq2mpi97NqGEbkofcVkZvJei5xqimckTxfDRdjuKt4Hr6",
"is_running": true,
"skipped_components": [
"dht",
"upnp",
"hash_announcer",
"peer_protocol_server",
"libtorrent_component"
],
"startup_status": {
"background_downloader": true,
"blob_manager": true,
"database": true,
"disk_space": true,
"exchange_rate_manager": true,
"file_manager": true,
"tracker_announcer_component": true,
"wallet": true,
"wallet_server_payments": true
},
"wallet": {
"available_servers": 1,
"best_blockhash": "47eb373669435f62580b2855670788eaf07e62551c2d38361e24700f130cab36",
"blocks": 206,
"blocks_behind": 0,
"connected": "localhost:50002",
"connected_features": {
"daily_fee": "0",
"description": "",
"donation_address": "",
"genesis_hash": "6e3fcf1299d4ec5d79c3a4c91d624a4acf9e2e173d95a1a0504f677669687556",
"hash_function": "sha256",
"hosts": {},
"payment_address": "",
"protocol_max": "0.199.0",
"protocol_min": "0.54.0",
"pruning": null,
"server_version": "0.107.0",
"trending_algorithm": "fast_ar"
},
"headers_synchronization_progress": 100,
"known_servers": 0,
"servers": [
{
"availability": true,
"host": "localhost",
"latency": 0.00792012499999828,
"port": 50002
}
]
},
"wallet_server_payments": {
"max_fee": "0.0",
"running": false
}
}
}
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': {
<source ip and tcp port>: (int) bytes per second received,
},
'outgoing_bps': {
<destination ip and tcp port>: (int) bytes per second sent,
},
'total_outgoing_mps': (float) megabytes per second sent,
'total_incoming_mps': (float) megabytes per second received,
'max_outgoing_mbs': (float) maximum bandwidth (megabytes per second) sent, since the
daemon was started
'max_incoming_mbs': (float) maximum bandwidth (megabytes per second) received, since the
daemon was started
'total_sent' : (int) total number of bytes sent since the daemon was started
'total_received' : (int) total number of bytes received since the daemon was started
}
},
'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': {
<TCP | UDP>: (int) external_port,
},
'gateway': (str) manufacturer and model,
'dht_redirect_set': (bool),
'peer_redirect_set': (bool),
'external_ip': (str) external ip address,
}
}
stop
Stop lbrynet API server.
Returns:
↓
(string) Shutdown message
version
Get lbrynet API server version information
Examples
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",
"lbrynet_version": "0.109.0",
"os_release": "21.5.0",
"os_system": "Darwin",
"platform": "Darwin-21.5.0-x86_64-i386-64bit",
"processor": "i386",
"python_version": "3.7.13",
"version": "0.109.0"
}
}
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",
}
account
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 |
Examples
Add an account from seed
curl -d'{"method": "account_add", "params": {"account_name": "new account", "seed": "miss ready crop oval canyon such sing powder figure math noodle style", "single_key": false}}' http://localhost:5279/
lbrynet account add "new account" --seed="miss ready crop oval canyon such sing powder figure math noodle style"
requests.post("http://localhost:5279", json={"method": "account_add", "params": {"account_name": "new account", "seed": "miss ready crop oval canyon such sing powder figure math noodle style", "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": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
"is_default": false,
"ledger": "lbc_regtest",
"modified_on": 1655141657,
"name": "new account",
"private_key": "tprv8ZgxMBicQKsPdmLUTJtRsfwAeL527nfpJE1GhFFLzKtbuuzwYorQyq8guwgzFCQkqs8EuR2MGLkbh3xuEb1pFuAjx1Web8Vk3RXrrLVKwRU",
"public_key": "tpubD6NzVbkrYhZ4XENGLxZ2H5bHDMaxH7risXc3ymHeQbgzkQFiBCg1AKkZ66UqGohv1bXg5579Z3r4omYeqMEd1Khhyuf4dssfmBzfiEce23o",
"seed": "miss ready crop oval canyon such sing powder figure math noodle style"
}
}
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"
}
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. |
Examples
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"
}
}
Returns:
↓
(decimal) amount of lbry credits in wallet
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 |
Examples
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": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
"is_default": false,
"ledger": "lbc_regtest",
"modified_on": 1655141657,
"name": "generated account",
"private_key": "tprv8ZgxMBicQKsPdmLUTJtRsfwAeL527nfpJE1GhFFLzKtbuuzwYorQyq8guwgzFCQkqs8EuR2MGLkbh3xuEb1pFuAjx1Web8Vk3RXrrLVKwRU",
"public_key": "tpubD6NzVbkrYhZ4XENGLxZ2H5bHDMaxH7risXc3ymHeQbgzkQFiBCg1AKkZ66UqGohv1bXg5579Z3r4omYeqMEd1Khhyuf4dssfmBzfiEce23o",
"seed": "miss ready crop oval canyon such sing powder figure math noodle style"
}
}
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"
}
account_deposit
Spend a time locked transaction into your account.
Arguments
txid optional str | id of the transaction |
---|---|
nout optional int | output number in the transaction |
redeem_script optional str | redeem script for output |
private_key optional str | private key to sign transaction |
to_account optional str | deposit to this account |
wallet_id optional str | limit 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"
}
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 decimal | 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. |
Examples
Transfer 2 LBC from default account to specific account
curl -d'{"method": "account_fund", "params": {"to_account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn", "amount": "2.0", "everything": false, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --to_account="mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn" --amount=2.0 --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn", "amount": "2.0", "everything": false, "broadcast": true}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "01000000012a489c130efda054091c1e91a258ad57772619a9b42ab5e416768e32334e581c000000006a47304402207fd2ffd9fe8363604a428161ace5ad1bb3bab156e9746dcf4d9b784e90abd8c6022024766cb49008eeac5b963a97de0d63611e8a5d7299776eab95598514b18ad1da0121028a467e50cb5555cc3d4ce66944ffbf5566cfe7b8a553e3bf40d4d214d4cb5233ffffffff0200c2eb0b000000001976a9140e92a8bca34238d407745d94fc5b21f0e39f518888ac90d7ae2f000000001976a914169f2f9502bfb8ee9c1d97c315ef13672721638b88ac00000000",
"inputs": [
{
"address": "mqwYxGxBhfFodPpkCDGXK3eiSHpfRPi6SD",
"amount": "10.0",
"confirmations": 6,
"height": 201,
"nout": 0,
"timestamp": 1655141669,
"txid": "1c584e33328e7616e4b52ab4a919267757ad58a2911e1c0954a0fd0e139c482a",
"type": "payment"
}
],
"outputs": [
{
"address": "mgr1So3484shNr8kNMsavaohFwwRm9AnFU",
"amount": "2.0",
"confirmations": -2,
"height": -2,
"nout": 0,
"timestamp": null,
"txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8",
"type": "payment"
},
{
"address": "mhaZrhgfvGv49E47oDupq8wBppSNfhMFam",
"amount": "7.999876",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8",
"type": "payment"
}
],
"total_fee": "0.000124",
"total_input": "10.0",
"total_output": "9.999876",
"txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8"
}
}
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"
}
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 |
Examples
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": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"is_default": true,
"ledger": "lbc_regtest",
"name": "Account #mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"public_key": "tpubD6NzVbkrYhZ4Yj1pAFUmbQ8bvpo4d5aQyWUzVPpagEiAddqLjxzdvfzpxEinbB2JRXCLkHJ8kSSz4scPnw3rnQeYLmXEsr9cXkQLV4ZjwUh",
"satoshis": 1000000000
}
],
"page": 1,
"page_size": 20,
"total_items": 1,
"total_pages": 1
}
}
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"
}
]
}
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
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 |
Examples
Remove an account
curl -d'{"method": "account_remove", "params": {"account_id": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn"}}' http://localhost:5279/
lbrynet account remove mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn
requests.post("http://localhost:5279", json={"method": "account_remove", "params": {"account_id": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn"}}).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": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
"is_default": false,
"ledger": "lbc_regtest",
"modified_on": 1655141657,
"name": "generated account",
"private_key": "tprv8ZgxMBicQKsPdmLUTJtRsfwAeL527nfpJE1GhFFLzKtbuuzwYorQyq8guwgzFCQkqs8EuR2MGLkbh3xuEb1pFuAjx1Web8Vk3RXrrLVKwRU",
"public_key": "tpubD6NzVbkrYhZ4XENGLxZ2H5bHDMaxH7risXc3ymHeQbgzkQFiBCg1AKkZ66UqGohv1bXg5579Z3r4omYeqMEd1Khhyuf4dssfmBzfiEce23o",
"seed": "miss ready crop oval canyon such sing powder figure math noodle style"
}
}
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"
}
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"
}
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 |
Examples
Modify maximum number of times a change address can be reused
curl -d'{"method": "account_set", "params": {"account_id": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn", "default": false, "change_max_uses": 10}}' http://localhost:5279/
lbrynet account set mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn --change_max_uses=10
requests.post("http://localhost:5279", json={"method": "account_set", "params": {"account_id": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn", "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": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
"is_default": false,
"ledger": "lbc_regtest",
"modified_on": 1655141657,
"name": "new account",
"private_key": "tprv8ZgxMBicQKsPdmLUTJtRsfwAeL527nfpJE1GhFFLzKtbuuzwYorQyq8guwgzFCQkqs8EuR2MGLkbh3xuEb1pFuAjx1Web8Vk3RXrrLVKwRU",
"public_key": "tpubD6NzVbkrYhZ4XENGLxZ2H5bHDMaxH7risXc3ymHeQbgzkQFiBCg1AKkZ66UqGohv1bXg5579Z3r4omYeqMEd1Khhyuf4dssfmBzfiEce23o",
"seed": "miss ready crop oval canyon such sing powder figure math noodle style"
}
}
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"
}
address
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 |
Examples
Check if address is mine
curl -d'{"method": "address_is_mine", "params": {"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ"}}' http://localhost:5279/
lbrynet address is_mine muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ
requests.post("http://localhost:5279", json={"method": "address_is_mine", "params": {"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": true
}
Returns:
↓
(bool) true, if address is associated with current wallet
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 |
Examples
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": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mhSwvz7Qfuh343S8WrXpPoPcaxbtw7QM5W",
"pubkey": "tpubDA9GDAntyJu4NnUS2eNJcNYev2VpQi2g9SJZHw9jwfJLVkCvDqtTNJCxS2c25i4BbBZwGZWFBHgAbrQ77qzN2vAiqxwj2w7rTEsxFHv1oKV",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mhaZrhgfvGv49E47oDupq8wBppSNfhMFam",
"pubkey": "tpubDA9GDAntyJu4H7sF54p2y2XUQKZecnakxWYJpSzRAnKgMxNip8xJVz7piyaZUwivQvz4RxbGpyn8NQPHqJmHsGDfkwXeHFsgJAHWP6Sqpxq",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "miK8WKVbTb25PHkuzGtgjMkUrmrWZe4d7U",
"pubkey": "tpubDA9GDAntyJu4Vt4X61z35Cr2HxGTr4PDUpmX5abtbGQ2Zs5EJJ3kAwwhdyCC1EGx4NqiErEXzictM4SxnfQng7jEhiKofkQHkgysqQb6VyQ",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "miihJtUK4WKc6u3gxirkNmKTbPBvFUxt81",
"pubkey": "tpubDA9GDAntyJu4JbNXGCuV83JHncjaq7VvaxuGBNNEuMRdk8aXKLQ7xNPncmrtzS5kjKqWQhW79YCve3EfUAvE6dsVn9DQXdWjq9KZQcn1cZs",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"pubkey": "tpubDA9GDAntyJu4K82qyamAJ31vsRiLmGAGQAvvjMWbyHf5yJFDQt8sVpGCftFYMmhME5bRYSXzogRbJkthKhHLsgxJURfNofnNiJbNKDiNQLk",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mnHsWiDjPYw27jPzMfqUFM9scdsgHQ6NJg",
"pubkey": "tpubDA9GDAntyJu4mwA4W8hg3Wsf5PH3YWgbcoB4dr3Cf77KELoQeD8WfN4avxprcKKd2E4ivZGTJ45ntCimLTrQibBcanGxudpvqCiDfvCocM1",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mp2RdZPTyBs9WrtPodcrSf9rTBSRKCTBqR",
"pubkey": "tpubDA9GDAntyJu4ftNy5YcBuVWmiCNsjsEtZHDi45Q3TKDqgaRsQTMCq1STgCV3KhcM3VWANdk2gPaSmF4Acf39WGgcwRjsbfYgCPUDGfkn5cQ",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mpKoa7UDF5mD7bupzZpdnyXxo13vPHAPAj",
"pubkey": "tpubDA9GDAntyJu4ygvkf9qDcakZPBDGQzqZ3qkQLWT7odrTx3sEKwMU8S5YRs1siZVLGEGBkya6oMPKB4DDJ8idy78mMujvCJ9xg8MbRDn2zFk",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mqaQqa8sxKjoPtSiacuKZX61v2TASZiK7e",
"pubkey": "tpubDA9GDAntyJu56YFCUSaYZTbzDQmLUtpKMhxLFP3BgnRa7QUEQnbZVEYUBSQ8yiMbUhA83Pt72b18NnyWE7EvFP7Nf2gY1ZDq9xTBM9cRcar",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mqdwaA91Fe888P29tm8XqDbutdq4jfmKzV",
"pubkey": "tpubDA9GDAntyJu4tKNwyo8vLQ2KTvSTteofqjM4YDEgUxUd1n4o5iBme1QcYF799H7Svi1MiUkQsgsehfEoELY9zY5me6JuALY7fcDTdpL4Kks",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mqwYxGxBhfFodPpkCDGXK3eiSHpfRPi6SD",
"pubkey": "tpubDA9GDAntyJu4EExRfNAiaX8BF4aMZodvmbW6fyohsh2KrJtEpsA3RYGpHadnFW2XNQ3AM8rMnrF8XzDett9gYAqcwgX5NfB7aGwZUzFnY7G",
"used_times": 1
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "ms5HaDddaUyAAMczcdCbYuTFkuBdAgQxeY",
"pubkey": "tpubDA9GDAntyJu4djXrpu7QzDQyq3L9vYpePKx7oxhBnhb9iogFm5yhr35v6hY6F2nbTC1cNtNPMj9mdCGAzgRAPcp314RMpdu1vdZ8HbKGzsg",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mtq45ABFdcEBnuG8VjRfyhRW35rzWZa7U9",
"pubkey": "tpubDA9GDAntyJu4cfSnoTMmBNQG7PS9nYkWih6c9DdVQ4BsdcYh77xvCqRnYfxUSzEepHt3CbRVQjknCpX3e7di9UdvZB2eUHDrp33EeudNqGW",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mtvRgoqoAZdrqrsTdGYmqKzByKuerqgupK",
"pubkey": "tpubDA9GDAntyJu52jLmREuYqCNJmX1uzsAxWsYME8PoUK4wG9KrdDrNRdGwmSwB7XZewgBJ9wu31TeL1cWMwegUc5QzF6xtGcPhPXsuSBtu1DE",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mtwm7SVcxtxXHgkxwLfrPodkuo14wKgNrz",
"pubkey": "tpubDA9GDAntyJu4YkkdNxGKiUABfQ1phUrbuQaVS7u7bE7xjKEMMfJ9ga1pb3kijvY6v7TuV9nTDCkng1XJcgBda3btMCh3Fwt9ngGwHRDXm2Z",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"pubkey": "tpubDA9GDAntyJu4MyJWHNPKXbWDmkmg1VVMSxumiRmBHQfQKqfr7BGiHRrP4pHXexmorYAXjHkzB4naVB8qp6Cr5JZBuBoD9QGWYmAM9NcQZqP",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mur916Vn2bk7ASmHqtVs294wgU6KeHVxmq",
"pubkey": "tpubDA9GDAntyJu4Eixz66KLYzFsprgwbQ1CsTEZjy48cRRHt4Md4mfgJ8ps8h8sp8dg35rD3GD5WuUes9GB5ceVKJehHsZUCtcUxDbExrozfN1",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mv4KFMYgTdH3c2etDRvyybzKAxfCk3rHi5",
"pubkey": "tpubDA9GDAntyJu4UuzqvQhgnXkPz2wJNL7zUWZLE7HYP7woQ62wuJnBNt6QLGw2Gc1WRJZ3sa558CsedMJEaFuMa6zUaVmoQysF6WwwT7yuhaF",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mvJRJRn2ZvdLwLsKuAyenCpBkY9QxbegGF",
"pubkey": "tpubDA9GDAntyJu4qkyiyr8CRDo12dohq2BcBCY8M7qRELp6xXJncbhjdx4eMZNhSfHd5SWa2qYm4Aupot866XqZ9G2UznaN5PtWF1faNKqBxT4",
"used_times": 0
},
{
"account": "mhjFSotvK8b2eJHZw2Tgf8czVLDsG2tLyu",
"address": "mwSmsEyeJE7CxzLvwoGqoHLWmd4r7nQeeJ",
"pubkey": "tpubDA9GDAntyJu4S7YgeBYbzaaCUPadcuhYmgR2Ugrj7yuvkfpGt1qRYkA9uQE8ekfkN2cSU7ywTqRSXmYVm4DBxQM5PbfLE1FGh7vrfyTDZDv",
"used_times": 0
}
],
"page": 1,
"page_size": 20,
"total_items": 53,
"total_pages": 3
}
}
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"
]
}
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 |
Examples
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": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ"
}
Returns:
↓
"an address in base58"
blob
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
blob_clean
Deletes blobs to cleanup disk space
Returns:
↓
(bool) true if successful
blob_delete
Delete a blob
Arguments
blob_hash str | blob hash of the blob to delete |
---|
Examples
Delete a blob
curl -d'{"method": "blob_delete", "params": {"blob_hash": "d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996"}}' http://localhost:5279/
lbrynet blob delete d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996
requests.post("http://localhost:5279", json={"method": "blob_delete", "params": {"blob_hash": "d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": "Deleted d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996"
}
Returns:
↓
(str) Success/fail message
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
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 in a stream by sd hash, ie the hash of the stream descriptor blob for a stream that has been downloaded |
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
Examples
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": [
"d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996",
"3413d65026fcabc798f477a457e205e96b3ac921176df62f79a9d90b9c5bed665bb3ad849c8b472c27d13cfbc6440e9f",
"9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"536763bbb86446ef57a8a45493b12503ea4c74d865692343ff60c3b40431b5a8624341ae1e48aaf601057071cb25b7c3"
],
"page": 1,
"page_size": 20,
"total_items": 4,
"total_pages": 1
}
}
Returns:
↓
(list) List of blob hashes
blob_reflect
Reflects specified blobs
Arguments
reflector_server optional str | reflector address |
---|
Returns:
↓
(list) reflected blob hashes
blob_reflect_all
Reflects all saved blobs
Returns:
↓
(bool) true if successful
channel
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 |
Examples
Abandon a channel claim
curl -d'{"method": "channel_abandon", "params": {"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet channel abandon 595c2e2f0c1f59188628fab7503692b0145779a2
requests.post("http://localhost:5279", json={"method": "channel_abandon", "params": {"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "preview": false, "blocking": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "010000000164ffcff7cce034b5b519f047c9aa5c4cf0dc52d6e5804d74174140a5c52182ab000000006a4730440220554a49624aa9ba48ff6f6ea0e747e3f0fce88e9fbdaef0ec8336e8367dc8552802203988c9dc46b066b699fe7f93bd2fcad05cd86b309846f65b85c3b32ba98667c6012103687cff1a4970d2e992ba0035de7251dd822cb495c17ec0c5c4543a514227cd65ffffffff0134b7f505000000001976a91406c0b5a2fea95e096d4406846d1eb01a1993d5a388ac00000000",
"inputs": [
{
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 9,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
}
],
"outputs": [
{
"address": "mg8fCtz1uf7aZe8UVgzMcBPw1V3yEu4Qry",
"amount": "0.999893",
"confirmations": -2,
"height": -2,
"nout": 0,
"timestamp": null,
"txid": "3691918e1a838c00b759609bfc89effdfab93860a9bc68d06edcc6ee0bb566d5",
"type": "payment"
}
],
"total_fee": "0.000107",
"total_input": "1.0",
"total_output": "0.999893",
"txid": "3691918e1a838c00b759609bfc89effdfab93860a9bc68d06edcc6ee0bb566d5"
}
}
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"
}
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 |
Examples
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": "0100000001b8749850c50b2d456a0d54ab618c516f9f80a6f1dc7977dab4ca230e775931f0010000006a473044022041b5434aab5d73b41aad02687a657c9b99e1ef83fa8eabb08407359cbe6731e30220293f3f8ac7bf6ade85f4a181920b20d6d55b04acbce1edffc9ef7d1f94a88fdc012102ebd9926866ffd2ea504ee0ec7affe0f85f76e8a3c55149680ff74a63bd655123ffffffff0200e1f505000000004cb508406368616e6e656c260012230a2103bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e56d7576a914988d8d19fed515ed8e9d60a1c31c8aed750e441d88acc462a029000000001976a914b3aa073545c0d148feed1b89f24a3c7302c2f53188ac00000000",
"inputs": [
{
"address": "mhaZrhgfvGv49E47oDupq8wBppSNfhMFam",
"amount": "7.999876",
"confirmations": 2,
"height": 207,
"nout": 1,
"timestamp": 1655141670,
"txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8",
"type": "payment"
}
],
"outputs": [
{
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "create",
"confirmations": -2,
"has_signing_key": true,
"height": -2,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": null,
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm"
},
"value_type": "channel"
},
{
"address": "mwtvw9x13nsVo6xkkrt3RFkk5h6TAjgPdK",
"amount": "6.983769",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964",
"type": "payment"
}
],
"total_fee": "0.016107",
"total_input": "7.999876",
"total_output": "7.983769",
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964"
}
}
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"
}
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
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
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) |
Examples
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": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"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#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm"
},
"value_type": "channel"
}
],
"page": 1,
"page_size": 20,
"total_items": 1,
"total_pages": 1
}
}
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"
}
]
}
channel_sign
Signs data using the specified channel signing key.
Arguments
channel_name optional str | name of channel used to sign (or use channel id) |
---|---|
channel_id optional str | claim id of channel used to sign (or use channel name) |
hexdata optional str | data to sign, encoded as hexadecimal |
channel_account_id optional str | one or more account ids for accounts to look in for channel certificates, defaults to all accounts. |
wallet_id optional str | restrict operation to specific wallet |
Returns:
↓
(dict) Signature if successfully made, (None) or an error otherwise
{
"signature": (str) The signature of the comment,
"signing_ts": (str) The timestamp used to sign the comment,
}
channel_update
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 |
Examples
Update a channel claim
curl -d'{"method": "channel_update", "params": {"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "title": "New Channel", "featured": [], "clear_featured": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "new_signing_key": false, "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}' http://localhost:5279/
lbrynet channel update 595c2e2f0c1f59188628fab7503692b0145779a2 --title="New Channel"
requests.post("http://localhost:5279", json={"method": "channel_update", "params": {"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "title": "New Channel", "featured": [], "clear_featured": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "new_signing_key": false, "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "01000000026419a92bda9f0ef64bde16f5a322d5668d68d53b4e38eb99b4738f72dbe880de000000006a47304402206e41c2509f2ff2099feb34189e34b30d1e5cb011a119c7d3a50ec48d8d49b987022035cb2af940fb1e1db687fc29e7575c22c3f1f799edd82d656b85a26fb653c78d012103687cff1a4970d2e992ba0035de7251dd822cb495c17ec0c5c4543a514227cd65ffffffffe8c0c36bed593c86544238beb9cf20d825962eb11053a24fa33a0378a87d7440000000006a47304402202b6601a98c683dfc99c2c1997156eb7bf6a45cc627d953b1b7246db450229c6e02201b74c5e5d27c7f3cf2770c7e308826d331dd75c2275e31f6828e42369fd2466b0121026dec9b64cb86838f381490252b2cfa34512e9673b65b6016734e92c1968762ecffffffff0200e1f505000000006eb708406368616e6e656c14a2795714b0923650b7fa288618591f0c2f2e5c59330012230a2103bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5420b4e6577204368616e6e656c6d6d76a914988d8d19fed515ed8e9d60a1c31c8aed750e441d88ac5ec9ea0b000000001976a9144c1f61ac2064778c7f08eda66437d2677befd3c088ac00000000",
"inputs": [
{
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "create",
"confirmations": 1,
"has_signing_key": true,
"height": 209,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm"
},
"value_type": "channel"
},
{
"address": "n1JZiGPzhiFUPTysS5PABHjdiRqfWNMSaX",
"amount": "1.999604",
"confirmations": 1,
"height": 209,
"nout": 0,
"timestamp": 1655141670,
"txid": "40747da878033aa34fa25310b12e9625d820cfb9be384254863c59ed6bc3c0e8",
"type": "payment"
}
],
"outputs": [
{
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": -2,
"has_signing_key": true,
"height": -2,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": null,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
{
"address": "mnTTF4Sw8SGHi58DRCRSpYXJosZ61nPijQ",
"amount": "1.9993635",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "payment"
}
],
"total_fee": "0.0002405",
"total_input": "2.999604",
"total_output": "2.9993635",
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64"
}
}
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"
}
claim
claim_list
List my stream and channel claims.
Arguments
claim_type optional str or list | claim type: channel, stream, repost, collection |
---|---|
claim_id optional str or list | claim id |
channel_id optional str or list | streams in this channel |
name optional str or list | claim name |
is_spent optional bool | shows previous claim updates and abandons |
account_id optional str | id of the account to query |
wallet_id optional str | restrict results to specific wallet |
has_source optional bool | list claims containing a source field |
has_no_source optional bool | list claims not containing a source field |
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
resolve optional bool | resolves each claim to provide additional metadata |
order_by optional str | field to order by: 'name', 'height', 'amount' |
no_totals optional bool | do not calculate the total number of pages and items in result set (significant performance boost) |
include_received_tips optional bool | calculate the amount of tips received for claim outputs |
Examples
List all your claims
curl -d'{"method": "claim_list", "params": {"claim_type": [], "claim_id": [], "name": [], "is_spent": false, "channel_id": [], "has_source": false, "has_no_source": false, "resolve": false, "no_totals": false, "include_received_tips": false}}' http://localhost:5279/
lbrynet claim list
requests.post("http://localhost:5279", json={"method": "claim_list", "params": {"claim_type": [], "claim_id": [], "name": [], "is_spent": false, "channel_id": [], "has_source": false, "has_no_source": false, "resolve": false, "no_totals": false, "include_received_tips": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 1,
"height": 214,
"is_channel_signature_valid": true,
"is_internal_transfer": false,
"is_my_input": true,
"is_my_output": true,
"is_spent": false,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 5,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 5,
"has_signing_key": true,
"height": 210,
"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#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
}
],
"page": 1,
"page_size": 20,
"total_items": 2,
"total_pages": 1
}
}
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"
}
]
}
claim_search
Search for stream and channel claims on the blockchain. Arguments marked with "supports equality constraints" allow prepending the value with an equality constraint such as '>', '>=', '<' and '<=' eg. --height=">400000" would limit results to only claims above 400k block height. They also support multiple constraints passed as a list of the args described above. eg. --release_time=[">1000000", "<2000000"]
Arguments
name optional str | claim name (normalized) |
---|---|
text optional str | full text search |
claim_id optional str | full or partial claim id |
claim_ids optional list | list of full claim ids |
txid optional str | transaction id |
nout optional str | position in the transaction |
channel optional str | claims signed by this channel (argument is a URL which automatically gets resolved), see --channel_ids if you need to filter by multiple channels at the same time, includes claims with invalid signatures, use in conjunction with --valid_channel_signature |
channel_ids optional list | claims signed by any of these channels (arguments must be claim ids of the channels), includes claims with invalid signatures, implies --has_channel_signature, use in conjunction with --valid_channel_signature |
not_channel_ids optional list | exclude claims signed by any of these channels (arguments must be claim ids of the channels) |
has_channel_signature optional bool | claims with a channel signature (valid or invalid) |
valid_channel_signature optional bool | claims with a valid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with valid signatures |
invalid_channel_signature optional bool | claims with invalid channel signature or no signature, use in conjunction with --has_channel_signature to only get claims with invalid signatures |
limit_claims_per_channel optional int | only return up to the specified number of claims per channel |
is_controlling optional bool | winning claims of their respective name |
public_key_id optional str | only return channels having this public key id, this is the same key as used in the wallet file to map channel certificate private keys: {'public_key_id': 'private key'} |
height optional int | last updated block height (supports equality constraints) |
timestamp optional int | last updated timestamp (supports equality constraints) |
creation_height optional int | created at block height (supports equality constraints) |
creation_timestamp optional int | created at timestamp (supports equality constraints) |
activation_height optional int | height at which claim starts competing for name (supports equality constraints) |
expiration_height optional int | height at which claim will expire (supports equality constraints) |
release_time optional int | limit to claims self-described as having been released to the public on or after this UTC timestamp, when claim does not provide a release time the publish time is used instead (supports equality constraints) |
amount optional int | limit by claim value (supports equality constraints) |
support_amount optional int | limit by supports and tips received (supports equality constraints) |
effective_amount optional int | limit by total value (initial claim value plus all tips and supports received), this amount is blank until claim has reached activation height (supports equality constraints) |
trending_score optional int | limit by trending score (supports equality constraints) |
trending_group optional int | DEPRECATED - instead please use trending_score |
trending_mixed optional int | DEPRECATED - instead please use trending_score |
trending_local optional int | DEPRECATED - instead please use trending_score |
trending_global optional int | DEPRECATED - instead please use trending_score |
reposted_claim_id optional str | all reposts of the specified original claim id |
reposted optional int | claims reposted this many times (supports equality constraints) |
claim_type optional str | filter by 'channel', 'stream', 'repost' or 'collection' |
stream_types optional list | filter by 'video', 'image', 'document', etc |
media_types optional list | filter by 'video/mp4', 'image/png', etc |
fee_currency optional string | specify fee currency: LBC, BTC, USD |
fee_amount optional decimal | content download fee (supports equality constraints) |
duration optional int | duration of video or audio in seconds (supports equality constraints) |
any_tags optional list | find claims containing any of the tags |
all_tags optional list | find claims containing every tag |
not_tags optional list | find claims not containing any of these tags |
any_languages optional list | find claims containing any of the languages |
all_languages optional list | find claims containing every language |
not_languages optional list | find claims not containing any of these languages |
any_locations optional list | find claims containing any of the locations |
all_locations optional list | find claims containing every location |
not_locations optional list | find claims not containing any of these locations |
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
order_by optional list | field to order by, default is descending order, to do an ascending order prepend ^ to the field name, eg. '^amount' available fields: 'name', 'height', 'release_time', 'publish_time', 'amount', 'effective_amount', 'support_amount', 'trending_group', 'trending_mixed', 'trending_local', 'trending_global', 'activation_height' |
no_totals optional bool | do not calculate the total number of pages and items in result set (significant performance boost) |
wallet_id optional str | wallet to check for claim purchase receipts |
include_purchase_receipt optional bool | lookup and include a receipt if this wallet has purchased the claim |
include_is_my_output optional bool | lookup and include a boolean indicating if claim being resolved is yours |
remove_duplicates optional bool | removes duplicated content from search by picking either the original claim or the oldest matching repost |
has_source optional bool | find claims containing a source field |
sd_hash optional str | find claims where the source stream descriptor hash matches (partially or completely) the given hexadecimal string |
has_no_source optional bool | find claims not containing a source field |
new_sdk_server optional str | URL of the new SDK server (EXPERIMENTAL) |
Examples
Search for all claims in channel
curl -d'{"method": "claim_search", "params": {"claim_ids": [], "channel": "@channel", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": [], "no_totals": false, "include_purchase_receipt": false, "include_is_my_output": false, "remove_duplicates": false, "has_source": false, "has_no_source": false}}' http://localhost:5279/
lbrynet claim search --channel=@channel
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"claim_ids": [], "channel": "@channel", "channel_ids": [], "not_channel_ids": [], "has_channel_signature": false, "valid_channel_signature": false, "invalid_channel_signature": false, "is_controlling": false, "stream_types": [], "media_types": [], "any_tags": [], "all_tags": [], "not_tags": [], "any_languages": [], "all_languages": [], "not_languages": [], "any_locations": [], "all_locations": [], "not_locations": [], "order_by": [], "no_totals": false, "include_purchase_receipt": false, "include_is_my_output": false, "remove_duplicates": false, "has_source": false, "has_no_source": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"blocked": {
"channels": [],
"total": 0
},
"items": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"canonical_url": "lbry://@channel#5/astream#a",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 1,
"height": 214,
"is_channel_signature_valid": true,
"meta": {
"activation_height": 214,
"creation_height": 213,
"creation_timestamp": 1655141671,
"effective_amount": "1.0",
"expiration_height": 714,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 213
},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"short_url": "lbry://astream#a",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"canonical_url": "lbry://@channel#5",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 5,
"has_signing_key": false,
"height": 210,
"meta": {
"activation_height": 210,
"claims_in_channel": 1,
"creation_height": 209,
"creation_timestamp": 1655141670,
"effective_amount": "1.0",
"expiration_height": 710,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 209
},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"short_url": "lbry://@channel#5",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
}
],
"page": 1,
"page_size": 20,
"total_items": 1,
"total_pages": 1
}
}
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"
}
]
}
collection
collection_abandon
Abandon one of my collection 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"
}
collection_create
Create a new collection.
Arguments
name str | name of the collection |
---|---|
bid decimal | amount to back the claim |
claims optional list | claim ids to be included in the collection |
allow_duplicate_name optional bool | create new collection even if one already exists with given name. default: false. |
title optional str | title of the collection |
description optional str | description of the collection |
tags optional list | content tags |
clear_languages optional bool | clear existing languages (prior to adding new ones) |
languages optional list | languages used by the collection, 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 collection, 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 |
channel_id optional str | claim id of the publisher channel |
channel_name optional str | name of the 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 collection 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 |
Examples
Create a collection of one stream
curl -d'{"method": "collection_create", "params": {"name": "tom", "bid": "1.0", "claims": ["ad25e05aa7dc5e9994869040c6103f9a8728db46"], "allow_duplicate_name": false, "tags": [], "languages": [], "locations": [], "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet collection create --name=tom --bid=1.0 --channel_id=595c2e2f0c1f59188628fab7503692b0145779a2 --claims=ad25e05aa7dc5e9994869040c6103f9a8728db46
requests.post("http://localhost:5279", json={"method": "collection_create", "params": {"name": "tom", "bid": "1.0", "claims": ["ad25e05aa7dc5e9994869040c6103f9a8728db46"], "allow_duplicate_name": false, "tags": [], "languages": [], "locations": [], "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "01000000012c1bc49ac50486afeda93e5b8bff99abc845c446215a05d57c24dc3d522dd304010000006b483045022100ced18ea9fe454cf44d94bb9a5d7e6915030fb6c8f79c0df2f68cbbdd30f5913702204c6d7aded8529aef37f9e800c7e4159c02ed6cf1308c4bac32726b76902733fb0121023bf6d860bb1c3b7c71d9d9c985a56bdba1c6f754fa351805f02d89a87ff0222cffffffff0200e1f5050000000091b503746f6d4c6f01a2795714b0923650b7fa288618591f0c2f2e5c591bb9bb615fa343bdb5e2194aa8b18986d5f001413697412ec4b5f1a529c971e90a63a27ebf78a5e512d5f1b87dde99e6e40aa4e9b710240536ec62c3f1b56df51a1812160a1446db28879a3f10c640908694995edca75ae025ad6d7576a914934ab2faddc49cbc3cad5a805f3e79c5c502d14888ac202c7e17000000001976a914e9d5fbcc88ada7ba2a27cdf59e70c57b339cbf9f88ac00000000",
"inputs": [
{
"address": "n44m2TuZKypifAkpPQqEN4VtRkCxgbgkA3",
"amount": "4.947555",
"confirmations": 2,
"height": 215,
"nout": 1,
"timestamp": 1655141672,
"txid": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c",
"type": "payment"
}
],
"outputs": [
{
"address": "mtwm7SVcxtxXHgkxwLfrPodkuo14wKgNrz",
"amount": "1.0",
"claim_id": "bd463bad61b8e420258f96e817b9540fa134ed23",
"claim_op": "create",
"confirmations": -2,
"height": -2,
"is_channel_signature_valid": true,
"meta": {},
"name": "tom",
"normalized_name": "tom",
"nout": 0,
"permanent_url": "lbry://tom#bd463bad61b8e420258f96e817b9540fa134ed23",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 7,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": null,
"txid": "a9954fce4be4598afcead007cec8f64bbcc8a899080f99bd1a0bfe07f2b501c7",
"type": "claim",
"value": {
"claims": [
"ad25e05aa7dc5e9994869040c6103f9a8728db46"
]
},
"value_type": "collection"
},
{
"address": "n2qN5bEHEQ1keWyR6GbNd15dbHE6z1FoZb",
"amount": "3.941448",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "a9954fce4be4598afcead007cec8f64bbcc8a899080f99bd1a0bfe07f2b501c7",
"type": "payment"
}
],
"total_fee": "0.006107",
"total_input": "4.947555",
"total_output": "4.941448",
"txid": "a9954fce4be4598afcead007cec8f64bbcc8a899080f99bd1a0bfe07f2b501c7"
}
}
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"
}
collection_list
List my collection claims.
Arguments
resolve optional bool | resolve collection claim |
---|---|
resolve_claims optional int | resolve every claim |
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 |
Examples
List collections
curl -d'{"method": "collection_list", "params": {"resolve_claims": 1, "resolve": true}}' http://localhost:5279/
lbrynet collection list --resolve --resolve_claims=1
requests.post("http://localhost:5279", json={"method": "collection_list", "params": {"resolve_claims": 1, "resolve": true}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"address": "mtwm7SVcxtxXHgkxwLfrPodkuo14wKgNrz",
"amount": "1.0",
"canonical_url": "lbry://@channel#5/tom#b",
"claim_id": "bd463bad61b8e420258f96e817b9540fa134ed23",
"claim_op": "create",
"claims": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"canonical_url": "lbry://@channel#5/astream#a",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 4,
"height": 214,
"is_channel_signature_valid": true,
"meta": {
"activation_height": 214,
"creation_height": 213,
"creation_timestamp": 1655141671,
"effective_amount": "1.0",
"expiration_height": 714,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 213
},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"short_url": "lbry://astream#a",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"canonical_url": "lbry://@channel#5",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 8,
"has_signing_key": false,
"height": 210,
"meta": {
"activation_height": 210,
"claims_in_channel": 2,
"creation_height": 209,
"creation_timestamp": 1655141670,
"effective_amount": "1.0",
"expiration_height": 710,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 209
},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"short_url": "lbry://@channel#5",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
}
],
"confirmations": 1,
"height": 217,
"is_channel_signature_valid": true,
"meta": {
"activation_height": 217,
"creation_height": 217,
"creation_timestamp": 1655141675,
"effective_amount": "1.0",
"expiration_height": 717,
"is_controlling": true,
"reposted": 0,
"support_amount": "0.0",
"take_over_height": 217
},
"name": "tom",
"normalized_name": "tom",
"nout": 0,
"permanent_url": "lbry://tom#bd463bad61b8e420258f96e817b9540fa134ed23",
"short_url": "lbry://tom#b",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 8,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141675,
"txid": "a9954fce4be4598afcead007cec8f64bbcc8a899080f99bd1a0bfe07f2b501c7",
"type": "claim",
"value": {
"claims": [
"ad25e05aa7dc5e9994869040c6103f9a8728db46"
]
},
"value_type": "collection"
}
],
"page": 1,
"page_size": 20,
"total_items": 1,
"total_pages": 1
}
}
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"
}
]
}
collection_resolve
Resolve claims in the collection.
Arguments
claim_id optional str | claim id of the collection |
---|---|
url optional str | url of the collection |
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 |
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"
}
]
}
collection_update
Update an existing collection claim.
Arguments
claim_id str | claim_id of the collection to update |
---|---|
bid optional decimal | amount to back the claim |
claims optional list | claim ids |
clear_claims optional bool | clear existing claim references (prior to adding new ones) |
title optional str | title of the collection |
description optional str | description of the collection |
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 collection, 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 collection, 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 |
channel_id optional str | claim id of the publisher channel |
channel_name optional str | name of the 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 in which to look for collection (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 collection is sent |
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 collection, 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 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"
}
file
file_delete
Delete a LBRY file
Arguments
delete_from_download_dir optional bool | delete file from download directory, instead of just deleting blobs |
---|---|
delete_all optional bool | if there are multiple matching files, allow the deletion of multiple files. Otherwise do not delete anything. |
sd_hash optional str | delete by file sd hash |
file_name optional str | delete by file name in downloads folder |
stream_hash optional str | delete by file stream hash |
rowid optional int | delete by file row id |
claim_id optional str | delete by file claim id |
txid optional str | delete by file claim txid |
nout optional int | delete by file claim nout |
claim_name optional str | delete by file claim name |
channel_claim_id optional str | delete by file channel claim id |
channel_name optional str | delete by file channel claim name |
Examples
Delete a file
curl -d'{"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46"}}' http://localhost:5279/
lbrynet file delete --claim_id="ad25e05aa7dc5e9994869040c6103f9a8728db46"
requests.post("http://localhost:5279", json={"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": true
}
Returns:
↓
(bool) true if deletion was successful
file_list
List files limited by optional filters
Arguments
sd_hash optional str | get file with matching sd hash |
---|---|
file_name optional str | get file with matching file name in the downloads folder |
stream_hash optional str | get file with matching stream hash |
rowid optional int | get file with matching row id |
added_on optional int | get file with matching time of insertion |
claim_id optional str | get file with matching claim id(s) |
outpoint optional str | get file with matching claim outpoint(s) |
txid optional str | get file with matching claim txid |
nout optional int | get file with matching claim nout |
channel_claim_id optional str | get file with matching channel claim id(s) |
channel_name optional str | get file with matching channel name |
claim_name optional str | get file with matching claim name |
blobs_in_stream optional int | get file with matching blobs in stream |
download_path optional str | get file with matching download path |
uploading_to_reflector optional bool | get files currently uploading to reflector |
is_fully_reflected optional bool | get files that have been uploaded to reflector |
status optional str | match by status, ( running | finished | stopped ) |
completed optional bool | match only completed |
blobs_remaining optional int | amount of remaining blobs to download |
sort optional str | field to sort by (one of the above filter fields) |
comparison optional str | logical comparison, (eq | ne | g | ge | l | le | in) |
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
wallet_id optional str | add purchase receipts from this wallet |
Examples
List local files
curl -d'{"method": "file_list", "params": {"reverse": false}}' http://localhost:5279/
lbrynet file list
requests.post("http://localhost:5279", json={"method": "file_list", "params": {"reverse": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"added_on": null,
"blobs_completed": 1,
"blobs_in_stream": 1,
"blobs_remaining": 0,
"channel_claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"channel_name": "@channel",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_name": "astream",
"completed": true,
"confirmations": -1,
"content_fee": null,
"download_directory": null,
"download_path": null,
"file_name": null,
"height": -1,
"is_fully_reflected": true,
"key": "66f888fe00cf558494c2fcbd5903d00d",
"metadata": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"mime_type": "application/octet-stream",
"nout": 0,
"outpoint": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234:0",
"points_paid": 0.0,
"protobuf": "01a2795714b0923650b7fa288618591f0c2f2e5c5961baf110460a527e38b68f0653c1c79f2cae1f57ade55c009fb7578175c9d93d7edb0546d1378e1d33d99df8df0d5cfe9e7a5b63053a4e7ce003f95f5890b27f0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707238333268703178180b22186170706c69636174696f6e2f6f637465742d73747265616d32309ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"purchase_receipt": null,
"reflector_progress": 0,
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"status": "finished",
"stopped": true,
"stream_hash": "c48ff9950efbcb78b20d311467b1b0e321069ef5ece96898eb08a27a62d1ef2594cd24f1e8d6993f00c48fd6a4221490",
"stream_name": "tmpr832hp1x",
"streaming_url": "http://localhost:5280/stream/9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"suggested_file_name": "tmpr832hp1x",
"timestamp": null,
"total_bytes": 16,
"total_bytes_lower_bound": 0,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"uploading_to_reflector": false,
"written_bytes": 0
},
{
"added_on": null,
"blobs_completed": 1,
"blobs_in_stream": 1,
"blobs_remaining": 0,
"channel_claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"channel_name": "@channel",
"claim_id": "46bff43fbdffabf12efc867c2b4c7865315b0b76",
"claim_name": "blank-image",
"completed": false,
"confirmations": -1,
"content_fee": null,
"download_directory": null,
"download_path": null,
"file_name": null,
"height": -1,
"is_fully_reflected": true,
"key": "b2c6c26d1094b988fbf3313086f2a256",
"metadata": {
"author": "Picaso",
"description": "A blank PNG that is 5x7.",
"fee": {
"address": "mnHsWiDjPYw27jPzMfqUFM9scdsgHQ6NJg",
"amount": "0.3",
"currency": "LBC"
},
"image": {
"height": 7,
"width": 5
},
"languages": [
"en"
],
"license": "Public Domain",
"license_url": "http://public-domain.org",
"locations": [
{
"city": "Manchester",
"country": "US",
"state": "NH"
}
],
"release_time": "1655141671",
"source": {
"hash": "6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545",
"media_type": "image/png",
"name": "tmps0do5cfj.png",
"sd_hash": "d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996",
"size": "99"
},
"stream_type": "image",
"tags": [
"blank",
"art"
],
"thumbnail": {
"url": "http://smallmedia.com/thumbnail.jpg"
},
"title": "Blank Image"
},
"mime_type": "image/png",
"nout": 0,
"outpoint": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c:0",
"points_paid": 0.0,
"protobuf": "01a2795714b0923650b7fa288618591f0c2f2e5c5946580bd06bec18e960285651ca9130c75fcf4f5b3cd71fa5d97fe7013de1bf7627b08de186dc0f5c4ff33a6e7173b24f7da6a91080ffb840f6f6fbf4897851790ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d707330646f3563666a2e706e6718632209696d6167652f706e673230d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728a7ea9d95063222080112196f4a4f7b3ab55c52fe12f9d8b9b255fb2625522e4b00415bed188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e63686573746572",
"purchase_receipt": null,
"reflector_progress": 0,
"sd_hash": "d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996",
"status": "finished",
"stopped": true,
"stream_hash": "eec0d9d4bf368e6e8abe11a0ceaf6f27606f11c1868d415e1470baa316400d6517f6092974ec5c58018b30b3e8e5b884",
"stream_name": "tmps0do5cfj.png",
"streaming_url": "http://localhost:5280/stream/d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996",
"suggested_file_name": "tmps0do5cfj.png",
"timestamp": null,
"total_bytes": 112,
"total_bytes_lower_bound": 96,
"txid": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c",
"uploading_to_reflector": false,
"written_bytes": 0
}
],
"page": 1,
"page_size": 20,
"total_items": 2,
"total_pages": 1
}
}
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": [
{
"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"
}
]
}
file_reflect
Reflect all the blobs in a file matching the filter criteria
Arguments
sd_hash optional str | get file with matching sd hash |
---|---|
file_name optional str | get file with matching file name in the downloads folder |
stream_hash optional str | get file with matching stream hash |
rowid optional int | get file with matching row id |
reflector optional str | reflector server, ip address or url by default choose a server from the config |
Returns:
↓
(list) list of blobs reflected
file_save
Start saving a file to disk.
Arguments
file_name optional str | file name to save to |
---|---|
download_directory optional str | directory to save into |
sd_hash optional str | save file with matching sd hash |
stream_hash optional str | save file with matching stream hash |
rowid optional int | save file with matching row id |
claim_id optional str | save file with matching claim id |
txid optional str | save file with matching claim txid |
nout optional int | save file with matching claim nout |
claim_name optional str | save file with matching claim name |
channel_claim_id optional str | save file with matching channel claim id |
channel_name optional str | save file with matching channel claim name |
Examples
Save a file to the downloads directory
curl -d'{"method": "file_save", "params": {"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83"}}' http://localhost:5279/
lbrynet file save --sd_hash="9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83"
requests.post("http://localhost:5279", json={"method": "file_save", "params": {"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"added_on": 1655141677,
"blobs_completed": 1,
"blobs_in_stream": 1,
"blobs_remaining": 0,
"channel_claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"channel_name": "@channel",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_name": "astream",
"completed": true,
"confirmations": 4,
"content_fee": null,
"download_directory": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd",
"download_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd/tmpr832hp1x_1",
"file_name": "tmpr832hp1x_1",
"height": 214,
"is_fully_reflected": false,
"key": "66f888fe00cf558494c2fcbd5903d00d",
"metadata": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"mime_type": "application/octet-stream",
"nout": 0,
"outpoint": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234:0",
"points_paid": 0.0,
"protobuf": "01a2795714b0923650b7fa288618591f0c2f2e5c5961baf110460a527e38b68f0653c1c79f2cae1f57ade55c009fb7578175c9d93d7edb0546d1378e1d33d99df8df0d5cfe9e7a5b63053a4e7ce003f95f5890b27f0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707238333268703178180b22186170706c69636174696f6e2f6f637465742d73747265616d32309ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"purchase_receipt": null,
"reflector_progress": 0,
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"status": "finished",
"stopped": true,
"stream_hash": "c48ff9950efbcb78b20d311467b1b0e321069ef5ece96898eb08a27a62d1ef2594cd24f1e8d6993f00c48fd6a4221490",
"stream_name": "tmpr832hp1x",
"streaming_url": "http://localhost:5280/stream/9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"suggested_file_name": "tmpr832hp1x",
"timestamp": 1655141671,
"total_bytes": 16,
"total_bytes_lower_bound": 0,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"uploading_to_reflector": false,
"written_bytes": 11
}
}
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"
}
file_set_status
Start or stop downloading a file
Arguments
status str | one of "start" or "stop" |
---|---|
sd_hash optional str | set status of file with matching sd hash |
file_name optional str | set status of file with matching file name in the downloads folder |
stream_hash optional str | set status of file with matching stream hash |
rowid optional int | set status of file with matching row id |
Returns:
↓
(str) Confirmation message
peer
peer_list
Get peers for blob hash
Arguments
blob_hash str | find available peers for this blob hash |
---|---|
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
Returns:
↓
(list) List of contact dictionaries {'address': <peer ip>, 'udp_port': <dht port>, 'tcp_port': <peer port>,
'node_id': <peer node id>}
peer_ping
Send a kademlia ping to the specified peer. If address and port are provided the peer is directly pinged, if not provided the peer is located first.
Returns:
↓
(str) pong, or {'error': <error message>} if an error is encountered
preference
preference_get
Get preference value for key or all values if not key is passed in.
Arguments
key optional str | key associated with value |
---|---|
wallet_id optional str | restrict operation to specific wallet |
Examples
Get preferences
curl -d'{"method": "preference_get", "params": {}}' http://localhost:5279/
lbrynet preference get
requests.post("http://localhost:5279", json={"method": "preference_get", "params": {}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"theme": "dark"
}
}
Returns:
↓
(dict) Dictionary of preference(s)
preference_set
Set preferences
Arguments
key str | key associated with value |
---|---|
value str | key associated with value |
wallet_id optional str | restrict operation to specific wallet |
Examples
Set preference
curl -d'{"method": "preference_set", "params": {"key": "theme", "value": "dark"}}' http://localhost:5279/
lbrynet preference set "theme" "dark"
requests.post("http://localhost:5279", json={"method": "preference_set", "params": {"key": "theme", "value": "dark"}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"theme": "dark"
}
}
Returns:
↓
(dict) Dictionary with key/value of new preference
purchase
purchase_create
Purchase a claim.
Arguments
claim_id optional str | claim id of claim to purchase |
---|---|
url optional str | lookup claim to purchase by url |
wallet_id optional str | restrict operation to specific wallet |
funding_account_ids optional list | ids of accounts to fund this transaction |
allow_duplicate_purchase optional bool | allow purchasing claim_id you already own |
override_max_key_fee optional bool | ignore max key fee for this purchase |
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"
}
purchase_list
List my claim purchases.
Arguments
claim_id optional str | purchases for specific claim |
---|---|
resolve optional str | include resolved claim information |
account_id optional str | id of the account to query |
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 |
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"
}
]
}
settings
settings_clear
Clear daemon settings
Returns:
↓
(dict) Updated dictionary of daemon settings
settings_get
Get daemon settings
Examples
Get settings
curl -d'{"method": "settings_get", "params": {}}' http://localhost:5279/
lbrynet settings get
requests.post("http://localhost:5279", json={"method": "settings_get", "params": {}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"allowed_origin": "",
"announce_head_and_sd_only": true,
"api": "localhost:5279",
"audio_encoder": "aac -b:a 160k",
"blob_download_timeout": 30.0,
"blob_lru_cache_size": 0,
"blob_storage_limit": 0,
"blockchain_name": "lbrycrd_regtest",
"coin_selection_strategy": "prefer_confirmed",
"components_to_skip": [
"dht",
"upnp",
"hash_announcer",
"peer_protocol_server",
"libtorrent_component"
],
"concurrent_blob_announcers": 10,
"concurrent_hub_requests": 32,
"concurrent_reflector_uploads": 10,
"config": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmp_dufqex7/daemon_settings.yml",
"data_dir": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd",
"download_dir": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd",
"download_timeout": 30.0,
"ffmpeg_path": "",
"fixed_peer_delay": 2.0,
"fixed_peers": [
[
"127.0.0.1",
5567
]
],
"hub_timeout": 30.0,
"jurisdiction": null,
"known_dht_nodes": [],
"lbryum_servers": [
[
"localhost",
50002
]
],
"max_connections_per_download": 4,
"max_key_fee": {
"amount": 50.0,
"currency": "USD"
},
"max_wallet_server_fee": "0.0",
"network_interface": "0.0.0.0",
"network_storage_limit": 0,
"node_rpc_timeout": 5.0,
"peer_connect_timeout": 3.0,
"prometheus_port": 0,
"reflect_streams": true,
"reflector_servers": [
[
"127.0.0.1",
5566
]
],
"save_blobs": true,
"save_files": true,
"save_resolved_claims": true,
"share_usage_data": false,
"split_buckets_under_index": 2,
"streaming_get": true,
"streaming_server": "localhost:5280",
"tcp_port": 4444,
"track_bandwidth": true,
"tracker_servers": [
[
"tracker.lbry.com",
9252
],
[
"tracker.lbry.grin.io",
9252
]
],
"transaction_cache_size": 10000,
"udp_port": 4444,
"use_upnp": false,
"video_bitrate_maximum": 5000000,
"video_encoder": "libx264 -crf 24 -preset faster -pix_fmt yuv420p",
"video_scaler": "-vf \"scale=if(gte(iw\\,ih)\\,min(1920\\,iw)\\,-2):if(lt(iw\\,ih)\\,min(1920\\,ih)\\,-2)\" -maxrate 5500K -bufsize 5000K",
"volume_analysis_time": 240,
"volume_filter": "",
"wallet_dir": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpfx0nk2jd",
"wallets": [
"default_wallet"
]
}
}
Returns:
↓
(dict) Dictionary of daemon settings
See ADJUSTABLE_SETTINGS in lbry/conf.py for full list of settings
settings_set
Set daemon settings
Examples
Set settings
curl -d'{"method": "settings_set", "params": {"key": "tcp_port", "value": 99}}' http://localhost:5279/
lbrynet settings set "tcp_port" 99
requests.post("http://localhost:5279", json={"method": "settings_set", "params": {"key": "tcp_port", "value": 99}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"tcp_port": 99
}
}
Returns:
↓
(dict) Updated dictionary of daemon settings
stream
stream_abandon
Abandon one of my stream 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 |
Examples
Abandon a stream claim
curl -d'{"method": "stream_abandon", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream abandon ad25e05aa7dc5e9994869040c6103f9a8728db46
requests.post("http://localhost:5279", json={"method": "stream_abandon", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "preview": false, "blocking": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "010000000134627f9ba4ba51befc3e15e8f60f7151e171618922ef727e1ee5effa87c47075000000006a47304402206abd1bb758c3bac2e23a22e93bf2166d29a27215eb297fd063f823cd3c68898b0220301c9f4dd874a90a877ab135153ba7bb1d9d93de8ed1a5db6d9653ece6c8e46b01210200ae7b8f7a6220cb0f3699aeb1b2f1ce7825554f50b6cf542e63f3018e9852b6ffffffff0134b7f505000000001976a9143bd49c5746cb0cbba81dc36420123d208f30600488ac00000000",
"inputs": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 4,
"height": 214,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
}
],
"outputs": [
{
"address": "mkyJrpgUxpSyVdb6bA36F2cZQfZpWa7Pci",
"amount": "0.999893",
"confirmations": -2,
"height": -2,
"nout": 0,
"timestamp": null,
"txid": "3ef9d8954a84d44a1b3ddf95114e6b77bcbd2cfe5af0d509b1b8a3d9aada3182",
"type": "payment"
}
],
"total_fee": "0.000107",
"total_input": "1.0",
"total_output": "0.999893",
"txid": "3ef9d8954a84d44a1b3ddf95114e6b77bcbd2cfe5af0d509b1b8a3d9aada3182"
}
}
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"
}
stream_cost_estimate
Get estimated cost for a lbry stream
Arguments
uri str | uri to use |
---|
Returns:
↓
(float) Estimated cost in lbry credits, returns None if uri is not
resolvable
stream_create
Make a new stream claim and announce the associated file to lbrynet.
Arguments
name str | name of the content (can only consist of a-z A-Z 0-9 and -(dash)) |
---|---|
bid decimal | amount to back the claim |
file_path optional str | path to file to be associated with name. |
file_name optional str | name of file to be associated with stream. |
file_hash optional str | hash of file to be associated with stream. |
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 |
allow_duplicate_name optional bool | create new claim even if one already exists with given name. default: false. |
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 |
sd_hash optional str | sd_hash of stream |
channel_id optional str | claim id of the publisher channel |
channel_name optional str | name of the 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 |
Examples
Create a stream claim without metadata
curl -d'{"method": "stream_create", "params": {"name": "astream", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpr832hp1x", "validate_file": false, "optimize_file": false, "tags": [], "languages": [], "locations": [], "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream create astream 1.0 /var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpr832hp1x
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "astream", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmpr832hp1x", "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": "01000000016419a92bda9f0ef64bde16f5a322d5668d68d53b4e38eb99b4738f72dbe880de010000006b483045022100d6963914b5e07f2c89f15f743c924919f51bbccbf1382395e54ba31cf67c9d5f02205cad973318f58d2841bda1f4c27be312881d2c32974b25d612106fa99cf53828012103c1b9bc894048c2d8d7091ed0d92d1b9468343eba19470bba436c0c4ee2cccb96ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707238333268703178180b22186170706c69636174696f6e2f6f637465742d73747265616d32309ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c836d7576a9143d39ffed222af9cdea57d6d388ebba0aeda3039d88ac38fb9423000000001976a914152e48d498f73f383b15e73d6504ba35e6f4639e88ac00000000",
"inputs": [
{
"address": "mwtvw9x13nsVo6xkkrt3RFkk5h6TAjgPdK",
"amount": "6.983769",
"confirmations": 4,
"height": 209,
"nout": 1,
"timestamp": 1655141670,
"txid": "de80e8db728f73b499eb384e3bd5688d66d522a3f516de4bf60e9fda2ba91964",
"type": "payment"
}
],
"outputs": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "create",
"confirmations": -2,
"height": -2,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"timestamp": null,
"txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "mhSwvz7Qfuh343S8WrXpPoPcaxbtw7QM5W",
"amount": "5.969662",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344",
"type": "payment"
}
],
"total_fee": "0.014107",
"total_input": "6.983769",
"total_output": "6.969662",
"txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344"
}
}
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"
}
stream_list
List my stream claims.
Arguments
name optional str or list | stream name |
---|---|
claim_id optional str or list | stream id |
is_spent optional bool | shows previous stream updates and abandons |
account_id optional str | id of the account to query |
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 stream to provide additional metadata |
no_totals optional bool | do not calculate the total number of pages and items in result set (significant performance boost) |
Examples
List all your stream claims
curl -d'{"method": "stream_list", "params": {"name": [], "claim_id": [], "is_spent": false, "resolve": false, "no_totals": false}}' http://localhost:5279/
lbrynet stream list
requests.post("http://localhost:5279", json={"method": "stream_list", "params": {"name": [], "claim_id": [], "is_spent": false, "resolve": false, "no_totals": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": 1,
"height": 214,
"is_channel_signature_valid": true,
"is_internal_transfer": false,
"is_my_input": true,
"is_my_output": true,
"is_spent": false,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 5,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": 1655141671,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "create",
"confirmations": 2,
"height": 213,
"is_internal_transfer": false,
"is_my_input": true,
"is_my_output": true,
"is_spent": true,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"timestamp": 1655141671,
"txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
}
],
"page": 1,
"page_size": 20,
"total_items": 2,
"total_pages": 1
}
}
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"
}
]
}
stream_repost
Creates a claim that references an existing stream by its claim id.
Arguments
name str | name of the content (can only consist of a-z A-Z 0-9 and -(dash)) |
---|---|
bid decimal | amount to back the claim |
claim_id str | id of the claim being reposted |
allow_duplicate_name optional bool | create new claim even if one already exists with given name. default: false. |
title optional str | title of the repost |
description optional str | description of the repost |
tags optional list | add repost tags |
channel_id optional str | claim id of the publisher channel |
channel_name optional str | name of the 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"
}
stream_update
Update an existing stream claim and if a new file is provided announce it to lbrynet.
Arguments
claim_id str | id of the stream claim to update |
---|---|
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 and file_path must be specified. |
optimize_file optional bool | transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required and file_path must be specified. |
file_name optional str | override file name, defaults to name from file_path. |
file_size optional str | override file size, otherwise automatically computed. |
file_hash optional str | override file hash, otherwise automatically computed. |
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 |
clear_fee optional bool | clear previously set fee |
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 |
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 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'}" |
clear_locations optional bool | clear existing locations (prior to adding new ones) |
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 |
sd_hash optional str | sd_hash of stream |
channel_id optional str | claim id of the publisher channel |
channel_name optional str | name of the publisher channel |
clear_channel optional bool | remove channel signature |
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 in which to look for stream (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 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 |
replace optional bool | instead of modifying specific values on the stream, this will clear all existing values and only save passed in values, useful for form submissions where all values are always set |
Examples
Update a stream claim to add channel
curl -d'{"method": "stream_update", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "validate_file": false, "optimize_file": false, "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "clear_channel": false, "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}' http://localhost:5279/
lbrynet stream update ad25e05aa7dc5e9994869040c6103f9a8728db46 --channel_id="595c2e2f0c1f59188628fab7503692b0145779a2"
requests.post("http://localhost:5279", json={"method": "stream_update", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "validate_file": false, "optimize_file": false, "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "clear_channel": false, "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"height": -2,
"hex": "010000000244a3bd0e72a6f87a1e2282dadf3a332eb04eba7dac715f14a6ac36288eece7f9000000006a4730440220117bdbc0e547eda333409733aa38ccb4841a7873db6c4a971fcf8f87a7c1553e022007bf22f8573e95012d4918fea61ba8b04a7a10af93aea95fbbffe187ca17621101210200ae7b8f7a6220cb0f3699aeb1b2f1ce7825554f50b6cf542e63f3018e9852b6ffffffffe3d2e954c197eace1e6b39edc7451a2cf9b6e1771a37f8127da3f105e929baac010000006a473044022100e29082b0d9e24dc0a9622856ab499725155e379a323575be3ccda6472970e330021f652654fcbad99cbadbf22cf8f876a597f672ba86d4b5e53e400af23914ff200121038af0e4f3c8d08223532f5ade7d5da0203b676b3445a8791c955f8d0f868b2c18ffffffff0200e1f50500000000fd2301b7076173747265616d1446db28879a3f10c640908694995edca75ae025ad4ce801a2795714b0923650b7fa288618591f0c2f2e5c5961baf110460a527e38b68f0653c1c79f2cae1f57ade55c009fb7578175c9d93d7edb0546d1378e1d33d99df8df0d5cfe9e7a5b63053a4e7ce003f95f5890b27f0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d707238333268703178180b22186170706c69636174696f6e2f6f637465742d73747265616d32309ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c836d6d76a9143d39ffed222af9cdea57d6d388ebba0aeda3039d88ac22abd205000000001976a91434ab169b2f32ccd430bc73f2c2116f48b907267d88ac00000000",
"inputs": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "create",
"confirmations": 1,
"height": 213,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"timestamp": 1655141671,
"txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "muXoymiRVLaS1FXJSgPjieSedrWPgUgEkK",
"amount": "0.9772565",
"confirmations": 3,
"height": 211,
"nout": 1,
"timestamp": 1655141670,
"txid": "acba29e905f1a37d12f8371a77e1b6f92c1a45c7ed396b1eceea97c154e9d2e3",
"type": "payment"
}
],
"outputs": [
{
"address": "mm6gzeSV7hiGxtAv3rQjo3sRYtCDGD4t2M",
"amount": "1.0",
"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46",
"claim_op": "update",
"confirmations": -2,
"height": -2,
"is_channel_signature_valid": true,
"meta": {},
"name": "astream",
"normalized_name": "astream",
"nout": 0,
"permanent_url": "lbry://astream#ad25e05aa7dc5e9994869040c6103f9a8728db46",
"signing_channel": {
"address": "muRaaMs12imkZJQofvBuLbAFYAs6TiQPAQ",
"amount": "1.0",
"claim_id": "595c2e2f0c1f59188628fab7503692b0145779a2",
"claim_op": "update",
"confirmations": 4,
"has_signing_key": true,
"height": 210,
"meta": {},
"name": "@channel",
"normalized_name": "@channel",
"nout": 0,
"permanent_url": "lbry://@channel#595c2e2f0c1f59188628fab7503692b0145779a2",
"timestamp": 1655141670,
"txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
"type": "claim",
"value": {
"public_key": "03bbf11fc85401781301f36897b5b01b0aef440db5d6fb0747900b8c69e40e55e5",
"public_key_id": "moF9EgZauGirwqpwZ7NgVsCAxddcPABTfm",
"title": "New Channel"
},
"value_type": "channel"
},
"timestamp": null,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "claim",
"value": {
"source": {
"hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
"media_type": "application/octet-stream",
"name": "tmpr832hp1x",
"sd_hash": "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
"size": "11"
},
"stream_type": "binary"
},
"value_type": "stream"
},
{
"address": "mkKSPTEMxFHfbYE8dYMmczn3BCJRg4LoHQ",
"amount": "0.9769245",
"confirmations": -2,
"height": -2,
"nout": 1,
"timestamp": null,
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
"type": "payment"
}
],
"total_fee": "0.000332",
"total_input": "1.9772565",
"total_output": "1.9769245",
"txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234"
}
}
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"
}
support
support_abandon
Abandon supports, including tips, of a specific claim, optionally keeping some amount as supports.
Arguments
claim_id optional str | claim_id of the support to abandon |
---|---|
txid optional str | txid of the claim to abandon |
nout optional int | nout of the claim to abandon |
keep optional decimal | amount of lbc to keep as support |
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"
}
support_create
Create a support or a tip for name claim.
Arguments
claim_id str | claim_id of the claim to support |
---|---|
amount decimal | amount of support |
tip optional bool | send support to claim owner, default: false. |
channel_id optional str | claim id of the supporters identity channel |
channel_name optional str | name of the supporters identity 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 |
comment optional str | add a comment to the support |
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"
}
support_list
List staked supports and sent/received tips.
Arguments
name optional str or list | claim name |
---|---|
claim_id optional str or list | claim id |
received optional bool | only show received (tips) |
sent optional bool | only show sent (tips) |
staked optional bool | only show my staked supports |
is_spent optional bool | show abandoned supports |
account_id optional str | id of the account to query |
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 |
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"
}
]
}
support_sum
List total staked supports for a claim, grouped by the channel that signed the support. If claim_id is a channel claim, you can use --include_channel_content to also include supports for content claims in the channel. !!!! NOTE: PAGINATION DOES NOT DO ANYTHING AT THE MOMENT !!!!!
Arguments
claim_id optional str | claim id |
---|---|
new_sdk_server optional str | URL of the new SDK server (EXPERIMENTAL) |
include_channel_content optional bool | if claim_id is for a channel, include supports for claims in that channel |
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": [
"glorious data in dictionary"
]
}
sync
sync_apply
Apply incoming synchronization data, if provided, and return a sync hash and update wallet data. Wallet must be unlocked to perform this operation. If "encrypt-on-disk" preference is True and supplied password is different from local password, or there is no local password (because local wallet was not encrypted), then the supplied password will be used for local encryption (overwriting previous local encryption password).
Arguments
password optional str | password to decrypt incoming and encrypt outgoing data |
---|---|
data optional str | incoming sync data, if any |
wallet_id optional str | wallet being sync'ed |
blocking optional bool | wait until any new accounts have sync'ed |
Returns:
↓
(map) sync hash and data
sync_hash
Deterministic hash of the wallet.
Arguments
wallet_id optional str | wallet for which to generate hash |
---|
Returns:
↓
(str) sha256 hash of wallet
tracemalloc
tracemalloc_disable
Disable tracemalloc memory tracing
Returns:
↓
(bool) is it tracing?
tracemalloc_enable
Enable tracemalloc memory tracing
Returns:
↓
(bool) is it tracing?
tracemalloc_top
Show most common objects, the place that created them and their size.
Arguments
items int | maximum items to return, from the most common |
---|
Returns:
↓
(dict) dictionary containing most common objects in memory
{
"line": (str) filename and line number where it was created,
"code": (str) code that created it,
"size": (int) size in bytes, for each "memory block",
"count" (int) number of memory blocks
}
transaction
transaction_list
List transactions belonging to wallet
Arguments
account_id optional str | id of the account to query |
---|---|
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 |
Examples
List your transactions
curl -d'{"method": "transaction_list", "params": {}}' http://localhost:5279/
lbrynet transaction list
requests.post("http://localhost:5279", json={"method": "transaction_list", "params": {}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"abandon_info": [],
"claim_info": [],
"confirmations": 1,
"date": "2022-06-13 13:34",
"fee": "-0.000124",
"purchase_info": [],
"support_info": [],
"timestamp": 1655141670,
"txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8",
"update_info": [],
"value": "0.0"
},
{
"abandon_info": [],
"claim_info": [],
"confirmations": 7,
"date": "2022-06-13 13:34",
"fee": "0.0",
"purchase_info": [],
"support_info": [],
"timestamp": 1655141669,
"txid": "1c584e33328e7616e4b52ab4a919267757ad58a2911e1c0954a0fd0e139c482a",
"update_info": [],
"value": "10.0"
}
],
"page": 1,
"page_size": 20,
"total_items": 2,
"total_pages": 1
}
}
Returns:
↓
(list) List of transactions
{
"claim_info": (list) claim info if in txn [{
"address": (str) address of claim,
"balance_delta": (float) bid amount,
"amount": (float) claim amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"abandon_info": (list) abandon info if in txn [{
"address": (str) address of abandoned claim,
"balance_delta": (float) returned amount,
"amount": (float) claim amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"confirmations": (int) number of confirmations for the txn,
"date": (str) date and time of txn,
"fee": (float) txn fee,
"support_info": (list) support info if in txn [{
"address": (str) address of support,
"balance_delta": (float) support amount,
"amount": (float) support amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"is_tip": (bool),
"nout": (int) nout
}],
"timestamp": (int) timestamp,
"txid": (str) txn id,
"update_info": (list) update info if in txn [{
"address": (str) address of claim,
"balance_delta": (float) credited/debited
"amount": (float) absolute amount,
"claim_id": (str) claim id,
"claim_name": (str) claim name,
"nout": (int) nout
}],
"value": (float) value of txn
}
transaction_show
Get a decoded transaction from a txid
Arguments
txid str | txid of the transaction |
---|
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"
}
txo
txo_list
List my transaction outputs.
Arguments
type optional str or list | claim type: stream, channel, support, purchase, collection, repost, other |
---|---|
txid optional str or list | transaction id of outputs |
claim_id optional str or list | claim id |
channel_id optional str or list | claims in this channel |
not_channel_id optional str or list | claims not in this channel |
name optional str or list | claim name |
is_spent optional bool | only show spent txos |
is_not_spent optional bool | only show not spent txos |
is_my_input_or_output optional bool | txos which have your inputs or your outputs, if using this flag the other related flags are ignored (--is_my_output, --is_my_input, etc) |
is_my_output optional bool | show outputs controlled by you |
is_not_my_output optional bool | show outputs not controlled by you |
is_my_input optional bool | show outputs created by you |
is_not_my_input optional bool | show outputs not created by you |
exclude_internal_transfers optional bool | excludes any outputs that are exactly this combination: "--is_my_input --is_my_output --type=other" this allows to exclude "change" payments, this flag can be used in combination with any of the other flags |
include_received_tips optional bool | calculate the amount of tips received for claim outputs |
account_id optional str | id of the account to query |
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 claim to provide additional metadata |
order_by optional str | field to order by: 'name', 'height', 'amount' and 'none' |
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"
}
]
}
txo_plot
Plot transaction output sum over days.
Arguments
type optional str or list | claim type: stream, channel, support, purchase, collection, repost, other |
---|---|
txid optional str or list | transaction id of outputs |
claim_id optional str or list | claim id |
name optional str or list | claim name |
channel_id optional str or list | claims in this channel |
not_channel_id optional str or list | claims not in this channel |
is_spent optional bool | only show spent txos |
is_not_spent optional bool | only show not spent txos |
is_my_input_or_output optional bool | txos which have your inputs or your outputs, if using this flag the other related flags are ignored (--is_my_output, --is_my_input, etc) |
is_my_output optional bool | show outputs controlled by you |
is_not_my_output optional bool | show outputs not controlled by you |
is_my_input optional bool | show outputs created by you |
is_not_my_input optional bool | show outputs not created by you |
exclude_internal_transfers optional bool | excludes any outputs that are exactly this combination: "--is_my_input --is_my_output --type=other" this allows to exclude "change" payments, this flag can be used in combination with any of the other flags |
account_id optional str | id of the account to query |
wallet_id optional str | restrict results to specific wallet |
days_back optional int | number of days back from today (not compatible with --start_day, --days_after, --end_day) |
start_day optional date | start on specific date (YYYY-MM-DD) (instead of --days_back) |
days_after optional int | end number of days after --start_day (instead of --end_day) |
end_day optional date | end on specific date (YYYY-MM-DD) (instead of --days_after) |
Returns:
↓
List[Dict]
txo_spend
Spend transaction outputs, batching into multiple transactions as necessary.
Arguments
type optional str or list | claim type: stream, channel, support, purchase, collection, repost, other |
---|---|
txid optional str or list | transaction id of outputs |
claim_id optional str or list | claim id |
channel_id optional str or list | claims in this channel |
not_channel_id optional str or list | claims not in this channel |
name optional str or list | claim name |
is_my_input optional bool | show outputs created by you |
is_not_my_input optional bool | show outputs not created by you |
exclude_internal_transfers optional bool | excludes any outputs that are exactly this combination: "--is_my_input --is_my_output --type=other" this allows to exclude "change" payments, this flag can be used in combination with any of the other flags |
account_id optional str | id of the account to query |
wallet_id optional str | restrict results to specific wallet |
preview optional bool | do not broadcast the transaction |
blocking optional bool | wait until abandon is in mempool |
batch_size optional int | number of txos to spend per transactions |
include_full_tx optional bool | include entire tx in output and not just the txid |
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"
}
]
txo_sum
Sum of transaction outputs.
Arguments
type optional str or list | claim type: stream, channel, support, purchase, collection, repost, other |
---|---|
txid optional str or list | transaction id of outputs |
claim_id optional str or list | claim id |
name optional str or list | claim name |
channel_id optional str or list | claims in this channel |
not_channel_id optional str or list | claims not in this channel |
is_spent optional bool | only show spent txos |
is_not_spent optional bool | only show not spent txos |
is_my_input_or_output optional bool | txos which have your inputs or your outputs, if using this flag the other related flags are ignored (--is_my_output, --is_my_input, etc) |
is_my_output optional bool | show outputs controlled by you |
is_not_my_output optional bool | show outputs not controlled by you |
is_my_input optional bool | show outputs created by you |
is_not_my_input optional bool | show outputs not created by you |
exclude_internal_transfers optional bool | excludes any outputs that are exactly this combination: "--is_my_input --is_my_output --type=other" this allows to exclude "change" payments, this flag can be used in combination with any of the other flags |
account_id optional str | id of the account to query |
wallet_id optional str | restrict results to specific wallet |
Returns:
↓
int
utxo
utxo_list
List unspent transaction outputs
Arguments
account_id optional str | id of the account to query |
---|---|
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 |
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"
}
]
}
utxo_release
When spending a UTXO it is locally locked to prevent double spends; occasionally this can result in a UTXO being locked which ultimately did not get spent (failed to broadcast, spend transaction was not accepted by blockchain node, etc). This command releases the lock on all UTXOs in your account.
Arguments
account_id optional str | id of the account to query |
---|---|
wallet_id optional str | restrict operation to specific wallet |
Returns:
↓
None
wallet
wallet_add
Add existing wallet.
Arguments
wallet_id str | wallet file name |
---|
Returns:
↓
{
"id": "wallet_id",
"name": "optional wallet name"
}
wallet_balance
Return the balance of a wallet
Arguments
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
wallet_create
Create a new wallet.
Arguments
wallet_id str | wallet file name |
---|---|
skip_on_startup optional bool | don't add wallet to daemon_settings.yml |
create_account optional bool | generates the default account |
single_key optional bool | used with --create_account, creates single-key account |
Returns:
↓
{
"id": "wallet_id",
"name": "optional wallet name"
}
wallet_decrypt
Decrypt an encrypted wallet, this will remove the wallet password. The wallet must be unlocked to decrypt it
Arguments
wallet_id optional str | restrict operation to specific wallet |
---|
Returns:
↓
(bool) true if wallet is decrypted, otherwise false
wallet_encrypt
Encrypt an unencrypted wallet with a password
Arguments
new_password str | password to encrypt account |
---|---|
wallet_id optional str | restrict operation to specific wallet |
Returns:
↓
(bool) true if wallet is decrypted, otherwise false
wallet_list
List wallets.
Arguments
wallet_id optional str | show specific wallet only |
---|---|
page optional int | page to return during paginating |
page_size optional int | number of items on page during pagination |
Examples
List your wallets
curl -d'{"method": "wallet_list", "params": {}}' http://localhost:5279/
lbrynet wallet list
requests.post("http://localhost:5279", json={"method": "wallet_list", "params": {}}).json()
Output:
↓
{
"jsonrpc": "2.0",
"result": {
"items": [
{
"id": "my_wallet.json",
"name": "Wallet"
}
],
"page": 1,
"page_size": 20,
"total_items": 1,
"total_pages": 1
}
}
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": "wallet_id",
"name": "optional wallet name"
}
]
}
wallet_lock
Lock an unlocked wallet
Arguments
wallet_id optional str | restrict operation to specific wallet |
---|
Returns:
↓
(bool) true if wallet is locked, otherwise false
wallet_reconnect
Reconnects ledger network client, applying new configurations.
Returns:
↓
None
wallet_remove
Remove an existing wallet.
Arguments
wallet_id str | name of wallet to remove |
---|
Returns:
↓
{
"id": "wallet_id",
"name": "optional wallet name"
}
wallet_send
Send the same number of credits to multiple addresses using all accounts in wallet to fund the transaction and the default account to receive any change.
Arguments
wallet_id optional str | restrict operation to specific wallet |
---|---|
change_account_id optional str | account where change will go |
funding_account_ids optional str | accounts to fund the transaction |
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"
}
wallet_status
Status of wallet including encryption/lock state.
Arguments
wallet_id optional str | status of specific wallet |
---|
Returns:
↓
Dictionary of wallet status information.
wallet_unlock
Unlock an encrypted wallet
Arguments
password str | password to use for unlocking |
---|---|
wallet_id optional str | restrict operation to specific wallet |
Returns:
↓
(bool) true if wallet is unlocked, otherwise false