11import { TransportGenerics } from '../transports'
2- import { InputParametersDefinition } from '../validation/input-params'
32import { AdapterEndpoint } from './endpoint'
43
5- /**
6- * Type for the base input parameter config that any [[MarketStatusEndpoint]] must extend
7- */
8- export type MarketStatusEndpointInputParametersDefinition = InputParametersDefinition & {
9- market : {
10- aliases : readonly [ ]
11- type : 'string'
12- description : 'The name of the market'
13- required : boolean
14- }
15- }
16-
174/**
185 * Base input parameter config that any [[MarketStatusEndpoint]] must extend
196 */
@@ -24,26 +11,44 @@ export const marketStatusEndpointInputParametersDefinition = {
2411 description : 'The name of the market' ,
2512 required : true ,
2613 } ,
27- } as const satisfies MarketStatusEndpointInputParametersDefinition
14+ type : {
15+ type : 'string' ,
16+ description : 'Type of the market status' ,
17+ options : [ 'regular' , '24/5' ] ,
18+ default : 'regular' ,
19+ } ,
20+ } as const
2821
2922export enum MarketStatus {
3023 UNKNOWN = 0 ,
3124 CLOSED = 1 ,
3225 OPEN = 2 ,
3326}
3427
28+ export enum TwentyfourFiveMarketStatus {
29+ UNKNOWN = 0 ,
30+ PRE_MARKET = 1 ,
31+ REGULAR = 2 ,
32+ POST_MARKET = 3 ,
33+ OVERNIGHT = 4 ,
34+ WEEKEND = 5 ,
35+ }
36+
37+ type AggregatedMarketStatus = MarketStatus | TwentyfourFiveMarketStatus
38+
3539export type MarketStatusResultResponse = {
36- Result : MarketStatus
40+ Result : AggregatedMarketStatus
3741 Data : {
38- result : MarketStatus
42+ result : AggregatedMarketStatus
43+ statusString : string
3944 }
4045}
4146
4247/**
4348 * Helper type structure that contains the different types passed to the generic parameters of a PriceEndpoint
4449 */
4550export type MarketStatusEndpointGenerics = TransportGenerics & {
46- Parameters : MarketStatusEndpointInputParametersDefinition
51+ Parameters : typeof marketStatusEndpointInputParametersDefinition
4752 Response : MarketStatusResultResponse
4853}
4954
0 commit comments