Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client1inch

1inch price provider

Hierarchy

  • Client1inch

Index

Constructors

constructor

  • Creates an instance of Client1inch and possibly override default config.

    memberof

    Client1inch

    Parameters

    Returns Client1inch

Properties

Protected apiUrl

apiUrl: string = 'https://api.1inch.exchange'

Protected apiVersion

apiVersion: string = 'v3.0'

Protected chainId

chainId: number = ...

Methods

getPairPriceByAddress

  • Returns the price of a pair of contrat addresses.

    memberof

    Client1inch

    Parameters

    Returns Promise<number>

    • The price of the pair quote.

getPairPriceBySymbols

  • Get the price with symbols instead of contract addressed.

    Parameters

    Returns Promise<number>

    • The returns of getPairPrice method.

getTokenBySymbol

  • getTokenBySymbol(symbol: string): Promise<IToken>
  • Search a token from its symbol.

    Parameters

    • symbol: string

      The token symbol.

    Returns Promise<IToken>

    • The token if found.

getTokensList

  • getTokensList(force?: boolean): Promise<ITokenList>
  • Get the list of supported tokens and use cache if exists.

    memberof

    Client1inch

    Parameters

    • force: boolean = false

      A flag to force tokens list to be refheshed.

    Returns Promise<ITokenList>

    • The list of tokens.

isAddressValid

  • isAddressValid(address: string): boolean
  • Check if an address of a contract is valid or not.

    memberof

    Client1inch

    Parameters

    • address: string

      The contract or account address to check.

    Returns boolean

    • The check status.

Generated using TypeDoc