Simple PayID utility functions
$ yarn add payid-core
or with npm:
$ npm install payid-core
- parsePayId(payId) ⇒ 
PayIdComponents|undefined Parse a PayID into PayIdComponents.
- isValidPayId(payId) ⇒ 
boolean Check whether a string is syntactically a valid PayID.
- resolvePayId(payId, [options]) ⇒ 
Promise Retrieve one or more addresses associated with a PayID.
By default, this retrieves all of a PayID's addresses by passing the
payidnetwork in the header of the request.To retrieve an address for a particular payment network, set
options.networkto the desired PaymentNetwork.
Parse a PayID into PayIdComponents.
Kind: global function
Returns: PayIdComponents | undefined - the PayIdComponents if the PayID is syntactically valid, otherwise undefined
| Param | Type | Description | 
|---|---|---|
| payId | string | 
the PayID to parse | 
Check whether a string is syntactically a valid PayID.
Kind: global function
Returns: boolean - true if the PayID is valid, otherwise false
| Param | Type | Description | 
|---|---|---|
| payId | string | 
the PayID to check | 
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
Returns: Promise - Promise resolves to PaymentInformation. If useInsecureHttp was set, then usedInsecureHttp: true will be set
Throws:
Error'Invalid PayID' ifpayIdis syntactically invalid;${status} ${statusText} ${text}if the response is not successful (status in the range 200-299)
| Param | Type | Description | 
|---|---|---|
| payId | string | 
The PayID to resolve for one or more addresses | 
| [options] | Object | 
Options object | 
| [options.network] | PaymentNetwork | 
The network to retrieve an address for | 
| [options.useInsecureHttp] | boolean | 
If true, http will be used. Use for testing purposes only. Defaults to false | 
- Node.js LTS
 - Yarn
 - TypeScript
 - Linting with eslint
 - Testing with Jest
 - Code coverage
 
- compile
- Runs typescript (tsc) and outputs to 
./dist 
 - Runs typescript (tsc) and outputs to 
 - lint
- Runs eslint (use 
--fixto automatically fix issues) 
 - Runs eslint (use 
 - test
- Runs jest testing framework
 
 - coverage
- Collects code coverage information and outputs to 
./coverage 
 - Collects code coverage information and outputs to 
 - docs
- Generate README.md (from README.hbs and jsdoc2md) and 
./docs(withtypedoc) 
 - Generate README.md (from README.hbs and jsdoc2md) and