Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Contracts

Hierarchy

  • Contracts

Index

Constructors

Properties

avatarSupport: AvatarSupport
core: PhotochromicCore
ens: Contract
registrar: PhotochromicRegistrar
resolver: PhotochromicResolver

Methods

  • connect(signerOrProvider: string | Provider | Signer): void
  • Parameters

    • signerOrProvider: string | Provider | Signer

    Returns void

  • getAddressRecord(node: string, coinType?: number): Promise<string>
  • Returns the address of the given node, associated with the given coinType.

    Parameters

    • node: string

      The node (owner) of the record.

    • Optional coinType: number

      The coin type used to query the value. Default: 60 (ETH).

    Returns Promise<string>

    The address associated with the given key, returns an empty string if not set.

  • getGracePeriod(): Promise<number>
  • Returns Promise<number>

    The grace period of a PhotoChromic domain.

  • getNodeOfAddress(owner: string): Promise<string>
  • Returns the node associated with the given (owner) address.

    Parameters

    • owner: string

      The owner of the node.

    Returns Promise<string>

    The node associated with the given address.

  • getOwnerOfNode(node: string): Promise<string>
  • Returns the owner of the node based on the ENS registry.

    Parameters

    • node: string

      The hash of the name, e.g. namehash("john.photochromic.eth").

    Returns Promise<string>

    The owner of the node.

  • getPricePerYear(): Promise<BigNumber>
  • Returns Promise<BigNumber>

    The price per (additional) year. e.g. 5 years = profile.price + 4 * pricePerYear.

  • getProfile(profileName: string, years?: number): Promise<Profile>
  • Parameters

    • profileName: string

      The name of the profile.

    • years: number = 1

    Returns Promise<Profile>

    The profile associated with the given name.

  • Returns Promise<Profile[]>

    The list of profiles that are supported by the core contract.

  • getTextRecord(node: string, key: string): Promise<string>
  • Returns the value of the given node, associated with the given key.

    Parameters

    • node: string

      The node (owner) of the record.

    • key: string

      The key used to query the value.

    Returns Promise<string>

    The value associated with the given key, returns an empty string if not set.

  • getTextRecordNode(key: string, value: string): Promise<string>
  • Returns the node that owns the given VALIDATED key-value pair. E.g., "com.twitter", "@john" can be owned by a certain node.

    Parameters

    • key: string

      The key of the text record.

    • value: string

      The value of the text record.

    Returns Promise<string>

    The node corresponding with the given key-value pair.

  • getTicketValidityPeriod(): Promise<number>
  • Returns Promise<number>

    The validity period of a ticket.

  • getTokenId(address: string): Promise<BigNumber>
  • Returns the token identifier of the given address.

    throws

    If the given address has no PhotoChromic NFT.

    Parameters

    • address: string

      The owner's address.

    Returns Promise<BigNumber>

    The token identifier linked to the given address.

  • getTokenURI(address: string): Promise<string>
  • Returns the URI linked to the token of the given address.

    Parameters

    • address: string

      The owner's address.

    Returns Promise<string>

    The IPFS URI of the asset linked to the given address.

  • An extended version of getAddressRecord, also returns whether the address record is verified or not.

    Parameters

    • node: string

      The node (owner) of the record.

    • Optional coinType: number

      The coin type used to query the value. Default: 60 (ETH).

    Returns Promise<ValidatedAddrRecord>

    The record associated with the given key, returns an empty string if not set.

  • An extended version of getTextRecord, also returns whether the text record is verified or not.

    Parameters

    • node: string

      The node (owner) of the record.

    • key: string

      The key used to query the value.

    Returns Promise<ValidatedTextRecord>

    The record associated with the given key, returns an empty string if not set.

  • Returns all validity dates linked to the given node.

    todo:

    generalize for nodes.

    Parameters

    • node: string

      The hash of the name, e.g. namehash("john.photochromic.eth").

    Returns Promise<ValidityDates>

    A set of validity dates linked to the given label.

  • Initializes all the contracts. Both resolver and registrar addresses are queried from the version tracker.

    Parameters

    Returns Promise<void>

  • isAvailable(node: string): Promise<boolean>
  • Check whether the given node is still available.

    Parameters

    • node: string

      The hash of the name, e.g. namehash("john.photochromic.eth").

    Returns Promise<boolean>

    Whether the node is still available to register.

  • isValidNode(node: string): Promise<boolean>
  • Returns whether the given node is still a valid PhotoChromic identity.

    Parameters

    • node: string

      The hash of the name, e.g. namehash("john.photochromic.eth").

    Returns Promise<boolean>

    Whether the given node is valid (i.e. not transferred).

  • isValidTicketOfOwner(node: string, owner: string): Promise<boolean>
  • Returns whether the owner has a valid ticket linked to the given node.

    Parameters

    • node: string

      The hash of the name, e.g. namehash("john.photochromic.eth").

    • owner: string

      The owner of the ticket.

    Returns Promise<boolean>

    Whether the given owner of the node has a valid ticket.

Generated using TypeDoc