Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents the Integral TwapPair contract with methods for returning token addresses, token decimals, an oracle address and a Token object.

Hierarchy

  • TwapPair

Index

Constructors

Properties

ERC20_CODER: Interface = ...
PAIR_CODER: Interface = ...

Methods

  • getOracleAddress(provider: BaseProvider, chainId: ChainId, pairAddress: string): Promise<string>
  • Returns an oracle address from TwapPair contract

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • pairAddress: string

      TwapPair contract address

    Returns Promise<string>

    Oracle address normalized to lowercase

  • getToken(provider: BaseProvider, chainId: ChainId, tokenAddress: string): Promise<Token>
  • Returns a Token object for given ERC20 token address

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • tokenAddress: string

      ERC20 token address

    Returns Promise<Token>

    Token object

  • getTokenAddresses(provider: BaseProvider, chainId: ChainId, pairAddress: string): Promise<[string, string]>
  • Returns token0 and token1 addresses from TwapPair contract

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • pairAddress: string

      TwapPair contract address

    Returns Promise<[string, string]>

    Token0 and token1 addresses normalized to lowercase

  • getTokenDecimals(provider: BaseProvider, chainId: ChainId, tokenAddress: string): Promise<number>
  • Returns token decimals from TwapOracle contract

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • tokenAddress: string

      ERC20 token address

    Returns Promise<number>

    Token decimals