npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ilp-plugin-virtual

v16.0.1

Published

ILP virtual ledger plugin for directly transacting connectors

Downloads

91

Readme

ilp-plugin-virtual npm circle codecov

ILP virtual ledger plugin for directly transacting connectors

NOTE:

The current version of ilp-plugin-virtual is designed to be used in ILP Kit. An HTTP server is required in order to pass RPC calls to the plugin, and to perform authorization on RPC calls.

Installation

npm install --save ilp-plugin-virtual

Usage

You can test out the ledger plugin by running npm test on your machine. To include debug information during the test, run DEBUG=ilp* npm test.

When instantiating the plugin, make sure to pass in an object with the right fields:

{
  "maxBalance": "highest balance allowed",
  "prefix": "prefix for ilp address",
  "secret": "your secret. your peer must know the corresponding public key.",
  "peerPublicKey": "base64url encoded public key of your peer",
  "rpcUri": "https://example.com/rpc", // this is used to communicate with your peer (see below)
  "_store": { /* this object will be created by the connector */ },
  "info": { /* the object to be returned by getInfo */ }
}

Receiving RPC calls

In order to use plugin virtual, you need an HTTP endpoint that passes calls to the plugin. The url must take one query parameter (method), as well as a JSON body. The method parameter and parsed body must be passed to the plugin like so:

plugin.receive(method, body)

Generate a trustline prefix

If you want to generate a trustline prefix from a secret key, peer's public key, and currency, you can access the method through the token class:

const Token = require('ilp-plugin-virtual/src/util/token')
const prefix = Token.prefix({
  secretKey: 'o9Lt0oZFek1ArM_A0HUAq8M8edRuoSeLjX8i10sVUiY',
  peerPublicKey: 'KRixgcBCBdyQln7IBYiopjuNO78QSFtXgOwP1sbsCSk',
  currency: 'USD'
})