payid-lib
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

payid-lib

Simple PayID utility functions

Installation

$ yarn add payid-lib

or with npm:

$ npm install payid-lib

payid-lib API Reference

Functions

parsePayId(payId)

Parse a PayID into PayIdComponents.

isValidPayId(payId)

Check whether a string is syntactically a valid PayID.

resolvePayId(payId, options)

Retrieve one or more addresses associated with a PayID.

By default, this retrieves all of a PayID's addresses by passing the payid network in the header of the request.

To retrieve an address for a particular payment network, set options.network to the desired PaymentNetwork.

parsePayId(payId) ⇒

Parse a PayID into PayIdComponents.

Kind: global function
Returns: the PayIdComponents if the PayID is syntactically valid, otherwise undefined

Param Description
payId the PayID to parse

isValidPayId(payId) ⇒

Check whether a string is syntactically a valid PayID.

Kind: global function
Returns: true if the PayID is valid, otherwise false

Param Description
payId the PayID to check

resolvePayId(payId, options)

Retrieve one or more addresses associated with a PayID.

By default, this retrieves all of a PayID's addresses by passing the payid network in the header of the request.

To retrieve an address for a particular payment network, set options.network to the desired PaymentNetwork.

Kind: global function

Param Description
payId The PayID to resolve for one or more addresses
options Options object
options.network The network to retrieve an address for
options.useInsecureHttp If true, http will be used. Use for testing purposes only. Defaults to false

Development Environment

  • Node.js LTS
  • Yarn
  • TypeScript
  • Linting with eslint
  • Testing with Jest
  • Code coverage

Scripts

  • compile
    • Runs typescript (tsc) and outputs to ./dist
  • lint
    • Runs eslint (use --fix to automatically fix issues)
  • test
    • Runs jest testing framework
  • coverage
    • Collects code coverage information and outputs to ./coverage
  • docs
    • Generate README.md (from README.hbs and jsdoc2md) and ./docs (with typedoc)

Dependents (0)

Package Sidebar

Install

npm i payid-lib

Weekly Downloads

4

Version

0.1.0

License

ISC

Unpacked Size

12.7 kB

Total Files

12

Last publish

Collaborators

  • intelliot