/lbry-nodejs

A LBRY API wrapper for node.js

Primary LanguageJavaScript

lbry-nodejs

A nodejs RPC wrapper for LBRY protocol


Donate LBRY credits

bUgP1zxWitRBcz4kJdGzgsNoFQU4H71yYu

Donate Bitcoin

1GXHUyUaMu8RnmHqApz3CuLAbGhcxbqGjT


To get started:

1) Download the and run the lbrynet-daemon:

$ ./lbrynet-daemon

Or download the app, and open it.

2) Require the module in your application

const lbry = require('lbry-nodejs')

3) Use a method

lbry.get('name')
.then((data) => console.log(data))
.catch((error) => console.error(error))

Example

Method with required parameters

resolve_name

Inputs

const name = 'itsadisaster'
Method
lbry.resolve_name(name)
Response
const response = {
  "id": null,
  "jsonrpc": "2.0",
  "result": {
    "author": "Written and directed by Todd Berger",
    "content_type": "video/mp4",
    "description": "Four couples meet for Sunday brunch only to discover they are stuck in a house together as the world may be about to end.",
    "fee": {
      "USD": {
        "address": "bX4sH7PbLLfwiMfm5HJKAmzdhoQK3pSuSU",
        "amount": 5.0
      }
    },
    "language": "en",
    "license": "Oscilloscope Laboratories",
    "nsfw": false,
    "sources": {
      "lbry_sd_hash": "8e877083818a51734b2722e7f53b3352255feca8c38be619471ef1af730b272f295ff1a774cf28f71dfad7b3a249e747"
    },
    "thumbnail": "http://ia.media-imdb.com/images/M/MV5BMTQwNjYzMTQ0Ml5BMl5BanBnXkFtZTcwNDUzODM5Nw@@._V1_SY1000_CR0,0,673,1000_AL_.jpg",
    "title": "It's a Disaster",
    "ver": "0.0.3"
  }
}

Method with optional parameters:

peer_list

Inputs

const blob_hash = 'some_blob_hash'
const optional_paramaters = { timeout: 60 }
Method
lbry.peer_list(blob_hash, optional_paramaters)
Response
const response = {
  "id": null,
  "jsonrpc": "2.0",
  "result": {

  }
}

Currently available methods

☑️ blob_announce_all

☑️ blob_reflect_all

☑️ claim_list_mine

☑️ channel_list_mine

☑️ channel_new

☑️ daemon_stop

☑️ status

☑️ settings_get

☑️ transaction_list

☑️ wallet_new_address

☑️ version

☑️ help

☑️ resolve_name

☑️ blob_delete

☑️ blob_get

☑️ blob_list

☑️ block_show

☑️ claim_abandon

☑️ claim_list

☑️ claim_new_support

☑️ claim_show

☑️ file_list

☑️ file_seed

☑️ get

☑️ get_availability

☑️ peer_list

☑️ publish

☑️ reflect

☑️ report_bug

☑️ send_amount_to_address

☑️ settings_set

☑️ stream_cost_estimate

☑️ transaction_show

☑️ wallet_is_address_mine

☑️ wallet_public_key

☑️ wallet_list

☑️ wallet_unused_address

☑️ file_set_status