tardis-dev
Version:
Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js
93 lines • 3.15 kB
TypeScript
import { BookChange, Trade } from '../types.ts';
import { Mapper } from './mapper.ts';
export declare class PoloniexV2TradesMapper implements Mapper<'poloniex', Trade> {
canHandle(message: any): boolean;
getFilters(symbols?: string[]): {
readonly channel: "trades";
readonly symbols: string[] | undefined;
}[];
map(message: PoloniexV2TradesMessage, localTimestamp: Date): IterableIterator<Trade>;
}
export declare class PoloniexV2BookChangeMapper implements Mapper<'poloniex', BookChange> {
canHandle(message: any): boolean;
getFilters(symbols?: string[]): {
readonly channel: "book_lv2";
readonly symbols: string[] | undefined;
}[];
map(message: PoloniexV2BookMessage, localTimestamp: Date): IterableIterator<BookChange>;
}
export declare class PoloniexTradesMapper implements Mapper<'poloniex', Trade> {
private readonly _channelIdToSymbolMap;
canHandle(message: PoloniexPriceAggreatedMessage): boolean;
getFilters(symbols?: string[]): {
readonly channel: "price_aggregated_book";
readonly symbols: string[] | undefined;
}[];
map(message: PoloniexPriceAggreatedMessage, localTimestamp: Date): IterableIterator<Trade>;
}
export declare class PoloniexBookChangeMapper implements Mapper<'poloniex', BookChange> {
private readonly _channelIdToSymbolMap;
canHandle(message: PoloniexPriceAggreatedMessage): boolean;
getFilters(symbols?: string[]): {
readonly channel: "price_aggregated_book";
readonly symbols: string[] | undefined;
}[];
map(message: PoloniexPriceAggreatedMessage, localTimestamp: Date): IterableIterator<BookChange>;
}
type PoloniexBookSnapshot = ['i', {
currencyPair: string;
orderBook: [{
[key: string]: string;
}, {
[key: string]: string;
}];
}];
type PoloniexBookUpdate = ['o', 0 | 1, string, string];
type PoloniexTrade = ['t', string, 1 | 0, string, string, number];
type PoloniexPriceAggreatedMessage = [number, number, (PoloniexBookSnapshot | PoloniexBookUpdate | PoloniexTrade)[], string?];
type PoloniexV2TradesMessage = {
channel: 'trades';
data: [
{
symbol: 'USDD_USDT';
amount: '53.17153856';
quantity: '53.0866';
takerSide: 'sell';
createTime: 1659916859838;
price: '1.0016';
id: '60100203';
ts: 1659916859843;
}
];
};
type PoloniexV2BookMessage = {
channel: 'book_lv2';
data: [
{
symbol: 'AAVE_BTC';
createTime: 1659916859818;
asks: [string, string][];
bids: [string, string][];
lastId: 20251;
id: 20252;
ts: 1659916859824;
}
];
action: 'update';
} | {
channel: 'book_lv2';
data: [
{
symbol: 'AAVE_BTC';
createTime: 1659900600092;
asks: [string, string][];
bids: [string, string][];
lastId: 85;
id: 86;
ts: 1659916800614;
}
];
action: 'snapshot';
};
export {};
//# sourceMappingURL=poloniex.d.ts.map