Last active
September 3, 2024 14:50
-
-
Save Fyzu/7ce934237abaed51bb640a72cd021e82 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CandleData { | |
subscribeData( | |
symbol: string, | |
aggregation: AggregationPeriod, | |
/** | |
* `fromTime` and `toTime` options are candles timestamps which should be used when requesting more candles data (lazy loading) | |
* `fromTime` is an oldest candle's timestamp which should be data get from, `toTime` is the newest (usually toTime candle equals the oldest visible candle) | |
*/ | |
options?: ChartDataOptions, | |
onSnapshot: (data: ChartCandleData[]) => void), | |
onUpdate: (data: ChartCandleData[]) => void), | |
onError: (error: Error) => void | |
): { | |
requestRange(fromTime: number, toTime: number): void | |
unsubscribe(): void | |
}; | |
createDataModel( | |
symbol: string, | |
aggregation: AggregationPeriod, | |
/** | |
* `fromTime` and `toTime` options are candles timestamps which should be used when requesting more candles data (lazy loading) | |
* `fromTime` is an oldest candle's timestamp which should be data get from, `toTime` is the newest (usually toTime candle equals the oldest visible candle) | |
*/ | |
options?: ChartDataOptions, | |
/** | |
* !!! Use with caution !!! | |
* This function updates the whole instrument series data | |
*/ | |
// sub?: (data: ChartCandleData[]) => void | |
): { | |
subscribe(onUpdate: (sub: (type: 'snapshot' | 'update', data: ChartCandleData[]) => void)): Cancel | |
get(fromTime: number, toTime: number, onResult: ResultCallback, onError: ErrorCallback): Cancel; | |
close(): void | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment