import { DriftClient, OrderRecord, UserStatsAccount, UserStats, WrappedEvent, BulkAccountLoader } from '..'; import { PublicKey } from '@solana/web3.js'; import { UserMap } from './userMap'; export declare class UserStatsMap { /** * map from authority pubkey to UserStats */ private userStatsMap; private driftClient; private bulkAccountLoader; /** * Creates a new UserStatsMap instance. * * @param {DriftClient} driftClient - The DriftClient instance. * @param {BulkAccountLoader} [bulkAccountLoader] - If not provided, a new BulkAccountLoader with polling disabled will be created. */ constructor(driftClient: DriftClient, bulkAccountLoader?: BulkAccountLoader); subscribe(authorities: PublicKey[]): Promise; /** * * @param authority that owns the UserStatsAccount * @param userStatsAccount optional UserStatsAccount to subscribe to, if undefined will be fetched later * @param skipFetch if true, will not immediately fetch the UserStatsAccount */ addUserStat(authority: PublicKey, userStatsAccount?: UserStatsAccount, skipFetch?: boolean): Promise; updateWithOrderRecord(record: OrderRecord, userMap: UserMap): Promise; updateWithEventRecord(record: WrappedEvent, userMap?: UserMap): Promise; has(authorityPublicKey: string): boolean; get(authorityPublicKey: string): UserStats; /** * Enforce that a UserStats will exist for the given authorityPublicKey, * reading one from the blockchain if necessary. * @param authorityPublicKey * @returns */ mustGet(authorityPublicKey: string): Promise; values(): IterableIterator; size(): number; /** * Sync the UserStatsMap * @param authorities list of authorities to derive UserStatsAccount public keys from. * You may want to get this list from UserMap in order to filter out idle users */ sync(authorities: PublicKey[]): Promise; unsubscribe(): Promise; }