index.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * Addresses are a fundamental part of interacting with Ethereum. They
  3. * represent the gloabal identity of Externally Owned Accounts (accounts
  4. * backed by a private key) and contracts.
  5. *
  6. * The Ethereum Naming Service (ENS) provides an interconnected ecosystem
  7. * of contracts, standards and libraries which enable looking up an
  8. * address for an ENS name.
  9. *
  10. * These functions help convert between various formats, validate
  11. * addresses and safely resolve ENS names.
  12. *
  13. * @_section: api/address:Addresses [about-addresses]
  14. */
  15. /**
  16. * An interface for objects which have an address, and can
  17. * resolve it asyncronously.
  18. *
  19. * This allows objects such as [[Signer]] or [[Contract]] to
  20. * be used most places an address can be, for example getting
  21. * the [balance](Provider-getBalance).
  22. */
  23. export interface Addressable {
  24. /**
  25. * Get the object address.
  26. */
  27. getAddress(): Promise<string>;
  28. }
  29. /**
  30. * Anything that can be used to return or resolve an address.
  31. */
  32. export type AddressLike = string | Promise<string> | Addressable;
  33. /**
  34. * An interface for any object which can resolve an ENS name.
  35. */
  36. export interface NameResolver {
  37. /**
  38. * Resolve to the address for the ENS %%name%%.
  39. *
  40. * Resolves to ``null`` if the name is unconfigued. Use
  41. * [[resolveAddress]] (passing this object as %%resolver%%) to
  42. * throw for names that are unconfigured.
  43. */
  44. resolveName(name: string): Promise<null | string>;
  45. }
  46. export { getAddress, getIcapAddress } from "./address.js";
  47. export { getCreateAddress, getCreate2Address } from "./contract-address.js";
  48. export { isAddressable, isAddress, resolveAddress } from "./checks.js";
  49. //# sourceMappingURL=index.d.ts.map