@chainlink/external-adapter-framework 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import { TransportGenerics } from '../transports';
|
|
2
|
-
import { InputParametersDefinition } from '../validation/input-params';
|
|
3
2
|
import { AdapterEndpoint } from './endpoint';
|
|
4
|
-
/**
|
|
5
|
-
* Type for the base input parameter config that any [[MarketStatusEndpoint]] must extend
|
|
6
|
-
*/
|
|
7
|
-
export type MarketStatusEndpointInputParametersDefinition = InputParametersDefinition & {
|
|
8
|
-
market: {
|
|
9
|
-
aliases: readonly [];
|
|
10
|
-
type: 'string';
|
|
11
|
-
description: 'The name of the market';
|
|
12
|
-
required: boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
3
|
/**
|
|
16
4
|
* Base input parameter config that any [[MarketStatusEndpoint]] must extend
|
|
17
5
|
*/
|
|
@@ -22,23 +10,39 @@ export declare const marketStatusEndpointInputParametersDefinition: {
|
|
|
22
10
|
readonly description: "The name of the market";
|
|
23
11
|
readonly required: true;
|
|
24
12
|
};
|
|
13
|
+
readonly type: {
|
|
14
|
+
readonly type: "string";
|
|
15
|
+
readonly description: "Type of the market status";
|
|
16
|
+
readonly options: readonly ["regular", "24/5"];
|
|
17
|
+
readonly default: "regular";
|
|
18
|
+
};
|
|
25
19
|
};
|
|
26
20
|
export declare enum MarketStatus {
|
|
27
21
|
UNKNOWN = 0,
|
|
28
22
|
CLOSED = 1,
|
|
29
23
|
OPEN = 2
|
|
30
24
|
}
|
|
25
|
+
export declare enum TwentyfourFiveMarketStatus {
|
|
26
|
+
UNKNOWN = 0,
|
|
27
|
+
PRE_MARKET = 1,
|
|
28
|
+
REGULAR = 2,
|
|
29
|
+
POST_MARKET = 3,
|
|
30
|
+
OVERNIGHT = 4,
|
|
31
|
+
WEEKEND = 5
|
|
32
|
+
}
|
|
33
|
+
type AggregatedMarketStatus = MarketStatus | TwentyfourFiveMarketStatus;
|
|
31
34
|
export type MarketStatusResultResponse = {
|
|
32
|
-
Result:
|
|
35
|
+
Result: AggregatedMarketStatus;
|
|
33
36
|
Data: {
|
|
34
|
-
result:
|
|
37
|
+
result: AggregatedMarketStatus;
|
|
38
|
+
statusString: string;
|
|
35
39
|
};
|
|
36
40
|
};
|
|
37
41
|
/**
|
|
38
42
|
* Helper type structure that contains the different types passed to the generic parameters of a PriceEndpoint
|
|
39
43
|
*/
|
|
40
44
|
export type MarketStatusEndpointGenerics = TransportGenerics & {
|
|
41
|
-
Parameters:
|
|
45
|
+
Parameters: typeof marketStatusEndpointInputParametersDefinition;
|
|
42
46
|
Response: MarketStatusResultResponse;
|
|
43
47
|
};
|
|
44
48
|
/**
|
|
@@ -47,3 +51,4 @@ export type MarketStatusEndpointGenerics = TransportGenerics & {
|
|
|
47
51
|
*/
|
|
48
52
|
export declare class MarketStatusEndpoint<T extends MarketStatusEndpointGenerics> extends AdapterEndpoint<T> {
|
|
49
53
|
}
|
|
54
|
+
export {};
|
package/adapter/market-status.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketStatusEndpoint = exports.MarketStatus = exports.marketStatusEndpointInputParametersDefinition = void 0;
|
|
3
|
+
exports.MarketStatusEndpoint = exports.TwentyfourFiveMarketStatus = exports.MarketStatus = exports.marketStatusEndpointInputParametersDefinition = void 0;
|
|
4
4
|
const endpoint_1 = require("./endpoint");
|
|
5
5
|
/**
|
|
6
6
|
* Base input parameter config that any [[MarketStatusEndpoint]] must extend
|
|
@@ -12,6 +12,12 @@ exports.marketStatusEndpointInputParametersDefinition = {
|
|
|
12
12
|
description: 'The name of the market',
|
|
13
13
|
required: true,
|
|
14
14
|
},
|
|
15
|
+
type: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'Type of the market status',
|
|
18
|
+
options: ['regular', '24/5'],
|
|
19
|
+
default: 'regular',
|
|
20
|
+
},
|
|
15
21
|
};
|
|
16
22
|
var MarketStatus;
|
|
17
23
|
(function (MarketStatus) {
|
|
@@ -19,6 +25,15 @@ var MarketStatus;
|
|
|
19
25
|
MarketStatus[MarketStatus["CLOSED"] = 1] = "CLOSED";
|
|
20
26
|
MarketStatus[MarketStatus["OPEN"] = 2] = "OPEN";
|
|
21
27
|
})(MarketStatus || (exports.MarketStatus = MarketStatus = {}));
|
|
28
|
+
var TwentyfourFiveMarketStatus;
|
|
29
|
+
(function (TwentyfourFiveMarketStatus) {
|
|
30
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["UNKNOWN"] = 0] = "UNKNOWN";
|
|
31
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["PRE_MARKET"] = 1] = "PRE_MARKET";
|
|
32
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["REGULAR"] = 2] = "REGULAR";
|
|
33
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["POST_MARKET"] = 3] = "POST_MARKET";
|
|
34
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["OVERNIGHT"] = 4] = "OVERNIGHT";
|
|
35
|
+
TwentyfourFiveMarketStatus[TwentyfourFiveMarketStatus["WEEKEND"] = 5] = "WEEKEND";
|
|
36
|
+
})(TwentyfourFiveMarketStatus || (exports.TwentyfourFiveMarketStatus = TwentyfourFiveMarketStatus = {}));
|
|
22
37
|
/**
|
|
23
38
|
* A MarketStatusEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
|
|
24
39
|
* Data Feeds, its InputParameters must extend the basic ones (base).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market-status.js","sourceRoot":"","sources":["../../../src/adapter/market-status.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"market-status.js","sourceRoot":"","sources":["../../../src/adapter/market-status.ts"],"names":[],"mappings":";;;AACA,yCAA4C;AAE5C;;GAEG;AACU,QAAA,6CAA6C,GAAG;IAC3D,MAAM,EAAE;QACN,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,IAAI;KACf;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2BAA2B;QACxC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;QAC5B,OAAO,EAAE,SAAS;KACnB;CACO,CAAA;AAEV,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,mDAAU,CAAA;IACV,+CAAQ,CAAA;AACV,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,iFAAW,CAAA;IACX,uFAAc,CAAA;IACd,iFAAW,CAAA;IACX,yFAAe,CAAA;IACf,qFAAa,CAAA;IACb,iFAAW,CAAA;AACb,CAAC,EAPW,0BAA0B,0CAA1B,0BAA0B,QAOrC;AAoBD;;;GAGG;AACH,MAAa,oBAEX,SAAQ,0BAAkB;CAAG;AAF/B,oDAE+B"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainlink/external-adapter-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "git://github.com/smartcontractkit/ea-framework-js.git",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"ajv": "8.17.1",
|
|
9
|
-
"axios": "1.13.
|
|
9
|
+
"axios": "1.13.2",
|
|
10
10
|
"eventsource": "4.0.0",
|
|
11
|
-
"fastify": "5.6.
|
|
11
|
+
"fastify": "5.6.2",
|
|
12
12
|
"ioredis": "5.8.2",
|
|
13
13
|
"mock-socket": "9.3.1",
|
|
14
14
|
"pino": "10.1.0",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/node": "24.10.0",
|
|
41
41
|
"@types/sinonjs__fake-timers": "15.0.1",
|
|
42
42
|
"@types/ws": "8.18.1",
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "8.46.
|
|
44
|
-
"@typescript-eslint/parser": "8.46.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "8.46.3",
|
|
44
|
+
"@typescript-eslint/parser": "8.46.3",
|
|
45
45
|
"ava": "6.4.1",
|
|
46
46
|
"axios-mock-adapter": "2.1.0",
|
|
47
47
|
"c8": "10.1.3",
|
|
48
|
-
"eslint": "9.39.
|
|
48
|
+
"eslint": "9.39.1",
|
|
49
49
|
"eslint-config-prettier": "10.1.8",
|
|
50
50
|
"eslint-plugin-tsdoc": "0.4.0",
|
|
51
51
|
"mocksse": "1.0.4",
|