@ariva-mds/mds
Version:
Stock market data
133 lines • 6.58 kB
TypeScript
import { MdsAuthdata } from './MdsAuthdata';
import { RunningRequest } from './RunningRequest';
import { MdsOptions } from './MdsOptions';
import { Observable } from 'rxjs';
import { MarketstateUpdate } from './MarketstateUpdate';
import { AfuCompanyProfile, BidAskHistoryData, ListingdataWithIdAndQuality, MarketdepthWithId, MarketstateResponseSearch, MasterdataMergedSummaryWithId, OrderBookVariant, PerformanceDataForTimeRange, Quality, Resolution, Sourcedata, TickHistoryData, TimeRange, TimeseriesBidAskData, TimeseriesData, TopflopList, TradetickerEvent, Tradingtime, TradingtimeInfoReply, WebSocketMessage } from '../models';
export declare class MdsConnection {
protected waitingForReconnect: RunningRequest[];
private readonly websocket;
private readonly authdataCallback;
private readonly state;
private waitingForAuthentification;
private nextGeneratedRequestId;
private readonly runningRequests;
private readonly isDebug;
private readonly reconnectTimer;
/**
* construct an MdsConnection
*/
constructor(websocketUrl: string, authdataCallback: () => Promise<MdsAuthdata>, options?: MdsOptions);
close(): void;
/**
* create a hearbeat observable that can be subscribed to
*/
heartbeat(): Observable<string | undefined>;
/**
* sets the priority for sources
*/
priority(sources: string[]): Promise<WebSocketMessage>;
/**
* Sources
* information about sources, access to other data that is linked to a source
*/
/**
* gets the basic information about a source
*/
private sourceCache;
source(sourceId: string): Promise<Sourcedata>;
/**
* gets the trading time for a source
* */
private tradingtimeCache;
tradingtime(sourceId: string): Promise<Tradingtime>;
/**
* gets the tradingtime for a source
* */
private tradingtimeAnalysisCache;
tradingtimeAnalysis(sourceId: string, date: Date): Promise<TradingtimeInfoReply>;
/**
* Returns a list or stream of the current trades from this source.
* */
tradeticker(sourceId: string, quality: Quality, onlyWithTurnover: boolean, preloadSize?: number): Observable<TradetickerEvent>;
/**
* Instruments
* information about instruments, access to other data that is linked to an instrument
*/
/**
* Returns one Instrument
*/
private masterdataCache;
masterdata(instrumentId: string): Promise<MasterdataMergedSummaryWithId>;
/**
* Returns a list of all Listings for the Instrument
* */
instrumentsListings(instrumentId: string, sourceId?: string): Observable<ListingdataWithIdAndQuality>;
/**
* Returns the AFU company profile
*/
afuCompanyProfile(instrumentId: string): Promise<AfuCompanyProfile>;
/**
* Marketstates
* information about listings, access to other data that is linked to a listing
*/
/**
* create a MarketstateUpdate observable that can be subscribed to, contains both full state and delta for every marketstate
*/
marketstates(marketstateQueries: string[], quality?: Quality): Observable<MarketstateUpdate>;
/**
* create a Marketstate for a snapshot request
*/
marketstateSnapshot(marketstateQueries: string[], quality?: Quality): Observable<MarketstateResponseSearch>;
/**
* create a market state observable that can be subscribed to, contains only delta for every marketstate
*/
marketstateUpdates(marketstateQueries: string[], quality?: Quality): Observable<MarketstateResponseSearch>;
/**
* create a market state observable that can be subscribed to, contains only full state for every marketstate
*/
marketstatesStates(marketstateQueries: string[], quality?: Quality): Observable<MarketstateResponseSearch | undefined>;
/**
* Returns the Open-High-Low-Close Timeseries for the specified Instrument on the Source.
* */
timeseries(marketstateId: string, resolution: Resolution, start?: Date | string, end?: Date | string, cleanSplits?: boolean, cleanDividends?: boolean, cleanDistributions?: boolean, cleanSubscriptions?: boolean, quality?: Quality): Observable<TimeseriesData>;
/**
* Returns the Open-High-Low-Close Timeseries for the specified Instrument on the Source.
* */
timeseriesSnapshot(marketstateId: string, resolution: Resolution, start?: Date | string, end?: Date | string, cleanSplits?: boolean, cleanDividends?: boolean, cleanDistributions?: boolean, cleanSubscriptions?: boolean, quality?: Quality): Observable<TimeseriesData>;
/**
* Returns the Orderbook for the specified Marketstate.
* */
marketdepth(marketstateId: string, quality?: Quality, orderBookVariant?: OrderBookVariant): Observable<MarketdepthWithId>;
/**
* Returns the performance for a specified listing of an instrument.
*/
performance(marketstateId: string, quality?: Quality, ...timeRanges: TimeRange[]): Observable<PerformanceDataForTimeRange>;
/**
* Returns the bid/ask history for the specified Instrument on the Source.
*/
bidAskHistory(marketstateId: string, start?: Date | string, end?: Date | string, quality?: Quality, offset?: number, limit?: number): Observable<BidAskHistoryData>;
/**
* Returns the tick history for the specified Instrument on the Source.
*/
tickHistory(marketstateId: string, start?: Date | string, end?: Date | string, filterByVolume?: boolean, quality?: Quality, offset?: number, limit?: number): Observable<TickHistoryData>;
timeseriesBidAsk(marketstateId: string, resolution: Resolution, start?: Date | string, end?: Date | string, quality?: Quality): Observable<TimeseriesBidAskData>;
/**
* Returns the Open-High-Low-Close Timeseries for the specified Instrument on the Source.
* */
timeseriesBidAskSnapshot(marketstateId: string, resolution: Resolution, start?: Date | string, end?: Date | string, quality?: Quality): Observable<TimeseriesBidAskData>;
/**
* Returns the Orderbook for the specified Marketstate.
* */
topflop(listId: string, sourcePriorities: string[], quality: Quality, topSize?: number, flopSize?: number): Observable<TopflopList>;
private updateExistingMarketstateWithDeltaUpdate;
private sendAsSoonAsAuthenticationPermits;
private stayAuthenticated;
private generateNextRequestId;
private observable;
private promise;
private processWebsocketMessageEvent;
private debug;
private error;
}
//# sourceMappingURL=MdsConnection.d.ts.map