lbry 0.1.5

  • Example
  • Installing
  • Versions
  • 49

LBRYDart #

LRBY API binding for the Dart Language #

Placeholder for actual information about this binding

Installation #

To install this package, include lbry in your dependencies in your project's pubspec.yaml:

    lbry: any

Usage #

Simply import package:lbry/lbry.dart in your dart file, and initialize the API objects as follow:

import 'package:lbry/lbry.dart';

void main() {
  // optional timeout parameter
  LbrydApi api = LbrydApi(timeout: 5);
  // lbrycrd requires username and password
  LbrycrdApi api = LbrycrdApi("username", "password");
  // calling api method 'help' without args"help");
  // calling resolve method with args"resolve", params: {"name": "odder otter"});

Feedback #

If you would like to provide feedback or find a bug, simply open an issue in the github repository

0.1.5 #

Provides a clear and descriptive

0.1.4 #

Removes verbosity from description

0.1.3 #

Adds more verbosity to description

0.1.2 #

Initial Release


import 'dart:convert';
import 'package:lbry/lbry.dart';

void main() async {
  /*  This API provides two classes, LbrydApi and LbrycrdApi.
   *  To call either simply import lbry/lbry.dart, and initialize them. 
  // Returns an object of type LbrydApi
  var lbrydApi = LbrydApi();
  /* To use the API, simply provide a name to a method in the API
   * This returns the body of the HTTP Response as a JSON MAP */
  var response = await"help");

  // This prints something along the lines of:
  // id: 1, jsonrpc: 2.0, result: {about: This is the LBRY JSON-RPC API ...

  // Create a JSON Encoder to pretty-print output
  JsonEncoder json = JsonEncoder.withIndent('  ');

  // Now we can try and display it much more nicely

  /* This prints the following:
  > {
  >   "id": 1,
  >   "jsonrpc": "2.0",
  >   "result": {
  >     "about": "This is the LBRY JSON-RPC API",
  >     "command_help": "Pass a `command` parameter to this method to see help for that command (e.g. `help command=resolve_name`)",
  >     "command_list": "Get a full list of commands using the `commands` method",
  >     "more_info": "Visit for more info"
  >   }
  > }

  As we can see, the actual body of the response is given in the `result`
  field, however the everything in the response is returned for
  better context about what specific request did what.

  // To access the Map, use simple Map notation

  // To get the ID of the last request, simply use the LbryApi's getter.
  int id = lbrydApi.requestId;

  /* If we want to use parameters to functions, we can do so as follows: */
  var metatableDict = await"resolve_name",
      params: {
        "name": "doge",
        "force": true,

    /* Since the HTTP Methods are asynchronous, the method
   * returns a dynamic Map representing the JSON dict returned
   * by the API.
   * It is preferable to use the await keyword instead of
   * using the Futures API, however you may do as you please.
   * */

  /* We can also use the Future API */"resolve",
      params: {
    "uri": "doge",
    "uris": ["crab", "otter", "turtle"]
  }).then((response) {

    LbrycrdApi works in the same way as LbrydApi, however
    LbrycrdApi requires your username and password when
    initializing the object to use the API  */
  var lbrycrdApi = LbrycrdApi("username", "password");

  /* Since lbrynet isn't running currently, this will error out.
  *  This is the (uglier) way to asynchronously handle errors
  *  and responses through the Future API */"help").then((response) {
  }).catchError((error) {


Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  lbry: ^0.1.5

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:lbry/lbry.dart';
Version Uploaded Documentation Archive
0.1.6 Nov 12, 2018 Go to the documentation of lbry 0.1.6 Download lbry 0.1.6 archive
0.1.5 Nov 12, 2018 Go to the documentation of lbry 0.1.5 Download lbry 0.1.5 archive
0.1.4 Nov 12, 2018 Go to the documentation of lbry 0.1.4 Download lbry 0.1.4 archive
0.1.3 Nov 12, 2018 Go to the documentation of lbry 0.1.3 Download lbry 0.1.3 archive
0.1.2 Nov 12, 2018 Go to the documentation of lbry 0.1.2 Download lbry 0.1.2 archive
0.0.0 Nov 12, 2018 Go to the documentation of lbry 0.0.0 Download lbry 0.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 23, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.16


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:lbry/lbry.dart.

Health suggestions

Fix lib/src/lbrycrd_api.dart. (-1 points)

Analysis of lib/src/lbrycrd_api.dart reported 2 hints:

line 13 col 3: Prefer using /// for doc comments.

line 33 col 3: Prefer using /// for doc comments.

Fix lib/src/lbryd_api.dart. (-1 points)

Analysis of lib/src/lbryd_api.dart reported 2 hints:

line 13 col 3: Prefer using /// for doc comments.

line 22 col 3: Prefer using /// for doc comments.

Fix lib/src/base_api.dart. (-0.50 points)

Analysis of lib/src/base_api.dart reported 1 hint:

line 11 col 3: Prefer using /// for doc comments.

Fix lib/src/exceptions.dart. (-0.50 points)

Analysis of lib/src/exceptions.dart reported 1 hint:

line 7 col 3: Prefer using /// for doc comments.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
http ^0.12.0 0.12.0+2
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.7
path 1.6.2
pedantic 1.7.0
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6