import { Address, CryptoAddressDetails } from './Generated/api'; /** * A client for PayID. */ export default class PayIdClient { private readonly useHttps; /** * Initialize a new PayIdClient. * * @param useHttps Whether to cuse HTTPS when making PayID requests. Most users should set this to 'true' to avoid * Man-in-the-Middle attacks. Exposed as an option for testing purposes. Defaults to true. */ constructor(useHttps?: boolean); /** * Retrieve the crypto address associated with a PayID on the given network. * * @see https://docs.payid.org/payid-headers * * @param payId The PayID to resolve. * @param network The network to resolve on. */ cryptoAddressForPayId(payId: string, network: string): Promise; /** * Retrieve all addresses associated with a PayId. * * @param payId The PayID to resolve. */ allAddressesForPayId(payId: string): Promise>; /** * Return an array of {@link Address}es that match the inputs. * * @param payId The PayID to resolve. * @param network The network to resolve on. */ private addressesForPayIdAndNetwork; /** * Try to create a pretty formatted error message given an error which may be an HTTP error. * * @param error An error which may be an HTTP error. * @returns A sane message for upstream errors. */ private static messageFromMaybeHttpError; /** * Make a set of options for the API that include a header with `Accept` set to the given value. * * @param acceptType The value for the `Accept` header. * @returns An options object that can be passed to an api. */ private static makeOptionsWithAcceptTypes; /** * Parse a payID to a host and path. */ private static parsePayId; }