/// /// /// import { DriftClient } from '../driftClient'; import { UserAccount } from '../types'; import { Commitment, PublicKey } from '@solana/web3.js'; import { Buffer } from 'buffer'; import { DLOB } from '../dlob/DLOB'; import { OrderSubscriberConfig, OrderSubscriberEvents } from './types'; import { PollingSubscription } from './PollingSubscription'; import { WebsocketSubscription } from './WebsocketSubscription'; import StrictEventEmitter from 'strict-event-emitter-types'; import { EventEmitter } from 'events'; import { ProtectMakerParamsMap } from '../index'; import { grpcSubscription } from './grpcSubscription'; export declare class OrderSubscriber { driftClient: DriftClient; usersAccounts: Map; subscription: PollingSubscription | WebsocketSubscription | grpcSubscription; commitment: Commitment; eventEmitter: StrictEventEmitter; fetchPromise?: Promise; fetchPromiseResolver: () => void; mostRecentSlot: number; decodeFn: (name: string, data: Buffer) => UserAccount; decodeData?: boolean; fetchAllNonIdleUsers?: boolean; constructor(config: OrderSubscriberConfig); subscribe(): Promise; fetch(): Promise; tryUpdateUserAccount(key: string, dataType: 'raw' | 'decoded' | 'buffer', data: string[] | UserAccount | Buffer, slot: number): void; /** * Creates a new DLOB for the order subscriber to fill. This will allow a * caller to extend the DLOB Subscriber with a custom DLOB type. * @returns New, empty DLOB object. */ protected createDLOB(protectedMakerParamsMap?: ProtectMakerParamsMap): DLOB; getDLOB(slot: number, protectedMakerParamsMap?: ProtectMakerParamsMap): Promise; getSlot(): number; addPubkey(userAccountPublicKey: PublicKey): Promise; mustGetUserAccount(key: string): Promise; unsubscribe(): Promise; }