Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TwapFactory Abstract

Represents the Integral TwapFactory contract with methods for returning a pair address and the number of all pairs.

Hierarchy

  • TwapFactory

Index

Constructors

Properties

FACTORY_CODER: Interface = ...

Methods

  • getPairAddress(provider: BaseProvider, chainId: ChainId, first: Currency, second: Currency, cache?: Cache, ttlSeconds?: number): Promise<undefined | string>
  • Returns the pair address for given tokens

    Parameters

    • provider: BaseProvider

      An abstraction of a connection to the Ethereum network

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • first: Currency

      The first token in pair

    • second: Currency

      The second token in pair

    • Optional cache: Cache
    • Optional ttlSeconds: number

      TTL in seconds that object is stored in caching system

    Returns Promise<undefined | string>

    Pair address normalized to lowercase

  • getPairAddressById(provider: BaseProvider, chainId: ChainId, id: number): Promise<string>
  • Returns a pair address for given id

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • id: number

      Id of a pair in TwapFactory contract

    Returns Promise<string>

    Pair address normalized to lowercase

  • getPairCount(provider: BaseProvider, chainId: ChainId): Promise<number>
  • Returns a number of pairs in the TwapFactory contract

    Parameters

    • provider: BaseProvider

      A blockchain network connection provider

    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    Returns Promise<number>

    Number of pairs