Options
All
  • Public
  • Public/Protected
  • All
Menu

Data access layer to access Whirlpool related accounts Includes internal cache that can be refreshed by the client.

Hierarchy

  • AccountFetcher

Index

Constructors

  • new AccountFetcher(connection: Connection, cache?: Record<string, CachedContent<CachedValue>>): AccountFetcher

Methods

  • getAccountRentExempt(refresh?: boolean): Promise<number>
  • Retrieve minimum balance for rent exemption of a Token Account;

    Parameters

    • refresh: boolean = false

      force refresh of account rent exemption

    Returns Promise<number>

    minimum balance for rent exemption

  • Retrieve a cached whirlpool config account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      whirlpool config address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | WhirlpoolsConfigData>

    whirlpool config account

  • getFeeTier(address: Address, refresh?: boolean): Promise<null | FeeTierData>
  • Retrieve a cached fee tier account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      fee tier address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | FeeTierData>

    fee tier account

  • getMintInfo(address: Address, refresh?: boolean): Promise<null | MintInfo>
  • Retrieve a cached mint info account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      mint info address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | MintInfo>

    mint info account

  • getPool(address: Address, refresh?: boolean): Promise<null | WhirlpoolData>
  • Retrieve a cached whirlpool account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      whirlpool address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | WhirlpoolData>

    whirlpool account

  • getPosition(address: Address, refresh?: boolean): Promise<null | PositionData>
  • Retrieve a cached position account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      position address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | PositionData>

    position account

  • getTickArray(address: Address, refresh?: boolean): Promise<null | TickArrayData>
  • Retrieve a cached tick array account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      tick array address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | TickArrayData>

    tick array account

  • getTokenInfo(address: Address, refresh?: boolean): Promise<null | AccountInfo>
  • Retrieve a cached token info account. Fetch from rpc on cache miss.

    Parameters

    • address: Address

      token info address

    • refresh: boolean = false

      force cache refresh

    Returns Promise<null | AccountInfo>

    token info account

  • listMintInfos(addresses: Address[], refresh: boolean): Promise<(null | MintInfo)[]>
  • Retrieve a list of cached mint info accounts. Fetch from rpc for cache misses.

    Parameters

    • addresses: Address[]

      mint info addresses

    • refresh: boolean

      force cache refresh

    Returns Promise<(null | MintInfo)[]>

    mint info accounts

  • listPools(addresses: Address[], refresh: boolean): Promise<(null | WhirlpoolData)[]>
  • Retrieve a list of cached whirlpool accounts. Fetch from rpc for cache misses.

    Parameters

    • addresses: Address[]

      whirlpool addresses

    • refresh: boolean

      force cache refresh

    Returns Promise<(null | WhirlpoolData)[]>

    whirlpool accounts

  • listPositions(addresses: Address[], refresh: boolean): Promise<(null | PositionData)[]>
  • Retrieve a list of cached position accounts. Fetch from rpc for cache misses.

    Parameters

    • addresses: Address[]

      position addresses

    • refresh: boolean

      force cache refresh

    Returns Promise<(null | PositionData)[]>

    position accounts

  • listTickArrays(addresses: Address[], refresh: boolean): Promise<(null | TickArrayData)[]>
  • Retrieve a list of cached tick array accounts. Fetch from rpc for cache misses.

    Parameters

    • addresses: Address[]

      tick array addresses

    • refresh: boolean

      force cache refresh

    Returns Promise<(null | TickArrayData)[]>

    tick array accounts

  • listTokenInfos(addresses: Address[], refresh: boolean): Promise<(null | AccountInfo)[]>
  • Retrieve a list of cached token info accounts. Fetch from rpc for cache misses.

    Parameters

    • addresses: Address[]

      token info addresses

    • refresh: boolean

      force cache refresh

    Returns Promise<(null | AccountInfo)[]>

    token info accounts

  • refreshAll(): Promise<void>
  • Update the cached value of all entities currently in the cache. Uses batched rpc request for network efficient fetch.

    Returns Promise<void>

Generated using TypeDoc