Core ILP module — handles ledger abstraction and quoting
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src/lib fix: check whether sourceAmount is falsey instead of undefined Apr 24, 2017
test feat: Update Message format for ilp-kit 2.0 compat Apr 12, 2017
.eslintrc chore: set up eslint Jun 2, 2016
.gitignore test: setup test framework Jun 2, 2016
.npmignore feat: Update Message format for ilp-kit 2.0 compat Apr 12, 2017 chore: tag version 14.0.0 Apr 12, 2017 chore: update license Nov 2, 2016
LICENSE chore: merge #87 Jul 31, 2017
index.js feat: BREAKING ilp addressing; Core Jul 22, 2016
npmrc-env feat: initial working version Jun 5, 2016
package.json 14.0.1 Apr 24, 2017
wallaby.js test(wallaby): add wallaby support Jun 12, 2016

ilp-core npm circle codecov FOSSA Status

Core ILP module — handles ledger abstraction and quoting


You need to install this module along with any ledger plugin modules you would like to use, e.g.:

npm install --save ilp-core ilp-plugin-bells



const Client = require('ilp-core').Client
const Core = require('ilp-core').Core

const core = new Core()

// options for the plugin that Client instantiates.
// '_plugin' is the plugin module.
const pluginOpts = {
  _plugin: require('ilp-plugin-bells'),
  prefix: '',
  account: '',
  password: 'alice'

// It is optional to specify clientOpts. It has one field, connectors, which
// contains http endpoints for the connectors you wish to use.
// These http addresses are used for quoting and getting ILP address information.
// If unspecified, Client will get connectors from the plugin's 'getInfo' method.
const clientOpts = {
  connectors: [

core.addClient('', new Client(pluginOpts, clientOpts))


Sending a Payment

const payment = {
  destinationAccount: '',
  destinationAmount: '1',
  destinationMemo: {
    myKey: 'myValue'
  executionCondition: 'uzoYx3K6u-Nt6kZjbN6KmH0yARfhkj9e17eQfpSeB7U',
  expiresAt: (new Date( + 10000)).toISOString()

const client = core.getClient('')
client.connect().then(() => {
  return client.quote({
    destinationAddress: payment.destinationAccount,
    destinationAmount: payment.destinationAmount,
    // You can optionally specify connectors here. If left unspecified,
    // then they will be accessed from the clientOpts object in the constructor,
    // or from the 'getInfo' method of the plugin.
    connectors: [ 'https://a.example:4000', 'https://b.example:5555' ]
  .then((quote) => {
    return client.sendQuotedPayment(Object.assign({}, payment, quote))
  .then(() => {
    console.log('payment sent')
.catch((err) => {

core.on('fulfill_execution_condition', (client, transfer, fulfillment) => {
  console.log('transfer fulfilled', fulfillment)

Receiving a Transfer

Note that the receive event is fired for conditional transfers, so the event does not necessarily indicate that funds have been transferred

core.on('receive', (client, transfer) => {
  client.fulfillCondition(, 'HS8e5Ew02XKAglyus2dh2Ohabuqmy3HDM8EXMLz22ok')


FOSSA Status