lbry-sdk APIs

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

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

Returns

(map) added account details
// example(s) for account_add to come later

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.
  • confirmations
    optionalint
    Only include transactions with this many confirmed blocks.

Returns

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

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

Returns

(map) new account details
// example(s) for account_create to come later

account_decrypt

Decrypt an encrypted account, this will remove the wallet password

Arguments

  • account_id
    optionalstr
    id for the account to decrypt

Returns

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

account_encrypt

Encrypt an unencrypted account with a password

Arguments

  • account_id
    optionalstr
    id for the account to encrypt

Returns

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

account_fund

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

Arguments

  • to_account
    optionalstr
    send to this account
  • from_account
    optionalstr
    spend from this account
  • amount
    str
    the amount to transfer lbc
  • everything
    optionalbool
    transfer everything (excluding claims), default: false.
  • outputs
    optionalint
    split payment across many outputs, default: 1.
  • broadcast
    optionalbool
    actually broadcast the transaction, default: false.

Returns

(map) transaction performing requested action
// example(s) for account_fund to come later

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

Returns

(map) balance of account(s)
// example(s) for account_list to come later

account_lock

Lock an unlocked account

Arguments

  • account_id
    optionalstr
    id for the account to lock

Returns

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

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

Returns

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

account_remove

Remove an existing account.

Arguments

  • account_id
    str
    id of the account to remove

Returns

(map) details of removed account
// example(s) for account_remove to come later

account_send

Send the same number of credits to multiple addresses.

Arguments

  • account_id
    optionalstr
    account to fund the transaction
  • broadcast
    optionalbool
    actually broadcast the transaction, default: false.

Returns

// example(s) for account_send to come later

account_set

Change various settings on an account.

Arguments

  • account_id
    str
    id of the account to change
  • 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

(map) updated account details
// example(s) for account_set to come later

account_unlock

Unlock an encrypted account

Arguments

  • account_id
    optionalstr
    id for the account to unlock

Returns

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

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

Returns

(bool) true, if address is associated with current wallet
// example(s) for address_is_mine to come later

address_list

List account addresses

Arguments

  • account_id
    optionalstr
    id of the account to use
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

List of wallet addresses
// example(s) for address_list to come later

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

Returns

(str) Unused wallet address in base58
// example(s) for address_unused to come later

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) for blob_announce to come later

blob_availability

Get blob availability

Arguments

  • blob_hash
    str
    check availability for this blob hash
  • search_timeout
    optionalint
    how long to search for peers for the blob in the dht
  • blob_timeout
    optionalint
    how long to try downloading from a peer

Returns

(dict) {
    "is_available": 
    "reachable_peers": [":"],
    "unreachable_peers": [":"]
}
// example(s) for blob_availability to come later

blob_delete

Delete a blob

Arguments

  • blob_hash
    str
    blob hash of the blob to delete

Returns

(str) Success/fail message
// example(s) for blob_delete to come later

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
  • encoding
    optionalstr
    by default no attempt at decoding is made, can be set to one of the following decoders: 'json'
  • payment_rate_manager
    optionalstr
    if not given the default payment rate manager will be used. supported alternative rate managers: 'only-free'

Returns

(str) Success/Fail message or (dict) decoded data
// example(s) for blob_get 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_size
    optionalint
    results page size
  • page
    optionalint
    page of results to return

Returns

(list) List of blob hashes
// example(s) for blob_list to come later

blob_reflect

Reflects specified blobs

Arguments

  • reflector_server
    optionalstr
    reflector address

Returns

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

blob_reflect_all

Reflects all saved blobs

Returns

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

block_show

Get contents of a block

Arguments

  • blockhash
    str
    hash of the block to look up
  • height
    int
    height of the block to look up

Returns

(dict) Requested block
// example(s) for block_show to come later

channel_export

Export serialized channel signing information for a given certificate claim id

Arguments

  • claim_id
    str
    Claim ID to export information about

Returns

(str) Serialized certificate information
// example(s) for channel_export to come later

channel_import

Import serialized channel signing information (to allow signing new claims to the channel)

Arguments

  • serialized_certificate_info
    str
    certificate info

Returns

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

channel_list

Get certificate claim infos for channels that can be published to

Arguments

  • account_id
    optionalstr
    id of the account to use
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) ClaimDict, includes 'is_mine' field to indicate if the certificate claim
is in the wallet.
// example(s) for channel_list to come later

channel_new

Generate a publisher key and create a new '@' prefixed certificate claim

Arguments

  • channel_name
    str
    name of the channel prefixed with '@'
  • amount
    decimal
    bid amount on the channel
  • account_id
    optionalstr
    id of the account to store channel

Returns

(dict) Dictionary containing result of the claim
{
    'tx' : (str) hex encoded transaction
    'txid' : (str) txid of resulting claim
    'nout' : (int) nout of the resulting claim
    'fee' : (float) fee paid for the claim transaction
    'claim_id' : (str) claim ID of the resulting claim
}
// example(s) for channel_new to come later

claim_abandon

Abandon a name and reclaim credits from the claim

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
  • blocking
    optionalbool
    wait until abandon is in mempool

Returns

(dict) Dictionary containing result of the claim
{
    success: (bool) True if txn is successful
    txid : (str) txid of resulting transaction
}
// example(s) for claim_abandon to come later

claim_list

List current claims and information about them for a given name

Arguments

  • name
    str
    name of the claim to list info about

Returns

(dict) State of claims assigned for the name
{
    'claims': (list) list of claims for the name
    [
        {
        'amount': (float) amount assigned to the claim
        'effective_amount': (float) total amount assigned to the claim,
                            including supports
        'claim_id': (str) claim ID of the claim
        'height': (int) height of block containing the claim
        'txid': (str) txid of the claim
        'nout': (int) nout of the claim
        'permanent_url': (str) permanent url of the claim,
        'supports': (list) a list of supports attached to the claim
        'value': (str) the value of the claim
        },
    ]
    'supports_without_claims': (list) supports without any claims attached to them
    'last_takeover_height': (int) the height of last takeover for the name
}
// example(s) for claim_list to come later

claim_list_by_channel

Get paginated claims in a channel specified by a channel uri

Arguments

  • uri
    str
    uri of the channel
  • uris
    optionallist
    uris of the channel
  • page
    optionalint
    which page of results to return where page 1 is the first page, defaults to no pages
  • page_size
    optionalint
    number of results in a page, default of 10

Returns

{
     resolved channel uri: {
        If there was an error:
        'error': (str) error message

        'claims_in_channel': the total number of results for the channel,

        If a page of results was requested:
        'returned_page': page number returned,
        'claims_in_channel': [
            {
                'absolute_channel_position': (int) claim index number in sorted list of
                                             claims which assert to be part of the
                                             channel
                '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,
                '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,
                '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
            }
        ],
    }
}
// example(s) for claim_list_by_channel to come later

claim_list_mine

List my name claims

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) List of name claims owned by user
 [
     {
         'address': (str) address that owns the claim
         'amount': (float) amount assigned to the claim
         'blocks_to_expiration': (int) number of blocks until it expires
         'category': (str) "claim", "update" , or "support"
         'claim_id': (str) claim ID of the claim
         'confirmations': (int) number of blocks of confirmations for the claim
         'expiration_height': (int) the block height which the claim will expire
         'expired': (bool) true if expired, false otherwise
         'height': (int) height of the block containing the claim
         'is_spent': (bool) true if claim is abandoned, false otherwise
         'name': (str) name of the claim
         'permanent_url': (str) permanent url of the claim,
         'txid': (str) txid of the claim
         'nout': (int) nout of the claim
         'value': (str) value of the claim
     },
]
// example(s) for claim_list_mine to come later

claim_new_support

Support a name claim

Arguments

  • name
    str
    name of the claim to support
  • claim_id
    str
    claim_id of the claim to support
  • amount
    decimal
    amount of support
  • account_id
    optionalstr
    id of the account to use

Returns

(dict) Dictionary containing the transaction information
{
    "hex": (str) raw transaction,
    "inputs": (list) inputs(dict) used for the transaction,
    "outputs": (list) outputs(dict) for the transaction,
    "total_fee": (int) fee in dewies,
    "total_input": (int) total of inputs in dewies,
    "total_output": (int) total of outputs in dewies(input - fees),
    "txid": (str) txid of the transaction,
}
// example(s) for claim_new_support to come later

claim_send_to_address

Send a name claim to an address

Arguments

  • claim_id
    str
    claim_id to send
  • address
    str
    address to send the claim to
  • amount
    optionalint
    Amount of credits to claim name for, defaults to the current amount on the claim

Returns

(dict) Dictionary containing result of the claim
{
    'tx' : (str) hex encoded transaction
    'txid' : (str) txid of resulting claim
    'nout' : (int) nout of the resulting claim
    'fee' : (float) fee paid for the claim transaction
    'claim_id' : (str) claim ID of the resulting claim
}
// example(s) for claim_send_to_address to come later

claim_show

Resolve claim info from txid/nout or with claim ID

Arguments

  • txid
    optionalstr
    look for claim with this txid, nout must also be specified
  • nout
    optionalint
    look for claim with this nout, txid must also be specified
  • claim_id
    optionalstr
    look for claim with this claim id

Returns

(dict) Dictionary containing claim info as below,

{
    'txid': (str) txid of claim
    'nout': (int) nout of claim
    'amount': (float) amount of claim
    'value': (str) value of claim
    'height' : (int) height of claim takeover
    'claim_id': (str) claim ID of claim
    'supports': (list) list of supports associated with claim
}

if claim cannot be resolved, dictionary as below will be returned

{
    'error': (str) reason for error
}
// example(s) for claim_show to come later

claim_tip

Tip the owner of the claim

Arguments

  • claim_id
    str
    claim_id of the claim to support
  • amount
    decimal
    amount of support
  • account_id
    optionalstr
    id of the account to use

Returns

(dict) Dictionary containing the transaction information
{
    "hex": (str) raw transaction,
    "inputs": (list) inputs(dict) used for the transaction,
    "outputs": (list) outputs(dict) for the transaction,
    "total_fee": (int) fee in dewies,
    "total_input": (int) total of inputs in dewies,
    "total_output": (int) total of outputs in dewies(input - fees),
    "txid": (str) txid of the transaction,
}
// example(s) for claim_tip to come later

commands

Return a list of available commands

Returns

(list) list of available commands
// example(s) for commands 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
// example(s) for file_delete to come later

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
  • 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
  • sort
    optionalstr
    sort by any property, like 'file_name' or 'metadata.author'; to specify direction append ',asc' or ',desc'

Returns

(list) List of files

[
    {
        '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': (int) file 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,
        'status': (str) downloader status
        'claim_id': (str) None if claim is not found else the claim id,
        'outpoint': (str) None if claim is not found else the tx and output,
        '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,
        '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
    },
]
// example(s) for file_list to come later

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) for file_reflect to come later

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) for file_set_status to come later

get

Download stream from a LBRY name.

Arguments

  • uri
    optionalstr
    uri of the content to download
  • file_name
    optionalstr
    specified name for the downloaded file
  • timeout
    optionalint
    download timeout in number of seconds

Returns

(dict) Dictionary containing information about the stream
{
    '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': (int) file 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,
    'status': (str) downloader status,
    'claim_id': (str) claim id,
    'outpoint': (str) claim outpoint string,
    'txid': (str) claim txid,
    'nout': (int) claim nout,
    'metadata': (dict) claim metadata,
    'channel_claim_id': (str) None if claim is not signed
    'channel_name': (str) None if claim is not signed
    'claim_name': (str) claim name
}
// example(s) for get to come later

help

Return a useful message for an API command

Arguments

  • command
    optionalstr
    command to retrieve documentation for

Returns

(str) Help message
// example(s) for help to come later

peer_list

Get peers for blob hash

Arguments

  • blob_hash
    str
    find available peers for this blob hash
  • timeout
    optionalint
    peer search timeout in seconds

Returns

(list) List of contact dictionaries {'host': , 'port': , 'node_id': }
// example(s) for peer_list 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

  • address
    optionalstr
    ip address of the peer
  • port
    optionalint
    udp port of the peer

Returns

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

publish

Make a new name claim and publish associated data to lbrynet, update over existing claim if user already has a claim for name. Fields required in the final Metadata are: 'title' 'description' 'author' 'language' 'license' 'nsfw' Metadata can be set by either using the metadata argument or by setting individual arguments fee, title, description, author, language, license, license_url, thumbnail, preview, nsfw, or sources. Individual arguments will overwrite the fields specified in metadata argument.

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
  • metadata
    optionaldict
    ClaimDict to associate with the claim.
  • file_path
    optionalstr
    path to file to be associated with name. If provided, a lbry stream of this file will be used in 'sources'. If no path is given but a sources dict is provided, it will be used. If neither are provided, an error is raised.
  • fee
    optionaldict
    Dictionary representing key fee to download content: { 'currency': currency_symbol, 'amount': decimal, 'address': str, optional } supported currencies: LBC, USD, BTC If an address is not provided a new one will be automatically generated. Default fee is zero.
  • 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
  • language
    optionalstr
    language of the publication
  • license
    optionalstr
    publication license
  • license_url
    optionalstr
    publication license url
  • thumbnail
    optionalstr
    thumbnail url
  • preview
    optionalstr
    preview url
  • nsfw
    optionalbool
    whether the content is nsfw
  • sources
    optionalstr
    {'lbry_sd_hash': sd_hash} specifies sd hash of file
  • channel_name
    optionalstr
    name of the publisher channel name in the wallet
  • channel_id
    optionalstr
    claim id of the publisher channel, does not check for channel claim being in the wallet. This allows publishing to a channel where only the certificate private key is in the wallet.
  • 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 funding the transaction
  • claim_address
    optionalstr
    address where the claim is sent to, if not specified new address will automatically be created

Returns

(dict) Dictionary containing result of the claim
{
    'tx' : (str) hex encoded transaction
    'txid' : (str) txid of resulting claim
    'nout' : (int) nout of the resulting claim
    'fee' : (decimal) fee paid for the claim transaction
    'claim_id' : (str) claim ID of the resulting claim
}
// example(s) for publish to come later

report_bug

Report a bug to slack

Arguments

  • message
    str
    Description of the bug

Returns

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

resolve

Resolve given LBRY URIs

Arguments

  • force
    optionalbool
    force refresh and ignore cache
  • uri
    str
    uri to resolve
  • uris
    optionallist
    uris to resolve

Returns

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

        If the uri 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,
            '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 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 uri resolves to a channel:
        'claims_in_channel': (int) number of claims in the channel,

        If the uri 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,
            '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
        }
}
// example(s) for resolve to come later

resolve_name

Resolve stream info from a LBRY name

Arguments

  • name
    str
    the name to resolve
  • force
    optionalbool
    force refresh and do not check cache

Returns

(dict) Metadata dictionary from name claim, None if the name is not
resolvable
// example(s) for resolve_name to come later

routing_table_get

Get DHT routing information

Returns

(dict) dictionary containing routing and contact information
{
    "buckets": {
        : [
            {
                "address": (str) peer address,
                "port": (int) peer udp port
                "node_id": (str) peer node id,
                "blobs": (list) blob hashes announced by peer
            }
        ]
    },
    "contacts": (list) contact node ids,
    "blob_hashes": (list) all of the blob hashes stored by peers in the list of buckets,
    "node_id": (str) the local dht node id
}
// example(s) for routing_table_get to come later

settings_get

Get daemon settings

Returns

(dict) Dictionary of daemon settings
See ADJUSTABLE_SETTINGS in lbrynet/conf.py for full list of settings
// example(s) for settings_get to come later

settings_set

Set daemon settings

Arguments

  • download_directory
    optionalstr
    path of download directory
  • data_rate
    optionalfloat
    0.0001
  • download_timeout
    optionalint
    180
  • peer_port
    optionalint
    3333
  • max_key_fee
    optionaldict
    maximum key fee for downloads, in the format: { 'currency': <currency_symbol>, 'amount': <amount> }. In the CLI, it must be an escaped JSON string Supported currency symbols: LBC, USD, BTC
  • disable_max_key_fee
    optionalbool
    False
  • use_upnp
    optionalbool
    True
  • run_reflector_server
    optionalbool
    False
  • cache_time
    optionalint
    150
  • reflect_uploads
    optionalbool
    True
  • share_usage_data
    optionalbool
    True
  • peer_search_timeout
    optionalint
    3
  • sd_download_timeout
    optionalint
    3
  • auto_renew_claim_height_delta
    optionalint
    0 claims set to expire within this many blocks will be automatically renewed after startup (if set to 0, renews will not be made automatically)

Returns

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

status

Get daemon status

Returns

(dict) lbrynet-daemon status
{
    'installation_id': (str) installation id - base58,
    'is_running': (bool),
    'is_first_run': bool,
    'skipped_components': (list) [names of skipped components (str)],
    'startup_status': { Does not include components which have been skipped
        'database': (bool),
        'wallet': (bool),
        'session': (bool),
        'dht': (bool),
        'hash_announcer': (bool),
        'stream_identifier': (bool),
        'file_manager': (bool),
        'blob_manager': (bool),
        'blockchain_headers': (bool),
        'peer_protocol_server': (bool),
        'reflector': (bool),
        'upnp': (bool),
        'exchange_rate_manager': (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),
    },
    '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,
    },
    'hash_announcer': {
        'announce_queue_size': (int) number of blobs currently queued to be announced
    },
    'file_manager': {
        'managed_files': (int) count of files in the file 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,
    }
}
// example(s) for status to come later

stop

Stop lbrynet

Returns

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

stream_availability

Get stream availability for lbry uri

Arguments

  • uri
    str
    check availability for this uri
  • search_timeout
    optionalint
    how long to search for peers for the blob in the dht
  • blob_timeout
    optionalint
    how long to try downloading from a peer

Returns

(dict) {
    'is_available': ,
    'did_decode': ,
    'did_resolve': ,
    'is_stream': ,
    'num_blobs_in_stream': ,
    'sd_hash': ,
    'sd_blob_availability':  see `blob_availability`,
    'head_blob_hash': ,
    'head_blob_availability':  see `blob_availability`,
    'use_upnp': ,
    'upnp_redirect_is_set': ,
    'error':  |  error message
}
// example(s) for stream_availability to come later

stream_cost_estimate

Get estimated cost for a lbry stream

Arguments

  • uri
    str
    uri to use
  • size
    optionalfloat
    stream size in bytes. if provided an sd blob won't be downloaded.

Returns

(float) Estimated cost in lbry credits, returns None if uri is not
resolvable
// example(s) for stream_cost_estimate to come later

transaction_list

List transactions belonging to wallet

Arguments

  • account_id
    optionalstr
    id of the account to query
  • 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
}
// example(s) for transaction_list to come later

transaction_show

Get a decoded transaction from a txid

Arguments

  • txid
    str
    txid of the transaction

Returns

(dict) JSON formatted transaction
// example(s) for transaction_show to come later

utxo_list

List unspent transaction outputs

Arguments

  • account_id
    optionalstr
    id of the account to query
  • page
    optionalint
    page to return during paginating
  • page_size
    optionalint
    number of items on page during pagination

Returns

(list) List of unspent transaction outputs (UTXOs)
[
    {
        "address": (str) the output address
        "amount": (float) unspent amount
        "height": (int) block height
        "is_claim": (bool) is the tx a claim
        "is_coinbase": (bool) is the tx a coinbase tx
        "is_support": (bool) is the tx a support
        "is_update": (bool) is the tx an update
        "nout": (int) nout of the output
        "txid": (str) txid of the output
    },
    ...
]
// example(s) for utxo_list to come later

version

Get lbry version information

Returns

(dict) Dictionary of lbry version information
{
    'build': (str) build type (e.g. "dev", "rc", "release"),
    'ip': (str) remote ip, if available,
    'lbrynet_version': (str) lbrynet_version,
    'lbryum_version': (str) lbryum_version,
    'lbryschema_version': (str) lbryschema_version,
    'os_release': (str) os release string
    'os_system': (str) os name
    'platform': (str) platform string
    'processor': (str) processor type,
    'python_version': (str) python version,
}
// example(s) for version to come later

wallet_prefill_addresses

Create new UTXOs, each containing `amount` credits

Arguments

  • no_broadcast
    optionalbool
    whether to broadcast or not
  • num_addresses
    int
    num of addresses to create
  • amount
    decimal
    initial amount in each address

Returns

(dict) the resulting transaction
// example(s) for wallet_prefill_addresses to come later

wallet_send

Send credits. If given an address, send credits to it. If given a claim id, send a tip to the owner of a claim specified by uri. A tip is a claim support where the recipient of the support is the claim address for the claim being supported.

Arguments

  • amount
    decimal
    amount of credit to send
  • address
    str
    address to send credits to
  • claim_id
    str
    claim_id of the claim to send to tip to
  • account_id
    optionalstr
    account to fund the transaction

Returns

If sending to an address:
(dict) Dictionary containing the transaction information
{
    "hex": (str) raw transaction,
    "inputs": (list) inputs(dict) used for the transaction,
    "outputs": (list) outputs(dict) for the transaction,
    "total_fee": (int) fee in dewies,
    "total_input": (int) total of inputs in dewies,
    "total_output": (int) total of outputs in dewies(input - fees),
    "txid": (str) txid of the transaction,
}

If sending a claim tip:
(dict) Dictionary containing the result of the support
{
    txid : (str) txid of resulting support claim
    nout : (int) nout of the resulting support claim
    fee : (float) fee paid for the transaction
}
// example(s) for wallet_send to come later

This website is in beta and under heavy development.
All information should be considered incomplete and possibly incorrect and things may not work as expected.



Please do not share or link this site publicly while this message is here. This website is open source and you can contribute to it on Github.