import { User, DriftClient, UserAccount, OrderRecord, WrappedEvent, DLOB, UserSubscriptionConfig, DataAndSlot, ProtectMakerParamsMap } from '..'; import { PublicKey } from '@solana/web3.js'; import { UserAccountFilterCriteria as UserFilterCriteria, UserMapConfig } from './userMapConfig'; export interface UserMapInterface { subscribe(): Promise; unsubscribe(): Promise; addPubkey(userAccountPublicKey: PublicKey, userAccount?: UserAccount, slot?: number, accountSubscription?: UserSubscriptionConfig): Promise; has(key: string): boolean; get(key: string): User | undefined; getWithSlot(key: string): DataAndSlot | undefined; mustGet(key: string, accountSubscription?: UserSubscriptionConfig): Promise; mustGetWithSlot(key: string, accountSubscription?: UserSubscriptionConfig): Promise>; getUserAuthority(key: string): PublicKey | undefined; updateWithOrderRecord(record: OrderRecord): Promise; values(): IterableIterator; valuesWithSlot(): IterableIterator>; entries(): IterableIterator<[string, User]>; entriesWithSlot(): IterableIterator<[string, DataAndSlot]>; } export declare class UserMap implements UserMapInterface { private userMap; driftClient: DriftClient; private connection; private commitment; private includeIdle; private additionalFilters?; private disableSyncOnTotalAccountsChange; private lastNumberOfSubAccounts; private subscription; private stateAccountUpdateCallback; private decode; private mostRecentSlot; private syncConfig; private syncPromise?; private syncPromiseResolver; private throwOnFailedSync; /** * Constructs a new UserMap instance. */ constructor(config: UserMapConfig); subscribe(): Promise; addPubkey(userAccountPublicKey: PublicKey, userAccount?: UserAccount, slot?: number, accountSubscription?: UserSubscriptionConfig): 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; getWithSlot(key: string): DataAndSlot | 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, accountSubscription?: UserSubscriptionConfig): Promise; mustGetWithSlot(key: string, accountSubscription?: UserSubscriptionConfig): Promise>; mustGetUserAccount(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, protectedMakerParamsMap?: ProtectMakerParamsMap): Promise; updateWithOrderRecord(record: OrderRecord): Promise; updateWithEventRecord(record: WrappedEvent): Promise; values(): IterableIterator; valuesWithSlot(): IterableIterator>; entries(): IterableIterator<[string, User]>; entriesWithSlot(): IterableIterator<[string, DataAndSlot]>; 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; /** * Syncs the UserMap using the default sync method (single getProgramAccounts call with filters). * This method may fail when drift has too many users. (nodejs response size limits) * @returns */ private defaultSync; /** * Syncs the UserMap using the paginated sync method (multiple getMultipleAccounts calls with filters). * This method is more reliable when drift has many users. * @returns */ private paginatedSync; unsubscribe(): Promise; updateUserAccount(key: string, userAccount: UserAccount, slot: number): Promise; updateLatestSlot(slot: number): void; getSlot(): number; } //# sourceMappingURL=userMap.d.ts.map