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' , '245' ] ,
18+ default : 'regular' ,
19+ } ,
20+ } as const
2821
2922export enum MarketStatus {
3023 UNKNOWN = 0 ,
3124 CLOSED = 1 ,
3225 OPEN = 2 ,
3326}
3427
28+ // 24/5
29+ export enum TwoFourFiveMarketStatus {
30+ UNKNOWN = 0 ,
31+ PRE_MARKET = 11 ,
32+ REGULAR = 12 ,
33+ POST_MARKET = 13 ,
34+ OVERNIGHT = 14 ,
35+ WEEKEND = 15 ,
36+ }
37+
38+ type AggregatedMarketStatus = MarketStatus | TwoFourFiveMarketStatus
39+
3540export type MarketStatusResultResponse = {
36- Result : MarketStatus
41+ Result : AggregatedMarketStatus
3742 Data : {
38- result : MarketStatus
43+ result : AggregatedMarketStatus
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