This commit is contained in:
Alex Grintsvayg 2017-04-21 15:14:33 -04:00
parent 1dda158087
commit ce40efa6cb

View file

@ -80,14 +80,42 @@ Returns:
(dict) Requested block (dict) Requested block
``` ```
## channel_list_mine
```text
Get my channels
Returns:
(list) ClaimDict
```
## channel_new
```text
Generate a publisher key and create a new certificate claim
Args:
'channel_name': (str) '@' prefixed name
'amount': (float) amount to claim name
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
}
```
## claim_abandon ## claim_abandon
```text ```text
Abandon a name and reclaim credits from the claim Abandon a name and reclaim credits from the claim
Args: Args:
'txid': (str) txid of claim 'claim_id': (str) claim_id of claim
'nout': (int) nout of claim
Return: Return:
(dict) Dictionary containing result of the claim (dict) Dictionary containing result of the claim
{ {
@ -181,6 +209,7 @@ Args:
'name': (str) name to look up, do not include lbry:// prefix 'name': (str) name to look up, do not include lbry:// prefix
'txid'(optional): (str) if specified, look for claim with this txid 'txid'(optional): (str) if specified, look for claim with this txid
'nout'(optional): (int) if specified, look for claim with this nout 'nout'(optional): (int) if specified, look for claim with this nout
'claim_id'(optional): (str) if specified, look for claim with this claim_id
Returns: Returns:
(dict) Dictionary contaning claim info, (bool) false if claim is not (dict) Dictionary contaning claim info, (bool) false if claim is not
resolvable resolvable
@ -313,16 +342,12 @@ Returns:
Download stream from a LBRY name. Download stream from a LBRY name.
Args: Args:
'name': (str) name to download 'uri': (str) lbry uri to download
'file_name'(optional): (str) a user specified name for the downloaded file 'file_name'(optional): (str) a user specified name for the downloaded file
'stream_info'(optional): (str) specified stream info overrides name
'timeout'(optional): (int) download timeout in number of seconds 'timeout'(optional): (int) download timeout in number of seconds
'download_directory'(optional): (str) path to directory where file will be saved 'download_directory'(optional): (str) path to directory where file will be saved
'wait_for_write'(optional): (bool) defaults to True. When set, waits for the file to
only start to be written before returning any results.
Returns: Returns:
(dict) Dictionary contaning information about the stream (dict) Dictionary contaning information about the stream
{ {
'completed': (bool) true if download is completed, 'completed': (bool) true if download is completed,
'file_name': (str) name of file, 'file_name': (str) name of file,
@ -349,10 +374,10 @@ Returns:
## get_availability ## get_availability
```text ```text
Get stream availability for a winning claim Get stream availability for lbry uri
Args: Args:
'name' : (str) lbry name 'uri' : (str) lbry uri
'sd_timeout' (optional): (int) sd blob download timeout 'sd_timeout' (optional): (int) sd blob download timeout
'peer_timeout' (optional): (int) how long to look for peers 'peer_timeout' (optional): (int) how long to look for peers
@ -425,6 +450,7 @@ Args:
'preview'(optional): (str) preview URL for the file 'preview'(optional): (str) preview URL for the file
'nsfw'(optional): (bool) True if not safe for work 'nsfw'(optional): (bool) True if not safe for work
'sources'(optional): (dict){'lbry_sd_hash':sd_hash} specifies sd hash of file 'sources'(optional): (dict){'lbry_sd_hash':sd_hash} specifies sd hash of file
'channel_name' (optional): (str) name of the publisher channel
Returns: Returns:
(dict) Dictionary containing result of the claim (dict) Dictionary containing result of the claim
@ -459,6 +485,81 @@ Returns:
(bool) true if successful (bool) true if successful
``` ```
## resolve
```text
Resolve a LBRY URI
Args:
'uri': (str) uri to download
Returns:
None if nothing can be resolved, otherwise:
If 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,
'supports: (list) list of supports [{'txid': txid,
'nout': nout,
'amount': 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 uri resolves to a channel:
'claims_in_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': txid,
'nout': nout,
'amount': 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 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,
'channel_name': (str) channel name if claim is in a channel
'supports: (list) list of supports [{'txid': txid,
'nout': nout,
'amount': 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_name ## resolve_name
```text ```text
@ -534,7 +635,8 @@ Args:
'size' (optional): (int) stream size, in bytes. if provided an sd blob 'size' (optional): (int) stream size, in bytes. if provided an sd blob
won't be downloaded. won't be downloaded.
Returns: Returns:
(float) Estimated cost in lbry credits (float) Estimated cost in lbry credits, returns None if uri is not
resolveable
``` ```
## transaction_list ## transaction_list
@ -574,6 +676,7 @@ Returns:
'lbrynet_update_available': (bool) whether there's an update available, 'lbrynet_update_available': (bool) whether there's an update available,
'lbrynet_version': (str) lbrynet_version, 'lbrynet_version': (str) lbrynet_version,
'lbryum_version': (str) lbryum_version, 'lbryum_version': (str) lbryum_version,
'lbryschema_version': (str) lbryschema_version,
'os_release': (str) os release string 'os_release': (str) os release string
'os_system': (str) os name 'os_system': (str) os name
'platform': (str) platform string 'platform': (str) platform string