Simple PayID utility functions
$ yarn add payid-core
or with npm:
$ npm install payid-core
PayIdComponents
| undefined
Parse a PayID into PayIdComponents.
boolean
Check whether a string is syntactically a valid PayID.
Promise
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.
PayIdComponents
| undefined
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 |
boolean
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 |
Promise
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' if payId
is 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 |
./dist
--fix
to automatically fix issues)./coverage
./docs
(with typedoc
)Generated using TypeDoc