import { User, DriftClient, UserAccount, OrderRecord, WrappedEvent, DLOB } from '..'; import { PublicKey } from '@solana/web3.js'; import { UserAccountFilterCriteria as UserFilterCriteria, UserMapConfig } from './userMapConfig'; export interface UserMapInterface { subscribe(): Promise; unsubscribe(): Promise; addPubkey(userAccountPublicKey: PublicKey): Promise; has(key: string): boolean; get(key: string): User | undefined; mustGet(key: string): Promise; getUserAuthority(key: string): PublicKey | undefined; updateWithOrderRecord(record: OrderRecord): Promise; values(): IterableIterator; } export declare class UserMap implements UserMapInterface { private userMap; driftClient: DriftClient; private connection; private commitment; private includeIdle; private disableSyncOnTotalAccountsChange; private lastNumberOfSubAccounts; private subscription; private stateAccountUpdateCallback; private decode; private mostRecentSlot; private syncPromise?; private syncPromiseResolver; /** * Constructs a new UserMap instance. */ constructor(config: UserMapConfig); subscribe(): Promise; addPubkey(userAccountPublicKey: PublicKey, userAccount?: UserAccount, slot?: number): Promise; has(key: string): boolean; /** * gets the User for a particular userAccountPublicKey, if no User exists, undefined is returned * @param key userAccountPublicKey to get User for * @returns user User | undefined */ get(key: string): User | undefined; /** * gets the User for a particular userAccountPublicKey, if no User exists, new one is created * @param key userAccountPublicKey to get User for * @returns User */ mustGet(key: string): Promise; /** * gets the Authority for a particular userAccountPublicKey, if no User exists, undefined is returned * @param key userAccountPublicKey to get User for * @returns authority PublicKey | undefined */ getUserAuthority(key: string): PublicKey | undefined; /** * implements the {@link DLOBSource} interface * create a DLOB from all the subscribed users * @param slot */ getDLOB(slot: number): Promise; updateWithOrderRecord(record: OrderRecord): Promise; updateWithEventRecord(record: WrappedEvent): Promise; values(): IterableIterator; size(): number; /** * Returns a unique list of authorities for all users in the UserMap that meet the filter criteria * @param filterCriteria: Users must meet these criteria to be included * @returns */ getUniqueAuthorities(filterCriteria?: UserFilterCriteria): PublicKey[]; sync(): Promise; unsubscribe(): Promise; updateUserAccount(key: string, userAccount: UserAccount, slot: number): Promise; updateLatestSlot(slot: number): void; getSlot(): number; }