Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Type aliases

AddressDetailsType

AddressDetailsType: "CryptoAddressDetails" | "AchAddressDetails" | string

BTCPaymentNetwork

BTCPaymentNetwork: "btc-testnet" | "btc-mainnet"

ETHPaymentNetwork

ETHPaymentNetwork: "eth-rinkeby" | "eth-ropsten" | "eth-mainnet"

ILPPaymentNetwork

ILPPaymentNetwork: "interledger-mainnet" | "interledger-testnet"

PaymentNetwork

PaymentNetwork: XRPLPaymentNetwork | BTCPaymentNetwork | ETHPaymentNetwork | ILPPaymentNetwork | "ach" | "payid" | string

Payment Network strings.

The general standard form of the Accept: header for cryptocurrencies is:

application/{payment-network}-{environment}+json

The special value payid asks the server to return ALL of the addresses associated with the PayID.

see

https://payid.org/whitepaper.pdf

XRPLPaymentNetwork

XRPLPaymentNetwork: "xrpl-testnet" | "xrpl-devnet" | "xrpl-mainnet"

Functions

isValidPayId

  • isValidPayId(payId: string): boolean
  • Check whether a string is syntactically a valid PayID.

    Parameters

    • payId: string

      the PayID to check

    Returns boolean

    true if the PayID is valid, otherwise false

parsePayId

  • Parse a PayID into PayIdComponents.

    Parameters

    • payId: string

      the PayID to parse

    Returns PayIdComponents | undefined

    the PayIdComponents if the PayID is syntactically valid, otherwise undefined

resolvePayId

  • 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.

    throws

    {Error} 'Invalid PayID' if payId is syntactically invalid; ${status} ${statusText} ${text} if the response is not successful (status in the range 200-299)

    Parameters

    • payId: string

      The PayID to resolve for one or more addresses

    • Default value options: ResolvePayIdOptions = { network: 'payid' }

    Returns Promise<PaymentInformation & OptionalInsecureFlag>

    Promise resolves to PaymentInformation. If useInsecureHttp was set, then usedInsecureHttp: true will be set

Generated using TypeDoc