lbrycrd APIs

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

abandonclaim

Create a transaction which spends a txout which assigned a value to a name, effectively abandoning that claim.

Arguments

  • txid
    string
    The transaction containing the unspent txout which should be spent.
  • lbrycrdaddress
    string
    The lbrycrd address to send to.
  • amount
    number
    The amount to send to the lbrycrd address. eg 0.1

Returns

"transactionid"  (string) The new transaction id.
// example(s) for abandonclaim to come later

abandonsupport

Create a transaction which spends a txout which supported a name claim, effectively abandoning that support.

Arguments

  • txid
    string
    The transaction containing the unspent txout which should be spent.
  • lbrycrdaddress
    string
    The lbrycrd address to send to.
  • amount
    number
    The amount to send to the lbrycrd address. eg 0.1

Returns

"transactionid"  (string) The new transaction id.
// example(s) for abandonsupport to come later

claimname

Create a transaction which issues a claim assigning a value to a name. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no other greater unspent transactions issuing a claim over the same name. The amount is a real and is rounded to the nearest 0.00000001

Arguments

  • name
    string
    The name to be assigned the value.
  • value
    string
    The value to assign to the name encoded in hexadecimal.
  • amount
    number
    The amount in LBRYcrd to send. eg 0.1

Returns

"transactionid"  (string) The transaction id.
// example(s) for claimname to come later

getclaimbyid

Get a claim by claim id

Arguments

  • claimId
    string
    the claimId of this claim

Returns

{
"name"                (string) the name of the claim
"value"               (string) claim metadata
"claimId"             (string) the claimId of this claim
"txid"                (string) the hash of the transaction which has successfully claimed this name
"n"                   (numeric) vout value
"amount"              (numeric) txout value
"effective amount"    (numeric) txout amount plus amount from all supports associated with the claim
"height"              (numeric) the height of the block in which this claim transaction is located
"supports"            (array of object) supports for this claim
"valid at height"     (numeric) the height at which the claim is valid
[
  "txid"              (string) the txid of the support
  "n"                 (numeric) the index of the support in the transaction's list of outputs
  "height"            (numeric) the height at which the support was included in the blockchain
  "valid at height"   (numeric) the height at which the support is valid
  "amount"            (numeric) the amount of the support
]
}
// example(s) for getclaimbyid to come later

getclaimsforname

Return all claims and supports for a name

Arguments

  • name
    string
    the name for which to get claims and supports

Returns

{
"nLastTakeoverheight" (numeric) the last height at which ownership of the name changed
"claims": [    (array of object) claims for this name
  {
    "claimId"    (string) the claimId of this claim
    "txid"       (string) the txid of this claim
    "n"          (numeric) the index of the claim in the transaction's list of outputs
    "nHeight"    (numeric) the height at which the claim was included in the blockchain
    "nValidAtHeight" (numeric) the height at which the claim became/becomes valid
    "nAmount"    (numeric) the amount of the claim
    "nEffectiveAmount" (numeric) the total effective amount of the claim, taking into effect whether the claim or support has reached its nValidAtHeight
    "supports" : [ (array of object) supports for this claim
      "txid"     (string) the txid of the support
      "n"        (numeric) the index of the support in the transaction's list of outputs
      "nHeight"  (numeric) the height at which the support was included in the blockchain
      "nValidAtHeight" (numeric) the height at which the support became/becomes valid
      "nAmount"  (numeric) the amount of the support
    ]
  }
],
"unmatched supports": [ (array of object) supports that did not match a claim for this name
  {
    "txid"     (string) the txid of the support
    "n"        (numeric) the index of the support in the transaction's list of outputs
    "nHeight"  (numeric) the height at which the support was included in the blockchain
    "nValidAtHeight" (numeric) the height at which the support became/becomes valid
    "nAmount"  (numeric) the amount of the support
  }
]
}
// example(s) for getclaimsforname to come later

getclaimsfortx

Return any claims or supports found in a transaction

Arguments

  • txid
    string
    the txid of the transaction to check for unspent claims

Returns

[
{
  "nOut"                   (numeric) the index of the claim or support in the transaction's list out outputs
  "claim type"             (string) 'claim' or 'support'
  "name"                   (string) the name claimed or supported
  "value"                  (string) if a name claim, the value of the claim
  "supported txid"         (string) if a support, the txid of the supported claim
  "supported nout"         (numeric) if a support, the index of the supported claim in its transaction
  "depth"                  (numeric) the depth of the transaction in the main chain
  "in claim trie"          (boolean) if a name claim, whether the claim is active, i.e. has made it into the trie
  "is controlling"         (boolean) if a name claim, whether the claim is the current controlling claim for the name
  "in support map"         (boolean) if a support, whether the support is active, i.e. has made it into the support map
  "in queue"               (boolean) whether the claim is in a queue waiting to be inserted into the trie or support map
  "blocks to valid"        (numeric) if in a queue, the number of blocks until it's inserted into the trie or support map
}
]
// example(s) for getclaimsfortx to come later

getclaimsintrie

Return all claims in the name trie.

Arguments

  • minconf
    optionalnumber
    the number of required confirmations

Returns

[
{
  "name"        (string) the name claimed
  "claims": [   (array of object) the claims for this name
    {
      "claimId" (string) the claimId of the claim
      "txid"    (string) the txid of the claim
      "n"       (numeric) the vout value of the claim
      "amount"  (numeric) txout amount
      "height"  (numeric) the height of the block in which this transaction is located
      "value"   (string) the value of this claim
    }
  ]
}
]
// example(s) for getclaimsintrie to come later

getclaimtrie

Return the entire name trie.

Arguments

  • minconf
    optionalnumber
    the number of required confirmations

Returns

{
"name"           (string) the name of the node
"hash"           (string) the hash of the node
"txid"           (string) (if value exists) the hash of the transaction which has successfully claimed this name
"n"              (numeric) (if value exists) vout value
"value"          (numeric) (if value exists) txout value
"height"         (numeric) (if value exists) the height of the block in which this transaction is located
}
// example(s) for getclaimtrie to come later

getnameproof

Return the cryptographic proof that a name maps to a value or doesn't.

Arguments

  • name
    string
    the name to get a proof for
  • blockhash
    optionalstring
    the hash of the block which is the basis of the proof. If none is given, the latest block will be used.

Returns

{
"nodes" : [       (array of object) full nodes (i.e.
                                      those which lead to
                                      the requested name)
  "children" : [  (array of object) the children of
                                     this node
    "child" : {   (object) a child node, either leaf or
                             reference to a full node
      "character" : "char" (string) the character which
                                        leads from the parent
                                        to this child node
      "nodeHash" :  "hash" (string, if exists) the hash of
                                                   the node if
                                                   this is a 
                                                   leaf node
      }
    ]
  "valueHash"     (string, if exists) the hash of this
                                        node's value, if
                                        it has one. If 
                                        this is the
                                        requested name
                                        this will not
                                        exist whether
                                        the node has a
                                        value or not
  ]
"txhash" : "hash" (string, if exists) the txid of the
                                          claim which controls
                                          this name, if there
                                          is one.
"nOut" : n,         (numeric) the nOut of the claim which
                                controls this name, if there
                                is one.
"last takeover height"  (numeric) the most recent height at
                                    which the value of a name
                                    changed other than through
                                    an update to the winning
                                    bid
}
}
// example(s) for getnameproof to come later

gettotalclaimednames

Return the total number of names that have been successfully claimed, and therefore exist in the trie

Returns

"total names"                (numeric) the total number of
names in the trie
// example(s) for gettotalclaimednames to come later

gettotalclaims

Return the total number of active claims in the trie

Returns

"total claims"             (numeric) the total number
of active claims
// example(s) for gettotalclaims to come later

gettotalvalueofclaims

Return the total value of the claims in the trie

Arguments

  • controlling_only
    boolean
    only include the value of controlling claims

Returns

"total value"                 (numeric) the total value of the
claims in the trie
// example(s) for gettotalvalueofclaims to come later

getvalueforname

Return the value associated with a name, if one exists

Arguments

  • name
    string
    the name to look up
  • minconf
    optionalnumber
    the number of required confirmations

Returns

"value"               (string) the value of the name, if it exists
"claimId"             (string) the claimId for this name claim
"txid"                (string) the hash of the transaction which successfully claimed the name
"n"                   (numeric) vout value
"amount"              (numeric) txout amount
"effective amount"    (numeric) txout amount plus amount from all supports associated with the claim
"height"              (numeric) the height of the block in which this transaction is located
// example(s) for getvalueforname to come later

listnameclaims

Return a list of all transactions claiming names.

Arguments

  • includesupports
    optionalboolean
    Whether to also include claim supports. Default is true.
  • activeonly
    optionalboolean
    Whether to only include transactions which are still active, i.e. have not been spent. Default is false.
  • minconf
    optionalnumber
    Only include transactions confirmed at least this many time.

Returns

[
{
  "name":"claimedname",        (string) The name that is claimed.
  "claimtype":"claimtype",     (string) CLAIM or SUPPORT.
  "claimId":"claimId",         (string) The claimId of the claim.
  "value":"value"              (string) The value assigned to the name, if claimtype is CLAIM.
  "account":"accountname",     (string) The account name associated with the transaction. 
                                            It will be "" for the default account.
  "address":"lbrycrdaddress",  (string) The lbrycrd address of the transaction.
  "category":"name"            (string) Always name
  "amount": x.xxx,               (numeric) The amount in LBC.
  "vout": n,                     (numeric) The vout value
  "fee": x.xxx,                  (numeric) The amount of the fee in LBC.
  "height": n                    (numeric) The height of the block in which this transaction was included.
  "confirmations": n,            (numeric) The number of confirmations for the transaction
  "blockhash": "hashvalue",    (string) The block hash containing the transaction.
  "blockindex": n,               (numeric) The block index containing the transaction.
  "txid": "transactionid",     (string) The transaction id.
  "time": xxx,                   (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
  "timereceived": xxx,           (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT).
  "comment": "...",            (string) If a comment is associated with the transaction.
}
]
// example(s) for listnameclaims to come later

supportclaim

Increase the value of a claim. Whichever claim has the greatest value, including all support values, will be the authoritative claim, according to the rest of the rules. The name is the name which is claimed by the claim that will be supported, the txid is the txid of the claim that will be supported, nout is the transaction output which contains the claim to be supported, and amount is the amount which will be added to the value of the claim. If the claim is currently the authoritative claim, this support will go into effect immediately. Otherwise, it will go into effect after 100 blocks. The support will be in effect until it is spent, and will lose its effect when the claim is spent or expires. The amount is a real and is rounded to the nearest .00000001

Arguments

  • name
    string
    The name claimed by the claim to support.
  • claimid
    string
    The claimid of the claim to support. This can be obtained by TODO PUT IN PLACE THAT SHOWS THIS.
  • amount
    number
    The amount in LBC to use to support the claim.

Returns

"transactionid"  (string) The transaction id of the support.
// example(s) for supportclaim to come later

updateclaim

Create a transaction which issues a claim assigning a value to a name, spending the previous txout which issued a claim over the same name and therefore superseding that claim. The claim will be authoritative if the transaction amount is greater than the transaction amount of all other unspent transactions which issue a claim over the same name, and it will remain authoritative as long as it remains unspent and there are no greater unspent transactions issuing a claim over the same name.

Arguments

  • txid
    string
    The transaction containing the unspent txout which should be spent.
  • value
    string
    The value to assign to the name encoded in hexadecimal.
  • amount
    number
    The amount in LBRYcrd to use to bid for the name. eg 0.1

Returns

"transactionid"  (string) The new transaction id.
// example(s) for updateclaim to come later

getbestblockhash

Returns the hash of the best (tip) block in the longest block chain. Result "hex" (string) the block hash hex encoded Examples: > lbrycrd-cli getbestblockhash > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbestblockhash", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

// example(s) for getbestblockhash to come later

getblock

If verbose is false, returns a string that is serialized, hex-encoded data for block 'hash'. If verbose is true, returns an Object with information about block . Examples: > lbrycrd-cli getblock "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblock", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hash
    string
    The block hash
  • verbose
    optionalboolean
    true for a json object, false for the hex encoded data

Returns

{
"hash" : "hash",     (string) the block hash (same as provided)
"confirmations" : n,   (numeric) The number of confirmations, or -1 if the block is not on the main chain
"size" : n,            (numeric) The block size
"height" : n,          (numeric) The block height or index
"version" : n,         (numeric) The block version
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
"merkleroot" : "xxxx", (string) The merkle root
"nameclaimroot" : "xxxx",  (string) The hash of the root of the name claim trie
"tx" : [               (array of string) The transaction ids
   "transactionid"     (string) The transaction id
   ,...
],
"time" : ttt,          (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt,    (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n,           (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx,  (numeric) The difficulty
"chainwork" : "xxxx",  (string) Expected number of hashes required to produce the chain up to this block (in hex)
"previousblockhash" : "hash",  (string) The hash of the previous block
"nextblockhash" : "hash"       (string) The hash of the next block
}

Result (for verbose=false):
"data"             (string) A string that is serialized, hex-encoded data for block 'hash'.
// example(s) for getblock to come later

getblockchaininfo

Returns an object containing various state info regarding block chain processing. Examples: > lbrycrd-cli getblockchaininfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"chain": "xxxx",        (string) current network name as defined in BIP70 (main, test, regtest)
"blocks": xxxxxx,         (numeric) the current number of blocks processed in the server
"headers": xxxxxx,        (numeric) the current number of headers we have validated
"bestblockhash": "...", (string) the hash of the currently best block
"difficulty": xxxxxx,     (numeric) the current difficulty
"mediantime": xxxxxx,     (numeric) median time for the current best block
"verificationprogress": xxxx, (numeric) estimate of verification progress [0..1]
"chainwork": "xxxx"     (string) total amount of work in active chain, in hexadecimal
"pruned": xx,             (boolean) if the blocks are subject to pruning
"pruneheight": xxxxxx,    (numeric) heighest block available
"softforks": [            (array) status of softforks in progress
   {
      "id": "xxxx",        (string) name of softfork
      "version": xx,         (numeric) block version
      "enforce": {           (object) progress toward enforcing the softfork rules for new-version blocks
         "status": xx,       (boolean) true if threshold reached
         "found": xx,        (numeric) number of blocks with the new version found
         "required": xx,     (numeric) number of blocks required to trigger
         "window": xx,       (numeric) maximum size of examined window of recent blocks
      },
      "reject": { ... }      (object) progress toward rejecting pre-softfork blocks (same fields as "enforce")
   }, ...
],
"bip9_softforks": {          (object) status of BIP9 softforks in progress
   "xxxx" : {                (string) name of the softfork
      "status": "xxxx",    (string) one of "defined", "started", "lockedin", "active", "failed"
      "bit": xx,             (numeric) the bit, 0-28, in the block version field used to signal this soft fork
      "startTime": xx,       (numeric) the minimum median time past of a block at which the bit gains its meaning
      "timeout": xx          (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in
   }
}
}
// example(s) for getblockchaininfo to come later

getblockcount

Returns the number of blocks in the longest block chain. Examples: > lbrycrd-cli getblockcount > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockcount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

n    (numeric) The current block count
// example(s) for getblockcount to come later

getblockhash

Returns hash of block in best-block-chain at index provided. Examples: > lbrycrd-cli getblockhash 1000 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockhash", "params": [1000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • index
    number
    The block index

Returns

"hash"         (string) The block hash
// example(s) for getblockhash to come later

getblockheader

If verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'. If verbose is true, returns an Object with information about blockheader . Examples: > lbrycrd-cli getblockheader "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockheader", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hash
    string
    The block hash
  • verbose
    optionalboolean
    true for a json object, false for the hex encoded data

Returns

{
"hash" : "hash",     (string) the block hash (same as provided)
"confirmations" : n,   (numeric) The number of confirmations, or -1 if the block is not on the main chain
"height" : n,          (numeric) The block height or index
"version" : n,         (numeric) The block version
"versionHex" : "00000000", (string) The block version formatted in hexadecimal
"merkleroot" : "xxxx", (string) The merkle root
"time" : ttt,          (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
"mediantime" : ttt,    (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
"nonce" : n,           (numeric) The nonce
"bits" : "1d00ffff", (string) The bits
"difficulty" : x.xxx,  (numeric) The difficulty
"previousblockhash" : "hash",  (string) The hash of the previous block
"nextblockhash" : "hash",      (string) The hash of the next block
"chainwork" : "0000...1f3"     (string) Expected number of hashes required to produce the current chain (in hex)
}

Result (for verbose=false):
"data"             (string) A string that is serialized, hex-encoded data for block 'hash'.
// example(s) for getblockheader to come later

getchaintips

Return information about all known tips in the block tree, including the main chain as well as orphaned branches. Examples: > lbrycrd-cli getchaintips > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintips", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

[
{
  "height": xxxx,         (numeric) height of the chain tip
  "hash": "xxxx",         (string) block hash of the tip
  "branchlen": 0          (numeric) zero for main chain
  "status": "active"      (string) "active" for the main chain
},
{
  "height": xxxx,
  "hash": "xxxx",
  "branchlen": 1          (numeric) length of branch connecting the tip to the main chain
  "status": "xxxx"        (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)
}
]
Possible values for status:
1.  "invalid"               This branch contains at least one invalid block
2.  "headers-only"          Not all blocks for this branch are available, but the headers are valid
3.  "valid-headers"         All blocks are available for this branch, but they were never fully validated
4.  "valid-fork"            This branch is not part of the active chain, but is fully validated
5.  "active"                This is the tip of the active main chain, which is certainly valid
// example(s) for getchaintips to come later

getdifficulty

Returns the proof-of-work difficulty as a multiple of the minimum difficulty. Examples: > lbrycrd-cli getdifficulty > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdifficulty", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

n.nnn       (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.
// example(s) for getdifficulty to come later

getmempoolinfo

Returns details on the active state of the TX memory pool. Examples: > lbrycrd-cli getmempoolinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmempoolinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"size": xxxxx,               (numeric) Current tx count
"bytes": xxxxx,              (numeric) Sum of all tx sizes
"usage": xxxxx,              (numeric) Total memory usage for the mempool
"maxmempool": xxxxx,         (numeric) Maximum memory usage for the mempool
"mempoolminfee": xxxxx       (numeric) Minimum fee for tx to be accepted
}
// example(s) for getmempoolinfo to come later

getrawmempool

Returns all transaction ids in memory pool as a json array of string transaction ids. Examples: > lbrycrd-cli getrawmempool true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawmempool", "params": [true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • verbose
    optionalboolean
    true for a json object, false for array of transaction ids

Returns

[                     (json array of string)
"transactionid"     (string) The transaction id
,...
]

Result: (for verbose = true):
{                           (json object)
"transactionid" : {       (json object)
  "size" : n,             (numeric) transaction size in bytes
  "fee" : n,              (numeric) transaction fee in LBC
  "modifiedfee" : n,      (numeric) transaction fee with fee deltas used for mining priority
  "time" : n,             (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT
  "height" : n,           (numeric) block height when transaction entered pool
  "startingpriority" : n, (numeric) priority when transaction entered pool
  "currentpriority" : n,  (numeric) transaction priority now
  "descendantcount" : n,  (numeric) number of in-mempool descendant transactions (including this one)
  "descendantsize" : n,   (numeric) size of in-mempool descendants (including this one)
  "descendantfees" : n,   (numeric) modified fees (see above) of in-mempool descendants (including this one)
  "depends" : [           (array) unconfirmed transactions used as inputs for this transaction
      "transactionid",    (string) parent transaction id
     ... ]
}, ...
}
// example(s) for getrawmempool to come later

gettxout

Returns details about an unspent transaction output. Examples: Get unspent transactions > lbrycrd-cli listunspent View the details > lbrycrd-cli gettxout "txid" 1 As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxout", "params": ["txid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The transaction id
  • n
    number
    vout number
  • includemempool
    optionalboolean
    Whether to include the mem pool

Returns

{
"bestblock" : "hash",    (string) the block hash
"confirmations" : n,       (numeric) The number of confirmations
"value" : x.xxx,           (numeric) The transaction value in LBC
"scriptPubKey" : {         (json object)
   "asm" : "code",       (string) 
   "hex" : "hex",        (string) 
   "reqSigs" : n,          (numeric) Number of required signatures
   "type" : "pubkeyhash", (string) The type, eg pubkeyhash
   "addresses" : [          (array of string) array of lbrycrd addresses
      "lbrycrdaddress"     (string) lbrycrd address
      ,...
   ]
},
"version" : n,            (numeric) The version
"coinbase" : true|false   (boolean) Coinbase or not
}
// example(s) for gettxout to come later

gettxoutproof

Returns a hex-encoded proof that "txid" was included in a block. NOTE: By default this function only works sometimes. This is when there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option or specify the block in which the transaction is included in manually (by blockhash). Return the raw transaction data.

Arguments

  • txids
    string
    A json array of txids to filter [ "txid" (string) A transaction hash ,... ]
  • block hash
    optionalstring
    If specified, looks for txid in the block with this hash

Returns

"data"           (string) A string that is a serialized, hex-encoded data for the proof.
// example(s) for gettxoutproof to come later

gettxoutsetinfo

Returns statistics about the unspent transaction output set. Note this call may take some time. Examples: > lbrycrd-cli gettxoutsetinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettxoutsetinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"height":n,     (numeric) The current block height (index)
"bestblock": "hex",   (string) the best block hash hex
"transactions": n,      (numeric) The number of transactions
"txouts": n,            (numeric) The number of output transactions
"bytes_serialized": n,  (numeric) The serialized size
"hash_serialized": "hash",   (string) The serialized hash
"total_amount": x.xxx          (numeric) The total amount
}
// example(s) for gettxoutsetinfo to come later

verifychain

Verifies blockchain database. Examples: > lbrycrd-cli verifychain > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • checklevel
    optionalnumber
    How thorough the block verification is.
  • numblocks
    optionalnumber
    The number of blocks to check.

Returns

true|false       (boolean) Verified or not
// example(s) for verifychain to come later

verifytxoutproof

Verifies that a proof points to a transaction in a block, returning the transaction it commits to and throwing an RPC error if the block is not in our best chain

Arguments

  • proof
    string
    The hex-encoded proof generated by gettxoutproof

Returns

["txid"]      (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid
// example(s) for verifytxoutproof to come later

getinfo

Returns an object containing various state info. Examples: > lbrycrd-cli getinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"version": xxxxx,           (numeric) the server version
"protocolversion": xxxxx,   (numeric) the protocol version
"walletversion": xxxxx,     (numeric) the wallet version
"balance": xxxxxxx,         (numeric) the total lbrycrd balance of the wallet
"blocks": xxxxxx,           (numeric) the current number of blocks processed in the server
"timeoffset": xxxxx,        (numeric) the time offset
"connections": xxxxx,       (numeric) the number of connections
"proxy": "host:port",     (string, optional) the proxy used by the server
"difficulty": xxxxxx,       (numeric) the current difficulty
"testnet": true|false,      (boolean) if the server is using testnet or not
"keypoololdest": xxxxxx,    (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool
"keypoolsize": xxxx,        (numeric) how many new keys are pre-generated
"unlocked_until": ttt,      (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked
"paytxfee": x.xxxx,         (numeric) the transaction fee set in LBC/kB
"relayfee": x.xxxx,         (numeric) minimum relay fee for non-free transactions in LBC/kB
"errors": "..."           (string) any error messages
}
// example(s) for getinfo to come later

help

List all commands, or get help for a specified command.

Arguments

  • command
    optionalstring
    The command to get help on

Returns

"text"     (string) The help text
// example(s) for help to come later

stop

Stop LBRYcrd server.

Returns

// example(s) for stop to come later

generate

Mine up to numblocks blocks immediately (before the RPC call returns) Examples: Generate 11 blocks > lbrycrd-cli generate 11

Arguments

  • numblocks
    number
    How many blocks are generated immediately.
  • maxtries
    optionalnumber
    How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated

Returns

// example(s) for generate to come later

generatetoaddress

Mine blocks immediately to a specified address (before the RPC call returns) Examples: Generate 11 blocks to myaddress > lbrycrd-cli generatetoaddress 11 "myaddress"

Arguments

  • numblocks
    number
    How many blocks are generated immediately.
  • address
    string
    The address to send the newly generated bitcoin to.
  • maxtries
    optionalnumber
    How many iterations to try (default = 1000000). Result [ blockhashes ] (array) hashes of blocks generated

Returns

// example(s) for generatetoaddress to come later

getblocktemplate

If the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'. It returns data needed to construct a block to work on. See https://en.bitcoin.it/wiki/BIP_0022 for full specification. Examples: > lbrycrd-cli getblocktemplate > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblocktemplate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • jsonrequestobject
    optionalstring
    A json object in the following spec { "mode":"template" (string, optional) This must be set to "template" or omitted "capabilities":[ (array, optional) A list of strings "support" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid' ,... ] }

Returns

{
"version" : n,                    (numeric) The block version
"previousblockhash" : "xxxx",    (string) The hash of current highest block
"transactions" : [                (array) contents of non-coinbase transactions that should be included in the next block
    {
       "data" : "xxxx",          (string) transaction data encoded in hexadecimal (byte-for-byte)
       "hash" : "xxxx",          (string) hash/id encoded in little-endian hexadecimal
       "depends" : [              (array) array of numbers 
           n                        (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is
           ,...
       ],
       "fee": n,                   (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one
       "sigops" : n,               (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any
       "required" : true|false     (boolean) if provided and true, this transaction must be in the final block
    }
    ,...
],
"coinbaseaux" : {                  (json object) data that should be included in the coinbase's scriptSig content
    "flags" : "flags"            (string) 
},
"coinbasevalue" : n,               (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)
"coinbasetxn" : { ... },           (json object) information for coinbase transaction
"target" : "xxxx",               (string) The hash target
"mintime" : xxx,                   (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)
"mutable" : [                      (array of string) list of ways the block template may be changed 
   "value"                         (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'
   ,...
],
"noncerange" : "00000000ffffffff",   (string) A range of valid nonces
"sigoplimit" : n,                 (numeric) limit of sigops in blocks
"sizelimit" : n,                  (numeric) limit of block size
"curtime" : ttt,                  (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)
"bits" : "xxx",                 (string) compressed target of next block
"height" : n                      (numeric) The height of the next block
}
// example(s) for getblocktemplate to come later

getgenerate

Return if the server is set to generate coins or not. The default is false. It is set with the command line argument -gen (or lbrycrd.conf setting gen) It can also be set with the setgenerate call. Result true|false (boolean) If the server is set to generate coins or not Examples: > lbrycrd-cli getgenerate > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getgenerate", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

// example(s) for getgenerate to come later

gethashespersec

Returns a recent hashes per second performance measurement while generating. See the getgenerate and setgenerate calls to turn generation on and off. Examples: > lbrycrd-cli gethashespersec > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gethashespersec", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

n            (numeric) The recent hashes per second when generation is on (will return 0 if generation is off)
// example(s) for gethashespersec to come later

getmininginfo

Returns a json object containing mining-related information. Examples: > lbrycrd-cli getmininginfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getmininginfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"blocks": nnn,             (numeric) The current block
"currentblocksize": nnn,   (numeric) The last block size
"currentblocktx": nnn,     (numeric) The last block transaction
"difficulty": xxx.xxxxx    (numeric) The current difficulty
"errors": "..."          (string) Current errors
"generate": true|false     (boolean) If the generation is on or off (see getgenerate or setgenerate calls)
"genproclimit": n          (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)
"hashespersec": n          (numeric) The hashes per second of the generation, or 0 if no generation.
"pooledtx": n              (numeric) The size of the mem pool
"testnet": true|false      (boolean) If using testnet or not
"chain": "xxxx",         (string) current network name as defined in BIP70 (main, test, regtest)
}
// example(s) for getmininginfo to come later

getnetworkhashps

Returns the estimated network hashes per second based on the last n blocks. Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change. Pass in [height] to estimate the network speed at the time when a certain block was found. Examples: > lbrycrd-cli getnetworkhashps > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkhashps", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • blocks
    optionalnumber
    The number of blocks, or -1 for blocks since last difficulty change.
  • height
    optionalnumber
    To estimate at the time of the given height.

Returns

x             (numeric) Hashes per second estimated
// example(s) for getnetworkhashps to come later

prioritisetransaction

Accepts the transaction into mined blocks at a higher (or lower) priority Examples: > lbrycrd-cli prioritisetransaction "txid" 0.0 10000 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "prioritisetransaction", "params": ["txid", 0.0, 10000] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The transaction id.
  • priority delta
    number
    The priority to add or subtract. The transaction selection algorithm considers the tx as it would have a higher priority. (priority of a transaction is calculated: coinage * value_in_satoshis / txsize)
  • fee delta
    number
    The fee value (in satoshis) to add (or subtract, if negative). The fee is not actually paid, only the algorithm for selecting transactions into a block considers the transaction as it would have paid a higher (or lower) fee. Result true (boolean) Returns true

Returns

// example(s) for prioritisetransaction to come later

setgenerate

Set 'generate' true or false to turn generation on or off. Generation is limited to 'genproclimit' processors, -1 is unlimited. See the getgenerate call for the current setting. Examples: Set the generation on with a limit of one processor > lbrycrd-cli setgenerate true 1 Check the setting > lbrycrd-cli getgenerate Turn off generation > lbrycrd-cli setgenerate false Using json rpc > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setgenerate", "params": [true, 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • generate
    boolean
    Set to true to turn on generation, off to turn off.
  • genproclimit
    optionalnumber
    Set the processor limit for when generation is on. Can be -1 for unlimited.

Returns

// example(s) for setgenerate to come later

submitblock

Attempts to submit new block to network. The 'jsonparametersobject' parameter is currently ignored. See https://en.bitcoin.it/wiki/BIP_0022 for full specification. Examples: > lbrycrd-cli submitblock "mydata" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "submitblock", "params": ["mydata"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hexdata
    string
    the hex-encoded block data to submit
  • jsonparametersobject
    optionalstring
    object of optional parameters { "workid" : "id" (string, optional) if the server provided a workid, it MUST be included with submissions }

Returns

// example(s) for submitblock to come later

addnode

Attempts add or remove a node from the addnode list. Or try a connection to a node once. Examples: > lbrycrd-cli addnode "192.168.0.6:8333" "onetry" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addnode", "params": ["192.168.0.6:8333", "onetry"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • node
    string
    The node (see getpeerinfo for nodes)
  • command
    string
    'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once

Returns

// example(s) for addnode to come later

clearbanned

Clear all banned IPs. Examples: > lbrycrd-cli clearbanned > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

// example(s) for clearbanned to come later

disconnectnode

Immediately disconnects from the specified node. Examples: > lbrycrd-cli disconnectnode "192.168.0.6:8333" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["192.168.0.6:8333"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • node
    string
    The node (see getpeerinfo for nodes)

Returns

// example(s) for disconnectnode to come later

getaddednodeinfo

Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here) If dns is false, only a list of added nodes will be provided, otherwise connected information will also be available. Examples: > lbrycrd-cli getaddednodeinfo true > lbrycrd-cli getaddednodeinfo true "192.168.0.201" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • dns
    boolean
    If false, only a list of added nodes will be provided, otherwise connected information will also be available.
  • node
    optionalstring
    If provided, return information about this specific node, otherwise all nodes are returned.

Returns

[
{
  "addednode" : "192.168.0.201",   (string) The node ip address
  "connected" : true|false,          (boolean) If connected
  "addresses" : [
     {
       "address" : "192.168.0.201:8333",  (string) The lbrycrd server host and port
       "connected" : "outbound"           (string) connection, inbound or outbound
     }
     ,...
   ]
}
,...
]
// example(s) for getaddednodeinfo to come later

getconnectioncount

Returns the number of connections to other nodes. Examples: > lbrycrd-cli getconnectioncount > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getconnectioncount", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

n          (numeric) The connection count
// example(s) for getconnectioncount to come later

getnettotals

Returns information about network traffic, including bytes in, bytes out, and current time. Examples: > lbrycrd-cli getnettotals > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnettotals", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"totalbytesrecv": n,   (numeric) Total bytes received
"totalbytessent": n,   (numeric) Total bytes sent
"timemillis": t,       (numeric) Total cpu time
"uploadtarget":
{
  "timeframe": n,                         (numeric) Length of the measuring timeframe in seconds
  "target": n,                            (numeric) Target in bytes
  "target_reached": true|false,           (boolean) True if target is reached
  "serve_historical_blocks": true|false,  (boolean) True if serving historical blocks
  "bytes_left_in_cycle": t,               (numeric) Bytes left in current time cycle
  "time_left_in_cycle": t                 (numeric) Seconds left in current time cycle
}
}
// example(s) for getnettotals to come later

getnetworkinfo

Returns an object containing various state info regarding P2P networking. Examples: > lbrycrd-cli getnetworkinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnetworkinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"version": xxxxx,                      (numeric) the server version
"subversion": "/Satoshi:x.x.x/",     (string) the server subversion string
"protocolversion": xxxxx,              (numeric) the protocol version
"localservices": "xxxxxxxxxxxxxxxx", (string) the services we offer to the network
"timeoffset": xxxxx,                   (numeric) the time offset
"connections": xxxxx,                  (numeric) the number of connections
"networks": [                          (array) information per network
{
  "name": "xxx",                     (string) network (ipv4, ipv6 or onion)
  "limited": true|false,               (boolean) is the network limited using -onlynet?
  "reachable": true|false,             (boolean) is the network reachable?
  "proxy": "host:port"               (string) the proxy that is used for this network, or empty if none
}
,...
],
"relayfee": x.xxxxxxxx,                (numeric) minimum relay fee for non-free transactions in LBC/kB
"localaddresses": [                    (array) list of local addresses
{
  "address": "xxxx",                 (string) network address
  "port": xxx,                         (numeric) network port
  "score": xxx                         (numeric) relative score
}
,...
]
"warnings": "..."                    (string) any network warnings (such as alert messages) 
}
// example(s) for getnetworkinfo to come later

getpeerinfo

Returns data about each connected network node as a json array of objects. Examples: > lbrycrd-cli getpeerinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

[
{
  "id": n,                   (numeric) Peer index
  "addr":"host:port",      (string) The ip address and port of the peer
  "addrlocal":"ip:port",   (string) local address
  "services":"xxxxxxxxxxxxxxxx",   (string) The services offered
  "relaytxes":true|false,    (boolean) Whether peer has asked us to relay transactions to it
  "lastsend": ttt,           (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send
  "lastrecv": ttt,           (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive
  "bytessent": n,            (numeric) The total bytes sent
  "bytesrecv": n,            (numeric) The total bytes received
  "conntime": ttt,           (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)
  "timeoffset": ttt,         (numeric) The time offset in seconds
  "pingtime": n,             (numeric) ping time (if available)
  "minping": n,              (numeric) minimum observed ping time (if any at all)
  "pingwait": n,             (numeric) ping wait (if non-zero)
  "version": v,              (numeric) The peer version, such as 7001
  "subver": "/Satoshi:0.8.5/",  (string) The string version
  "inbound": true|false,     (boolean) Inbound (true) or Outbound (false)
  "startingheight": n,       (numeric) The starting height (block) of the peer
  "banscore": n,             (numeric) The ban score
  "synced_headers": n,       (numeric) The last header we have in common with this peer
  "synced_blocks": n,        (numeric) The last block we have in common with this peer
  "inflight": [
     n,                        (numeric) The heights of blocks we're currently asking from this peer
     ...
  ]
  "bytessent_per_msg": {
     "addr": n,             (numeric) The total bytes sent aggregated by message type
     ...
  }
  "bytesrecv_per_msg": {
     "addr": n,             (numeric) The total bytes received aggregated by message type
     ...
  }
}
,...
]
// example(s) for getpeerinfo to come later

listbanned

List all banned IPs/Subnets. Examples: > lbrycrd-cli listbanned > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listbanned", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

// example(s) for listbanned to come later

ping

Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping. Examples: > lbrycrd-cli ping > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "ping", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

// example(s) for ping to come later

setban

Attempts add or remove a IP/Subnet from the banned list. Examples: > lbrycrd-cli setban "192.168.0.6" "add" 86400 > lbrycrd-cli setban "192.168.0.0/24" "add" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setban", "params": ["192.168.0.6", "add" 86400] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • ip(/netmask)
    string
    The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)
  • command
    string
    'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list
  • bantime
    optionalnumber
    time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)
  • absolute
    optionalboolean
    If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)

Returns

// example(s) for setban to come later

createrawtransaction

Create a transaction spending the given inputs and creating new outputs. Outputs can be addresses or data. Returns hex-encoded raw transaction. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network. Examples: > lbrycrd-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01}" > lbrycrd-cli createrawtransaction "[{\"txid\":\"myid\",\"vout\":0}]" "{\"data\":\"00010203\"}" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "{\"address\":0.01}"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/ > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createrawtransaction", "params": ["[{\"txid\":\"myid\",\"vout\":0}]", "{\"data\":\"00010203\"}"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • transactions
    string
    A json array of json objects [ { "txid":"id", (string, required) The transaction id "vout":n (numeric, required) The output number } ,... ]
  • outputs
    string
    a json object with outputs { "address": x.xxx (numeric or string, required) The key is the lbrycrd address, the numeric value (can be string) is the LBC amount "data": "hex", (string, required) The key is "data", the value is hex encoded data ... }
  • locktime
    optionalnumber
    Raw locktime. Non-0 value also locktime-activates inputs

Returns

"transaction"            (string) hex string of the transaction
// example(s) for createrawtransaction to come later

decoderawtransaction

Return a JSON object representing the serialized, hex-encoded transaction. Examples: > lbrycrd-cli decoderawtransaction "hexstring" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decoderawtransaction", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hex
    string
    The transaction hex string

Returns

{
"txid" : "id",        (string) The transaction id
"size" : n,             (numeric) The transaction size
"version" : n,          (numeric) The version
"locktime" : ttt,       (numeric) The lock time
"vin" : [               (array of json objects)
   {
     "txid": "id",    (string) The transaction id
     "vout": n,         (numeric) The output number
     "scriptSig": {     (json object) The script
       "asm": "asm",  (string) asm
       "hex": "hex"   (string) hex
     },
     "sequence": n     (numeric) The script sequence number
   }
   ,...
],
"vout" : [             (array of json objects)
   {
     "value" : x.xxx,            (numeric) The value in LBC
     "n" : n,                    (numeric) index
     "scriptPubKey" : {          (json object)
       "asm" : "asm",          (string) the asm
       "hex" : "hex",          (string) the hex
       "reqSigs" : n,            (numeric) The required sigs
       "type" : "pubkeyhash",  (string) The type, eg 'pubkeyhash'
       "addresses" : [           (json array of string)
         "12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc"   (string) lbrycrd address
         ,...
       ]
     }
   }
   ,...
],
}
// example(s) for decoderawtransaction to come later

decodescript

Decode a hex-encoded script. Examples: > lbrycrd-cli decodescript "hexstring" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hex
    string
    the hex encoded script

Returns

{
"asm":"asm",   (string) Script public key
"hex":"hex",   (string) hex encoded public key
"type":"type", (string) The output type
"reqSigs": n,    (numeric) The required signatures
"addresses": [   (json array of string)
   "address"     (string) lbrycrd address
   ,...
],
"p2sh","address" (string) script address
}
// example(s) for decodescript to come later

fundrawtransaction

Add inputs to a transaction until it has enough in value to meet its out value. This will not modify existing inputs, and will add one change output to the outputs. Note that inputs which were signed may need to be resigned after completion since in/outputs have been added. The inputs added will not be signed, use signrawtransaction for that. Note that all existing inputs must have their previous output transaction be in the wallet. Note that all inputs selected must be of standard form and P2SH scripts must be in the wallet using importaddress or addmultisigaddress (to calculate fees). Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only Examples: Create a transaction with no inputs > lbrycrd-cli createrawtransaction "[]" "{\"myaddress\":0.01}" Add sufficient unsigned inputs to meet the output value > lbrycrd-cli fundrawtransaction "rawtransactionhex" Sign the transaction > lbrycrd-cli signrawtransaction "fundedtransactionhex" Send the transaction > lbrycrd-cli sendrawtransaction "signedtransactionhex"

Arguments

  • hexstring
    string
    The hex string of the raw transaction
  • options
    optionalobject
    { "changeAddress" (string, optional, default pool address) The bitcoin address to receive the change "changePosition" (numeric, optional, default random) The index of the change output "includeWatching" (boolean, optional, default false) Also select inputs which are watch only "lockUnspents" (boolean, optional, default false) Lock selected unspent outputs } for backward compatibility: passing in a true instead of an object will result in {"includeWatching":true}

Returns

{
"hex":       "value", (string)  The resulting raw transaction (hex-encoded string)
"fee":       n,         (numeric) Fee the resulting transaction pays
"changepos": n          (numeric) The position of the added change output, or -1
}
"hex"
// example(s) for fundrawtransaction to come later

getrawtransaction

NOTE: By default this function only works sometimes. This is when the tx is in the mempool or there is an unspent output in the utxo for this transaction. To make it always work, you need to maintain a transaction index, using the -txindex command line option. Return the raw transaction data. If verbose=0, returns a string that is serialized, hex-encoded data for 'txid'. If verbose is non-zero, returns an Object with information about 'txid'. Examples: > lbrycrd-cli getrawtransaction "mytxid" > lbrycrd-cli getrawtransaction "mytxid" 1 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawtransaction", "params": ["mytxid", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The transaction id
  • verbose
    optionalnumber
    If 0, return a string, other return a json object

Returns

"data"      (string) The serialized, hex-encoded data for 'txid'

Result (if verbose > 0):
{
"hex" : "data",       (string) The serialized, hex-encoded data for 'txid'
"txid" : "id",        (string) The transaction id (same as provided)
"size" : n,             (numeric) The transaction size
"version" : n,          (numeric) The version
"locktime" : ttt,       (numeric) The lock time
"vin" : [               (array of json objects)
   {
     "txid": "id",    (string) The transaction id
     "vout": n,         (numeric) 
     "scriptSig": {     (json object) The script
       "asm": "asm",  (string) asm
       "hex": "hex"   (string) hex
     },
     "sequence": n      (numeric) The script sequence number
   }
   ,...
],
"vout" : [              (array of json objects)
   {
     "value" : x.xxx,            (numeric) The value in LBC
     "n" : n,                    (numeric) index
     "scriptPubKey" : {          (json object)
       "asm" : "asm",          (string) the asm
       "hex" : "hex",          (string) the hex
       "reqSigs" : n,            (numeric) The required sigs
       "type" : "pubkeyhash",  (string) The type, eg 'pubkeyhash'
       "addresses" : [           (json array of string)
         "lbrycrdaddress"        (string) lbrycrd address
         ,...
       ]
     }
   }
   ,...
],
"blockhash" : "hash",   (string) the block hash
"confirmations" : n,      (numeric) The confirmations
"time" : ttt,             (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)
"blocktime" : ttt         (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
}
// example(s) for getrawtransaction to come later

sendrawtransaction

Submits raw transaction (serialized, hex-encoded) to local node and network. Also see createrawtransaction and signrawtransaction calls. Examples: Create a transaction > lbrycrd-cli createrawtransaction "[{\"txid\" : \"mytxid\",\"vout\":0}]" "{\"myaddress\":0.01}" Sign the transaction, and get back the hex > lbrycrd-cli signrawtransaction "myhex" Send the transaction (signed hex) > lbrycrd-cli sendrawtransaction "signedhex" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["signedhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hexstring
    string
    The hex string of the raw transaction)
  • allowhighfees
    optionalboolean
    Allow high fees

Returns

"hex"             (string) The transaction hash in hex
// example(s) for sendrawtransaction to come later

signrawtransaction

Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. Examples: > lbrycrd-cli signrawtransaction "myhex" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signrawtransaction", "params": ["myhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • hexstring
    string
    The transaction hex string
  • prevtxs
    optionalstring
    An json array of previous dependent transaction outputs [ (json array of json objects, or 'null' if none provided) { "txid":"id", (string, required) The transaction id "vout":n, (numeric, required) The output number "scriptPubKey": "hex", (string, required) script key "redeemScript": "hex" (string, required for P2SH) redeem script } ,... ]
  • privatekeys
    optionalstring
    A json array of base58-encoded private keys for signing [ (json array of strings, or 'null' if none provided) "privatekey" (string) private key in base58-encoding ,... ]
  • sighashtype
    optionalstring
    The signature hash type. Must be one of "ALL" "NONE" "SINGLE" "ALL|ANYONECANPAY" "NONE|ANYONECANPAY" "SINGLE|ANYONECANPAY"

Returns

{
"hex" : "value",           (string) The hex-encoded raw transaction with signature(s)
"complete" : true|false,   (boolean) If the transaction has a complete set of signatures
"errors" : [                 (json array of objects) Script verification errors (if there are any)
  {
    "txid" : "hash",           (string) The hash of the referenced, previous transaction
    "vout" : n,                (numeric) The index of the output to spent and used as input
    "scriptSig" : "hex",       (string) The hex-encoded signature script
    "sequence" : n,            (numeric) Script sequence number
    "error" : "text"           (string) Verification or signing error related to the input
  }
  ,...
]
}
// example(s) for signrawtransaction to come later

createmultisig

Creates a multi-signature address with n signature of m keys required. It returns a json object with the address and redeemScript. Examples: Create a multisig address from 2 addresses > lbrycrd-cli createmultisig 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createmultisig", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • nrequired
    number
    The number of required signatures out of the n keys or addresses.
  • keys
    string
    A json array of keys which are lbrycrd addresses or hex-encoded public keys [ "key" (string) lbrycrd address or hex-encoded public key ,... ]

Returns

{
"address":"multisigaddress",  (string) The value of the new multisig address.
"redeemScript":"script"       (string) The string value of the hex-encoded redemption script.
}
// example(s) for createmultisig to come later

estimatefee

Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks. Examples: > lbrycrd-cli estimatefee 6

Arguments

  • nblocks
    number

Returns

n              (numeric) estimated fee-per-kilobyte

A negative value is returned if not enough transactions and blocks
have been observed to make an estimate.
// example(s) for estimatefee to come later

estimatepriority

Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks. Examples: > lbrycrd-cli estimatepriority 6

Arguments

  • nblocks
    number

Returns

n              (numeric) estimated priority

A negative value is returned if not enough transactions and blocks
have been observed to make an estimate.
// example(s) for estimatepriority to come later

estimatesmartfee

WARNING: This interface is unstable and may disappear or change! Estimates the approximate fee per kilobyte needed for a transaction to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid. Examples: > lbrycrd-cli estimatesmartfee 6

Arguments

  • nblocks
    number

Returns

{
"feerate" : x.x,     (numeric) estimate fee-per-kilobyte (in BTC)
"blocks" : n         (numeric) block number where estimate was found
}

A negative value is returned if not enough transactions and blocks
have been observed to make an estimate for any number of blocks.
However it will not return a value below the mempool reject fee.
// example(s) for estimatesmartfee to come later

estimatesmartpriority

WARNING: This interface is unstable and may disappear or change! Estimates the approximate priority a zero-fee transaction needs to begin confirmation within nblocks blocks if possible and return the number of blocks for which the estimate is valid. Examples: > lbrycrd-cli estimatesmartpriority 6

Arguments

  • nblocks
    number

Returns

{
"priority" : x.x,    (numeric) estimated priority
"blocks" : n         (numeric) block number where estimate was found
}

A negative value is returned if not enough transactions and blocks
have been observed to make an estimate for any number of blocks.
However if the mempool reject fee is set it will return 1e9 * MAX_MONEY.
// example(s) for estimatesmartpriority to come later

validateaddress

Return information about the given lbrycrd address. Examples: > lbrycrd-cli validateaddress "1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "validateaddress", "params": ["1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address to validate

Returns

{
"isvalid" : true|false,       (boolean) If the address is valid or not. If not, this is the only property returned.
"address" : "lbrycrdaddress", (string) The lbrycrd address validated
"scriptPubKey" : "hex",       (string) The hex encoded scriptPubKey generated by the address
"ismine" : true|false,        (boolean) If the address is yours or not
"iswatchonly" : true|false,   (boolean) If the address is watchonly
"isscript" : true|false,      (boolean) If the key is a script
"pubkey" : "publickeyhex",    (string) The hex value of the raw public key
"iscompressed" : true|false,  (boolean) If the address is compressed
"account" : "account"         (string) DEPRECATED. The account associated with the address, "" is the default account
}
// example(s) for validateaddress to come later

verifymessage

Verify a signed message Examples: Unlock the wallet for 30 seconds > lbrycrd-cli walletpassphrase "mypassphrase" 30 Create the signature > lbrycrd-cli signmessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" "my message" Verify the signature > lbrycrd-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" "signature" "my message" As json rpc > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifymessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ", "signature", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address to use for the signature.
  • signature
    string
    The signature provided by the signer in base 64 encoding (see signmessage).
  • message
    string
    The message that was signed.

Returns

true|false   (boolean) If the signature is verified or not.
// example(s) for verifymessage to come later

abandontransaction

Mark in-wallet transaction as abandoned This will mark this transaction and all its in-wallet descendants as abandoned which will allow for their inputs to be respent. It can be used to replace "stuck" or evicted transactions. It only works on transactions which are not included in a block and are not currently in the mempool. It has no effect on transactions which are already conflicted or abandoned. Examples: > lbrycrd-cli abandontransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "abandontransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The transaction id

Returns

// example(s) for abandontransaction to come later

addmultisigaddress

Add a nrequired-to-sign multisignature address to the wallet. Each key is a Bitcoin address or hex-encoded public key. If 'account' is specified (DEPRECATED), assign address to that account. Examples: Add a multisig address from 2 addresses > lbrycrd-cli addmultisigaddress 2 "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]" As json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "addmultisigaddress", "params": [2, "[\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\",\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • nrequired
    number
    The number of required signatures out of the n keys or addresses.
  • keysobject
    string
    A json array of lbrycrd addresses or hex-encoded public keys [ "address" (string) lbrycrd address or hex-encoded public key ..., ]
  • account
    optionalstring
    DEPRECATED. An account to assign the addresses to.

Returns

"lbrycrdaddress"  (string) A lbrycrd address associated with the keys.
// example(s) for addmultisigaddress to come later

backupwallet

Safely copies current wallet file to destination, which can be a directory or a path with filename. Examples: > lbrycrd-cli backupwallet "backup.dat" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • destination
    string
    The destination directory or file

Returns

// example(s) for backupwallet to come later

dumpprivkey

Reveals the private key corresponding to 'lbrycrdaddress'. Then the importprivkey can be used with this output Examples: > lbrycrd-cli dumpprivkey "myaddress" > lbrycrd-cli importprivkey "mykey" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpprivkey", "params": ["myaddress"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address for the private key

Returns

"key"                (string) The private key
// example(s) for dumpprivkey to come later

dumpwallet

Dumps all wallet keys in a human-readable format. Examples: > lbrycrd-cli dumpwallet "test" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "dumpwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • filename
    string
    The filename

Returns

// example(s) for dumpwallet to come later

encryptwallet

Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server. Examples: Encrypt you wallet > lbrycrd-cli encryptwallet "my pass phrase" Now set the passphrase to use the wallet, such as for signing or sending LBC > lbrycrd-cli walletpassphrase "my pass phrase" Now we can so something like sign > lbrycrd-cli signmessage "lbrycrdaddress" "test message" Now lock the wallet again by removing the passphrase > lbrycrd-cli walletlock As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • passphrase
    string
    The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.

Returns

// example(s) for encryptwallet to come later

getaccount

DEPRECATED. Returns the account associated with the given address. Examples: > lbrycrd-cli getaccount "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccount", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address for account lookup.

Returns

"accountname"        (string) the account address
// example(s) for getaccount to come later

getaccountaddress

DEPRECATED. Returns the current Bitcoin address for receiving payments to this account. Examples: > lbrycrd-cli getaccountaddress > lbrycrd-cli getaccountaddress "" > lbrycrd-cli getaccountaddress "myaccount" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaccountaddress", "params": ["myaccount"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    string
    The account name for the address. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created and a new address created if there is no account by the given name.

Returns

"lbrycrdaddress"   (string) The account lbrycrd address
// example(s) for getaccountaddress to come later

getaddressesbyaccount

DEPRECATED. Returns the list of addresses for the given account. Examples: > lbrycrd-cli getaddressesbyaccount "tabby" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getaddressesbyaccount", "params": ["tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    string
    The account name.

Returns

[                     (json array of string)
"lbrycrdaddress"  (string) a lbrycrd address associated with the given account
,...
]
// example(s) for getaddressesbyaccount to come later

getbalance

If account is not specified, returns the server's total available balance. If account is specified (DEPRECATED), returns the balance in the account. Note that the account "" is not the same as leaving the parameter out. The server total may be different to the balance in the default "" account. Examples: The total amount in the wallet > lbrycrd-cli getbalance The total amount in the wallet at least 5 blocks confirmed > lbrycrd-cli getbalance "*" 6 As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    optionalstring
    DEPRECATED. The selected account, or "*" for entire wallet. It may be the default account using "".
  • minconf
    optionalnumber
    Only include transactions confirmed at least this many times.
  • includeWatchonly
    optionalboolean
    Also include balance in watchonly addresses (see 'importaddress')

Returns

amount              (numeric) The total amount in LBC received for this account.
// example(s) for getbalance to come later

getnewaddress

Returns a new Bitcoin address for receiving payments. If 'account' is specified (DEPRECATED), it is added to the address book so payments received with the address will be credited to 'account'. Examples: > lbrycrd-cli getnewaddress > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    optionalstring
    DEPRECATED. The account name for the address to be linked to. If not provided, the default account "" is used. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.

Returns

"lbrycrdaddress"    (string) The new lbrycrd address
// example(s) for getnewaddress to come later

getrawchangeaddress

Returns a new Bitcoin address, for receiving change. This is for use with raw transactions, NOT normal use. Examples: > lbrycrd-cli getrawchangeaddress > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrawchangeaddress", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

"address"    (string) The address
// example(s) for getrawchangeaddress to come later

getreceivedbyaccount

DEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations. Examples: Amount received by the default account with at least 1 confirmation > lbrycrd-cli getreceivedbyaccount "" Amount received at the tabby account including unconfirmed amounts with zero confirmations > lbrycrd-cli getreceivedbyaccount "tabby" 0 The amount with at least 6 confirmation, very safe > lbrycrd-cli getreceivedbyaccount "tabby" 6 As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaccount", "params": ["tabby", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    string
    The selected account, may be the default account using "".
  • minconf
    optionalnumber
    Only include transactions confirmed at least this many times.

Returns

amount              (numeric) The total amount in LBC received for this account.
// example(s) for getreceivedbyaccount to come later

getreceivedbyaddress

Returns the total amount received by the given lbrycrdaddress in transactions with at least minconf confirmations. Examples: The amount from transactions with at least 1 confirmation > lbrycrd-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" The amount including unconfirmed transactions, zero confirmations > lbrycrd-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" 0 The amount with at least 6 confirmation, very safe > lbrycrd-cli getreceivedbyaddress "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" 6 As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getreceivedbyaddress", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address for transactions.
  • minconf
    optionalnumber
    Only include transactions confirmed at least this many times.

Returns

amount   (numeric) The total amount in LBC received at this address.
// example(s) for getreceivedbyaddress to come later

gettransaction

Get detailed information about in-wallet transaction Examples: > lbrycrd-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" > lbrycrd-cli gettransaction "1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d" true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "gettransaction", "params": ["1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The transaction id
  • includeWatchonly
    optionalboolean
    Whether to include watchonly addresses in balance calculation and details[]

Returns

{
"amount" : x.xxx,        (numeric) The transaction amount in LBC
"confirmations" : n,     (numeric) The number of confirmations
"blockhash" : "hash",  (string) The block hash
"blockindex" : xx,       (numeric) The index of the transaction in the block that includes it
"blocktime" : ttt,       (numeric) The time in seconds since epoch (1 Jan 1970 GMT)
"txid" : "transactionid",   (string) The transaction id.
"time" : ttt,            (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)
"timereceived" : ttt,    (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)
"bip125-replaceable": "yes|no|unknown"  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                 may be unknown for unconfirmed transactions not in the mempool
"details" : [
  {
    "account" : "accountname",  (string) DEPRECATED. The account name involved in the transaction, can be "" for the default account.
    "address" : "lbrycrdaddress",   (string) The lbrycrd address involved in the transaction
    "category" : "send|receive",    (string) The category, either 'send' or 'receive'
    "amount" : x.xxx,                 (numeric) The amount in LBC
    "label" : "label",              (string) A comment for the address/transaction, if any
    "vout" : n,                       (numeric) the vout value
  }
  ,...
],
"hex" : "data"         (string) Raw data for transaction
}
// example(s) for gettransaction to come later

getunconfirmedbalance

Returns the server's total unconfirmed balance

Returns

// example(s) for getunconfirmedbalance to come later

getwalletinfo

Returns an object containing various wallet state info. Examples: > lbrycrd-cli getwalletinfo > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{
"walletversion": xxxxx,     (numeric) the wallet version
"balance": xxxxxxx,         (numeric) the total confirmed balance of the wallet in LBC
"unconfirmed_balance": xxx, (numeric) the total unconfirmed balance of the wallet in LBC
"immature_balance": xxxxxx, (numeric) the total immature balance of the wallet in LBC
"txcount": xxxxxxx,         (numeric) the total number of transactions in the wallet
"keypoololdest": xxxxxx,    (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool
"keypoolsize": xxxx,        (numeric) how many new keys are pre-generated
"unlocked_until": ttt,      (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked
"paytxfee": x.xxxx,         (numeric) the transaction fee configuration, set in LBC/kB
}
// example(s) for getwalletinfo to come later

importaddress

Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend. Examples: Import a script with rescan > lbrycrd-cli importaddress "myscript" Import using a label without rescan > lbrycrd-cli importaddress "myscript" "testing" false As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myscript", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • script
    string
    The hex-encoded script (or address)
  • label
    optionalstring
    An optional label
  • rescan
    optionalboolean
    Rescan the wallet for transactions
  • p2sh
    optionalboolean
    Add the P2SH version of the script as well Note: This call can take minutes to complete if rescan is true. If you have the full public key, you should call importpubkey instead of this.

Returns

// example(s) for importaddress to come later

importprivkey

Adds a private key (as returned by dumpprivkey) to your wallet. Examples: Dump a private key > lbrycrd-cli dumpprivkey "myaddress" Import the private key with rescan > lbrycrd-cli importprivkey "mykey" Import using a label and without rescan > lbrycrd-cli importprivkey "mykey" "testing" false As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importprivkey", "params": ["mykey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdprivkey
    string
    The private key (see dumpprivkey)
  • label
    optionalstring
    An optional label
  • rescan
    optionalboolean
    Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.

Returns

// example(s) for importprivkey to come later

importprunedfunds

Imports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.

Arguments

  • rawtransaction
    string
    A raw transaction in hex funding an already-existing address in wallet
  • txoutproof
    string
    The hex output from gettxoutproof that contains the transaction
  • label
    optionalstring
    An optional label

Returns

// example(s) for importprunedfunds to come later

importpubkey

Adds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Examples: Import a public key with rescan > lbrycrd-cli importpubkey "mypubkey" Import using a label without rescan > lbrycrd-cli importpubkey "mypubkey" "testing" false As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importpubkey", "params": ["mypubkey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • pubkey
    string
    The hex-encoded public key
  • label
    optionalstring
    An optional label
  • rescan
    optionalboolean
    Rescan the wallet for transactions Note: This call can take minutes to complete if rescan is true.

Returns

// example(s) for importpubkey to come later

importwallet

Imports keys from a wallet dump file (see dumpwallet). Examples: Dump the wallet > lbrycrd-cli dumpwallet "test" Import the wallet > lbrycrd-cli importwallet "test" Import using the json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importwallet", "params": ["test"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • filename
    string
    The wallet file

Returns

// example(s) for importwallet to come later

keypoolrefill

Fills the keypool. Examples: > lbrycrd-cli keypoolrefill > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "keypoolrefill", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • newsize
    optionalnumber
    The new keypool size

Returns

// example(s) for keypoolrefill to come later

listaccounts

DEPRECATED. Returns Object that has account names as keys, account balances as values. Examples: List account balances where there at least 1 confirmation > lbrycrd-cli listaccounts List account balances including zero confirmation transactions > lbrycrd-cli listaccounts 0 List account balances for 6 or more confirmations > lbrycrd-cli listaccounts 6 As json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaccounts", "params": [6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • minconf
    optionalnumber
    Only include transactions with at least this many confirmations
  • includeWatchonly
    optionalboolean
    Include balances in watchonly addresses (see 'importaddress')

Returns

{                      (json object where keys are account names, and values are numeric balances
"account": x.xxx,  (numeric) The property name is the account name, and the value is the total balance for the account.
...
}
// example(s) for listaccounts to come later

listaddressgroupings

Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions Examples: > lbrycrd-cli listaddressgroupings > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listaddressgroupings", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

[
[
  [
    "lbrycrdaddress",     (string) The lbrycrd address
    amount,                 (numeric) The amount in LBC
    "account"             (string, optional) The account (DEPRECATED)
  ]
  ,...
]
,...
]
// example(s) for listaddressgroupings to come later

listlockunspent

Returns list of temporarily unspendable outputs. See the lockunspent call to lock and unlock transactions for spending. Examples: List the unspent transactions > lbrycrd-cli listunspent Lock an unspent transaction > lbrycrd-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]" List the locked transactions > lbrycrd-cli listlockunspent Unlock the transaction again > lbrycrd-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listlockunspent", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

[
{
  "txid" : "transactionid",     (string) The transaction id locked
  "vout" : n                      (numeric) The vout value
}
,...
]
// example(s) for listlockunspent to come later

listreceivedbyaccount

DEPRECATED. List balances by account. Examples: > lbrycrd-cli listreceivedbyaccount > lbrycrd-cli listreceivedbyaccount 6 true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaccount", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • minconf
    optionalnumber
    The minimum number of confirmations before payments are included.
  • includeempty
    optionalboolean
    Whether to include accounts that haven't received any payments.
  • includeWatchonly
    optionalboolean
    Whether to include watchonly addresses (see 'importaddress').

Returns

[
{
  "involvesWatchonly" : true,   (bool) Only returned if imported addresses were involved in transaction
  "account" : "accountname",  (string) The account name of the receiving account
  "amount" : x.xxx,             (numeric) The total amount received by addresses with this account
  "confirmations" : n,          (numeric) The number of confirmations of the most recent transaction included
  "label" : "label"           (string) A comment for the address/transaction, if any
}
,...
]
// example(s) for listreceivedbyaccount to come later

listreceivedbyaddress

List balances by receiving address. Examples: > lbrycrd-cli listreceivedbyaddress > lbrycrd-cli listreceivedbyaddress 6 true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • minconf
    optionalnumber
    The minimum number of confirmations before payments are included.
  • includeempty
    optionalboolean
    Whether to include addresses that haven't received any payments.
  • includeWatchonly
    optionalboolean
    Whether to include watchonly addresses (see 'importaddress').

Returns

[
{
  "involvesWatchonly" : true,        (bool) Only returned if imported addresses were involved in transaction
  "address" : "receivingaddress",  (string) The receiving address
  "account" : "accountname",       (string) DEPRECATED. The account of the receiving address. The default account is "".
  "amount" : x.xxx,                  (numeric) The total amount in LBC received by the address
  "confirmations" : n,               (numeric) The number of confirmations of the most recent transaction included
  "label" : "label"                (string) A comment for the address/transaction, if any
}
,...
]
// example(s) for listreceivedbyaddress to come later

listsinceblock

Get all transactions in blocks since block [blockhash], or all transactions if omitted Examples: > lbrycrd-cli listsinceblock > lbrycrd-cli listsinceblock "000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad" 6 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listsinceblock", "params": ["000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • blockhash
    optionalstring
    The block hash to list transactions since
  • target-confirmations:
    optionalnumber
    The confirmations required, must be 1 or more
  • includeWatchonly:
    optionalboolean
    Include transactions to watchonly addresses (see 'importaddress')

Returns

{
"transactions": [
  "account":"accountname",       (string) DEPRECATED. The account name associated with the transaction. Will be "" for the default account.
  "address":"lbrycrdaddress",    (string) The lbrycrd address of the transaction. Not present for move transactions (category = move).
  "category":"send|receive",     (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.
  "amount": x.xxx,          (numeric) The amount in LBC. This is negative for the 'send' category, and for the 'move' category for moves 
                                        outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.
  "vout" : n,               (numeric) the vout value
  "fee": x.xxx,             (numeric) The amount of the fee in LBC. This is negative and only available for the 'send' category of transactions.
  "confirmations": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.
  "blockhash": "hashvalue",     (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.
  "blockindex": n,          (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.
  "blocktime": xxx,         (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
  "txid": "transactionid",  (string) The transaction id. Available for 'send' and 'receive' category of transactions.
  "time": xxx,              (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).
  "timereceived": xxx,      (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.
  "comment": "...",       (string) If a comment is associated with the transaction.
  "label" : "label"       (string) A comment for the address/transaction, if any
  "to": "...",            (string) If a comment to is associated with the transaction.
],
"lastblock": "lastblockhash"     (string) The hash of the last block
}
// example(s) for listsinceblock to come later

listtransactions

Returns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'. Examples: List the most recent 10 transactions in the systems > lbrycrd-cli listtransactions List transactions 100 to 120 > lbrycrd-cli listtransactions "*" 20 100 As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listtransactions", "params": ["*", 20, 100] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • account
    optionalstring
    DEPRECATED. The account name. Should be "*".
  • count
    optionalnumber
    The number of transactions to return
  • from
    optionalnumber
    The number of transactions to skip
  • includeWatchonly
    optionalboolean
    Include transactions to watchonly addresses (see 'importaddress')

Returns

[
{
  "account":"accountname",       (string) DEPRECATED. The account name associated with the transaction. 
                                              It will be "" for the default account.
  "address":"lbrycrdaddress",    (string) The lbrycrd address of the transaction. Not present for 
                                              move transactions (category = move).
  "category":"send|receive|move", (string) The transaction category. 'move' is a local (off blockchain)
                                              transaction between accounts, and not associated with an address,
                                              transaction id or block. 'send' and 'receive' transactions are 
                                              associated with an address, transaction id and block details
  "amount": x.xxx,          (numeric) The amount in LBC. This is negative for the 'send' category, and for the
                                       'move' category for moves outbound. It is positive for the 'receive' category,
                                       and for the 'move' category for inbound funds.
  "vout": n,                (numeric) the vout value
  "fee": x.xxx,             (numeric) The amount of the fee in LBC. This is negative and only available for the 
                                       'send' category of transactions.
  "abandoned": xxx          (bool) 'true' if the transaction has been abandoned (inputs are respendable).
  "confirmations": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and 
                                       'receive' category of transactions. Negative confirmations indicate the
                                       transaction conflicts with the block chain
  "trusted": xxx            (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.
  "blockhash": "hashvalue", (string) The block hash containing the transaction. Available for 'send' and 'receive'
                                        category of transactions.
  "blockindex": n,          (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'
                                        category of transactions.
  "blocktime": xxx,         (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).
  "txid": "transactionid", (string) The transaction id. Available for 'send' and 'receive' category of transactions.
  "time": xxx,              (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).
  "timereceived": xxx,      (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available 
                                        for 'send' and 'receive' category of transactions.
  "comment": "...",       (string) If a comment is associated with the transaction.
  "label": "label"        (string) A comment for the address/transaction, if any
  "otheraccount": "accountname",  (string) For the 'move' category of transactions, the account the funds came 
                                        from (for receiving funds, positive amounts), or went to (for sending funds,
                                        negative amounts).
  "bip125-replaceable": "yes|no|unknown"  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
                                                   may be unknown for unconfirmed transactions not in the mempool
}
]
// example(s) for listtransactions to come later

listunspent

Returns array of unspent transaction outputs with between minconf and maxconf (inclusive) confirmations. Optionally filter to only include txouts paid to specified addresses. Examples: > lbrycrd-cli listunspent > lbrycrd-cli listunspent 6 9999999 "[\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\",\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\"]" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listunspent", "params": [6, 9999999 "[\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\",\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\"]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Returns

{txid, vout, scriptPubKey, amount, confirmations}

Arguments:
1. minconf          (numeric, optional, default=1) The minimum confirmations to filter
2. maxconf          (numeric, optional, default=9999999) The maximum confirmations to filter
3. "addresses"    (string) A json array of lbrycrd addresses to filter
  [
    "address"   (string) lbrycrd address
    ,...
  ]

Result
[                   (array of json object)
{
  "txid" : "txid",        (string) the transaction id 
  "vout" : n,               (numeric) the vout value
  "address" : "address",  (string) the lbrycrd address
  "account" : "account",  (string) DEPRECATED. The associated account, or "" for the default account
  "scriptPubKey" : "key", (string) the script key
  "amount" : x.xxx,         (numeric) the transaction amount in LBC
  "confirmations" : n       (numeric) The number of confirmations
}
,...
]
// example(s) for listunspent to come later

lockunspent

Updates list of temporarily unspendable outputs. Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs. If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked. A locked transaction output will not be chosen by automatic coin selection, when spending LBC. Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list is always cleared (by virtue of process exit) when a node stops or fails. Also see the listunspent call Examples: List the unspent transactions > lbrycrd-cli listunspent Lock an unspent transaction > lbrycrd-cli lockunspent false "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]" List the locked transactions > lbrycrd-cli listlockunspent Unlock the transaction again > lbrycrd-cli lockunspent true "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "lockunspent", "params": [false, "[{\"txid\":\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\",\"vout\":1}]"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • unlock
    boolean
    Whether to unlock (true) or lock (false) the specified transactions
  • transactions
    optionalstring
    A json array of objects. Each object the txid (string) vout (numeric) [ (json array of json objects) { "txid":"id", (string) The transaction id "vout": n (numeric) The output number } ,... ]

Returns

true|false    (boolean) Whether the command was successful or not
// example(s) for lockunspent to come later

move

DEPRECATED. Move a specified amount from one account in your wallet to another. Examples: Move 0.01 LBC from the default account to the account named tabby > lbrycrd-cli move "" "tabby" 0.01 Move 0.01 LBC timotei to akiko with a comment and funds have 6 confirmations > lbrycrd-cli move "timotei" "akiko" 0.01 6 "happy birthday!" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko", 0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • fromaccount
    string
    The name of the account to move funds from. May be the default account using "".
  • toaccount
    string
    The name of the account to move funds to. May be the default account using "".
  • amount
    number
    Quantity of LBC to move between accounts.
  • minconf
    optionalnumber
    Only use funds with at least this many confirmations.
  • comment
    optionalstring
    An optional comment, stored in the wallet only.

Returns

true|false           (boolean) true if successful.
// example(s) for move to come later

removeprunedfunds

Deletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will effect wallet balances. Examples: > lbrycrd-cli removeprunedfunds "a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5" As a JSON-RPC call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "removprunedfunds", "params": ["a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • txid
    string
    The hex-encoded id of the transaction you are deleting

Returns

// example(s) for removeprunedfunds to come later

sendfrom

DEPRECATED (use sendtoaddress). Sent an amount from an account to a lbrycrd address. Examples: Send 0.01 LBC from the default account to the address, must have at least 1 confirmation > lbrycrd-cli sendfrom "" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.01 Send 0.01 from the tabby account to the given address, funds must have at least 6 confirmations > lbrycrd-cli sendfrom "tabby" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.01 6 "donation" "seans outpost" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfrom", "params": ["tabby", "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.01, 6, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • fromaccount
    string
    The name of the account to send funds from. May be the default account using "".
  • tolbrycrdaddress
    string
    The lbrycrd address to send funds to.
  • amount
    number
    The amount in LBC (transaction fee is added on top).
  • minconf
    optionalnumber
    Only use funds with at least this many confirmations.
  • comment
    optionalstring
    A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.
  • comment-to
    optionalstring
    An optional comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, it is just kept in your wallet.

Returns

"transactionid"        (string) The transaction id.
// example(s) for sendfrom to come later

sendmany

Send multiple times. Amounts are double-precision floating point numbers. Examples: Send two amounts to two different addresses: > lbrycrd-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}" Send two amounts to two different addresses setting the confirmation and comment: > lbrycrd-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}" 6 "testing" Send two amounts to two different addresses, subtract fee from amount: > lbrycrd-cli sendmany "" "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}" 1 "" "[\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\",\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\"]" As a json rpc call > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendmany", "params": ["", "{\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01,\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}", 6, "testing"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • fromaccount
    string
    DEPRECATED. The account to send the funds from. Should be "" for the default account
  • amounts
    string
    A json object with addresses and amounts { "address":amount (numeric or string) The lbrycrd address is the key, the numeric amount (can be string) in LBC is the value ,... }
  • minconf
    optionalnumber
    Only use the balance confirmed at least this many times.
  • comment
    optionalstring
    A comment
  • subtractfeefromamount
    optionalstring
    A json array with addresses. The fee will be equally deducted from the amount of each selected address. Those recipients will receive less LBC than you enter in their corresponding amount field. If no addresses are specified here, the sender pays the fee. [ "address" (string) Subtract fee from this address ,... ]

Returns

"transactionid"          (string) The transaction id for the send. Only 1 transaction is created regardless of 
the number of addresses.
// example(s) for sendmany to come later

sendtoaddress

Send an amount to a given address. Examples: > lbrycrd-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 > lbrycrd-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "donation" "seans outpost" > lbrycrd-cli sendtoaddress "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" 0.1 "" "" true > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendtoaddress", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address to send to.
  • amount
    number
    The amount in LBC to send. eg 0.1
  • comment
    optionalstring
    A comment used to store what the transaction is for. This is not part of the transaction, just kept in your wallet.
  • comment-to
    optionalstring
    A comment to store the name of the person or organization to which you're sending the transaction. This is not part of the transaction, just kept in your wallet.
  • subtractfeefromamount
    optionalboolean
    The fee will be deducted from the amount being sent. The recipient will receive less LBC than you enter in the amount field.

Returns

"transactionid"  (string) The transaction id.
// example(s) for sendtoaddress to come later

setaccount

DEPRECATED. Sets the account associated with the given address. Examples: > lbrycrd-cli setaccount "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" "tabby" > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "setaccount", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ", "tabby"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address to be associated with an account.
  • account
    string
    The account to assign the address to.

Returns

// example(s) for setaccount to come later

settxfee

Set the transaction fee per kB. Overwrites the paytxfee parameter. Examples: > lbrycrd-cli settxfee 0.00001 > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "settxfee", "params": [0.00001] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • amount
    number
    The transaction fee in LBC/kB Result true|false (boolean) Returns true if successful

Returns

// example(s) for settxfee to come later

signmessage

Sign a message with the private key of an address Examples: Unlock the wallet for 30 seconds > lbrycrd-cli walletpassphrase "mypassphrase" 30 Create the signature > lbrycrd-cli signmessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" "my message" Verify the signature > lbrycrd-cli verifymessage "1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ" "signature" "my message" As json rpc > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "signmessage", "params": ["1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ", "my message"] }' -H 'content-type: text/plain;' http://127.0.0.1:9245/

Arguments

  • lbrycrdaddress
    string
    The lbrycrd address to use for the private key.
  • message
    string
    The message to create a signature of.

Returns

"signature"          (string) The signature of the message encoded in base 64
// example(s) for signmessage 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.