Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ilp-compat-plugin

justmoon45Apache-2.02.0.3TypeScript support: included

Convert a Ledger Plugin Interface (LPI) version 1 plugin to LPIv2

ilp, plugin, compat, compatibility, migrate, update, upgrade, convert, lpi1, lpi2, lpi, lpiv2

readme

ilp-plugin-compat

ILP plugin compatibility layer

Turns any LPI1 plugin into an LPI2 plugin.

Usage

const compat = require('ilp-compat-plugin')

const Plugin = require('some-old-plugin')

const plugin = compat(new Plugin({ ... }))

console.log(plugin.constructor.version) // => 2

// Use LPI2
const { fulfillment, data } = await plugin.sendTransfer({ ... })

Note that it's safe to pass LPI2 plugins to compat, it will simply become a no-op.