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

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 reciepts

Returns

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

Get a file


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "added_on": 1574265331,
    "blobs_completed": 1,
    "blobs_in_stream": 1,
    "blobs_remaining": 0,
    "channel_claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
    "channel_name": "@channel",
    "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
    "claim_name": "astream",
    "completed": true,
    "confirmations": 3,
    "content_fee": null,
    "download_directory": "/tmp/tmpgnoina61",
    "download_path": "/tmp/tmpgnoina61/tmprsllesnu",
    "file_name": "tmprsllesnu",
    "height": 214,
    "key": "f67a8b72104b6dba232cfcd28e7a4766",
    "metadata": {
      "source": {
        "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
        "media_type": "application/octet-stream",
        "name": "tmprsllesnu",
        "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "size": "11"
      },
      "stream_type": "binary"
    },
    "mime_type": "application/octet-stream",
    "nout": 0,
    "outpoint": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0",
    "points_paid": 0.0,
    "protobuf": "01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "purchase_receipt": null,
    "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "status": "finished",
    "stopped": true,
    "stream_hash": "092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879",
    "stream_name": "tmprsllesnu",
    "streaming_url": "http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "suggested_file_name": "tmprsllesnu",
    "timestamp": 1574265353,
    "total_bytes": 16,
    "total_bytes_lower_bound": 0,
    "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
    "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.
  • 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
  • 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_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_mine": "payment to one of your accounts, only available when it can be determined",
            "type": "one of 'claim', 'support' or 'purchase'",
            "name": "when type is 'claim' or 'support', this is the claim name",
            "claim_id": "when type is 'claim', 'support' or 'purchase', this is the claim id",
            "claim_op": "when type is 'claim', this determines if it is 'create' or 'update'",
            "value": "when type is 'claim' or 'support' with payload, this is the decoded protobuf payload",
            "value_type": "determines the type of the 'value' field: 'channel', 'stream', etc",
            "protobuf": "hex encoded raw protobuf version of 'value' field",
            "permanent_url": "when type is 'claim' or 'support', this is the long permanent claim URL",
            "claim": "for purchase outputs only, metadata of purchased claim",
            "reposted_claim": "for repost claims only, metadata of claim being reposted",
            "signing_channel": "for signed claims only, metadata of signing channel",
            "is_channel_signature_valid": "for signed claims only, whether signature is valid",
            "purchase_receipt": "metadata for the purchase transaction associated with this claim"
        }
    ],
    "total_input": "sum of inputs as a decimal",
    "total_output": "sum of outputs, sans fee, as a decimal",
    "total_fee": "fee amount",
    "hex": "entire transaction encoded in hex"
}

Publish a file


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000014b4df6fa2d6bb71b8963612d726f784dde2af32bfab13e96b0339f81301b0f48010000006b483045022100aff221a2ddf4253b22658eaeaf7cb16c2d561e3adcf68f7fee8965b3a935de5f0220321668388dc2b49b200d49e890027f500a3eb249645d9f5b6f46a33a9362dbf6012103a6b983e7675a1caab5c6ba805072f0dc58d8c1c968f1d52a4dd3be4f2fa04eb9ffffffff0200e1f50500000000bfb50c612d6e65772d73747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d706a37356164663863180b22186170706c69636174696f6e2f6f637465742d73747265616d3230776854e31884a3d321f5cba68a640d5d995830a21e4f7ea985d0441807f27bce45931c596ce0593ad47098dc7e55b6286d7576a9145b6f93dc376438022d0efc6e47fee875712590b488ace0b46217000000001976a9141bfe3963c1ea54a16243934a6c2fb6e2e3bf751788ac00000000",
    "inputs": [
      {
        "address": "mpzToGNACEPUN3SP3mavDeXyjZLPBAdKzh",
        "amount": "4.947555",
        "confirmations": 4,
        "height": 215,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265353,
        "txid": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "morRT4ExEyDWP11jMcr1HgZEq41QcScjzV",
        "amount": "1.0",
        "claim_id": "252b24ba95a8ce9219092bc57fae0e79680f0339",
        "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#252b24ba95a8ce9219092bc57fae0e79680f0339",
        "timestamp": null,
        "txid": "7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmpj75adf8c",
            "sd_hash": "776854e31884a3d321f5cba68a640d5d995830a21e4f7ea985d0441807f27bce45931c596ce0593ad47098dc7e55b628",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mi4y63DYGkcC8Vgc1wLMc1GSB4wJdK9zQL",
        "amount": "3.923448",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a",
        "type": "payment"
      }
    ],
    "total_fee": "0.024107",
    "total_input": "4.947555",
    "total_output": "4.923448",
    "txid": "7da7cd3dea5c6ee825309226683067a2faa2011c18482048f84be11da74a615a"
  }
}

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 reciepts

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#6d779c509a47c97a050540a42863341eed6c47ad"]}}' http://localhost:5279/
lbrynet resolve astream#6d779c509a47c97a050540a42863341eed6c47ad
requests.post("http://localhost:5279", json={"method": "resolve", "params": {"urls": ["astream#6d779c509a47c97a050540a42863341eed6c47ad"]}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "astream#6d779c509a47c97a050540a42863341eed6c47ad": {
      "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
      "amount": "1.0",
      "canonical_url": "lbry://@channel#7/astream#6",
      "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
      "claim_op": "update",
      "confirmations": 3,
      "height": 214,
      "is_channel_signature_valid": true,
      "meta": {
        "activation_height": 213,
        "creation_height": 213,
        "creation_timestamp": 1574265353,
        "effective_amount": "1.0",
        "expiration_height": 263187,
        "is_controlling": true,
        "reposted": 0,
        "support_amount": "0.0",
        "take_over_height": 213,
        "trending_global": 0.0,
        "trending_group": 0,
        "trending_local": 0.0,
        "trending_mixed": 0.0
      },
      "name": "astream",
      "normalized_name": "astream",
      "nout": 0,
      "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
      "short_url": "lbry://astream#6",
      "signing_channel": {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "update",
        "confirmations": 7,
        "has_signing_key": false,
        "height": 210,
        "meta": {
          "activation_height": 209,
          "claims_in_channel": 1,
          "creation_height": 209,
          "creation_timestamp": 1574265352,
          "effective_amount": "1.0",
          "expiration_height": 263183,
          "is_controlling": true,
          "reposted": 0,
          "support_amount": "0.0",
          "take_over_height": 209,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "short_url": "lbry://@channel#7",
        "timestamp": 1574265352,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      "timestamp": 1574265353,
      "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
      "type": "claim",
      "value": {
        "source": {
          "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
          "media_type": "application/octet-stream",
          "name": "tmprsllesnu",
          "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
          "size": "11"
        },
        "stream_type": "binary"
      },
      "value_type": "stream"
    }
  }
}

routing_table_get

Get DHT routing information

Arguments

Returns

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

status

Get daemon status

Arguments

Returns

(dict) lbrynet-daemon status
{
    'installation_id': (str) installation id - base58,
    'is_running': (bool),
    'skipped_components': (list) [names of skipped components (str)],
    'startup_status': { Does not include components which have been skipped
        'blob_manager': (bool),
        'blockchain_headers': (bool),
        'database': (bool),
        'dht': (bool),
        'exchange_rate_manager': (bool),
        'hash_announcer': (bool),
        'peer_protocol_server': (bool),
        'stream_manager': (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': {
        '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
            }
        ],
    },
    'dht': {
        'node_id': (str) lbry dht node id - hex encoded,
        'peers_in_routing_table': (int) the number of peers in the routing table,
    },
    'blob_manager': {
        'finished_blobs': (int) number of finished blobs in the blob manager,
        'connections': {
            'incoming_bps': {
                : (int) bytes per second received,
            },
            'outgoing_bps': {
                : (int) bytes per second sent,
            },
            'total_outgoing_mps': (float) megabytes per second sent,
            'total_incoming_mps': (float) megabytes per second received,
            'time': (float) timestamp
        }
    },
    'hash_announcer': {
        'announce_queue_size': (int) number of blobs currently queued to be announced
    },
    'stream_manager': {
        'managed_files': (int) count of files in the stream manager,
    },
    'upnp': {
        'aioupnp_version': (str),
        'redirects': {
            : (int) external_port,
        },
        'gateway': (str) manufacturer and model,
        'dht_redirect_set': (bool),
        'peer_redirect_set': (bool),
        'external_ip': (str) external ip address,
    }
}

Get status


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "blob_manager": {
      "connections": {
        "incoming_bps": {},
        "max_incoming_mbs": 0.0,
        "max_outgoing_mbs": 0.0,
        "outgoing_bps": {},
        "total_incoming_mbs": 0.0,
        "total_outgoing_mbs": 0.0,
        "total_received": 0,
        "total_sent": 0
      },
      "finished_blobs": 0
    },
    "connection_status": {
      "code": "connected",
      "message": "No connection problems detected"
    },
    "installation_id": "74U1CVifa5TSrJmrBCWUemuehciruvX7jp93cy3JZ3hPueR58izqFbkVeEkjo8dkcc",
    "is_running": true,
    "skipped_components": [
      "dht",
      "upnp",
      "hash_announcer",
      "peer_protocol_server"
    ],
    "startup_status": {
      "blob_manager": true,
      "database": true,
      "exchange_rate_manager": true,
      "stream_manager": true,
      "wallet": true
    },
    "stream_manager": {
      "managed_files": 0
    },
    "wallet": {
      "best_blockhash": "ee5cc9630f7869eb12890fb4041401996ea0190974145eeeea71a5155030d888",
      "blocks": 206,
      "blocks_behind": 0,
      "connected_servers": [
        {
          "host": "localhost",
          "latency": 0.01,
          "port": 50002
        }
      ],
      "headers_synchronization_progress": 100
    }
  }
}

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,
    'lbrynet_version': (str) lbrynet version,
    'torba_version': (str) torba version,
    'build': (str) "dev" | "qa" | "rc" | "release",
}

Get version


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

Output


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

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": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower", "single_key": false}}' http://localhost:5279/
lbrynet account add "new account" --seed="boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower"
requests.post("http://localhost:5279", json={"method": "account_add", "params": {"account_name": "new account", "seed": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower", "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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1574265320.2105434,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v",
    "public_key": "tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH",
    "seed": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower"
  }
}

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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}' http://localhost:5279/
lbrynet account balance "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"
requests.post("http://localhost:5279", json={"method": "account_balance", "params": {"account_id": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}).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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1574265320.0034864,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v",
    "public_key": "tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH",
    "seed": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower"
  }
}

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
    str
    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_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_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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz", "amount": "2.0", "everything": false, "broadcast": true}}' http://localhost:5279/
lbrynet account fund --to_account="mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz" --amount=2.0 --broadcast
requests.post("http://localhost:5279", json={"method": "account_fund", "params": {"to_account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz", "amount": "2.0", "everything": false, "broadcast": true}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001276e9cfba73cb4448a96198655b86391ac3da3a508cc0efbef344f9be34ccf1b010000006b483045022100e0d7d563ba1fef74e214800b5ef2a52b39a1a028f669da9c2e5a929faabb799002200342f38bba0e5f98b2d2257e3614fb8923ea67a74bca5bed2e704ee34025f348012102474c29b50715004a9ebcbd3437d191003a07d070e7d690f308d6617784f6b589ffffffff0200c2eb0b000000001976a91430ef0de4c1658b4786a47735a51889541f4ea0d888ac90d7ae2f000000001976a9140954d00cc8870a6fffe95dd68a4b8c0b43e0eb1488ac00000000",
    "inputs": [
      {
        "address": "mii4sVHEHUe2b5ByScY8YRy8uoFHJQQiLL",
        "amount": "10.0",
        "confirmations": 6,
        "height": 201,
        "is_change": false,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265351,
        "txid": "1bcf4ce39b4f34effb0ecc08a5a33dac9163b8558619968a44b43ca7fb9c6e27",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb",
        "amount": "2.0",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c",
        "type": "payment"
      },
      {
        "address": "mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE",
        "amount": "7.999876",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c",
        "type": "payment"
      }
    ],
    "total_fee": "0.000124",
    "total_input": "10.0",
    "total_output": "9.999876",
    "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c"
  }
}

Spread LBC between multiple addresses


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000016cbd18b25215142c6ed3cd910b4232e5a132ffc014607181d3a7338c3f20570d000000006a473044022017d83b4c85717d50123a5546972c87f9a91eaeadfb115b989f59cd3ce19a268502203bd0b5b501a2dc8b86bee47bc89e4e1ef32e6fc07408031dae4fc962dfb26a1d012103695b56b93635a3b926f1c545dc7a8f04589c6b92a0b3cc85b6837001383808bbffffffff03c0687804000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88acc0687804000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88ac6cb9fa02000000001976a9144cbad435ba26b413a104d3d3ee35f4f86ae561af88ac00000000",
    "inputs": [
      {
        "address": "mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb",
        "amount": "2.0",
        "confirmations": 1,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1574265352,
        "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      },
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.75",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      },
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.499859",
        "confirmations": -2,
        "height": -2,
        "nout": 2,
        "timestamp": null,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      }
    ],
    "total_fee": "0.000141",
    "total_input": "2.0",
    "total_output": "1.999859",
    "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a"
  }
}

Transfer all LBC to a specified account


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

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000034a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555000000006b483045022100b5aa96cd17b50de67f7af1bbe80a6ffa592503d4311f3d30393d0895212f868a022027f9307becff91ad895045143a31cca8a1c2a9e8c9d4c612d44cb51a0d2cbca1012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff4a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555010000006b483045022100e5cb8166ad69572fe6e43b5a15013ddf552c901f2e7b2d55d886202c1a31ff9302204f004c6ba66afa8e4e9ac58d61a11f7d126bbf8e69646a185a626ef51ef8f380012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff4a7dadb3c9ccacc0c6df48ee506e3a9788147c75a3a7cb5006d741297ab30555020000006a473044022028da4cb091fb903f6eb27aec53049682039e86161cb12537b2d0d34834475a97022063ae7817c85d47fca9fbc83e81e0ef6f7ce2592a1cd444984626c135df0cc487012102dda2eccfc24cf7fc3f636e486a3e2eabd25b1df6fa0c18972acc6694be27095affffffff015027eb0b000000001976a91437f69c006d90d2724662b176517c895b2449b82d88ac00000000",
    "inputs": [
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1574265352,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      },
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.75",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265352,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      },
      {
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "amount": "0.499859",
        "confirmations": 1,
        "height": 208,
        "is_change": true,
        "is_mine": true,
        "nout": 2,
        "timestamp": 1574265352,
        "txid": "5505b37a2941d70650cba7a3757c1488973a6e50ee48dfc6c0acccc9b3ad7d4a",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mkcrtKoGQxAsTRVywM8D6Js5rriUM7yzCE",
        "amount": "1.999604",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90",
        "type": "payment"
      }
    ],
    "total_fee": "0.000255",
    "total_input": "1.999859",
    "total_output": "1.999604",
    "txid": "ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90"
  }
}

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": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "is_default": true,
        "ledger": "lbc_regtest",
        "name": "Account #mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "public_key": "tpubD6NzVbkrYhZ4YRn7tNGJ5Dm7uXzsaWtuHQyqs1mEfPSa4c6CKM9UNzymW16TriuAq1m53iHmMsCK6XRGNQKFgZrkQmAmKXDa9R1fbsR2SAa",
        "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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}' http://localhost:5279/
lbrynet account remove mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz
requests.post("http://localhost:5279", json={"method": "account_remove", "params": {"account_id": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}).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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1574265320.0034864,
    "name": "generated account",
    "private_key": "tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v",
    "public_key": "tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH",
    "seed": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower"
  }
}

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

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_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_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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz", "default": false, "change_max_uses": 10}}' http://localhost:5279/
lbrynet account set mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz --change_max_uses=10
requests.post("http://localhost:5279", json={"method": "account_set", "params": {"account_id": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz", "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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
    "is_default": false,
    "ledger": "lbc_regtest",
    "modified_on": 1574265320.2819548,
    "name": "new account",
    "private_key": "tprv8ZgxMBicQKsPdRGVhcCgBrtSjGo285mwfMDKLWfk5bh86xwY1cJ1kLxuYhazqBt71vMPLDhSc4EAT56NkNGWBGNpxJkNQCD5PihgzB5sc1v",
    "public_key": "tpubD6NzVbkrYhZ4WtJHbFsGbGYZJJJxHQxrEep6d2i3VsVWwTCJe17bvqamipUqzRMr1DhNPdv7DCDyEiwmZLLZgDdNKagSvfb4s84hXbPnnSH",
    "seed": "boat diesel bring bounce aerobic scrap nephew aerobic palm dumb asthma tower"
  }
}

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": "n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV"}}' http://localhost:5279/
lbrynet address is_mine n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV
requests.post("http://localhost:5279", json={"method": "address_is_mine", "params": {"address": "n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV"}}).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": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "pubkey": "tpubDA9GDAntyJu4NgFPKZxseA97DkktAarw2r6TSR7DrCf1UgkGt9wxMM92tZFgQSAxLUQRj46d2BwVWrVpogjXWbBJ5YmEsCNr9bH1dhZKYvf",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE",
        "pubkey": "tpubDA9GDAntyJu4SViVfoRtyZoEKQTcBWnRGiYQkii83dc39MEtQrVGSavkPFPB2kTc3bFGB3VV9osgpVanZGgcE2XNXU1sBGoo9RETWUWDuCq",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mgQqoGzjchpufkZEJKERzef3iChhdQYsb8",
        "pubkey": "tpubDA9GDAntyJu5353qrDsn4R91yFpdpNoV78Q9DqPcb1mx8wBh9SwMZSAzBRhQpokcKv5KMBVspC6AK4zKeCrw7vw1e2jx8usK6FH1nv8uwCq",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mhfp8CpSpF7pMhecmJuUNdFdiQe4co28FJ",
        "pubkey": "tpubDA9GDAntyJu4pKENoSXF3dWWWhCmB9L7UcqJWkruaxvtQYeepdMdz7o8xg1DQBaMRa1rN8F2kUKcKvxJbTKUd28jtQwrfVsEu3EYPrUPG8y",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mii4sVHEHUe2b5ByScY8YRy8uoFHJQQiLL",
        "pubkey": "tpubDA9GDAntyJu4EdgFqxhSLBqEwjoTSX2HRRiJVFZpbcruFJsso1EKmu19DdBc63G1c1pT8HnUhovm7NCSWeVyvE9Q9wGA4JqdJ2miWqhdzkL",
        "used_times": 1
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mjBSc6kpP2gNzb9zN5LspJaQaRnLwMz9mA",
        "pubkey": "tpubDA9GDAntyJu4KF3RnQ2xracdQ4o6hVtzzuZPPEkE7S3kJz9bbK3Hu3bPsFm7dJZEJFenc2LGiDSh2PL2DMDe46XgvjuKBGtEv1UcEx7xhBB",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mjCepq2yajcN19LiVjzpp1vv9HaLBohX6p",
        "pubkey": "tpubDA9GDAntyJu4nBLAumTT2q7zWUbRBG5KHnokuYtP6iZvRprHSgvmbGW6U8rp3qrdc5EwwtA8bfXPr8oHUhWqyFghAuje6duXCUSTwnF5neD",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mjD5Gzs6Y6i1EXrozYTVFvYhtR9yW68zzR",
        "pubkey": "tpubDA9GDAntyJu56yVj8PtkFqEPv1TFfAJ28esQCsWoWYGwpvjCjogrD6WE4oWWftqUGay1NWQqSpU8zTahTBe4TH8tDqbsJLUaLBUpTh6qKFK",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mjjAfXyvgkN79EVAV2RaRJnEr3zCbYrfik",
        "pubkey": "tpubDA9GDAntyJu4dVKNCK99aJwfUAtt8Vo2qktd5WbmndJRfEPht2h4nh3w8gAvDWvvFUd3amLZtouL5Ytd3ReHG66ar2my4BHd81oGWTc6pK4",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "moeFade6p3SeJrCCLtW8n5xQeC76MmK6rV",
        "pubkey": "tpubDA9GDAntyJu54ZMryfAAwwUkRTfV8tB6JRi2zE8DujrgHkAFU3ijtG3BbAJLRk5EuPPvyVXas2B1GDy9R8y244y2BECwLfurm7dEjp6h7b8",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "monUko9N21KhSU64cyR71JmXrCwEgASsZD",
        "pubkey": "tpubDA9GDAntyJu4sgm88kENFkhGUcJcEVTdeXygAkYdV8CH9Wc4KCRR5CPwk88xTqb1eY5mFpxmLeB66UhsZ5mv6joycS5dbrXzginoo5LdHPt",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "morRT4ExEyDWP11jMcr1HgZEq41QcScjzV",
        "pubkey": "tpubDA9GDAntyJu4bHxs6B2Zyg7qZyrkWD7TxUPKZgMtB3EyTdQ3EFqCbZbDBbVBDhogS2WyBYvwkdLJv2upYc6qZiKqwFo9cHgLfKEXZnYwbN1",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mqdTgFwnMxuQWtH1ye1aAUrfdB94sZ2KxM",
        "pubkey": "tpubDA9GDAntyJu4P99V3pyArHs3MKE7Sbc9Kn4tHj8rtfVakDn69xJcpyCF14JNLSMSogKYqkYfHnfdvtrjCoMjLB7yx1opx3AdCvs3Jvp51uj",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm",
        "pubkey": "tpubDA9GDAntyJu4G5PVHd8A9DHUsQypRnevFAh77zdRoJMrCAW9qd8PfWPKP1muVHBZWhmr9fG4RGmwoy7jZ4geJ2mB8nVgJM67c5bU6krV7bo",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "msXM5XH862HzC7kjS1XKEG7L5whgULwhWS",
        "pubkey": "tpubDA9GDAntyJu4tuWbToebo9eMR95uiGo6x58botabQunqkyTrGojrJTE9TuTNmN21neDtaENMMbookzSsgpGJg5rNxNbWNBY9dvA3BY6p24X",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mudPqRHdTfGUwMtpRJpQNJsthhDRjXS53H",
        "pubkey": "tpubDA9GDAntyJu4Z69jjTHEGyEcf6xjyG7v64NDJcz4cgSWKqoLGis552MY1pAfcrWxfuutTBcdukpq8gPJpgU7BiN3S8MuUTJj4WB726RPJab",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mvNc5xtbdErj7uULreKpH97Fde15RZphGz",
        "pubkey": "tpubDA9GDAntyJu4T9yicq6fWRwdRyr296FYXVyRVy6Hn1YzQTypiXSSbMW9fBSamTGWEEuWreG548G9hn16KThQFvvSGRVuqKKSrCR6GpeZ8W4",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mven1osKweoMkyJkyhfZ9r2a1bie8K2jzT",
        "pubkey": "tpubDA9GDAntyJu4wixLuLoF7jowkUMyQrQcBz4ia53Z51sXBGvRUF2EuYJ9PeGgE8Fn8uhbHsoqn6jeknigbFwnb6V2wjrxVkToC5dpHoQc5p7",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mxMMrM8xQMSSfAaTqjwXds4jjLu5CKjMHD",
        "pubkey": "tpubDA9GDAntyJu4JC4DjX3aqYJxZ51bPcWrZgoDQVAJq8cQa21rjz3updsKYWotBmMpbnNoh1iSUHGtXKt5xNn8FWbz6J1hNDDwtrVKexpHtwa",
        "used_times": 0
      },
      {
        "account": "mnkgeudfzGEFzNCvscFvTJ7sSnLDkTVBsb",
        "address": "mxjecuQVCicsU7iAGnwApHmvoysTb9PiRt",
        "pubkey": "tpubDA9GDAntyJu4fjXXXWVK8M5HCNnw7j88thnsDmZVHQqxdbDhKreTqGsEZdJRdWH2htJPXbtCGtdGifXAjsXx5P18GbC73xHxsDwU3vVCRAe",
        "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": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}' http://localhost:5279/
lbrynet address list --account_id="mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"
requests.post("http://localhost:5279", json={"method": "address_list", "params": {"account_id": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mgjB6e1ezev8FY1ACnkmkDxjNCp5VC7Ano",
        "pubkey": "tpubDA9GDAntyJu4TFtXYGczh2A4XxW8noxE1dfMcLqjX9sMs8YNE1owV6ck3e9SN594tJiBdbTTqhbepa4JGFoWQRVCwzkEe5WC9ggfRQm7bQ8",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mgrgFeXbtX4DXFSkP8e4AEWSC6jULkZb63",
        "pubkey": "tpubDA9GDAntyJu4NVGo2ZA32S4SK3DVfKpYWpm6v9YgPcSobJvf8A5Gc5mAJGDzpnYaN9XyALhegTL21Wg8X8jC8AqfX8WS89q9rExJnPC6Kjv",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mhFB8td4KwVBy7hix8364L3yFSEiYuNbq9",
        "pubkey": "tpubDA9GDAntyJu4GC3Rh9ZJoxBAg3JS3wAXveny8iZBtXxyjZiyZNrQyTXarfBFfq3MzKntNRvgDAZvAs4f8sxwBgugf4vjEF2gE8ryjz79XM9",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "miKdTrdpBKoTvqSKgLZdibYgzZk5zszndC",
        "pubkey": "tpubDA9GDAntyJu4R6VQkrvDsNCqXw6buTQKvScS8QNKLwsPQ6NcqhaEDU9hpNYiV71f19DDGZyiQpLrr2xoNtKXELLrBW3uSyBfjrt9To1zQWq",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "miLbiPKfLD7c3T1FxfAtZ5idB18QdKmak2",
        "pubkey": "tpubDA9GDAntyJu4f5YeA4rhsqJ9yHGLjX7Wqa1DSGaC25bV86s5GGUkTvhb4X6DZ2d2qaBoCoGRkSfekVimbwQk187hzdLj6CCGtknPm7BjcRG",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mjyh73VqvMjSJqXjwBQPhjmxfssBfToEYb",
        "pubkey": "tpubDA9GDAntyJu4P6JJWkvwPzYGCYjdzttU7QaJBHRSEzF8wDTGNPfNQPCShSnLDiqWpxbrEbMEi9Xzwnn3HmgxEKofcnhDLixjQsgAjpf5WD6",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mkGUuHLcLht61VH22buTvPpM3mTPctRBtL",
        "pubkey": "tpubDA9GDAntyJu4pGUqURvR65CVjtUWWhuNw467D5Cr3aFGRaNavXcYL1fkreM2XJWtPsNfCg1prhe2W3aqW8Ay4a1eWm69Vm6hqNrwTKvy9Nw",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mmgsvuPTWoTUHdD45g1xUveEhhUzRrfVaP",
        "pubkey": "tpubDA9GDAntyJu4rpvkPkGapDqWw2na6gaGFGX6KEK86WTiEyuoCcbmRvtvcPxnUnKXsacbbpByrQwLkGD9qGjhfk9oUY3DYHEn9m4kJoQuusx",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mnWfTjdTbKbSZR8XW14tptAUVd96LkjUFm",
        "pubkey": "tpubDA9GDAntyJu4Jhq8X7ZmPJQSuUffLMUCAVqdAHwCdh6R26oieaSpFNGBhUk33nXc6uiU3apFynA4CpPBxG3FzPf1TMuYu1P82oeg8dMqTpn",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mpqKcHmmWE1qY727M7ANv9oBXir5VbHkdP",
        "pubkey": "tpubDA9GDAntyJu4H9XUa4RnDvRodqUrbJkAXamJwoMiXaseyEnwpqwq2XbkceBUsotfYr8r3YcDAwZce4TJ2rToT4MjnKCAoWTwka996khajde",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "msvdBNEf1cFSszvHNcQu3ANaK9g8gj582c",
        "pubkey": "tpubDA9GDAntyJu4WjEZzxFAUYS8KUcRM8DorcmbRF69PHaeDm3eu8YoJMMut3PL8RZEPSmvtc64F4Bb6GEJTcak1yw6ADZL6LoonK9E1khHzXM",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "muB4RCbSL3tF7onRRbUB4gRWTQEoT5ZcMz",
        "pubkey": "tpubDA9GDAntyJu4zcr2HyFHb3CfU44pYhwiS9TaRQySkVQfeQLzP1Zv9RAAsz3K3n8AcraHwf6Sw8AfRK2nKSm4g5Fto5iy1yTve5vGXEa5B48",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "muC5eaJq2CMrtE7te9cWcXUibWhsJnGuAm",
        "pubkey": "tpubDA9GDAntyJu4TatXRgBNSPcW8JBr4iB4jQ5v8A94Mm4uYvrFT75kNaXucZvewH9YxDMveySVfGbaxcLNv2A4mSavK6SZ3E6y5nvqJDix7tB",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mucSZwuwbd5xyfLxMu92GEBYSWM1pERa2v",
        "pubkey": "tpubDA9GDAntyJu52c37bwDHuV6CqiNXMGgnksYsK4hJrHQ79e6aKCpk9Qv2sQdLGm5LLq4J18Q89fdoQN9hBgQCZMkgQhhp5wXC8vF4ctwcXnG",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mv2hshHynpW7VyX8Nt7xT5ti9aC9NQyAwr",
        "pubkey": "tpubDA9GDAntyJu4kmzUa6CmrsCBNmVdHY95RNAkT8T2dBb4oLefiW7etod7B5t3Nh8wf6LoGDDaCrst7YC3NxNxsXibC1QsQGK7LL7HvBxwoxP",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mv5aGKkDs2VDxQ2u36iSfqcZn51BGMwax2",
        "pubkey": "tpubDA9GDAntyJu4bFmupNxnkNd8ytpwAGZCtJcVgRzvPSaNn1ok8GGnxgrrdkXQZDyu7Zsk1EWhoMktadaDYSnjFjVd2oacfgWLTFfGHd7NmLV",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mwDag7ghPP2pWPyMFwzjCGhAU7QeZwH6vf",
        "pubkey": "tpubDA9GDAntyJu4LwmAa81T4xZ7kvFstzh1pLvZVZBEk7Jxvc6s85zvVWL3mfRC7PDLDjqEkWYHS4zbA8qMLXtdumgdvyyQxrgo4iWtJPjo2LR",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mwaaxkhpkzN3o1TtvHBqpLiZZd4YpMrF6Y",
        "pubkey": "tpubDA9GDAntyJu4k2xQ73wyvV5gu3dysJg3QghtTohUfQmi6WkBeDn5jrWvHxbneZJYVCJdpCvNN53Me76h9xkF9uUngFPmVyY9yMk9ceKJyqP",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mwdDVkcLeWaQyYdXFSUy18DdVuaVER8uop",
        "pubkey": "tpubDA9GDAntyJu4ZJcT95421KsG4QCvYDAGUkgrNVBhwTodHnvRAEfiGktjP1U4iEZQWt8eaAfG5vQ1pgpHE9LDP8uirT2qE4fWJ8QyZ3xqjmt",
        "used_times": 0
      },
      {
        "account": "mzayD1KR21CDvPWZdsxDRX4vzLj7174Qjz",
        "address": "mxhALC4NpCKwxQdUitbHShiVAaJ1fSoYBi",
        "pubkey": "tpubDA9GDAntyJu54kGi7LH4ZyN6WXC2cgHCU3uiWzk67uDZFAvyr5jEt1WDXGwDvjWXdMiuHZdDXcWM52jPGueFkD4sXxYdFZpSq4V97K7LRCo",
        "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": "n1hQFQVV4mhHapCoFTdvXfAE8Z7uk5jGHV"
}

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_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": "d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605"}}' http://localhost:5279/
lbrynet blob delete d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605
requests.post("http://localhost:5279", json={"method": "blob_delete", "params": {"blob_hash": "d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": "Deleted d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605"
}

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 by sd hash
  • 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": [
      "d196df834a844e537fe4fbd08852132de6800c0e08e31577f32fb3d42371d81c31dada27c07a4a253fdae616c4ce3605",
      "0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e",
      "ff42b24e4b846dd1baf5e2b0f48c53b75184e2ffef8d20e770797704f0ddbf58ba8c243c7e2658b220d6bae9950e7278",
      "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d"
    ],
    "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_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_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": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet channel abandon 76f9b804d1d7a5a36eeebab1fa29333926f8fda1
requests.post("http://localhost:5279", json={"method": "channel_abandon", "params": {"claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001252e1cbd42a9e0629e127cc0a74168815a6610900281c90b5193c7660c990087000000006a47304402204023cb7d7bd038b65700e5121ecee2f08505b48561f8ca107f81980d33b220ab0220208af0641036108938197c076d1c9851eca1f0056d8b1e08394bcbd6b75c1d090121036e13c0c6a42f4d830bfadda1c3f130af17ca825ed79348a7de08548fd508cd10ffffffff0134b7f505000000001976a914f078ffcbc1414ec52d95531ae92f24d58a0c38e388ac00000000",
    "inputs": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "update",
        "confirmations": 8,
        "has_signing_key": true,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
          "title": "New Channel"
        },
        "value_type": "channel"
      }
    ],
    "outputs": [
      {
        "address": "n3STRGLnoQSevNzSZWZ9oA67SM4apXpFzn",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "99d49ed84cf7532a89775aa62be74dabb715320a5fe7d21c8e83a97b0e85c6c5",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "99d49ed84cf7532a89775aa62be74dabb715320a5fe7d21c8e83a97b0e85c6c5"
  }
}

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_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_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": "01000000016cbd18b25215142c6ed3cd910b4232e5a132ffc014607181d3a7338c3f20570d010000006b483045022100e328e296214c79e4cdcce2dd871b1cd931240af509fc7cb2b1d1cdc26b4dd6a30220567de67be6c7cea11fb5210f133c50db08c6ff5c5c4e5b431c63086003b5f50201210248c8856ffe16b8af0ab9914db4b4f1b3ee9caa94822ad6e9cc15e37d2f346d7bffffffff0200e1f5050000000084b508406368616e6e656c4c5d00125a0a583056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df0666d7576a914e5a5ec8c00823f369d4ba8abb114ea0b2028f21e88acc462a029000000001976a91477053863f3b082f79e4c835ee7137f0f8dd0725188ac00000000",
    "inputs": [
      {
        "address": "mgNHyfoek6eo9py6eA7nVWihdjQoepAqaE",
        "amount": "7.999876",
        "confirmations": 2,
        "height": 207,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265352,
        "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "create",
        "confirmations": -2,
        "has_signing_key": true,
        "height": -2,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": null,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4"
        },
        "value_type": "channel"
      },
      {
        "address": "mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm",
        "amount": "6.983769",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "payment"
      }
    ],
    "total_fee": "0.016107",
    "total_input": "7.999876",
    "total_output": "7.983769",
    "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859"
  }
}

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": "0100000001252e1cbd42a9e0629e127cc0a74168815a6610900281c90b5193c7660c990087010000006a47304402201c33fd93ea28b6ca66373e0763a49824a461578ba0b695baf0f43a70eaa97b5802200b7b172f3658a846fdf27885f0e2a770fb6096f1bf6ebda0fd854f848b7a70d801210281518437b8629fe82ada4cbc3fa290655706c66a31c477471cfa1fb69c1c64c2ffffffff0200e1f50500000000fd5001b50b406269676368616e6e656c4d25010012ab010a583056301006072a8648ce3d020106052b8104000a0342000493068955eb537a2d82dccbd84950341f5158c5a2a6deaa4950042b55066b248de1a19a75bc85e0c11d64a82d9145ba15601e6ecce51154ab155b14bd34d12308121663726561746f7240736d616c6c6d656469612e636f6d1a15687474703a2f2f736d616c6c6d656469612e636f6d22202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a7067420b426967204368616e6e656c4a1e41206368616e6e656c2077697468206c6f7473206f6620766964656f732e52202a1e687474703a2f2f736d616c6c6d656469612e636f6d2f6c6f676f2e6a70675a056d757369635a0361727462050883011820620308ab016a0208206a0908e9011a044b6979766d7576a914c14a8f51d1028696cf67e23bb5514e0e2431446d88ace221d305000000001976a914b8a9a496d90669cdf7d79dc115a08cc3a82f186388ac00000000",
    "inputs": [
      {
        "address": "myKgmPDaWLycFbgwqF6ei5fg1tYRivVZ2e",
        "amount": "1.9993355",
        "confirmations": 1,
        "height": 210,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265352,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "my8z2awNqM4VKJGTvfryoTeKg1YaCKu1kt",
        "amount": "1.0",
        "claim_id": "0dddf44763759c5d48f4b517c4c6edf91a835938",
        "claim_op": "create",
        "confirmations": -2,
        "has_signing_key": true,
        "height": -2,
        "meta": {},
        "name": "@bigchannel",
        "normalized_name": "@bigchannel",
        "nout": 0,
        "permanent_url": "lbry://@bigchannel#0dddf44763759c5d48f4b517c4c6edf91a835938",
        "timestamp": null,
        "txid": "225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a",
        "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": "3056301006072a8648ce3d020106052b8104000a0342000493068955eb537a2d82dccbd84950341f5158c5a2a6deaa4950042b55066b248de1a19a75bc85e0c11d64a82d9145ba15601e6ecce51154ab155b14bd34d12308",
          "public_key_id": "mpiMSeZA6qn3GvZk8KfChJgLWcfsskdZS5",
          "tags": [
            "music",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/logo.jpg"
          },
          "title": "Big Channel",
          "website_url": "http://smallmedia.com"
        },
        "value_type": "channel"
      },
      {
        "address": "mxMMrM8xQMSSfAaTqjwXds4jjLu5CKjMHD",
        "amount": "0.9772285",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "1.9993355",
    "total_output": "1.9772285",
    "txid": "225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a"
  }
}

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

  • 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_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": {}}' http://localhost:5279/
lbrynet channel list
requests.post("http://localhost:5279", json={"method": "channel_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "create",
        "confirmations": 1,
        "has_signing_key": true,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "total_pages": 1
  }
}

Paginate your channel claims


curl -d'{"method": "channel_list", "params": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet channel list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "channel_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "create",
        "confirmations": 1,
        "has_signing_key": true,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4"
        },
        "value_type": "channel"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "total_pages": 1
  }
}

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_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_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": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "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 76f9b804d1d7a5a36eeebab1fa29333926f8fda1 --title="New Channel"
requests.post("http://localhost:5279", json={"method": "channel_update", "params": {"claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "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": "01000000025938959fff1c02e7e0e6d105d4a0e10180084338e0decaba965f2ebd39afc46f000000006b483045022100b276b1a4d919aa367b30a4574b92c1f8180dacd1ad1d69a3cb49fd9dd7e36ef70220037d6ad8f11c92fda22e1222af2ad2580e74921ed251bfbb1059c1556f86e77d0121036e13c0c6a42f4d830bfadda1c3f130af17ca825ed79348a7de08548fd508cd10ffffffff907d4d39af576b3a8887578c4307a3b1cfb8d353cbd9eeab67bd649d9c5366ac000000006b483045022100f6fe619cb0d30e26c3495a53bd4b2fc2a643e5f10b5fa009c2e29d02ac0c22c202207eaa90180ba9e77bb6fd4697a08bb7f853de7e63ee760928e66631354cbd9f2e012103491fd5b5854dc05014d0f7fe31dc357816e104284bb2657c2d2753042aa2d609ffffffff0200e1f50500000000a6b708406368616e6e656c14a1fdf826393329fab1baee6ea3a5d7d104b8f9764c6a00125a0a583056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066420b4e6577204368616e6e656c6d6d76a914e5a5ec8c00823f369d4ba8abb114ea0b2028f21e88ac6ebeea0b000000001976a914c350b9ca410642afa1bcf86adbabbeaa995ff26388ac00000000",
    "inputs": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "create",
        "confirmations": 1,
        "has_signing_key": true,
        "height": 209,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4"
        },
        "value_type": "channel"
      },
      {
        "address": "mkcrtKoGQxAsTRVywM8D6Js5rriUM7yzCE",
        "amount": "1.999604",
        "confirmations": 1,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 0,
        "timestamp": 1574265352,
        "txid": "ac66539c9d64bd67abeed9cb53d3b8cfb1a307438c5787883a6b57af394d7d90",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "update",
        "confirmations": -2,
        "has_signing_key": true,
        "height": -2,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": null,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
          "title": "New Channel"
        },
        "value_type": "channel"
      },
      {
        "address": "myKgmPDaWLycFbgwqF6ei5fg1tYRivVZ2e",
        "amount": "1.9993355",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "payment"
      }
    ],
    "total_fee": "0.0002685",
    "total_input": "2.999604",
    "total_output": "2.9993355",
    "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25"
  }
}

claim_list

List my stream and channel claims.

Arguments

  • claim_type
    optionalstr
    claim type: channel, stream, repost, collection
  • 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_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": {}}' http://localhost:5279/
lbrynet claim list
requests.post("http://localhost:5279", json={"method": "claim_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "update",
        "confirmations": 5,
        "has_signing_key": true,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
          "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": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet claim list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "claim_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
        "amount": "1.0",
        "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "claim_op": "update",
        "confirmations": 5,
        "has_signing_key": true,
        "height": 210,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "@channel",
        "normalized_name": "@channel",
        "nout": 0,
        "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "timestamp": 1574265352,
        "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
        "type": "claim",
        "value": {
          "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
          "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
          "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.

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
  • 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_group
    optionalint
    group numbers 1 through 4 representing the trending groups of the content: 4 means content is trending globally and independently, 3 means content is not trending globally but is trending independently (locally), 2 means it is trending globally but not independently and 1 means it's not trending globally or locally (supports equality constraints)
  • trending_mixed
    optionalint
    trending amount taken from the global or local value depending on the trending group: 4 - global value, 3 - local value, 2 - global value, 1 - local value (supports equality constraints)
  • trending_local
    optionalint
    trending value calculated relative only to the individual contents past history (supports equality constraints)
  • trending_global
    optionalint
    trending value calculated relative to all trending content globally (supports equality constraints)
  • 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' or 'unknown'
  • 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)
  • 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 reciepts

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_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": []}}' 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": []}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7/astream#6",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_channel_signature_valid": true,
        "meta": {
          "activation_height": 213,
          "creation_height": 213,
          "creation_timestamp": 1574265353,
          "effective_amount": "1.0",
          "expiration_height": 263187,
          "is_controlling": true,
          "reposted": 0,
          "support_amount": "0.0",
          "take_over_height": 213,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "short_url": "lbry://astream#6",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "canonical_url": "lbry://@channel#7",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": false,
          "height": 210,
          "meta": {
            "activation_height": 209,
            "claims_in_channel": 1,
            "creation_height": 209,
            "creation_timestamp": 1574265352,
            "effective_amount": "1.0",
            "expiration_height": 263183,
            "is_controlling": true,
            "reposted": 0,
            "support_amount": "0.0",
            "take_over_height": 209,
            "trending_global": 0.0,
            "trending_group": 0,
            "trending_local": 0.0,
            "trending_mixed": 0.0
          },
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "short_url": "lbry://@channel#7",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "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": []}}' 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": []}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "canonical_url": "lbry://@channel#7/astream#6",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_channel_signature_valid": true,
        "meta": {
          "activation_height": 213,
          "creation_height": 213,
          "creation_timestamp": 1574265353,
          "effective_amount": "1.0",
          "expiration_height": 263187,
          "is_controlling": true,
          "reposted": 0,
          "support_amount": "0.0",
          "take_over_height": 213,
          "trending_global": 0.0,
          "trending_group": 0,
          "trending_local": 0.0,
          "trending_mixed": 0.0
        },
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "short_url": "lbry://astream#6",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "canonical_url": "lbry://@channel#7",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": false,
          "height": 210,
          "meta": {
            "activation_height": 209,
            "claims_in_channel": 1,
            "creation_height": 209,
            "creation_timestamp": 1574265352,
            "effective_amount": "1.0",
            "expiration_height": 263183,
            "is_controlling": true,
            "reposted": 0,
            "support_amount": "0.0",
            "take_over_height": 209,
            "trending_global": 0.0,
            "trending_group": 0,
            "trending_local": 0.0,
            "trending_mixed": 0.0
          },
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "short_url": "lbry://@channel#7",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "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_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_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
    list
    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
  • clear_languages
    optionalbool
    clear existing languages (prior to adding new ones)
  • 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
  • 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_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_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_list

List my collection claims.

Arguments

  • 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_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_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_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
  • 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
  • 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 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_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_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

comment_abandon

Abandon a comment published under your channel identity.

Arguments

  • comment_id
    str
    The ID of the comment to be abandoned.
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(dict) Object with the `comment_id` passed in as the key, and a flag indicating if it was abandoned
{
     (str): {
        "abandoned": (bool)
    }
}
// example(s) to come later

comment_create

Create and associate a comment with a claim using your channel identity.

Arguments

  • comment
    str
    Comment to be made, should be at most 2000 characters.
  • claim_id
    str
    The ID of the claim to comment on
  • parent_id
    optionalstr
    The ID of a comment to make a response to
  • channel_id
    optionalstr
    The ID of the channel you want to post under
  • channel_name
    optionalstr
    The channel you want to post as, prepend with a '@'
  • 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) Comment object if successfully made, (None) otherwise
{
    "comment":      (str) The actual string as inputted by the user,
    "comment_id":   (str) The Comment's unique identifier,
    "channel_name": (str) Name of the channel this was posted under, prepended with a '@',
    "channel_id":   (str) The Channel Claim ID that this comment was posted under,
    "signature":    (str) The signature of the comment,
    "channel_url":  (str) Channel's URI in the ClaimTrie,
    "parent_id":    (str) Comment this is replying to, (None) if this is the root,
    "timestamp":    (int) The time at which comment was entered into the server at, in nanoseconds.
}
// example(s) to come later

comment_hide

Hide a comment published to a claim you control.

Arguments

  • comment_ids
    optionalstr, list
    one or more comment_id to hide.
  • wallet_id
    optionalstr
    restrict operation to specific wallet

Returns

(dict) keyed by comment_id, containing success info
'': {
    "hidden": (bool)  flag indicating if comment_id was hidden
}
// example(s) to come later

comment_list

List comments associated with a claim.

Arguments

  • claim_id
    str
    The claim on which the comment will be made on
  • parent_id
    optionalstr
    CommentId of a specific thread you'd like to see
  • page
    optionalint
    The page you'd like to see in the comment list.
  • page_size
    optionalint
    The amount of comments that you'd like to retrieve
  • include_replies
    optionalbool
    Whether or not you want to include replies in list
  • is_channel_signature_valid
    optionalbool
    Only include comments with valid signatures. [Warning: Paginated total size will not change, even if list reduces]
  • visible
    optionalbool
    Select only Visible Comments
  • hidden
    optionalbool
    Select only Hidden Comments

Returns

(dict)  Containing the list, and information about the paginated content:
{
    "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": "A List of dict objects representing comments."
    [
        {
            "comment":      (str) The actual string as inputted by the user,
            "comment_id":   (str) The Comment's unique identifier,
            "channel_name": (str) Name of the channel this was posted under, prepended with a '@',
            "channel_id":   (str) The Channel Claim ID that this comment was posted under,
            "signature":    (str) The signature of the comment,
            "channel_url":  (str) Channel's URI in the ClaimTrie,
            "parent_id":    (str) Comment this is replying to, (None) if this is the root,
            "timestamp":    (int) The time at which comment was entered into the server at, in nanoseconds.
        },
        ...
    ]
}
// 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": "6d779c509a47c97a050540a42863341eed6c47ad"}}' http://localhost:5279/
lbrynet file delete --claim_id="6d779c509a47c97a050540a42863341eed6c47ad"
requests.post("http://localhost:5279", json={"method": "file_delete", "params": {"delete_from_download_dir": false, "delete_all": false, "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad"}}).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
  • outpoint
    optionalstr
    get file with matching claim outpoint
  • 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
  • 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
  • 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)
  • 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"
        }
    ]
}

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": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "channel_name": "@channel",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_name": "astream",
        "completed": true,
        "confirmations": -1,
        "content_fee": null,
        "download_directory": null,
        "download_path": null,
        "file_name": null,
        "height": -1,
        "key": "f67a8b72104b6dba232cfcd28e7a4766",
        "metadata": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "mime_type": "application/octet-stream",
        "nout": 0,
        "outpoint": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0",
        "points_paid": 0.0,
        "protobuf": "01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "purchase_receipt": null,
        "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "status": "finished",
        "stopped": true,
        "stream_hash": "092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879",
        "stream_name": "tmprsllesnu",
        "streaming_url": "http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "suggested_file_name": "tmprsllesnu",
        "timestamp": null,
        "total_bytes": 16,
        "total_bytes_lower_bound": 0,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "written_bytes": 0
      },
      {
        "added_on": null,
        "blobs_completed": 1,
        "blobs_in_stream": 1,
        "blobs_remaining": 0,
        "channel_claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "channel_name": "@channel",
        "claim_id": "c9a6d356aa9bba38a32e15e1be4651601c722462",
        "claim_name": "blank-image",
        "completed": false,
        "confirmations": -1,
        "content_fee": null,
        "download_directory": null,
        "download_path": null,
        "file_name": null,
        "height": -1,
        "key": "e8d2b17d3193371ca7f6c2d13f5663bd",
        "metadata": {
          "author": "Picaso",
          "description": "A blank PNG that is 5x7.",
          "fee": {
            "address": "n3x8BYAScTPWfaCABx8F4oC56DYMc7havg",
            "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": "1574265329",
          "source": {
            "hash": "6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545",
            "media_type": "image/png",
            "name": "tmpcsxmdo53.png",
            "sd_hash": "0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e",
            "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": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b:0",
        "points_paid": 0.0,
        "protobuf": "01a1fdf826393329fab1baee6ea3a5d7d104b8f9765fef5f401f359208ca5e5e24e0409f4b362a7d4a7d47c43c6793e04e1f29f5ff42d552b9a7a9d0deb138d9f62d6214919fafb6fc43f9c18cd6c5b0f599b641f70ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706373786d646f35332e706e6718632209696d6167652f706e6732300017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728f1c3d5ee053222080112196ff6156b8ae227e28d010fc14256d4848501c063137019cfcd188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e63686573746572",
        "purchase_receipt": null,
        "sd_hash": "0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e",
        "status": "finished",
        "stopped": true,
        "stream_hash": "21b2eeb95de4ca04cd368ee3ab12a11f489e2147cacde83ef6e50ffbcbc01c36daf1e9f63d78380734e38ef8bcac6086",
        "stream_name": "tmpcsxmdo53.png",
        "streaming_url": "http://localhost:5280/stream/0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e",
        "suggested_file_name": "tmpcsxmdo53.png",
        "timestamp": null,
        "total_bytes": 112,
        "total_bytes_lower_bound": 96,
        "txid": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b",
        "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": "6d779c509a47c97a050540a42863341eed6c47ad", "reverse": false}}' http://localhost:5279/
lbrynet file list --claim_id="6d779c509a47c97a050540a42863341eed6c47ad"
requests.post("http://localhost:5279", json={"method": "file_list", "params": {"claim_id": "6d779c509a47c97a050540a42863341eed6c47ad", "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": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
        "channel_name": "@channel",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_name": "astream",
        "completed": true,
        "confirmations": 3,
        "content_fee": null,
        "download_directory": null,
        "download_path": null,
        "file_name": null,
        "height": 214,
        "key": "f67a8b72104b6dba232cfcd28e7a4766",
        "metadata": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "mime_type": "application/octet-stream",
        "nout": 0,
        "outpoint": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0",
        "points_paid": 0.0,
        "protobuf": "01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "purchase_receipt": null,
        "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "status": "finished",
        "stopped": true,
        "stream_hash": "092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879",
        "stream_name": "tmprsllesnu",
        "streaming_url": "http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "suggested_file_name": "tmprsllesnu",
        "timestamp": 1574265353,
        "total_bytes": 16,
        "total_bytes_lower_bound": 0,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "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"
}

Save a file to the downloads directory


curl -d'{"method": "file_save", "params": {"sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d"}}' http://localhost:5279/
lbrynet file save --sd_hash="b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d"
requests.post("http://localhost:5279", json={"method": "file_save", "params": {"sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d"}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "added_on": 1574265331,
    "blobs_completed": 1,
    "blobs_in_stream": 1,
    "blobs_remaining": 0,
    "channel_claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
    "channel_name": "@channel",
    "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
    "claim_name": "astream",
    "completed": true,
    "confirmations": 3,
    "content_fee": null,
    "download_directory": null,
    "download_path": null,
    "file_name": null,
    "height": 214,
    "key": "f67a8b72104b6dba232cfcd28e7a4766",
    "metadata": {
      "source": {
        "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
        "media_type": "application/octet-stream",
        "name": "tmprsllesnu",
        "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
        "size": "11"
      },
      "stream_type": "binary"
    },
    "mime_type": "application/octet-stream",
    "nout": 0,
    "outpoint": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5:0",
    "points_paid": 0.0,
    "protobuf": "01a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "purchase_receipt": null,
    "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "status": "running",
    "stopped": false,
    "stream_hash": "092716e0202018119c909a6cce0f837c05a817359061112ca9efc5112d34369510980187e66ec45a3c34f40319275879",
    "stream_name": "tmprsllesnu",
    "streaming_url": "http://localhost:5280/stream/b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
    "suggested_file_name": "tmprsllesnu",
    "timestamp": 1574265353,
    "total_bytes": 16,
    "total_bytes_lower_bound": 0,
    "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
    "written_bytes": 0
  }
}

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
  • search_bottom_out_limit
    optionalint
    the number of search probes in a row that don't find any new peers before giving up and returning
  • 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_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_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_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_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": {
    "announce_head_and_sd_only": true,
    "api": "localhost:5279",
    "blob_download_timeout": 30.0,
    "blob_lru_cache_size": 0,
    "blockchain_name": "lbrycrd_regtest",
    "cache_time": 150,
    "coin_selection_strategy": "standard",
    "comment_server": "https://comments.lbry.com/api",
    "components_to_skip": [
      "dht",
      "upnp",
      "hash_announcer",
      "peer_protocol_server"
    ],
    "concurrent_blob_announcers": 10,
    "concurrent_reflector_uploads": 10,
    "config": "/home/lex/.local/share/lbry/lbrynet/daemon_settings.yml",
    "data_dir": "/tmp/tmpgnoina61",
    "download_dir": "/tmp/tmpgnoina61",
    "download_timeout": 30.0,
    "fixed_peer_delay": 2.0,
    "known_dht_nodes": [],
    "lbryum_servers": [
      [
        "127.0.0.1",
        50001
      ]
    ],
    "max_connections_per_download": 4,
    "max_key_fee": {
      "amount": 50.0,
      "currency": "USD"
    },
    "network_interface": "0.0.0.0",
    "node_rpc_timeout": 5.0,
    "peer_connect_timeout": 3.0,
    "reflect_streams": true,
    "reflector_servers": [
      [
        "127.0.0.1",
        5566
      ]
    ],
    "s3_headers_depth": 960,
    "save_blobs": true,
    "save_files": true,
    "share_usage_data": false,
    "split_buckets_under_index": 1,
    "streaming_get": true,
    "streaming_server": "localhost:5280",
    "tcp_port": 3333,
    "track_bandwidth": true,
    "udp_port": 4444,
    "use_upnp": false,
    "wallet_dir": "/tmp/tmpgnoina61",
    "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_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_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": "6d779c509a47c97a050540a42863341eed6c47ad", "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream abandon 6d779c509a47c97a050540a42863341eed6c47ad
requests.post("http://localhost:5279", json={"method": "stream_abandon", "params": {"claim_id": "6d779c509a47c97a050540a42863341eed6c47ad", "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001c5856fbb7009a85a78c9f9644b2d4f91bf6f7055718c652891939523a2278b6a000000006a47304402201d29042146b7798130463acbd5c6c3c4fa30963e5c45c9692696e719713ebb3702205bedc2f5e736588967442b98781a325a1f1059290d1cff1b1296c05fbde789e8012103f89a894c1453e0cddb844b1eb3f949ca2204d6ba34fc07249e47b55a8534a0b3ffffffff0134b7f505000000001976a914282fd11ceb5364d73f91cce828937eb2e5cd86cf88ac00000000",
    "inputs": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 3,
        "height": 214,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "outputs": [
      {
        "address": "mjBSc6kpP2gNzb9zN5LspJaQaRnLwMz9mA",
        "amount": "0.999893",
        "confirmations": -2,
        "height": -2,
        "nout": 0,
        "timestamp": null,
        "txid": "7c3a90172981e3154ad468ca9c977c0b7fac79f547ea65883dcc9bcbab7a3173",
        "type": "payment"
      }
    ],
    "total_fee": "0.000107",
    "total_input": "1.0",
    "total_output": "0.999893",
    "txid": "7c3a90172981e3154ad468ca9c977c0b7fac79f547ea65883dcc9bcbab7a3173"
  }
}

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
    str
    path to file to be associated with name.
  • 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
  • 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_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_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": "/tmp/tmprsllesnu", "tags": [], "languages": [], "locations": [], "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream create astream 1.0 /tmp/tmprsllesnu
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "astream", "bid": "1.0", "file_path": "/tmp/tmprsllesnu", "tags": [], "languages": [], "locations": [], "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "01000000015938959fff1c02e7e0e6d105d4a0e10180084338e0decaba965f2ebd39afc46f010000006a47304402207998278ec7f74855a16f282ed334847982ff2f90a0a8126c056a3af85c297c8a022024c09f4335f4b64c506ccd75619a3e4a4e3e485e215519f8388edcf4bebc18cb0121039f01e128d9a2bf76bdac66ef3c860fc36e10ff6189f27a10d0115c85d86993e3ffffffff0200e1f50500000000bab5076173747265616d4c94000a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d6d7576a914032dcda1a00c97492eba9cd3228eff69546c74a088ac38fb9423000000001976a9141de221c42b8c6ffaf4c2133b9c17353fa09fc41f88ac00000000",
    "inputs": [
      {
        "address": "mrNGxbLpqtct1KWvKFPWbvdrzs1EbAKBTm",
        "amount": "6.983769",
        "confirmations": 4,
        "height": 209,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265352,
        "txid": "6fc4af39bd2e5f96bacadee03843088001e1a0d405d1e6e0e7021cff9f953859",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "create",
        "confirmations": -2,
        "height": -2,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "timestamp": null,
        "txid": "9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "miExnY6VrwasxxmLwov7pxoSkXh5y6VKNE",
        "amount": "5.969662",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd",
        "type": "payment"
      }
    ],
    "total_fee": "0.014107",
    "total_input": "6.983769",
    "total_output": "6.969662",
    "txid": "9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd"
  }
}

Create an image stream claim with all metadata and fee


curl -d'{"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/tmp/tmpcsxmdo53.png", "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": 1574265329, "channel_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}' http://localhost:5279/
lbrynet stream create blank-image 1.0 /tmp/tmpcsxmdo53.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=1574265329 --channel_id="76f9b804d1d7a5a36eeebab1fa29333926f8fda1"
requests.post("http://localhost:5279", json={"method": "stream_create", "params": {"name": "blank-image", "bid": "1.0", "file_path": "/tmp/tmpcsxmdo53.png", "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": 1574265329, "channel_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000001fd942043ff232fd7e14a52fceda82d6504423ec141da78c3c35fa09e7d822097010000006b4830450221008aea0838df805584172337e3496860ee583e2049061a8bf4e05077df3165ed87022077c73e062adb40134c2e0d17f2cc888a6fc3157a432bc110b0846198ef3d480d01210308ef67ea2459f85847112fa55cd5223f5f0ddc3975401b4992fb3f139850b7d9ffffffff0200e1f50500000000fddc01b50b626c616e6b2d696d6167654db10101a1fdf826393329fab1baee6ea3a5d7d104b8f9765fef5f401f359208ca5e5e24e0409f4b362a7d4a7d47c43c6793e04e1f29f5ff42d552b9a7a9d0deb138d9f62d6214919fafb6fc43f9c18cd6c5b0f599b641f70ae6010a82010a306c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545120f746d706373786d646f35332e706e6718632209696d6167652f706e6732300017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e120650696361736f1a0d5075626c696320446f6d61696e2218687474703a2f2f7075626c69632d646f6d61696e2e6f726728f1c3d5ee053222080112196ff6156b8ae227e28d010fc14256d4848501c063137019cfcd188087a70e520408051007420b426c616e6b20496d6167654a184120626c616e6b20504e472074686174206973203578372e52252a23687474703a2f2f736d616c6c6d656469612e636f6d2f7468756d626e61696c2e6a70675a05626c616e6b5a03617274620208016a1308ec0112024e481a0a4d616e636865737465726d7576a914f6156b8ae227e28d010fc14256d4848501c0631388acac5e7d1d000000001976a91467ecfdce4cc9b6f3db9313277bda488868379d7088ac00000000",
    "inputs": [
      {
        "address": "miExnY6VrwasxxmLwov7pxoSkXh5y6VKNE",
        "amount": "5.969662",
        "confirmations": 2,
        "height": 213,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265353,
        "txid": "9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "n3x8BYAScTPWfaCABx8F4oC56DYMc7havg",
        "amount": "1.0",
        "claim_id": "c9a6d356aa9bba38a32e15e1be4651601c722462",
        "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#c9a6d356aa9bba38a32e15e1be4651601c722462",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": null,
        "txid": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b",
        "type": "claim",
        "value": {
          "author": "Picaso",
          "description": "A blank PNG that is 5x7.",
          "fee": {
            "address": "n3x8BYAScTPWfaCABx8F4oC56DYMc7havg",
            "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": "1574265329",
          "source": {
            "hash": "6c7df435d412c603390f593ef658c199817c7830ba3f16b7eadd8f99fa50e85dbd0d2b3dc61eadc33fe096e3872d1545",
            "media_type": "image/png",
            "name": "tmpcsxmdo53.png",
            "sd_hash": "0017ea2d52e8c2bb3309344fbec05b29a12f059e7ef55dee12682658e8e2f901b3cdf778ff3bfadb9522c008c851801e",
            "size": "99"
          },
          "stream_type": "image",
          "tags": [
            "blank",
            "art"
          ],
          "thumbnail": {
            "url": "http://smallmedia.com/thumbnail.jpg"
          },
          "title": "Blank Image"
        },
        "value_type": "stream"
      },
      {
        "address": "mpzToGNACEPUN3SP3mavDeXyjZLPBAdKzh",
        "amount": "4.947555",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b",
        "type": "payment"
      }
    ],
    "total_fee": "0.022107",
    "total_input": "5.969662",
    "total_output": "5.947555",
    "txid": "480f1b30819f33b0963eb1fa2bf32ade4d786f722d6163891bb76b2dfaf64d4b"
  }
}

stream_list

List my stream claims.

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_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": {}}' http://localhost:5279/
lbrynet stream list
requests.post("http://localhost:5279", json={"method": "stream_list", "params": {}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "total_pages": 1
  }
}

Paginate your stream claims


curl -d'{"method": "stream_list", "params": {"page": 1, "page_size": 20}}' http://localhost:5279/
lbrynet stream list --page=1 --page_size=20
requests.post("http://localhost:5279", json={"method": "stream_list", "params": {"page": 1, "page_size": 20}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "items": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": 1,
        "height": 214,
        "is_change": false,
        "is_channel_signature_valid": true,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 5,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": 1574265353,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      }
    ],
    "page": 1,
    "page_size": 20,
    "total_items": 1,
    "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.
  • 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_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_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.
  • 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
  • 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_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_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": "6d779c509a47c97a050540a42863341eed6c47ad", "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "clear_channel": false, "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}' http://localhost:5279/
lbrynet stream update 6d779c509a47c97a050540a42863341eed6c47ad --channel_id="76f9b804d1d7a5a36eeebab1fa29333926f8fda1"
requests.post("http://localhost:5279", json={"method": "stream_update", "params": {"claim_id": "6d779c509a47c97a050540a42863341eed6c47ad", "clear_fee": false, "tags": [], "clear_tags": false, "languages": [], "clear_languages": false, "locations": [], "clear_locations": false, "channel_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1", "clear_channel": false, "channel_account_id": [], "funding_account_ids": [], "preview": false, "blocking": false, "replace": false}}).json()

Output


{
  "jsonrpc": "2.0",
  "result": {
    "height": -2,
    "hex": "0100000002fd942043ff232fd7e14a52fceda82d6504423ec141da78c3c35fa09e7d822097000000006a473044022071f91293ea6594d24c509c1990817cbfe0192eb82224fefd858e8402c28b84ce02206bf38ebdea5378771a4f97f477a09cd4be32f7422b7c1cfbc37b86df7830057e012103f89a894c1453e0cddb844b1eb3f949ca2204d6ba34fc07249e47b55a8534a0b3ffffffff7ab2225f56b1d5bd85ec6fe6c8a797511308226a78972401ffd47efce0e05c22010000006b483045022100849d93b0e70e0cc615a34bc80d476fcc100ebd1cb7ed42846d64c3a950e47c7c0220651845f579da62189faa08c2559a4917830f717ae6660af44310ddf8d26468c4012103a362e2dc8696716d7a7b8c5235e0c21b3483e62ffa768966996c360c556039f6ffffffff0200e1f50500000000fd2301b7076173747265616d14ad476ced1e346328a44005057ac9479a509c776d4ce801a1fdf826393329fab1baee6ea3a5d7d104b8f97610031e5b3c49954d7f8854224fcc586162ffb37ebce66182dfadad96713bf9bb3c14c01dd7f8dce2923d4b4b07fbc272d1d7365de8719f714a3647fb62b2ca3a0a90010a8d010a30fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd120b746d7072736c6c65736e75180b22186170706c69636174696f6e2f6f637465742d73747265616d3230b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d6d6d76a914032dcda1a00c97492eba9cd3228eff69546c74a088ac32a0d205000000001976a914f974bc71e8add27124668d7f9d666f2d0f1bc06088ac00000000",
    "inputs": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "create",
        "confirmations": 1,
        "height": 213,
        "is_change": false,
        "is_mine": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "timestamp": 1574265353,
        "txid": "9720827d9ea05fc3c378da41c13e4204652da8edfc524ae1d72f23ff432094fd",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "mxMMrM8xQMSSfAaTqjwXds4jjLu5CKjMHD",
        "amount": "0.9772285",
        "confirmations": 3,
        "height": 211,
        "is_change": true,
        "is_mine": true,
        "nout": 1,
        "timestamp": 1574265352,
        "txid": "225ce0e0fc7ed4ff012497786a2208135197a7c8e66fec85bdd5b1565f22b27a",
        "type": "payment"
      }
    ],
    "outputs": [
      {
        "address": "mfomC6TdAbLQJpq1itfRdVbC7k8hArvypL",
        "amount": "1.0",
        "claim_id": "6d779c509a47c97a050540a42863341eed6c47ad",
        "claim_op": "update",
        "confirmations": -2,
        "height": -2,
        "is_channel_signature_valid": true,
        "meta": {},
        "name": "astream",
        "normalized_name": "astream",
        "nout": 0,
        "permanent_url": "lbry://astream#6d779c509a47c97a050540a42863341eed6c47ad",
        "signing_channel": {
          "address": "n2TDoavD9h9TVpxRWtAFpsQEFmpha7hbF3",
          "amount": "1.0",
          "claim_id": "76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "claim_op": "update",
          "confirmations": 4,
          "has_signing_key": true,
          "height": 210,
          "is_change": false,
          "is_mine": true,
          "meta": {},
          "name": "@channel",
          "normalized_name": "@channel",
          "nout": 0,
          "permanent_url": "lbry://@channel#76f9b804d1d7a5a36eeebab1fa29333926f8fda1",
          "timestamp": 1574265352,
          "txid": "8700990c66c793510bc981029010665a816841a7c07c129e62e0a942bd1c2e25",
          "type": "claim",
          "value": {
            "public_key": "3056301006072a8648ce3d020106052b8104000a03420004986e9237f24ccca2dd182fdc734c8aba84ec6fd2d031e9e2bbcdcad56c8e753636609434ced12a7bb978f1406fd0d6f8bebe7a9014c05e38efd0de7d173df066",
            "public_key_id": "mu39yX1k1WkNyPPvt7x27QyE9NDYX2dkS4",
            "title": "New Channel"
          },
          "value_type": "channel"
        },
        "timestamp": null,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "claim",
        "value": {
          "source": {
            "hash": "fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd",
            "media_type": "application/octet-stream",
            "name": "tmprsllesnu",
            "sd_hash": "b8aa5db430bc8cb142e650351aafbcf8db7f61f76cac2fc5494607ed1ea2621202d15372cafcc943a6ba155bca52789d",
            "size": "11"
          },
          "stream_type": "binary"
        },
        "value_type": "stream"
      },
      {
        "address": "n4FxPncA3L6B4PHQRgRLKZJo4XTeGhLmfh",
        "amount": "0.9768965",
        "confirmations": -2,
        "height": -2,
        "nout": 1,
        "timestamp": null,
        "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5",
        "type": "payment"
      }
    ],
    "total_fee": "0.000332",
    "total_input": "1.9772285",
    "total_output": "1.9768965",
    "txid": "6a8b27a22395939128658c7155706fbf914f2d4b64f9c9785aa80970bb6f85c5"
  }
}

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_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_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.
  • 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
  • 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_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_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 supports and tips in my control.

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

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

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": "2019-11-20 10:55",
        "fee": "-0.000124",
        "purchase_info": [],
        "support_info": [],
        "timestamp": 1574265352,
        "txid": "0d57203f8c33a7d381716014c0ff32a1e532420b91cdd36e2c141552b218bd6c",
        "update_info": [],
        "value": "0.0"
      },
      {
        "abandon_info": [],
        "claim_info": [],
        "confirmations": 7,
        "date": "2019-11-20 10:55",
        "fee": "0.0",
        "purchase_info": [],
        "support_info": [],
        "timestamp": 1574265351,
        "txid": "1bcf4ce39b4f34effb0ecc08a5a33dac9163b8558619968a44b43ca7fb9c6e27",
        "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_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_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

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

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