UNPKG

@investorid/identity-sdk

Version:
27 lines (26 loc) 1.03 kB
import { Signer } from 'ethers'; import { ValueError, ValueErrorParams } from '../errors/Errors'; import { Provider } from 'ethers/providers'; /** * Thrown when an invalid address is given */ export declare class InvalidAddressError extends Error implements ValueError { readonly value: any; constructor({ message, value }?: ValueErrorParams); } /** * Check if a string is a valid address (and return it checksummed). * @param address * @throws InvalidAddressError */ export declare function normalizeAddress(address: string): string; /** * Resolve a string with the Ethereum Naming Service. * * It will use the default Provider set for the SDK, or the optional provider in parameters. * @param ens * @param [provider] Override the default SDK provider. * @throws InvalidAddressError If the string could not be resolved to an address. * @throws InvalidProviderError If the provider is not a valid provider. */ export declare function resolveENS(ens: string, provider?: Provider | Signer): Promise<string>;