/// /// /// import { DriftClient } from '../driftClient'; import { UserAccount } from '../types'; import { Commitment } 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 { 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; 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(): DLOB; getDLOB(slot: number): Promise; getSlot(): number; unsubscribe(): Promise; }