Options
All
  • Public
  • Public/Protected
  • All
Menu

@integralhq/size-sdk - v0.1.3

Index

Type Aliases

GetCacheFunction: ((key: string) => Promise<string | undefined>)

Type declaration

    • (key: string): Promise<string | undefined>
    • Parameters

      • key: string

      Returns Promise<string | undefined>

SetCacheFunction: ((key: string, value: string, ttlSeconds?: number) => Promise<void>)

Type declaration

    • (key: string, value: string, ttlSeconds?: number): Promise<void>
    • Parameters

      • key: string
      • value: string
      • Optional ttlSeconds: number

      Returns Promise<void>

Functions

  • areAddressesEqual(firstAddress: string, secondAddress: string): boolean
  • Parameters

    • firstAddress: string
    • secondAddress: string

    Returns boolean

  • areTokensSorted(tokenA: Token, tokenB: Token): boolean
  • bigNumberFromString(decimals: number, value: string): BigNumber
  • Parameters

    • decimals: number
    • value: string

    Returns BigNumber

  • ceilDiv(a: BigNumber, b: BigNumber): BigNumber
  • denormalizeFrom18Decimals(amount: BigNumber, decimals: number): BigNumber
  • f18Mul(a: BigNumber, b: BigNumber): BigNumber
  • formatCurrency(decimals: number, value: BigNumber): string
  • getProvider(chainId: ChainId, __namedParameters: ApiCredentials): BaseProvider
  • Parameters

    • chainId: ChainId
    • __namedParameters: ApiCredentials

    Returns BaseProvider

  • getToken(provider: BaseProvider, chainId: ChainId, tokenAddressOrSymbol: string, cache?: Cache): Promise<Token>
  • Returns a Token object for given ERC20 token address or ETH currency symbol

    Parameters

    • provider: BaseProvider
    • chainId: ChainId

      Supported chains: Mainnet, Kovan

    • tokenAddressOrSymbol: string

      ERC20 token address or ETH currency symbol

    • Optional cache: Cache

    Returns Promise<Token>

    Token object

  • makeFloatEncodable(n: BigNumber): BigNumber
  • multicall(provider: BaseProvider, chainId: ChainId, calls: { callData: any; target: string }[]): Promise<any>
  • Parameters

    • provider: BaseProvider
    • chainId: ChainId
    • calls: { callData: any; target: string }[]

    Returns Promise<any>

  • multicallFunctionCall(): { decode: ((method: string, returnData: any) => Result); encode: ((method: string, callData: any) => { callData: string; target: string }) }
  • Returns { decode: ((method: string, returnData: any) => Result); encode: ((method: string, callData: any) => { callData: string; target: string }) }

    • decode: ((method: string, returnData: any) => Result)
        • (method: string, returnData: any): Result
        • Parameters

          • method: string
          • returnData: any

          Returns Result

    • encode: ((method: string, callData: any) => { callData: string; target: string })
        • (method: string, callData: any): { callData: string; target: string }
        • Parameters

          • method: string
          • callData: any

          Returns { callData: string; target: string }

          • callData: string
          • target: string
  • normalizeTo18Decimals(amount: BigNumber, decimals: number): BigNumber
  • sqrt(y: BigNumber): BigNumber