Skip to content

Commit b1de097

Browse files
committed
Update market-status
1 parent 7f7b13e commit b1de097

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

src/adapter/market-status.ts

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
import { TransportGenerics } from '../transports'
2-
import { InputParametersDefinition } from '../validation/input-params'
32
import { 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,38 @@ export const marketStatusEndpointInputParametersDefinition = {
2411
description: 'The name of the market',
2512
required: true,
2613
},
27-
} as const satisfies MarketStatusEndpointInputParametersDefinition
14+
} as const
2815

2916
export enum MarketStatus {
3017
UNKNOWN = 0,
3118
CLOSED = 1,
3219
OPEN = 2,
3320
}
3421

22+
// 24/5
23+
export enum TwoFourFiveMarketStatus {
24+
UNKNOWN = 0,
25+
PRE_MARKET = 11,
26+
REGULAR = 12,
27+
POST_MARKET = 13,
28+
OVERNIGHT = 14,
29+
WEEKEND = 15,
30+
}
31+
32+
type AggregatedMarketStatus = MarketStatus | TwoFourFiveMarketStatus
33+
3534
export type MarketStatusResultResponse = {
36-
Result: MarketStatus
35+
Result: AggregatedMarketStatus
3736
Data: {
38-
result: MarketStatus
37+
result: AggregatedMarketStatus
3938
}
4039
}
4140

4241
/**
4342
* Helper type structure that contains the different types passed to the generic parameters of a PriceEndpoint
4443
*/
4544
export type MarketStatusEndpointGenerics = TransportGenerics & {
46-
Parameters: MarketStatusEndpointInputParametersDefinition
45+
Parameters: typeof marketStatusEndpointInputParametersDefinition
4746
Response: MarketStatusResultResponse
4847
}
4948

0 commit comments

Comments
 (0)