UNPKG

@drift-labs/sdk

Version:
31 lines (30 loc) 857 B
/// <reference types="bn.js" /> import { Keypair } from '@solana/web3.js'; import { BN } from '@coral-xyz/anchor'; type Quote = { bidPrice: BN; askPrice: BN; bidBaseAssetAmount: BN; askBaseAssetAmount: BN; marketIndex: number; isOracleOffset?: boolean; }; export declare class IndicativeQuotesSender { private endpoint; private keypair; private heartbeatTimeout; private sendQuotesInterval; private readonly heartbeatIntervalMs; private reconnectDelay; private ws; private connected; private quotes; constructor(endpoint: string, keypair: Keypair); generateChallengeResponse(nonce: string): string; handleAuthMessage(message: any): void; connect(): Promise<void>; private startHeartbeatTimer; setQuote(newQuotes: Quote | Quote[]): void; private reconnect; } export {};