JSPM

  • Created
  • Published
  • Downloads 1876
  • Score
    100M100P100Q111438F
  • License Apache-2.0

Module for parsing and serializing ILP packets

Package Exports

  • ilp-packet

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ilp-packet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ILP Packet

npm circle codecov

A serializer and deserializer for ILP packets and messages

Usage

Installation

npm install ilp-packet

As a module

const packet = require('ilp-packet')

const binaryPacket = packet.serializeIlpPayment({
  amount: '123000000',       // Unsigned 64-bit integer as a string
  account: 'g.us.nexus.bob', // ILP Address
  data: 'BBBB'               // Base64url-encoded attached data
}) // returns a Buffer

console.log(binaryPacket.toString('hex'))
// prints "011c000000000754d4c00e672e75732e6e657875732e626f620304104100"

const jsonPacket = packet.deserializeIlpPayment(binaryPacket)