interledger-deprecated / ilp-plugin-bells

ILP Ledger plugin for five-bells-ledger
Other
4 stars 8 forks source link

document api #107

Open michielbdejong opened 7 years ago

michielbdejong commented 7 years ago

The readme only gives an example of how to use this plugin as an admin, to listen to all ledger messages. Even if this package just implements the standard ILP plugin API, we should still document what the options for constructor arguments are.

michielbdejong commented 7 years ago

Right now, what I'm doing is something like this:

var Plugin = require('ilp-plugin-bells');
var request = require('request');

function getPlugin(host, user, pass) {
  return new Promise(resolve => {
    request({
      method: 'get',
      uri: `https://${host}/ledger`,
      json: true,
    }, (err, sendRes, body) => {
      resolve(new Plugin({
        prefix: body.ilp_prefix,
        account: `https://${host}/ledger/accounts/${user}`,
        password: pass,
      }));
    });
  });
}