Interface WhirlpoolAccountFetcherInterface

Fetcher interface for fetching WhirlpoolSupportedTypes from the network

interface WhirlpoolAccountFetcherInterface {
    getAccountRentExempt(refresh?: boolean): Promise<number>;
    getConfig(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | WhirlpoolsConfigData>;
    getConfigExtension(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | WhirlpoolsConfigExtensionData>;
    getConfigExtensions(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | WhirlpoolsConfigExtensionData>>;
    getConfigs(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | WhirlpoolsConfigData>>;
    getEpoch(refresh?: boolean): Promise<number>;
    getFeeTier(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | FeeTierData>;
    getFeeTiers(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | FeeTierData>>;
    getMintInfo(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | MintWithTokenProgram>;
    getMintInfos(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | MintWithTokenProgram>>;
    getPool(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | WhirlpoolData>;
    getPools(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | WhirlpoolData>>;
    getPosition(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | PositionData>;
    getPositionBundle(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | PositionBundleData>;
    getPositionBundles(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | PositionBundleData>>;
    getPositions(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | PositionData>>;
    getTickArray(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | TickArrayData>;
    getTickArrays(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<readonly (null | TickArrayData)[]>;
    getTokenBadge(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | TokenBadgeData>;
    getTokenBadges(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | TokenBadgeData>>;
    getTokenInfo(address: Address, opts?: SimpleAccountFetchOptions): Promise<null | AccountWithTokenProgram>;
    getTokenInfos(addresses: Address[], opts?: SimpleAccountFetchOptions): Promise<ReadonlyMap<string, null | AccountWithTokenProgram>>;
    populateCache<T>(accounts: ReadonlyMap<string, T>, parser: ParsableEntity<T>, now: number): void;
}

Implemented by

Methods

  • Fetch and cache the rent exempt value

    Parameters

    • Optionalrefresh: boolean

      If true, will always fetch from the network

    Returns Promise<number>

  • Fetch and cache the current epoch info

    Parameters

    • Optionalrefresh: boolean

      If true, will always fetch from the network

    Returns Promise<number>

  • Fetch and cache the account for a given Mint address

    Parameters

    • address: Address

      The address of the mint account

    • Optionalopts: SimpleAccountFetchOptions

      WhirlpoolAccountFetchOptions instance to dictate fetch behavior

    Returns Promise<null | MintWithTokenProgram>

  • Fetch and cache the accounts for a given array of Mint addresses

    Parameters

    • addresses: Address[]

      The array of mint account addresses

    • Optionalopts: SimpleAccountFetchOptions

      WhirlpoolAccountFetchOptions instance to dictate fetch behavior

    Returns Promise<ReadonlyMap<string, null | MintWithTokenProgram>>

  • Fetch and cache the account for a given TokenAccount address

    Parameters

    • address: Address

      The address of the token account

    • Optionalopts: SimpleAccountFetchOptions

      WhirlpoolAccountFetchOptions instance to dictate fetch behavior

    Returns Promise<null | AccountWithTokenProgram>

  • Fetch and cache the accounts for a given array of TokenAccount addresses

    Parameters

    • addresses: Address[]

      The array of token account addresses

    • Optionalopts: SimpleAccountFetchOptions

      WhirlpoolAccountFetchOptions instance to dictate fetch behavior

    Returns Promise<ReadonlyMap<string, null | AccountWithTokenProgram>>

  • Populate the fetcher's cache with the given WhirlpoolsData accounts

    Type Parameters

    Parameters

    • accounts: ReadonlyMap<string, T>

      The map of addresses to on-chain account data

    • parser: ParsableEntity<T>

      The ParsableEntity instance to parse the accounts

    • now: number

      The current timestamp to use for the cache

    Returns void