make method generic and add mapping

This commit is contained in:
Thijmen Maus
2023-09-12 11:25:43 +02:00
parent 9de8134286
commit 2fb2b7cc40
2 changed files with 13 additions and 7 deletions

View File

@@ -1,6 +1,8 @@
import {
CategoryCursorListV5,
CategoryV5,
ContractTypeV5,
CursorListV5,
InstrumentStatusV5,
OptionTypeV5,
OrderSideV5,
@@ -110,10 +112,14 @@ export interface SpotInstrumentInfoV5 {
};
}
export type InstrumentInfoResponseV5 =
| CategoryCursorListV5<LinearInverseInstrumentInfoV5[], 'linear' | 'inverse'>
| CategoryCursorListV5<OptionInstrumentInfoV5[], 'option'>
| CategoryCursorListV5<SpotInstrumentInfoV5[], 'spot'>;
type InstrumentInfoV5Mapping = {
linear: LinearInverseInstrumentInfoV5[],
inverse: LinearInverseInstrumentInfoV5[],
option: OptionInstrumentInfoV5[],
spot: SpotInstrumentInfoV5[]
};
export type InstrumentInfoResponseV5<C extends CategoryV5> = CategoryCursorListV5<InstrumentInfoV5Mapping[C], C>;
export default interface OrderbookLevelV5 {
price: string;