import { Commitment, PublicKey } from "@solana/web3.js"; import { FetchModule, FetchClient } from "@honeycomb-protocol/hive-control"; import { Currency, HolderAccount } from "../generated"; import { Metadata } from "@metaplex-foundation/mpl-token-metadata"; import { Account as TokenAccount, Mint } from "@solana/spl-token"; /** * Extends the Honeycomb interface with the `fetch` method to access the CurrencyManagerFetchClient. */ declare module "@honeycomb-protocol/hive-control" { interface FetchModule { currencyManager(): CurrencyManagerFetchClient; } } /** * Represents the Fetch Module which contains boiler plates for fetching HiveControl accounts. * @category Modules */ export declare class CurrencyManagerFetchClient extends FetchClient { /** * Creates a new instance of the CurrencyManagerFetchClient. */ constructor(); /** * Fetches the Currency object. * @param address - The public address of the Currency account. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ currency(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the mint object. * @param address - The mint address. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ mint(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the Metadata object. * @param mint - The minnt address of the token. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ metadata(mint: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the Currecy object along with it's dependencies. * @param address - The public address of the token. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ currencyWithDeps(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise<{ currency: Currency; mint: Mint; metadata: Metadata; } | null>; /** * Fetches the Holder Account object. * @param args - The currency address and owner of holder account. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ holderAccount(args: { currency: PublicKey; owner: PublicKey; }, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the Holder Account object. * @param address - The public address of the holderAccount. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ holderAccount(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the Token Account object. * @param address - The public address of the tokenAccount. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ tokenAccount(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise; /** * Fetches the Currecy object along with it's dependencies. * @param address - The public address of the holderAccount. * @param commitment The Solana block commitment. * @param forceFetch Wether to use cache data or forcefully forceFetch. * @returns An instance of HoneycombProject. */ holderAccountWithDeps(address: PublicKey, commitment?: Commitment, forceFetch?: boolean): Promise<{ holderAccount: HolderAccount; tokenAccount: TokenAccount; } | null>; /** * Installs the CurrencyManagerFetchClient into the FetchModule instance. * * @param fetchModule - The FetchModule instance to install the module into. * @returns The modified FetchModule instance with the CurrencyManagerFetchClient installed. */ install(fetchModule: FetchModule): FetchModule; } /** * Factory function to create a new instance of the CurrencyManagerFetchClient. * @category Factory * @returns A new instance of the CurrencyManagerFetchClient. */ export declare const currencyManagerFetch: () => CurrencyManagerFetchClient;