Describes an entity with the ability to query token information related to Erdstall and its onchain contracts.

Hierarchy

  • TokenProvider

Implemented by

Methods

  • Finds the address of the first registered token contract in Erdstall, which has the given symbol as its symbol according to the ERC20Detailed specification.

    Returns

    The address when a token contract matching the symbol could be found, otherwise undefined.

    Remarks

    ERC20Detailed

    Parameters

    • erdstall: Erdstall

      The Erdstall contract.

    • symbol: string

      The symbol to search for.

    • Optional fromBlock: number

      When omitted the starting block from when the Erdstall contract was deployed will be used.

    Returns Promise<undefined | Address>

  • Queries the registered token types on the given Erdstall contract.

    Returns

    A list of TokenTypeRegistered events, which might be empty if no token types were registered.

    Parameters

    • erdstall: Erdstall

      The Erdstall contract.

    • Optional fromBlock: number

      When omitted the starting block from when the Erdstall contract was deployed will be used.

    Returns Promise<TokenTypeRegistered[]>

  • Queries the registered tokens on the given Erdstall contract.

    Returns

    A list of TokenRegistered events, which might be empty if no tokens were registered.

    Parameters

    • erdstall: Erdstall

      The Erdstall contract.

    • Optional fromBlock: number

      When omitted the starting block from when the Erdstall contract was deployed will be used.

    Returns Promise<TokenRegistered[]>

  • Sets the locally cached token type for the given token address.

    Parameters

    • tokenAddr: string

      The address of the token to update.

    • ttype: "ETH" | "ERC20" | "ERC721" | "ERC721Mintable"

      The token type.

    Returns void

  • Retrieves the address of the token holder contract for the given token type related to the given Erdstall contract.

    Throws

    An error when no token holder contract is registered for the given token type.

    Returns

    The address of the holder contract in string representation.

    Parameters

    • erdstall: Erdstall

      The Erdstall contract.

    • ttype: "ETH" | "ERC20" | "ERC721" | "ERC721Mintable"

      The token type which is handled by some holder contract.

    Returns Promise<string>

  • Retrieves the token type for a given token address related to the given Erdstall contract.

    Throws

    An error when the given token address is not registered with the Erdstall contract.

    Returns

    The token type of the given token address.

    Parameters

    • erdstall: Erdstall

      The Erdstall contract.

    • tokenAddr: string

      The address of a token contract.

    Returns Promise<"ETH" | "ERC20" | "ERC721" | "ERC721Mintable">

Generated using TypeDoc