lbry-sdk master

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

You can find the repo for this API on GitHub:

https://github.com/lbryio/lbry-sdk

ffmpeg_find

Get ffmpeg installation information

Arguments

Returns

(dict) Dictionary of ffmpeg information
{
    'available': (bool) found ffmpeg,
    'which': (str) path to ffmpeg,
    'analyze_audio_volume': (bool) should ffmpeg analyze audio
}
// example(s) to come later

get

Download stream from a LBRY name.

Arguments

  • uri
    optionalstr
    uri of the content to download
  • file_name
    optionalstr
    specified name for the downloaded file, overrides the stream file name
  • download_directory
    optionalstr
    full path to the directory to download into
  • timeout
    optionalint
    download timeout in number of seconds
  • save_file
    optionalbool
    save the file to the downloads directory
  • wallet_id
    optionalstr
    wallet to check for claim purchase receipts

Returns

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

Get a file


curl -d'{"method": "get", "params": {"uri": "astream#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
  }
}

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
    optionaldecimal
    amount to back the claim
  • file_path
    optionalstr
    path to file to be associated with name.
  • file_name
    optionalstr
    name of file to be associated with stream.
  • file_hash
    optionalstr
    hash of file to be associated with stream.
  • validate_file
    optionalbool
    validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required
  • optimize_file
    optionalbool
    transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    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
    optionallist
    add content tags
  • languages
    optionallist
    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
    optionallist
    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
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • sd_hash
    optionalstr
    sd_hash of stream
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool

Returns

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

Publish a file


curl -d'{"method": "publish", "params": {"name": "a-new-stream", "bid": "1.0", "file_path": "/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"
  }
}

resolve

Get the claim that a URL refers to.

Arguments

  • urls
    optionalstr, list
    one or more urls to resolve
  • wallet_id
    optionalstr
    wallet to check for claim purchase receipts
  • new_sdk_server
    optionalstr
    URL of the new SDK server (EXPERIMENTAL)
  • include_purchase_receipt
    optionalbool
    lookup and include a receipt if this wallet has purchased the claim being resolved
  • include_is_my_output
    optionalbool
    lookup and include a boolean indicating if claim being resolved is yours
  • include_sent_supports
    optionalbool
    lookup and sum the total amount of supports you've made to this claim
  • include_sent_tips
    optionalbool
    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
    optionalbool
    lookup and sum the total amount of tips you've received to this claim (only makes sense when claim is yours)

Returns

Dictionary of results, keyed by url
'': {
        If a resolution error occurs:
        'error': Error message

        If the url resolves to a channel or a claim in a channel:
        'certificate': {
            'address': (str) claim address,
            'amount': (float) claim amount,
            'effective_amount': (float) claim amount including supports,
            'claim_id': (str) claim id,
            'claim_sequence': (int) claim sequence number (or -1 if unknown),
            'decoded_claim': (bool) whether or not the claim value was decoded,
            'height': (int) claim height,
            'confirmations': (int) claim depth,
            'timestamp': (int) timestamp of the block that included this claim tx,
            'has_signature': (bool) included if decoded_claim
            'name': (str) claim name,
            'permanent_url': (str) permanent url of the certificate claim,
            'supports: (list) list of supports [{'txid': (str) txid,
                                                 'nout': (int) nout,
                                                 'amount': (float) amount}],
            'txid': (str) claim txid,
            'nout': (str) claim nout,
            'signature_is_valid': (bool), included if has_signature,
            'value': ClaimDict if decoded, otherwise hex string
        }

        If the url resolves to a channel:
        'claims_in_channel': (int) number of claims in the channel,

        If the url resolves to a claim:
        'claim': {
            'address': (str) claim address,
            'amount': (float) claim amount,
            'effective_amount': (float) claim amount including supports,
            'claim_id': (str) claim id,
            'claim_sequence': (int) claim sequence number (or -1 if unknown),
            'decoded_claim': (bool) whether or not the claim value was decoded,
            'height': (int) claim height,
            'depth': (int) claim depth,
            'has_signature': (bool) included if decoded_claim
            'name': (str) claim name,
            'permanent_url': (str) permanent url of the claim,
            'channel_name': (str) channel name if claim is in a channel
            'supports: (list) list of supports [{'txid': (str) txid,
                                                 'nout': (int) nout,
                                                 'amount': (float) amount}]
            'txid': (str) claim txid,
            'nout': (str) claim nout,
            'signature_is_valid': (bool), included if has_signature,
            'value': ClaimDict if decoded, otherwise hex string
        }
}

Resolve a claim


curl -d'{"method": "resolve", "params": {"urls": ["astream#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"
    }
  }
}

routing_table_get

Get DHT routing information

Arguments

Returns

(dict) dictionary containing routing and peer information
{
    "buckets": {
        : [
            {
                "address": (str) peer address,
                "udp_port": (int) peer udp port,
                "tcp_port": (int) peer tcp port,
                "node_id": (str) peer node id,
            }
        ]
    },
    "node_id": (str) the local dht node id
    "prefix_neighbors_count": (int) the amount of peers sharing the same byte prefix of the local node id
}
// example(s) to come later

status

Get daemon status

Arguments

Returns

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

Get status


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "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
    }
  }
}

stop

Stop lbrynet API server.

Arguments

Returns

(string) Shutdown message
// example(s) to come later

version

Get lbrynet API server version information

Arguments

Returns

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

Get version


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "build": "dev",
    "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"
  }
}

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
    optionalstr
    seed to generate new account from
  • private_key
    optionalstr
    private key for new account
  • public_key
    optionalstr
    public key for new account
  • single_key
    optionalbool
    create single key account, default is multi-key
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

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

Add an account from seed


curl -d'{"method": "account_add", "params": {"account_name": "new account", "seed": "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"
  }
}

account_balance

Return the balance of an account

Arguments

  • account_id
    optionalstr
    If provided only the balance for this account will be given. Otherwise default account.
  • wallet_id
    optionalstr
    balance for specific wallet
  • confirmations
    optionalint
    Only include transactions with this many confirmed blocks.

Returns

(decimal) amount of lbry credits in wallet

Get default account balance


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

Output


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

Get balance for specific account by id


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

Output


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

account_create

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

Arguments

  • account_name
    str
    name of the account to create
  • single_key
    optionalbool
    create single key account, default is multi-key
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

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

Create an account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "address_generator": {
      "change": {
        "gap": 6,
        "maximum_uses_per_address": 1
      },
      "name": "deterministic-chain",
      "receiving": {
        "gap": 20,
        "maximum_uses_per_address": 1
      }
    },
    "encrypted": false,
    "id": "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"
  }
}

account_deposit

Spend a time locked transaction into your account.

Arguments

  • txid
    optionalstr
    id of the transaction
  • nout
    optionalint
    output number in the transaction
  • redeem_script
    optionalstr
    redeem script for output
  • private_key
    optionalstr
    private key to sign transaction
  • to_account
    optionalstr
    deposit to this account
  • wallet_id
    optionalstr
    limit operation to specific wallet.
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until tx has synced

Returns

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

account_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
    optionalstr
    send to this account
  • from_account
    optionalstr
    spend from this account
  • amount
    decimal
    the amount to transfer lbc
  • everything
    optionalbool
    transfer everything (excluding claims), default: false.
  • outputs
    optionalint
    split payment across many outputs, default: 1.
  • wallet_id
    optionalstr
    limit operation to specific wallet.
  • broadcast
    optionalbool
    actually broadcast the transaction, default: false.

Returns

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

Transfer 2 LBC from default account to specific account


curl -d'{"method": "account_fund", "params": {"to_account": "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"
  }
}

Spread LBC between multiple addresses


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001b8749850c50b2d456a0d54ab618c516f9f80a6f1dc7977dab4ca230e775931f0000000006b48304502210087b512d6b2772190e417f1b4252c0905d09c98eab3a229e3a3f2ab3bda11f2c7022030d2be08ee86c4b1e3899cebea7e1a5b68c74022502e57cc7b141c083fac45b401210232b7e745cbafb7b3506b71afe38ba9a1c049aec1426c3e5442b246604a14c5f6ffffffff03c0687804000000001976a9144f694178c5f66475002876866115a8a74177fcba88acc0687804000000001976a9144f694178c5f66475002876866115a8a74177fcba88ac6cb9fa02000000001976a9140e92a8bca34238d407745d94fc5b21f0e39f518888ac00000000",
    "inputs": [
      {
        "address": "mgr1So3484shNr8kNMsavaohFwwRm9AnFU",
        "amount": "2.0",
        "confirmations": 1,
        "height": 207,
        "nout": 0,
        "timestamp": 1655141670,
        "txid": "f03159770e23cab4da7779dcf1a6809f6f518c61ab540d6a452d0bc5509874b8",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mnkqmWKPUwkeDuq7pndpfrzXFQDmH9QTBo",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      },
      {
        "address": "mnkqmWKPUwkeDuq7pndpfrzXFQDmH9QTBo",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      },
      {
        "address": "mgr1So3484shNr8kNMsavaohFwwRm9AnFU",
        "amount": "0.499859",
        "confirmations": -2,
        "height": -2,
        "nout": 2,
        "timestamp": null,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      }
    ],
    "total_fee": "0.000141",
    "total_input": "2.0",
    "total_output": "1.999859",
    "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561"
  }
}

Transfer all LBC to a specified account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000003615517b8ac960bf2dddcb710b5ab9d10ad4775706c5f6e2bde911de71b06aeb1000000006a473044022070ccee08cbef735f798b9b29f5fc0f3e6541c4c32178b8ef5d8f45c3789e29ff02203df22817e856760c6453e7c869832fa385ab5284e8f8bd97815ded9f2b2a14bb012103087f88b56b3724117f595eabb5ac5282b9e73842f11c47ad1d20de6d856e72b5ffffffff615517b8ac960bf2dddcb710b5ab9d10ad4775706c5f6e2bde911de71b06aeb1010000006b483045022100d183c50ecdff7371e9a411e0252bab59d3b55984ddfc0b8adaa32087b67114a8022020003d8932c41cd71006e00eb346fa624d64b634c45ff12b8c1b3a4fd8b38a58012103087f88b56b3724117f595eabb5ac5282b9e73842f11c47ad1d20de6d856e72b5ffffffff615517b8ac960bf2dddcb710b5ab9d10ad4775706c5f6e2bde911de71b06aeb1020000006a473044022072d277ab8cdbcc3bbe4ffdcf6e34c55ab0de334f5ffbb3417690ac6e6cfea20d02206302c2026251b84b420427baaf91edcd93ab26264aff676816bbc80b70e05c3301210232b7e745cbafb7b3506b71afe38ba9a1c049aec1426c3e5442b246604a14c5f6ffffffff015027eb0b000000001976a914d90aac550e652c485f8c75585fa9bdf7b56c0f0c88ac00000000",
    "inputs": [
      {
        "address": "mnkqmWKPUwkeDuq7pndpfrzXFQDmH9QTBo",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "nout": 0,
        "timestamp": 1655141670,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      },
      {
        "address": "mnkqmWKPUwkeDuq7pndpfrzXFQDmH9QTBo",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "nout": 1,
        "timestamp": 1655141670,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      },
      {
        "address": "mgr1So3484shNr8kNMsavaohFwwRm9AnFU",
        "amount": "0.499859",
        "confirmations": 1,
        "height": 208,
        "nout": 2,
        "timestamp": 1655141670,
        "txid": "b1ae061be71d91de2b6e5f6c707547ad109dabb510b7dcddf20b96acb8175561",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n1JZiGPzhiFUPTysS5PABHjdiRqfWNMSaX",
        "amount": "1.999604",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "40747da878033aa34fa25310b12e9625d820cfb9be384254863c59ed6bc3c0e8",
        "type": "payment"
      }
    ],
    "total_fee": "0.000255",
    "total_input": "1.999859",
    "total_output": "1.999604",
    "txid": "40747da878033aa34fa25310b12e9625d820cfb9be384254863c59ed6bc3c0e8"
  }
}

account_list

List details of all of the accounts or a specific account.

Arguments

  • account_id
    optionalstr
    If provided only the balance for this account will be given
  • wallet_id
    optionalstr
    accounts in specific wallet
  • confirmations
    optionalint
    required confirmations (default: 0)
  • include_claims
    optionalbool
    include claims, requires than a LBC account is specified (default: false)
  • show_seed
    optionalbool
    show the seed for the account
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

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

List your accounts


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address_generator": {
          "change": {
            "gap": 6,
            "maximum_uses_per_address": 1
          },
          "name": "deterministic-chain",
          "receiving": {
            "gap": 20,
            "maximum_uses_per_address": 1
          }
        },
        "certificates": 0,
        "coins": 10.0,
        "encrypted": false,
        "id": "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
  }
}

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
    optionalstr
    restrict operation to specific wallet

Returns

(map) maximum gap for change and receiving addresses
// example(s) to come later

account_remove

Remove an existing account.

Arguments

  • account_id
    str
    id of the account to remove
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

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

Remove an account


curl -d'{"method": "account_remove", "params": {"account_id": "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"
  }
}

account_send

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

Arguments

  • account_id
    optionalstr
    account to fund the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until tx has synced

Returns

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

account_set

Change various settings on an account.

Arguments

  • account_id
    str
    id of the account to change
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • default
    optionalbool
    make this account the default
  • new_name
    optionalstr
    new name for the account
  • receiving_gap
    optionalint
    set the gap for receiving addresses
  • receiving_max_uses
    optionalint
    set the maximum number of times to use a receiving address
  • change_gap
    optionalint
    set the gap for change addresses
  • change_max_uses
    optionalint
    set the maximum number of times to use a change address

Returns

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

Modify maximum number of times a change address can be reused


curl -d'{"method": "account_set", "params": {"account_id": "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"
  }
}

address_is_mine

Checks if an address is associated with the current wallet.

Arguments

  • address
    str
    address to check
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(bool) true, if address is associated with current wallet

Check if address is mine


curl -d'{"method": "address_is_mine", "params": {"address": "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
}

address_list

List account addresses or details of single address.

Arguments

  • address
    optionalstr
    just show details for single address
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

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

List addresses in default account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "account": "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
  }
}

List addresses in specified account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mgPgMEPSvErRFvVihFmUrSD6W84u4TA7Hv",
        "pubkey": "tpubDA9GDAntyJu4VrQXCBni5u3bPJu4qHp6SPKn4eanRKvXfRgQSXHPTT5fW74hcEG68sg2eUPpA1HZeqEQaHJgNZFBuDi6pGenPASE9rwpPkt",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mgr1So3484shNr8kNMsavaohFwwRm9AnFU",
        "pubkey": "tpubDA9GDAntyJu4GoY24GN59DWm4A3uux8Gv71kD1fw85Nt7o4ZtdACNjM5ZE2gSN1GYrGYXoz8mzXoQRbPUQs4JTqARTSt5Faco4HM41rJTgf",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mguUfyvvbYuEWiXxKWCWp8dsvphC374QKC",
        "pubkey": "tpubDA9GDAntyJu4MQvij6HQg6Wc2Q2uWj7CAVoMnqsueh118giBDp2TYv1fXdgV2tPPvmXtwDqf99RNrcSn5YXXcELhd9msNEPw9hLPucG6CpE",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mhBjCUYvnJw7pLYyfyG3xzDohfJmwMjntM",
        "pubkey": "tpubDA9GDAntyJu4Jgaa9TzJ652wFyuLwBgMgaDKNFbMGhu7oNTpkuuB36ALmtRvtFCkozkSrZogj4dcuW246R9m3Nsm2d69oacBzbeiuyPCtQt",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mhfBgZWfPDF7wD6h97admwDYdaNs1SXafX",
        "pubkey": "tpubDA9GDAntyJu4zZ1UjFJcgC2zx8okqHedbh1scNYtEThVR53SJKr32oGq2LjUoz35Q7gBqQRcv67JiLVjtes5jpuQbjiaEio9iUmHDyQQCfK",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mi2aTSX87vtAg1QJoW6sP61cByjWgmv9sf",
        "pubkey": "tpubDA9GDAntyJu4MqkRoL5tDyCk12Mah17UjSYoev1pGqe9M5ZsbdmNDpDCpadXX3sgSKfarF7EDoitqnr5ixCvr6ReAF6wdaKMKJnsrVdeNL4",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mjPQuMg9VLMfJBRMTLkK5tc1F4v83EZuSG",
        "pubkey": "tpubDA9GDAntyJu4REycnhURTm9svTtCshEKdSKfA2hdmDWaM4Nh13NbppVuQ37G5rPQ26B5rfEw8fMQk3hPGnZ62bCB2Qq7b7wXLnnGqqFTNcT",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mjwhcGupeMHK5vPM3SftKjyPycFbFLYw9E",
        "pubkey": "tpubDA9GDAntyJu4oKFXbsX3iGqRfBiVZqQKinVB28dzjTYJWwP4bEURX6ogBUhvXwUqTDXX84v1Z6gBeoKQxTs3XKt55fk72NHf1VyRYmWco44",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mm29WyoMPQPJq7QVJGjtbxTvmPW1jL4KbF",
        "pubkey": "tpubDA9GDAntyJu4etnuFGKHEnL5VnoeExkX3o1KxcFyQQGYgRRSmKSYGGQcZjwH4GSpjnLSVhguac3aBRQYqB1C3c2GcD63EeWo4JtMZhExRpe",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mm6ju92EAUoX3Kx8yKMRDvV1Yw8fnMCbwJ",
        "pubkey": "tpubDA9GDAntyJu4NNzPx3B2mGLM3eqA8ocs77UZeA15ny7XLE3gCJoYCFpF8i6UU5UQc2qDZVwnhmwyUpriaaTCTNWBqZVpKbaCEjKFfvaJuog",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mnBXVNxS4Xs8xg3AzrQbfcjtBSmivXoh4n",
        "pubkey": "tpubDA9GDAntyJu4TV1sWBpVyD9DWnsH4m6vLKsv7ZurM71veSumgBymKN7BGT7DqCd2udCpDEaeRLX2A9XfD8h84yaJTpCvBiQs9gnQDXKNgi1",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mpPkZYKWvde2ycPeBwCPW4n1ZC4Z9dti8f",
        "pubkey": "tpubDA9GDAntyJu4F6uszUizCBJBZLn78LwFFXQkcJ6PpqBouLU2iFKVwZ4GPY6r4QvYjrvJ8UPJ8hyemLcxecveUmFeEJmH27ZBC3xkabgfaPn",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mpURY7Y9WPTf4yStztmtdiqnJEip3rzKdz",
        "pubkey": "tpubDA9GDAntyJu522u6TeHwazDETcpokjNqmmoJkdVDzqrYp6HGDo5RQAWpgBFAM18D9dfrqdoT3SXYShDneC8RLqZySidcuFfh85LaAtTXHaq",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mpaJaBdSVWmhvAx5M1DaHt5zZTbXhFiiLE",
        "pubkey": "tpubDA9GDAntyJu4sqMt3KuJpS1jL77fsZq2on7goPwczD4kTRCZHaMSFdggg7NsrrJgRUnyPq2t4WmW9EEbf9j5hTbW8ZVQK5hvkxxnWkQW9zY",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mszRRxz2VQZKsAKthY9heSB5xwdakZ6gkw",
        "pubkey": "tpubDA9GDAntyJu4xMmBekaRLedHLNdx6ksxZajRv7imPf5XFpciQKXDRPCv5rJ9oUDWX2oGp8JccjG4p3TY66wVhxXd77sDD3qDGjnMWJ9ZyFs",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mu6r6EMyp6nnwmydoFDaokhsaKndxxW4HY",
        "pubkey": "tpubDA9GDAntyJu4LXiLsMzUnVbqkRZv2aVv83v3PrhKatPww5wMr1H6t2bGSNBxTaTbr2Bhf1Ppm8AiE6jnQemf4rrYv5Fz6XujqBQADAm1k74",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mykwrnckz6sZ2KEe5Wpagt7SjPJdXF6m2V",
        "pubkey": "tpubDA9GDAntyJu4FiP8EBnyFjKgM7BzYai8Q5HZSr2Z4SRy3j2Zs47ivz1KvNZKDqF33Ljs3mrBUFgKycnqKHNY3AKe3WKZj8kyEAuBZNuPtvH",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "myqynCQQm83z7bjz1rJpFzv8aZxheNoosq",
        "pubkey": "tpubDA9GDAntyJu4YzqpSUC4UfUEEgWMowZmbpJRhRFS6WyLnN1hADYUty5dWxnUg6NccpNmQFL9kBWnoBiLEMoJuSdjbNZwr3tA8LZgh5byreV",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mzSzaNd9c3QoGiXESZcxv9vmwP2V7ujZJg",
        "pubkey": "tpubDA9GDAntyJu4iUzB1QVZ9ckBNHsM1WTHubjkDHpvCmeJYXvMdw6WABx9uJWQ8nFpEz8gd6sWDxSkkh9wbTTx4QH1XaNN4KSxtqxB3BQcM9V",
        "used_times": 0
      },
      {
        "account": "mqVK8Df2cBxZgUnxGXXd8JhTm1LHvPofdn",
        "address": "mzjHGbQvE5orzqRjmJxsbKN7jedNGmv4QD",
        "pubkey": "tpubDA9GDAntyJu4SzcUV91pjutvrUw1m5gRyzDC5BZbhgzMCZ5tCcMPuH9Ej3BoHv4RdVB1U4LbahzGTUdVZFSHqPng2eg9PLVbde4w8J17nGW",
        "used_times": 0
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 26,
    "total_pages": 2
  }
}

address_unused

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

Arguments

  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

"an address in base58"

Get an unused address


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

Output


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

blob_announce

Announce blobs to the DHT

Arguments

  • blob_hash
    optionalstr
    announce a blob, specified by blob_hash
  • stream_hash
    optionalstr
    announce all blobs associated with stream_hash
  • sd_hash
    optionalstr
    announce all blobs associated with sd_hash and the sd_hash itself

Returns

(bool) true if successful
// example(s) to come later

blob_clean

Deletes blobs to cleanup disk space

Arguments

Returns

(bool) true if successful
// example(s) to come later

blob_delete

Delete a blob

Arguments

  • blob_hash
    str
    blob hash of the blob to delete

Returns

(str) Success/fail message

Delete a blob


curl -d'{"method": "blob_delete", "params": {"blob_hash": "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"
}

blob_get

Download and return a blob

Arguments

  • blob_hash
    str
    blob hash of the blob to get
  • timeout
    optionalint
    timeout in number of seconds

Returns

(str) Success/Fail message or (dict) decoded data
// example(s) to come later

blob_list

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

Arguments

  • needed
    optionalbool
    only return needed blobs
  • finished
    optionalbool
    only return finished blobs
  • uri
    optionalstr
    filter blobs by stream in a uri
  • stream_hash
    optionalstr
    filter blobs by stream hash
  • sd_hash
    optionalstr
    filter blobs in a stream by sd hash, ie the hash of the stream descriptor blob for a stream that has been downloaded
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) List of blob hashes

List your local blobs


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      "d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996",
      "3413d65026fcabc798f477a457e205e96b3ac921176df62f79a9d90b9c5bed665bb3ad849c8b472c27d13cfbc6440e9f",
      "9ddea316b511d9f720b1f67f5958cac381fdac5d1d3beabc754b9a1220a891024e983241e2fc7549f0f89ea0636c6c83",
      "536763bbb86446ef57a8a45493b12503ea4c74d865692343ff60c3b40431b5a8624341ae1e48aaf601057071cb25b7c3"
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 4,
    "total_pages": 1
  }
}

blob_reflect

Reflects specified blobs

Arguments

  • reflector_server
    optionalstr
    reflector address

Returns

(list) reflected blob hashes
// example(s) to come later

blob_reflect_all

Reflects all saved blobs

Arguments

Returns

(bool) true if successful
// example(s) to come later

channel_abandon

Abandon one of my channel claims.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

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

Abandon a channel claim


curl -d'{"method": "channel_abandon", "params": {"claim_id": "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"
  }
}

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
    optionalbool
    create new channel even if one already exists with given name. default: false.
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • featured
    optionallist
    claim_ids of featured content in channel
  • tags
    optionallist
    content tags
  • languages
    optionallist
    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
    optionallist
    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
    optionalstr
    thumbnail url
  • cover_url
    optionalstr
    url of cover image
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the channel is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool

Returns

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

Create a channel claim without metadata


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "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"
  }
}

Create a channel claim with all metadata


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000164ffcff7cce034b5b519f047c9aa5c4cf0dc52d6e5804d74174140a5c52182ab010000006b483045022100d26fb9b49ef1a48d33c8639425c1bf216127a45b416ec6a51cb4e81bc8d3a4f002205b38ec4db4ac5e80801203b10b4d31e25775f259163b3f79e78da68eb5ba2b180121036a4e85fba940e22e77dae155444e4f11fa6b9436456a668f00cee5560e48eb36ffffffff0200e1f50500000000fd1701b50b406269676368616e6e656c4ced0012740a2102354550c6c7c2b7c777410102a90b1c3ffa1073517c1f60aa43306490a64a1089121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a9149205f209a3c3a7d6025acbbded70700b686f948488acd22cd305000000001976a91499bb3c59d341b872794cea2524fd2884f83c655e88ac00000000",
    "inputs": [
      {
        "address": "mnTTF4Sw8SGHi58DRCRSpYXJosZ61nPijQ",
        "amount": "1.9993635",
        "confirmations": 1,
        "height": 210,
        "nout": 1,
        "timestamp": 1655141670,
        "txid": "ab8221c5a5404117744d80e5d652dcf04c5caac947f019b5b534e0ccf7cfff64",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mtq45ABFdcEBnuG8VjRfyhRW35rzWZa7U9",
        "amount": "1.0",
        "claim_id": "6e536ae75030d1293b52d056a9bac51b3b02ed2a",
        "claim_op": "create",
        "confirmations": -2,
        "has_signing_key": true,
        "height": -2,
        "meta": {},
        "name": "@bigchannel",
        "normalized_name": "@bigchannel",
        "nout": 0,
        "permanent_url": "lbry://@bigchannel#6e536ae75030d1293b52d056a9bac51b3b02ed2a",
        "timestamp": null,
        "txid": "acba29e905f1a37d12f8371a77e1b6f92c1a45c7ed396b1eceea97c154e9d2e3",
        "type": "claim",
        "value": {
          "cover": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "description": "A channel with lots of videos.",
          "email": "creator@smallmedia.com",
          "languages": [
            "pt-BR",
            "uk"
          ],
          "locations": [
            {
              "country": "BR"
            },
            {
              "city": "Kiyv",
              "country": "UA"
            }
          ],
          "public_key": "02354550c6c7c2b7c777410102a90b1c3ffa1073517c1f60aa43306490a64a1089",
          "public_key_id": "mpJbNo6rzLmfViJkVay6kxdqCrAfB1BDbe",
          "tags": [
            "music",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "title": "Big Channel",
          "website_url": "http://smallmedia.com"
        },
        "value_type": "channel"
      },
      {
        "address": "muXoymiRVLaS1FXJSgPjieSedrWPgUgEkK",
        "amount": "0.9772565",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "acba29e905f1a37d12f8371a77e1b6f92c1a45c7ed396b1eceea97c154e9d2e3",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "1.9993635",
    "total_output": "1.9772565",
    "txid": "acba29e905f1a37d12f8371a77e1b6f92c1a45c7ed396b1eceea97c154e9d2e3"
  }
}

channel_export

Export channel private key.

Arguments

  • channel_id
    str
    claim id of channel to export
  • channel_name
    optionalstr
    name of channel to export
  • account_id
    optionalstr
    one or more account ids for accounts to look in for channels, defaults to all accounts.
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(str) serialized channel private key
// example(s) to come later

channel_import

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

Arguments

  • channel_data
    str
    serialized channel, as exported by channel export
  • wallet_id
    optionalstr
    import into specific wallet

Returns

(dict) Result dictionary
// example(s) to come later

channel_list

List my channel claims.

Arguments

  • name
    optionalstr or list
    channel name
  • claim_id
    optionalstr or list
    channel id
  • is_spent
    optionalbool
    shows previous channel updates and abandons
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • resolve
    optionalbool
    resolves each channel to provide additional metadata
  • no_totals
    optionalbool
    do not calculate the total number of pages and items in result set (significant performance boost)

Returns

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

List your channel claims


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "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
  }
}

Paginate your channel claims


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "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
  }
}

channel_sign

Signs data using the specified channel signing key.

Arguments

  • channel_name
    optionalstr
    name of channel used to sign (or use channel id)
  • channel_id
    optionalstr
    claim id of channel used to sign (or use channel name)
  • hexdata
    optionalstr
    data to sign, encoded as hexadecimal
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • wallet_id
    optionalstr
    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,
}
// example(s) to come later

channel_update

Update an existing channel claim.

Arguments

  • claim_id
    str
    claim_id of the channel to update
  • bid
    optionaldecimal
    amount to back the claim
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • email
    optionalstr
    email of channel owner
  • website_url
    optionalstr
    website url
  • featured
    optionallist
    claim_ids of featured content in channel
  • clear_featured
    optionalbool
    clear existing featured content (prior to adding new ones)
  • tags
    optionallist
    add content tags
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • languages
    optionallist
    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
    optionalbool
    clear existing languages (prior to adding new ones)
  • locations
    optionallist
    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
    optionalbool
    clear existing locations (prior to adding new ones)
  • thumbnail_url
    optionalstr
    thumbnail url
  • cover_url
    optionalstr
    url of cover image
  • account_id
    optionalstr
    account in which to look for channel (default: all)
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the channel is sent
  • new_signing_key
    optionalbool
    generate a new signing key, will invalidate all previous publishes
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool
  • replace
    optionalbool
    instead of modifying specific values on the channel, this will clear all existing values and only save passed in values, useful for form submissions where all values are always set

Returns

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

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"
  }
}

claim_list

List my stream and channel claims.

Arguments

  • claim_type
    optionalstr or list
    claim type: channel, stream, repost, collection
  • claim_id
    optionalstr or list
    claim id
  • channel_id
    optionalstr or list
    streams in this channel
  • name
    optionalstr or list
    claim name
  • is_spent
    optionalbool
    shows previous claim updates and abandons
  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • has_source
    optionalbool
    list claims containing a source field
  • has_no_source
    optionalbool
    list claims not containing a source field
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • resolve
    optionalbool
    resolves each claim to provide additional metadata
  • order_by
    optionalstr
    field to order by: 'name', 'height', 'amount'
  • no_totals
    optionalbool
    do not calculate the total number of pages and items in result set (significant performance boost)
  • include_received_tips
    optionalbool
    calculate the amount of tips received for claim outputs

Returns

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

List 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
  }
}

Paginate 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, "page": 1, "page_size": 20, "resolve": false, "no_totals": false, "include_received_tips": false}}' http://localhost:5279/
lbrynet claim list --page=1 --page_size=20
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, "page": 1, "page_size": 20, "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
  }
}

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
    optionalstr
    claim name (normalized)
  • text
    optionalstr
    full text search
  • claim_id
    optionalstr
    full or partial claim id
  • claim_ids
    optionallist
    list of full claim ids
  • txid
    optionalstr
    transaction id
  • nout
    optionalstr
    position in the transaction
  • channel
    optionalstr
    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
    optionallist
    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
    optionallist
    exclude claims signed by any of these channels (arguments must be claim ids of the channels)
  • has_channel_signature
    optionalbool
    claims with a channel signature (valid or invalid)
  • valid_channel_signature
    optionalbool
    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
    optionalbool
    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
    optionalint
    only return up to the specified number of claims per channel
  • is_controlling
    optionalbool
    winning claims of their respective name
  • public_key_id
    optionalstr
    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
    optionalint
    last updated block height (supports equality constraints)
  • timestamp
    optionalint
    last updated timestamp (supports equality constraints)
  • creation_height
    optionalint
    created at block height (supports equality constraints)
  • creation_timestamp
    optionalint
    created at timestamp (supports equality constraints)
  • activation_height
    optionalint
    height at which claim starts competing for name (supports equality constraints)
  • expiration_height
    optionalint
    height at which claim will expire (supports equality constraints)
  • release_time
    optionalint
    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
    optionalint
    limit by claim value (supports equality constraints)
  • support_amount
    optionalint
    limit by supports and tips received (supports equality constraints)
  • effective_amount
    optionalint
    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
    optionalint
    limit by trending score (supports equality constraints)
  • trending_group
    optionalint
    DEPRECATED - instead please use trending_score
  • trending_mixed
    optionalint
    DEPRECATED - instead please use trending_score
  • trending_local
    optionalint
    DEPRECATED - instead please use trending_score
  • trending_global
    optionalint
    DEPRECATED - instead please use trending_score
  • reposted_claim_id
    optionalstr
    all reposts of the specified original claim id
  • reposted
    optionalint
    claims reposted this many times (supports equality constraints)
  • claim_type
    optionalstr
    filter by 'channel', 'stream', 'repost' or 'collection'
  • stream_types
    optionallist
    filter by 'video', 'image', 'document', etc
  • media_types
    optionallist
    filter by 'video/mp4', 'image/png', etc
  • fee_currency
    optionalstring
    specify fee currency: LBC, BTC, USD
  • fee_amount
    optionaldecimal
    content download fee (supports equality constraints)
  • duration
    optionalint
    duration of video or audio in seconds (supports equality constraints)
  • any_tags
    optionallist
    find claims containing any of the tags
  • all_tags
    optionallist
    find claims containing every tag
  • not_tags
    optionallist
    find claims not containing any of these tags
  • any_languages
    optionallist
    find claims containing any of the languages
  • all_languages
    optionallist
    find claims containing every language
  • not_languages
    optionallist
    find claims not containing any of these languages
  • any_locations
    optionallist
    find claims containing any of the locations
  • all_locations
    optionallist
    find claims containing every location
  • not_locations
    optionallist
    find claims not containing any of these locations
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • order_by
    optionallist
    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
    optionalbool
    do not calculate the total number of pages and items in result set (significant performance boost)
  • wallet_id
    optionalstr
    wallet to check for claim purchase receipts
  • include_purchase_receipt
    optionalbool
    lookup and include a receipt if this wallet has purchased the claim
  • include_is_my_output
    optionalbool
    lookup and include a boolean indicating if claim being resolved is yours
  • remove_duplicates
    optionalbool
    removes duplicated content from search by picking either the original claim or the oldest matching repost
  • has_source
    optionalbool
    find claims containing a source field
  • sd_hash
    optionalstr
    find claims where the source stream descriptor hash matches (partially or completely) the given hexadecimal string
  • has_no_source
    optionalbool
    find claims not containing a source field
  • new_sdk_server
    optionalstr
    URL of the new SDK server (EXPERIMENTAL)

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"
        }
    ]
}

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
  }
}

Search for claims matching a name


curl -d'{"method": "claim_search", "params": {"name": "astream", "claim_ids": [], "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 --name="astream"
requests.post("http://localhost:5279", json={"method": "claim_search", "params": {"name": "astream", "claim_ids": [], "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
  }
}

collection_abandon

Abandon one of my collection claims.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    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"
}
// example(s) to come later

collection_create

Create a new collection.

Arguments

  • name
    str
    name of the collection
  • bid
    decimal
    amount to back the claim
  • claims
    optionallist
    claim ids to be included in the collection
  • allow_duplicate_name
    optionalbool
    create new collection even if one already exists with given name. default: false.
  • title
    optionalstr
    title of the collection
  • description
    optionalstr
    description of the collection
  • tags
    optionallist
    content tags
  • clear_languages
    optionalbool
    clear existing languages (prior to adding new ones)
  • languages
    optionallist
    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
    optionallist
    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
    optionalstr
    thumbnail url
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of the publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the collection is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool

Returns

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

Create a 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"
  }
}

collection_list

List my collection claims.

Arguments

  • resolve
    optionalbool
    resolve collection claim
  • resolve_claims
    optionalint
    resolve every claim
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    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"
        }
    ]
}

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
  }
}

collection_resolve

Resolve claims in the collection.

Arguments

  • claim_id
    optionalstr
    claim id of the collection
  • url
    optionalstr
    url of the collection
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    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"
        }
    ]
}
// example(s) to come later

collection_update

Update an existing collection claim.

Arguments

  • claim_id
    str
    claim_id of the collection to update
  • bid
    optionaldecimal
    amount to back the claim
  • claims
    optionallist
    claim ids
  • clear_claims
    optionalbool
    clear existing claim references (prior to adding new ones)
  • title
    optionalstr
    title of the collection
  • description
    optionalstr
    description of the collection
  • tags
    optionallist
    add content tags
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • languages
    optionallist
    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
    optionalbool
    clear existing languages (prior to adding new ones)
  • locations
    optionallist
    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
    optionalbool
    clear existing locations (prior to adding new ones)
  • thumbnail_url
    optionalstr
    thumbnail url
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of the publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account in which to look for collection (default: all)
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the collection is sent
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool
  • replace
    optionalbool
    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"
}
// example(s) to come later

file_delete

Delete a LBRY file

Arguments

  • delete_from_download_dir
    optionalbool
    delete file from download directory, instead of just deleting blobs
  • delete_all
    optionalbool
    if there are multiple matching files, allow the deletion of multiple files. Otherwise do not delete anything.
  • sd_hash
    optionalstr
    delete by file sd hash
  • file_name
    optionalstr
    delete by file name in downloads folder
  • stream_hash
    optionalstr
    delete by file stream hash
  • rowid
    optionalint
    delete by file row id
  • claim_id
    optionalstr
    delete by file claim id
  • txid
    optionalstr
    delete by file claim txid
  • nout
    optionalint
    delete by file claim nout
  • claim_name
    optionalstr
    delete by file claim name
  • channel_claim_id
    optionalstr
    delete by file channel claim id
  • channel_name
    optionalstr
    delete by file channel claim name

Returns

(bool) true if deletion was successful

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
}

file_list

List files limited by optional filters

Arguments

  • sd_hash
    optionalstr
    get file with matching sd hash
  • file_name
    optionalstr
    get file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    get file with matching stream hash
  • rowid
    optionalint
    get file with matching row id
  • added_on
    optionalint
    get file with matching time of insertion
  • claim_id
    optionalstr
    get file with matching claim id(s)
  • outpoint
    optionalstr
    get file with matching claim outpoint(s)
  • txid
    optionalstr
    get file with matching claim txid
  • nout
    optionalint
    get file with matching claim nout
  • channel_claim_id
    optionalstr
    get file with matching channel claim id(s)
  • channel_name
    optionalstr
    get file with matching channel name
  • claim_name
    optionalstr
    get file with matching claim name
  • blobs_in_stream
    optionalint
    get file with matching blobs in stream
  • download_path
    optionalstr
    get file with matching download path
  • uploading_to_reflector
    optionalbool
    get files currently uploading to reflector
  • is_fully_reflected
    optionalbool
    get files that have been uploaded to reflector
  • status
    optionalstr
    match by status, ( running | finished | stopped )
  • completed
    optionalbool
    match only completed
  • blobs_remaining
    optionalint
    amount of remaining blobs to download
  • sort
    optionalstr
    field to sort by (one of the above filter fields)
  • comparison
    optionalstr
    logical comparison, (eq | ne | g | ge | l | le | in)
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • wallet_id
    optionalstr
    add purchase receipts from this wallet

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"
        }
    ]
}

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
  }
}

List files matching a parameter


curl -d'{"method": "file_list", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "reverse": false}}' http://localhost:5279/
lbrynet file list --claim_id="ad25e05aa7dc5e9994869040c6103f9a8728db46"
requests.post("http://localhost:5279", json={"method": "file_list", "params": {"claim_id": "ad25e05aa7dc5e9994869040c6103f9a8728db46", "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": 4,
        "content_fee": null,
        "download_directory": null,
        "download_path": null,
        "file_name": null,
        "height": 214,
        "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": 1655141671,
        "total_bytes": 16,
        "total_bytes_lower_bound": 0,
        "txid": "7570c487faefe51e7e72ef22896171e151710ff6e8153efcbe51baa49b7f6234",
        "uploading_to_reflector": false,
        "written_bytes": 0
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "total_pages": 1
  }
}

file_reflect

Reflect all the blobs in a file matching the filter criteria

Arguments

  • sd_hash
    optionalstr
    get file with matching sd hash
  • file_name
    optionalstr
    get file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    get file with matching stream hash
  • rowid
    optionalint
    get file with matching row id
  • reflector
    optionalstr
    reflector server, ip address or url by default choose a server from the config

Returns

(list) list of blobs reflected
// example(s) to come later

file_save

Start saving a file to disk.

Arguments

  • file_name
    optionalstr
    file name to save to
  • download_directory
    optionalstr
    directory to save into
  • sd_hash
    optionalstr
    save file with matching sd hash
  • stream_hash
    optionalstr
    save file with matching stream hash
  • rowid
    optionalint
    save file with matching row id
  • claim_id
    optionalstr
    save file with matching claim id
  • txid
    optionalstr
    save file with matching claim txid
  • nout
    optionalint
    save file with matching claim nout
  • claim_name
    optionalstr
    save file with matching claim name
  • channel_claim_id
    optionalstr
    save file with matching channel claim id
  • channel_name
    optionalstr
    save file with matching channel claim name

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"
}

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
  }
}

file_set_status

Start or stop downloading a file

Arguments

  • status
    str
    one of "start" or "stop"
  • sd_hash
    optionalstr
    set status of file with matching sd hash
  • file_name
    optionalstr
    set status of file with matching file name in the downloads folder
  • stream_hash
    optionalstr
    set status of file with matching stream hash
  • rowid
    optionalint
    set status of file with matching row id

Returns

(str) Confirmation message
// example(s) to come later

peer_list

Get peers for blob hash

Arguments

  • blob_hash
    str
    find available peers for this blob hash
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) List of contact dictionaries {'address': , 'udp_port': , 'tcp_port': ,
'node_id': }
// example(s) to come later

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.

Arguments

Returns

(str) pong, or {'error': } if an error is encountered
// example(s) to come later

preference_get

Get preference value for key or all values if not key is passed in.

Arguments

  • key
    optionalstr
    key associated with value
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(dict) Dictionary of preference(s)

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"
  }
}

preference_set

Set preferences

Arguments

  • key
    str
    key associated with value
  • value
    str
    key associated with value
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(dict) Dictionary with key/value of new preference

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"
  }
}

purchase_create

Purchase a claim.

Arguments

  • claim_id
    optionalstr
    claim id of claim to purchase
  • url
    optionalstr
    lookup claim to purchase by url
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • allow_duplicate_purchase
    optionalbool
    allow purchasing claim_id you already own
  • override_max_key_fee
    optionalbool
    ignore max key fee for this purchase
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    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"
}
// example(s) to come later

purchase_list

List my claim purchases.

Arguments

  • claim_id
    optionalstr
    purchases for specific claim
  • resolve
    optionalstr
    include resolved claim information
  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    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"
        }
    ]
}
// example(s) to come later

settings_clear

Clear daemon settings

Arguments

Returns

(dict) Updated dictionary of daemon settings
// example(s) to come later

settings_get

Get daemon settings

Arguments

Returns

(dict) Dictionary of daemon settings
See ADJUSTABLE_SETTINGS in lbry/conf.py for full list of settings

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"
    ]
  }
}

settings_set

Set daemon settings

Arguments

Returns

(dict) Updated dictionary of daemon settings

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
  }
}

stream_abandon

Abandon one of my stream claims.

Arguments

  • claim_id
    optionalstr
    claim_id of the claim to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

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

Abandon a 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"
  }
}

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
// example(s) to come later

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
    optionalstr
    path to file to be associated with name.
  • file_name
    optionalstr
    name of file to be associated with stream.
  • file_hash
    optionalstr
    hash of file to be associated with stream.
  • validate_file
    optionalbool
    validate that the video container and encodings match common web browser support or that optimization succeeds if specified. FFmpeg is required
  • optimize_file
    optionalbool
    transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required
  • allow_duplicate_name
    optionalbool
    create new claim even if one already exists with given name. default: false.
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    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
    optionallist
    add content tags
  • languages
    optionallist
    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
    optionallist
    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
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • sd_hash
    optionalstr
    sd_hash of stream
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of the publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool

Returns

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

Create a 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"
  }
}

Create an image stream claim with all metadata and fee


curl -d'{"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmps0do5cfj.png", "validate_file": false, "optimize_file": false, "fee_currency": "LBC", "fee_amount": "0.3", "title": "Blank Image", "description": "A blank PNG that is 5x7.", "author": "Picaso", "tags": ["blank", "art"], "languages": ["en"], "locations": ["US:NH:Manchester"], "license": "Public Domain", "license_url": "http://public-domain.org", "thumbnail_url": "http://smallmedia.com/thumbnail.jpg", "release_time": 1655141671, "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream create blank-image 1.0 /var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmps0do5cfj.png --tags=blank --tags=art --languages=en --locations=US:NH:Manchester --fee_currency=LBC --fee_amount=0.3 --title="Blank Image" --description="A blank PNG that is 5x7." --author=Picaso --license="Public Domain" --license_url=http://public-domain.org --thumbnail_url="http://smallmedia.com/thumbnail.jpg" --release_time=1655141671 --channel_id="595c2e2f0c1f59188628fab7503692b0145779a2"
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/var/folders/46/44w2zhrx16b8gsvff9dxtr640000gq/T/tmps0do5cfj.png", "validate_file": false, "optimize_file": false, "fee_currency": "LBC", "fee_amount": "0.3", "title": "Blank Image", "description": "A blank PNG that is 5x7.", "author": "Picaso", "tags": ["blank", "art"], "languages": ["en"], "locations": ["US:NH:Manchester"], "license": "Public Domain", "license_url": "http://public-domain.org", "thumbnail_url": "http://smallmedia.com/thumbnail.jpg", "release_time": 1655141671, "channel_id": "595c2e2f0c1f59188628fab7503692b0145779a2", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "010000000144a3bd0e72a6f87a1e2282dadf3a332eb04eba7dac715f14a6ac36288eece7f9010000006b483045022100d1327306e6b07c668e21b915e0a9bbe7e08036ffc6a197f469ff458b5108be6e02207c4160f2c7e0344a2dc30beb0697bee536118df5e6cb978de072bb745b2783d60121026a72cb1ef362624b1483427abf7cb2731c1dd582bad08b4521a1e92967cbda32ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101a2795714b0923650b7fa288618591f0c2f2e5c5946580bd06bec18e960285651ca9130c75fcf4f5b3cd71fa5d97fe7013de1bf7627b08de186dc0f5c4ff33a6e7173b24f7da6a91080ffb840f6f6fbf4897851790ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d707330646f3563666a2e706e6718632209696d6167652f706e673230d221fe243afed69b84e6cbc32448260a187449c5123bfa89d33af05af2c8f195a7bbac2bfe02d4a2ba472af217af3996120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728a7ea9d95063222080112196f4a4f7b3ab55c52fe12f9d8b9b255fb2625522e4b00415bed188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a9144a4f7b3ab55c52fe12f9d8b9b255fb2625522e4b88acac5e7d1d000000001976a914f756abdb56de34ac287ee4b85ca911e2f83894b788ac00000000",
    "inputs": [
      {
        "address": "mhSwvz7Qfuh343S8WrXpPoPcaxbtw7QM5W",
        "amount": "5.969662",
        "confirmations": 2,
        "height": 213,
        "nout": 1,
        "timestamp": 1655141671,
        "txid": "f9e7ec8e2836aca6145f71ac7dba4eb02e333adfda82221e7af8a6720ebda344",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mnHsWiDjPYw27jPzMfqUFM9scdsgHQ6NJg",
        "amount": "1.0",
        "claim_id": "46bff43fbdffabf12efc867c2b4c7865315b0b76",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "meta": {},
        "name": "blank-image",
        "normalized_name": "blank-image",
        "nout": 0,
        "permanent_url": "lbry://blank-image#46bff43fbdffabf12efc867c2b4c7865315b0b76",
        "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": null,
        "txid": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c",
        "type": "claim",
        "value": {
          "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"
        },
        "value_type": "stream"
      },
      {
        "address": "n44m2TuZKypifAkpPQqEN4VtRkCxgbgkA3",
        "amount": "4.947555",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "5.969662",
    "total_output": "5.947555",
    "txid": "04d32d523ddc247cd5055a2146c445c8ab99ff8b5b3ea9edaf8604c59ac41b2c"
  }
}

stream_list

List my stream claims.

Arguments

  • name
    optionalstr or list
    stream name
  • claim_id
    optionalstr or list
    stream id
  • is_spent
    optionalbool
    shows previous stream updates and abandons
  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • resolve
    optionalbool
    resolves each stream to provide additional metadata
  • no_totals
    optionalbool
    do not calculate the total number of pages and items in result set (significant performance boost)

Returns

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

List 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
  }
}

Paginate your stream claims


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "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
  }
}

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
    optionalbool
    create new claim even if one already exists with given name. default: false.
  • title
    optionalstr
    title of the repost
  • description
    optionalstr
    description of the repost
  • tags
    optionallist
    add repost tags
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of the publisher channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    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"
}
// example(s) to come later

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
    optionaldecimal
    amount to back the claim
  • file_path
    optionalstr
    path to file to be associated with name.
  • validate_file
    optionalbool
    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
    optionalbool
    transcode the video & audio if necessary to ensure common web browser support. FFmpeg is required and file_path must be specified.
  • file_name
    optionalstr
    override file name, defaults to name from file_path.
  • file_size
    optionalstr
    override file size, otherwise automatically computed.
  • file_hash
    optionalstr
    override file hash, otherwise automatically computed.
  • fee_currency
    optionalstring
    specify fee currency
  • fee_amount
    optionaldecimal
    content download fee
  • fee_address
    optionalstr
    address where to send fee payments, will use value from --claim_address if not provided
  • clear_fee
    optionalbool
    clear previously set fee
  • title
    optionalstr
    title of the publication
  • description
    optionalstr
    description of the publication
  • author
    optionalstr
    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
    optionallist
    add content tags
  • clear_tags
    optionalbool
    clear existing tags (prior to adding new ones)
  • languages
    optionallist
    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
    optionalbool
    clear existing languages (prior to adding new ones)
  • locations
    optionallist
    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
    optionalbool
    clear existing locations (prior to adding new ones)
  • license
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail_url
    optionalstr
    thumbnail url
  • release_time
    optionalint
    original public release of content, seconds since UNIX epoch
  • width
    optionalint
    image/video width, automatically calculated from media file
  • height
    optionalint
    image/video height, automatically calculated from media file
  • duration
    optionalint
    audio/video duration in seconds, automatically calculated
  • sd_hash
    optionalstr
    sd_hash of stream
  • channel_id
    optionalstr
    claim id of the publisher channel
  • channel_name
    optionalstr
    name of the publisher channel
  • clear_channel
    optionalbool
    remove channel signature
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account in which to look for stream (default: all)
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified it will be determined automatically from the account
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until transaction is in mempool
  • replace
    optionalbool
    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

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"
}

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"
  }
}

support_abandon

Abandon supports, including tips, of a specific claim, optionally keeping some amount as supports.

Arguments

  • claim_id
    optionalstr
    claim_id of the support to abandon
  • txid
    optionalstr
    txid of the claim to abandon
  • nout
    optionalint
    nout of the claim to abandon
  • keep
    optionaldecimal
    amount of lbc to keep as support
  • account_id
    optionalstr
    id of the account to use
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    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"
}
// example(s) to come later

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
    optionalbool
    send support to claim owner, default: false.
  • channel_id
    optionalstr
    claim id of the supporters identity channel
  • channel_name
    optionalstr
    name of the supporters identity channel
  • channel_account_id
    optionalstr
    one or more account ids for accounts to look in for channel certificates, defaults to all accounts.
  • account_id
    optionalstr
    account to use for holding the transaction
  • wallet_id
    optionalstr
    restrict operation to specific wallet
  • funding_account_ids
    optionallist
    ids of accounts to fund this transaction
  • comment
    optionalstr
    add a comment to the support
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    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"
}
// example(s) to come later

support_list

List staked supports and sent/received tips.

Arguments

  • name
    optionalstr or list
    claim name
  • claim_id
    optionalstr or list
    claim id
  • received
    optionalbool
    only show received (tips)
  • sent
    optionalbool
    only show sent (tips)
  • staked
    optionalbool
    only show my staked supports
  • is_spent
    optionalbool
    show abandoned supports
  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • no_totals
    optionalbool
    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"
        }
    ]
}
// example(s) to come later

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
    optionalstr
    claim id
  • new_sdk_server
    optionalstr
    URL of the new SDK server (EXPERIMENTAL)
  • include_channel_content
    optionalbool
    if claim_id is for a channel, include supports for claims in that channel
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    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"
    ]
}
// example(s) to come later

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
    optionalstr
    password to decrypt incoming and encrypt outgoing data
  • data
    optionalstr
    incoming sync data, if any
  • wallet_id
    optionalstr
    wallet being sync'ed
  • blocking
    optionalbool
    wait until any new accounts have sync'ed

Returns

(map) sync hash and data
// example(s) to come later

sync_hash

Deterministic hash of the wallet.

Arguments

  • wallet_id
    optionalstr
    wallet for which to generate hash

Returns

(str) sha256 hash of wallet
// example(s) to come later

tracemalloc_disable

Disable tracemalloc memory tracing

Arguments

Returns

(bool) is it tracing?
// example(s) to come later

tracemalloc_enable

Enable tracemalloc memory tracing

Arguments

Returns

(bool) is it tracing?
// example(s) to come later

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
}
// example(s) to come later

transaction_list

List transactions belonging to wallet

Arguments

  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

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
}

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
  }
}

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"
}
// example(s) to come later

txo_list

List my transaction outputs.

Arguments

  • type
    optionalstr or list
    claim type: stream, channel, support, purchase, collection, repost, other
  • txid
    optionalstr or list
    transaction id of outputs
  • claim_id
    optionalstr or list
    claim id
  • channel_id
    optionalstr or list
    claims in this channel
  • not_channel_id
    optionalstr or list
    claims not in this channel
  • name
    optionalstr or list
    claim name
  • is_spent
    optionalbool
    only show spent txos
  • is_not_spent
    optionalbool
    only show not spent txos
  • is_my_input_or_output
    optionalbool
    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
    optionalbool
    show outputs controlled by you
  • is_not_my_output
    optionalbool
    show outputs not controlled by you
  • is_my_input
    optionalbool
    show outputs created by you
  • is_not_my_input
    optionalbool
    show outputs not created by you
  • exclude_internal_transfers
    optionalbool
    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
    optionalbool
    calculate the amount of tips received for claim outputs
  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination
  • resolve
    optionalbool
    resolves each claim to provide additional metadata
  • order_by
    optionalstr
    field to order by: 'name', 'height', 'amount' and 'none'
  • no_totals
    optionalbool
    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"
        }
    ]
}
// example(s) to come later

txo_plot

Plot transaction output sum over days.

Arguments

  • type
    optionalstr or list
    claim type: stream, channel, support, purchase, collection, repost, other
  • txid
    optionalstr or list
    transaction id of outputs
  • claim_id
    optionalstr or list
    claim id
  • name
    optionalstr or list
    claim name
  • channel_id
    optionalstr or list
    claims in this channel
  • not_channel_id
    optionalstr or list
    claims not in this channel
  • is_spent
    optionalbool
    only show spent txos
  • is_not_spent
    optionalbool
    only show not spent txos
  • is_my_input_or_output
    optionalbool
    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
    optionalbool
    show outputs controlled by you
  • is_not_my_output
    optionalbool
    show outputs not controlled by you
  • is_my_input
    optionalbool
    show outputs created by you
  • is_not_my_input
    optionalbool
    show outputs not created by you
  • exclude_internal_transfers
    optionalbool
    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
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • days_back
    optionalint
    number of days back from today (not compatible with --start_day, --days_after, --end_day)
  • start_day
    optionaldate
    start on specific date (YYYY-MM-DD) (instead of --days_back)
  • days_after
    optionalint
    end number of days after --start_day (instead of --end_day)
  • end_day
    optionaldate
    end on specific date (YYYY-MM-DD) (instead of --days_after)

Returns

List[Dict]
// example(s) to come later

txo_spend

Spend transaction outputs, batching into multiple transactions as necessary.

Arguments

  • type
    optionalstr or list
    claim type: stream, channel, support, purchase, collection, repost, other
  • txid
    optionalstr or list
    transaction id of outputs
  • claim_id
    optionalstr or list
    claim id
  • channel_id
    optionalstr or list
    claims in this channel
  • not_channel_id
    optionalstr or list
    claims not in this channel
  • name
    optionalstr or list
    claim name
  • is_my_input
    optionalbool
    show outputs created by you
  • is_not_my_input
    optionalbool
    show outputs not created by you
  • exclude_internal_transfers
    optionalbool
    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
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until abandon is in mempool
  • batch_size
    optionalint
    number of txos to spend per transactions
  • include_full_tx
    optionalbool
    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"
    }
]
// example(s) to come later

txo_sum

Sum of transaction outputs.

Arguments

  • type
    optionalstr or list
    claim type: stream, channel, support, purchase, collection, repost, other
  • txid
    optionalstr or list
    transaction id of outputs
  • claim_id
    optionalstr or list
    claim id
  • name
    optionalstr or list
    claim name
  • channel_id
    optionalstr or list
    claims in this channel
  • not_channel_id
    optionalstr or list
    claims not in this channel
  • is_spent
    optionalbool
    only show spent txos
  • is_not_spent
    optionalbool
    only show not spent txos
  • is_my_input_or_output
    optionalbool
    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
    optionalbool
    show outputs controlled by you
  • is_not_my_output
    optionalbool
    show outputs not controlled by you
  • is_my_input
    optionalbool
    show outputs created by you
  • is_not_my_input
    optionalbool
    show outputs not created by you
  • exclude_internal_transfers
    optionalbool
    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
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet

Returns

int
// example(s) to come later

utxo_list

List unspent transaction outputs

Arguments

  • account_id
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict results to specific wallet
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    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"
        }
    ]
}
// example(s) to come later

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
    optionalstr
    id of the account to query
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

None
// example(s) to come later

wallet_add

Add existing wallet.

Arguments

  • wallet_id
    str
    wallet file name

Returns

{
    "id": "wallet_id",
    "name": "optional wallet name"
}
// example(s) to come later

wallet_balance

Return the balance of a wallet

Arguments

  • wallet_id
    optionalstr
    balance for specific wallet
  • confirmations
    optionalint
    Only include transactions with this many confirmed blocks.

Returns

(decimal) amount of lbry credits in wallet
// example(s) to come later

wallet_create

Create a new wallet.

Arguments

  • wallet_id
    str
    wallet file name
  • skip_on_startup
    optionalbool
    don't add wallet to daemon_settings.yml
  • create_account
    optionalbool
    generates the default account
  • single_key
    optionalbool
    used with --create_account, creates single-key account

Returns

{
    "id": "wallet_id",
    "name": "optional wallet name"
}
// example(s) to come later

wallet_decrypt

Decrypt an encrypted wallet, this will remove the wallet password. The wallet must be unlocked to decrypt it

Arguments

  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(bool) true if wallet is decrypted, otherwise false
// example(s) to come later

wallet_encrypt

Encrypt an unencrypted wallet with a password

Arguments

  • new_password
    str
    password to encrypt account
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(bool) true if wallet is decrypted, otherwise false
// example(s) to come later

wallet_list

List wallets.

Arguments

  • wallet_id
    optionalstr
    show specific wallet only
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

{
    "page": "Page number of the current items.",
    "page_size": "Number of items to show on a page.",
    "total_pages": "Total number of pages.",
    "total_items": "Total number of items.",
    "items": [
        {
            "id": "wallet_id",
            "name": "optional wallet name"
        }
    ]
}

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
  }
}

wallet_lock

Lock an unlocked wallet

Arguments

  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(bool) true if wallet is locked, otherwise false
// example(s) to come later

wallet_reconnect

Reconnects ledger network client, applying new configurations.

Arguments

Returns

None
// example(s) to come later

wallet_remove

Remove an existing wallet.

Arguments

  • wallet_id
    str
    name of wallet to remove

Returns

{
    "id": "wallet_id",
    "name": "optional wallet name"
}
// example(s) to come later

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
    optionalstr
    restrict operation to specific wallet
  • change_account_id
    optionalstr
    account where change will go
  • funding_account_ids
    optionalstr
    accounts to fund the transaction
  • preview
    optionalbool
    do not broadcast the transaction
  • blocking
    optionalbool
    wait until tx has synced

Returns

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

wallet_status

Status of wallet including encryption/lock state.

Arguments

  • wallet_id
    optionalstr
    status of specific wallet

Returns

Dictionary of wallet status information.
// example(s) to come later

wallet_unlock

Unlock an encrypted wallet

Arguments

  • password
    str
    password to use for unlocking
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(bool) true if wallet is unlocked, otherwise false
// example(s) to come later