/// import { Buffer } from 'buffer'; import { Commitment, GetProgramAccountsConfig, GetProgramAccountsFilter, ProgramAccountChangeCallback, PublicKey } from '@solana/web3.js'; import BN from 'bn.js'; import { GmaBuilder, GmaBuilderOptions } from './GmaBuilder'; import { Convergence } from '../Convergence'; import { UnparsedAccount } from '../types'; export type GpaSortCallback = (a: UnparsedAccount, b: UnparsedAccount) => number; export declare class GpaBuilder { /** The connection instance to use when fetching accounts. */ protected readonly convergence: Convergence; /** The public key of the program we want to retrieve accounts from. */ protected readonly programId: PublicKey; /** The configs to use when fetching program accounts. */ protected config: GetProgramAccountsConfig; /** When provided, reorder accounts using this callback. */ protected sortCallback?: GpaSortCallback; constructor(convergence: Convergence, programId: PublicKey); getFilters(): GetProgramAccountsFilter[] | undefined; /** * Subscribes to changes within the program account * based on the specified commitment, defaults to 'confirmed'. * * Returns a subscription id used to unsubscribe */ subscribe(callback: ProgramAccountChangeCallback, commitment?: Commitment): number; unsubscribe(subscriptionId: number): Promise; mergeConfig(config: GetProgramAccountsConfig): this; slice(offset: number, length: number): this; withoutData(): this; addFilter(...filters: GetProgramAccountsFilter[]): this; where(offset: number, bytes: string | Buffer | PublicKey | BN | number): this; whereSize(dataSize: number): this; sortUsing(callback: GpaSortCallback): this; get(): Promise; getAndMap(callback: (account: UnparsedAccount) => T): Promise; getPublicKeys(): Promise; getDataAsPublicKeys(): Promise; getMultipleAccounts(callback?: (account: UnparsedAccount) => PublicKey, options?: GmaBuilderOptions): Promise; }