@chainlink/external-adapter-framework 1.2.0 → 1.3.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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # EA Framework v3
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@chainlink/external-adapter-framework.svg?style=flat)](https://www.npmjs.com/package/@chainlink/external-adapter-framework)
4
- ![Coverage](https://img.shields.io/badge/coverage-99.17%25-green)
4
+ ![Coverage](https://img.shields.io/badge/coverage-99.18%25-green)
5
5
 
6
6
  Framework to create External adapters, microservices that serve as middleware to facilitate connections between Chainlink Nodes and Data Providers (DP).
7
7
 
@@ -1,5 +1,6 @@
1
1
  export * from './basic';
2
- export * from './price';
3
2
  export * from './endpoint';
4
- export * from './types';
5
3
  export * from './lwba';
4
+ export * from './market-status';
5
+ export * from './price';
6
+ export * from './types';
package/adapter/index.js CHANGED
@@ -15,8 +15,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./basic"), exports);
18
- __exportStar(require("./price"), exports);
19
18
  __exportStar(require("./endpoint"), exports);
20
- __exportStar(require("./types"), exports);
21
19
  __exportStar(require("./lwba"), exports);
20
+ __exportStar(require("./market-status"), exports);
21
+ __exportStar(require("./price"), exports);
22
+ __exportStar(require("./types"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,0CAAuB;AACvB,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapter/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAuB;AACvB,6CAA0B;AAC1B,yCAAsB;AACtB,kDAA+B;AAC/B,0CAAuB;AACvB,0CAAuB"}
@@ -0,0 +1,49 @@
1
+ import { TransportGenerics } from '../transports';
2
+ import { InputParametersDefinition } from '../validation/input-params';
3
+ 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
+ /**
16
+ * Base input parameter config that any [[MarketStatusEndpoint]] must extend
17
+ */
18
+ export declare const marketStatusEndpointInputParametersDefinition: {
19
+ readonly market: {
20
+ readonly aliases: readonly [];
21
+ readonly type: "string";
22
+ readonly description: "The name of the market";
23
+ readonly required: true;
24
+ };
25
+ };
26
+ export declare enum MarketStatus {
27
+ UNKNOWN = 0,
28
+ CLOSED = 1,
29
+ OPEN = 2
30
+ }
31
+ export type MarketStatusResultResponse = {
32
+ Result: MarketStatus;
33
+ Data: {
34
+ result: MarketStatus;
35
+ };
36
+ };
37
+ /**
38
+ * Helper type structure that contains the different types passed to the generic parameters of a PriceEndpoint
39
+ */
40
+ export type MarketStatusEndpointGenerics = TransportGenerics & {
41
+ Parameters: MarketStatusEndpointInputParametersDefinition;
42
+ Response: MarketStatusResultResponse;
43
+ };
44
+ /**
45
+ * A MarketStatusEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
46
+ * Data Feeds, its InputParameters must extend the basic ones (base).
47
+ */
48
+ export declare class MarketStatusEndpoint<T extends MarketStatusEndpointGenerics> extends AdapterEndpoint<T> {
49
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MarketStatusEndpoint = exports.MarketStatus = exports.marketStatusEndpointInputParametersDefinition = void 0;
4
+ const endpoint_1 = require("./endpoint");
5
+ /**
6
+ * Base input parameter config that any [[MarketStatusEndpoint]] must extend
7
+ */
8
+ exports.marketStatusEndpointInputParametersDefinition = {
9
+ market: {
10
+ aliases: [],
11
+ type: 'string',
12
+ description: 'The name of the market',
13
+ required: true,
14
+ },
15
+ };
16
+ var MarketStatus;
17
+ (function (MarketStatus) {
18
+ MarketStatus[MarketStatus["UNKNOWN"] = 0] = "UNKNOWN";
19
+ MarketStatus[MarketStatus["CLOSED"] = 1] = "CLOSED";
20
+ MarketStatus[MarketStatus["OPEN"] = 2] = "OPEN";
21
+ })(MarketStatus = exports.MarketStatus || (exports.MarketStatus = {}));
22
+ /**
23
+ * A MarketStatusEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
24
+ * Data Feeds, its InputParameters must extend the basic ones (base).
25
+ */
26
+ class MarketStatusEndpoint extends endpoint_1.AdapterEndpoint {
27
+ }
28
+ exports.MarketStatusEndpoint = MarketStatusEndpoint;
29
+ //# sourceMappingURL=market-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"market-status.js","sourceRoot":"","sources":["../../../src/adapter/market-status.ts"],"names":[],"mappings":";;;AAEA,yCAA4C;AAc5C;;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;CAC+D,CAAA;AAElE,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qDAAW,CAAA;IACX,mDAAU,CAAA;IACV,+CAAQ,CAAA;AACV,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAiBD;;;GAGG;AACH,MAAa,oBAEX,SAAQ,0BAAkB;CAAG;AAF/B,oDAE+B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainlink/external-adapter-framework",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -14,8 +14,8 @@
14
14
  "pino-pretty": "9.1.0",
15
15
  "prom-client": "13.2.0",
16
16
  "redlock": "5.0.0-beta.2",
17
- "yeoman-generator": "3.1.1",
18
- "ws": "8.9.0"
17
+ "ws": "8.9.0",
18
+ "yeoman-generator": "3.1.1"
19
19
  },
20
20
  "scripts": {
21
21
  "build": "mkdir -p ./dist/src && cp package.json dist/src && cp README.md dist/src && tsc && yarn build-generator",
@@ -39,6 +39,7 @@
39
39
  "@types/node": "18.15.13",
40
40
  "@types/sinonjs__fake-timers": "8.1.2",
41
41
  "@types/ws": "8.5.3",
42
+ "@types/yeoman-generator": "5.2.11",
42
43
  "@typescript-eslint/eslint-plugin": "5.59.0",
43
44
  "@typescript-eslint/parser": "5.59.0",
44
45
  "ava": "5.2.0",
@@ -52,8 +53,7 @@
52
53
  "ts-node": "10.9.1",
53
54
  "ts-node-dev": "2.0.0",
54
55
  "typedoc": "0.23.21",
55
- "typescript": "5.0.4",
56
- "@types/yeoman-generator": "5.2.11"
56
+ "typescript": "5.0.4"
57
57
  },
58
58
  "prettier": {
59
59
  "semi": false,