Options
All
  • Public
  • Public/Protected
  • All
Menu

@contco/terra-utilities

Index

Variables

FCD_URL

FCD_URL: "https://fcd.terra.dev/" = "https://fcd.terra.dev/"

LCD_URL

LCD_URL: "https://lcd.contco.dev/" = "https://lcd.contco.dev/"

LUNA_DENOM

LUNA_DENOM: "uluna" = 'uluna'

MANTLE_URL

MANTLE_URL: "https://mantle.terra.dev/" = 'https://mantle.terra.dev/'

MICRO

MICRO: 1000000 = 1000000

TEFI_API

TEFI_API: "https://api.contco.dev/" = "https://api.contco.dev/"

UUSD_DENOM

UUSD_DENOM: "uusd" = 'uusd'

math

math: { ceil: (n: Value) => string; decimal: (number?: string, decimals?: number) => string; div: (a?: Value, b?: Value) => string; floor: (n: Value) => string; gt: (a: Value, b: Value) => boolean; minus: (a?: Value, b?: Value) => string; plus: (a?: Value, b?: Value) => string; sum: (array: any) => string; times: (a?: Value, b?: Value) => string; toAmount: (amount: string, decimals?: number) => string } = ...

Type declaration

  • ceil: (n: Value) => string
      • (n: Value): string
      • Parameters

        • n: Value

        Returns string

  • decimal: (number?: string, decimals?: number) => string
      • (number?: string, decimals?: number): string
      • Parameters

        • number: string = '0'
        • decimals: number = 6

        Returns string

  • div: (a?: Value, b?: Value) => string
      • (a?: Value, b?: Value): string
      • Parameters

        • Optional a: Value
        • Optional b: Value

        Returns string

  • floor: (n: Value) => string
      • (n: Value): string
      • Parameters

        • n: Value

        Returns string

  • gt: (a: Value, b: Value) => boolean
      • (a: Value, b: Value): boolean
      • Parameters

        • a: Value
        • b: Value

        Returns boolean

  • minus: (a?: Value, b?: Value) => string
      • (a?: Value, b?: Value): string
      • Parameters

        • Optional a: Value
        • Optional b: Value

        Returns string

  • plus: (a?: Value, b?: Value) => string
      • (a?: Value, b?: Value): string
      • Parameters

        • Optional a: Value
        • Optional b: Value

        Returns string

  • sum: (array: any) => string
      • (array: any): string
      • Parameters

        • array: any

        Returns string

  • times: (a?: Value, b?: Value) => string
      • (a?: Value, b?: Value): string
      • Parameters

        • Optional a: Value
        • Optional b: Value

        Returns string

  • toAmount: (amount: string, decimals?: number) => string
      • (amount: string, decimals?: number): string
      • Parameters

        • amount: string
        • decimals: number = 6

        Returns string

networks

networks: Record<string, MirrorNetworkInfo> = ...

Functions

Const calculateLpBonding

  • calculateLpBonding(bondAmount: string, poolResponse: any): { lpAmount: number; lpUstValue: number; token1: number; token2: number }
  • Parameters

    • bondAmount: string
    • poolResponse: any

    Returns { lpAmount: number; lpUstValue: number; token1: number; token2: number }

    • lpAmount: number
    • lpUstValue: number
    • token1: number
    • token2: number

Const convertDenomToValue

  • convertDenomToValue(denom: string | number): number

Const convertIntoDenom

  • convertIntoDenom(amount: string | number): number

Const getLastSyncedHeight

  • getLastSyncedHeight(): Promise<any>

Const getLatestBlockHeight

  • getLatestBlockHeight(lcdUrl?: string): Promise<any>

Const getLatestBlockTime

  • getLatestBlockTime(lcdUrl?: string): Promise<number>

Const getLpValue

  • getLpValue(poolResponse: any, price: number, isLuna?: boolean, lunaPrice?: number): number
  • Parameters

    • poolResponse: any
    • price: number
    • isLuna: boolean = false
    • Optional lunaPrice: number

    Returns number

Const getPoolInfo

  • getPoolInfo(poolAddr: string, lcdUrl?: string): Promise<any>

Const getPrice

  • getPrice(poolResponse: any): string

Const getUserTokenBalance

  • getUserTokenBalance(address: string, tokenAddr: string): Promise<any>

Const isLunaPair

  • isLunaPair(poolResponse: any): boolean

Const isNoneNativePair

  • isNoneNativePair(poolResponse: any): boolean

Const wasmStoreRequest

  • wasmStoreRequest(contractAddr: string, queryMsg: any, lcdUrl?: string): Promise<any>
  • Parameters

    • contractAddr: string
    • queryMsg: any
    • lcdUrl: string = ...

    Returns Promise<any>

Generated using TypeDoc