Class: URI

URI()

URI parser and generator

Constructor

new URI()

URI Methods. Shall only be used on AmonLib.URI instance. Do not instanciate by yourself.
Source:

Methods

parse(str) → (nullable) {Object|string|string|string}

This parses an URI to an object. Input is a string, either an address or a valid URI
Parameters:
Name Type Description
str Object address or URI
Source:
Returns:
  • obj
    Type
    Object
  • obj.address
    Type
    string
  • obj.coinCode [BTC, ETH]
    Type
    string
  • obj.amount Amount requested, optional
    Type
    string

stringify(params) → {string}

This generate an URI string to be used in links or QR-code
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
address string
coinCode string <nullable>
[BTC, ETH]
amount string <nullable>
Amount requested, optional
Source:
Returns:
URI as text
Type
string