@chainlink/external-adapter-framework 0.5.0 → 0.5.2
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/adapter/basic.d.ts +90 -0
- package/adapter/basic.js +325 -0
- package/adapter/basic.js.map +1 -0
- package/adapter/endpoint.d.ts +17 -0
- package/adapter/endpoint.js +20 -0
- package/adapter/endpoint.js.map +1 -0
- package/adapter/index.d.ts +4 -0
- package/adapter/index.js +21 -0
- package/adapter/index.js.map +1 -0
- package/adapter/price.d.ts +77 -0
- package/adapter/price.js +88 -0
- package/adapter/price.js.map +1 -0
- package/adapter/types.d.ts +124 -0
- package/adapter/types.js +3 -0
- package/adapter/types.js.map +1 -0
- package/background-executor.d.ts +9 -0
- package/background-executor.js +97 -0
- package/background-executor.js.map +1 -0
- package/cache/factory.d.ts +6 -0
- package/cache/factory.js +24 -0
- package/cache/factory.js.map +1 -0
- package/cache/index.d.ts +87 -0
- package/cache/index.js +133 -0
- package/cache/index.js.map +1 -0
- package/cache/local.d.ts +23 -0
- package/cache/local.js +84 -0
- package/cache/local.js.map +1 -0
- package/cache/metrics.d.ts +27 -0
- package/cache/metrics.js +121 -0
- package/cache/metrics.js.map +1 -0
- package/cache/redis.d.ts +16 -0
- package/cache/redis.js +101 -0
- package/cache/redis.js.map +1 -0
- package/config/index.d.ts +298 -0
- package/config/index.js +359 -0
- package/config/index.js.map +1 -0
- package/config/provider-limits.d.ts +27 -0
- package/config/provider-limits.js +75 -0
- package/config/provider-limits.js.map +1 -0
- package/examples/bank-frick/accounts.d.ts +45 -0
- package/examples/bank-frick/accounts.js +203 -0
- package/examples/bank-frick/accounts.js.map +1 -0
- package/examples/bank-frick/config/index.d.ts +17 -0
- package/examples/bank-frick/config/index.js +55 -0
- package/examples/bank-frick/config/index.js.map +1 -0
- package/examples/bank-frick/index.d.ts +2 -0
- package/examples/bank-frick/index.js +16 -0
- package/examples/bank-frick/index.js.map +1 -0
- package/examples/bank-frick/util.d.ts +4 -0
- package/examples/bank-frick/util.js +40 -0
- package/examples/bank-frick/util.js.map +1 -0
- package/examples/coingecko/src/config/index.d.ts +2 -0
- package/examples/coingecko/src/config/index.js +6 -0
- package/examples/coingecko/src/config/index.js.map +1 -0
- package/examples/coingecko/src/config/overrides.json +10825 -0
- package/examples/coingecko/src/crypto-utils.d.ts +62 -0
- package/examples/coingecko/src/crypto-utils.js +60 -0
- package/examples/coingecko/src/crypto-utils.js.map +1 -0
- package/examples/coingecko/src/endpoint/coins.d.ts +26 -0
- package/examples/coingecko/src/endpoint/coins.js +37 -0
- package/examples/coingecko/src/endpoint/coins.js.map +1 -0
- package/examples/coingecko/src/endpoint/crypto-marketcap.d.ts +3 -0
- package/examples/coingecko/src/endpoint/crypto-marketcap.js +30 -0
- package/examples/coingecko/src/endpoint/crypto-marketcap.js.map +1 -0
- package/examples/coingecko/src/endpoint/crypto-volume.d.ts +3 -0
- package/examples/coingecko/src/endpoint/crypto-volume.js +30 -0
- package/examples/coingecko/src/endpoint/crypto-volume.js.map +1 -0
- package/examples/coingecko/src/endpoint/crypto.d.ts +3 -0
- package/examples/coingecko/src/endpoint/crypto.js +28 -0
- package/examples/coingecko/src/endpoint/crypto.js.map +1 -0
- package/examples/coingecko/src/endpoint/dominance.d.ts +3 -0
- package/examples/coingecko/src/endpoint/dominance.js +28 -0
- package/examples/coingecko/src/endpoint/dominance.js.map +1 -0
- package/examples/coingecko/src/endpoint/global-marketcap.d.ts +3 -0
- package/examples/coingecko/src/endpoint/global-marketcap.js +28 -0
- package/examples/coingecko/src/endpoint/global-marketcap.js.map +1 -0
- package/examples/coingecko/src/endpoint/index.d.ts +6 -0
- package/examples/coingecko/src/endpoint/index.js +16 -0
- package/examples/coingecko/src/endpoint/index.js.map +1 -0
- package/examples/coingecko/src/global-utils.d.ts +42 -0
- package/examples/coingecko/src/global-utils.js +47 -0
- package/examples/coingecko/src/global-utils.js.map +1 -0
- package/examples/coingecko/src/index.d.ts +4 -0
- package/examples/coingecko/src/index.js +19 -0
- package/examples/coingecko/src/index.js.map +1 -0
- package/examples/cryptocompare/src/config/index.d.ts +2 -0
- package/examples/cryptocompare/src/config/index.js +6 -0
- package/examples/cryptocompare/src/config/index.js.map +1 -0
- package/examples/cryptocompare/src/endpoints/crypto.d.ts +40 -0
- package/examples/cryptocompare/src/endpoints/crypto.js +54 -0
- package/examples/cryptocompare/src/endpoints/crypto.js.map +1 -0
- package/examples/cryptocompare/src/endpoints/index.d.ts +1 -0
- package/examples/cryptocompare/src/endpoints/index.js +6 -0
- package/examples/cryptocompare/src/endpoints/index.js.map +1 -0
- package/examples/cryptocompare/src/index.d.ts +4 -0
- package/examples/cryptocompare/src/index.js +14 -0
- package/examples/cryptocompare/src/index.js.map +1 -0
- package/examples/genesis/config/index.d.ts +7 -0
- package/examples/genesis/config/index.js +11 -0
- package/examples/genesis/config/index.js.map +1 -0
- package/examples/genesis/index.d.ts +2 -0
- package/examples/genesis/index.js +13 -0
- package/examples/genesis/index.js.map +1 -0
- package/examples/genesis/sseStream.d.ts +27 -0
- package/examples/genesis/sseStream.js +149 -0
- package/examples/genesis/sseStream.js.map +1 -0
- package/index.d.ts +17 -0
- package/index.js +174 -0
- package/index.js.map +1 -0
- package/metrics/constants.d.ts +16 -0
- package/metrics/constants.js +26 -0
- package/metrics/constants.js.map +1 -0
- package/metrics/index.d.ts +19 -0
- package/metrics/index.js +139 -0
- package/metrics/index.js.map +1 -0
- package/metrics/util.d.ts +7 -0
- package/metrics/util.js +10 -0
- package/metrics/util.js.map +1 -0
- package/package.json +50 -42
- package/rate-limiting/background/fixed-frequency.d.ts +10 -0
- package/rate-limiting/background/fixed-frequency.js +36 -0
- package/rate-limiting/background/fixed-frequency.js.map +1 -0
- package/rate-limiting/index.d.ts +56 -0
- package/rate-limiting/index.js +86 -0
- package/rate-limiting/index.js.map +1 -0
- package/rate-limiting/metrics.d.ts +3 -0
- package/rate-limiting/metrics.js +45 -0
- package/rate-limiting/metrics.js.map +1 -0
- package/rate-limiting/request/simple-counting.d.ts +20 -0
- package/rate-limiting/request/simple-counting.js +63 -0
- package/rate-limiting/request/simple-counting.js.map +1 -0
- package/transports/batch-warming.d.ts +53 -0
- package/transports/batch-warming.js +136 -0
- package/transports/batch-warming.js.map +1 -0
- package/transports/index.d.ts +108 -0
- package/transports/index.js +56 -0
- package/transports/index.js.map +1 -0
- package/transports/metrics.d.ts +25 -0
- package/transports/metrics.js +122 -0
- package/transports/metrics.js.map +1 -0
- package/transports/rest.d.ts +68 -0
- package/transports/rest.js +131 -0
- package/transports/rest.js.map +1 -0
- package/transports/routing.d.ts +21 -0
- package/transports/routing.js +50 -0
- package/transports/routing.js.map +1 -0
- package/transports/sse.d.ts +61 -0
- package/transports/sse.js +97 -0
- package/transports/sse.js.map +1 -0
- package/transports/util.d.ts +9 -0
- package/transports/util.js +87 -0
- package/transports/util.js.map +1 -0
- package/transports/websocket.d.ts +95 -0
- package/transports/websocket.js +164 -0
- package/transports/websocket.js.map +1 -0
- package/util/censor/censor-list.d.ts +9 -0
- package/util/censor/censor-list.js +13 -0
- package/util/censor/censor-list.js.map +1 -0
- package/util/index.d.ts +13 -0
- package/util/index.js +38 -0
- package/util/index.js.map +1 -0
- package/util/logger.d.ts +49 -0
- package/util/logger.js +123 -0
- package/util/logger.js.map +1 -0
- package/util/request.d.ts +138 -0
- package/util/request.js +3 -0
- package/util/request.js.map +1 -0
- package/util/subscription-set/expiring-sorted-set.d.ts +21 -0
- package/util/subscription-set/expiring-sorted-set.js +36 -0
- package/util/subscription-set/expiring-sorted-set.js.map +1 -0
- package/util/subscription-set/redis-sorted-set.d.ts +9 -0
- package/util/subscription-set/redis-sorted-set.js +29 -0
- package/util/subscription-set/redis-sorted-set.js.map +1 -0
- package/util/subscription-set/subscription-set.d.ts +19 -0
- package/util/subscription-set/subscription-set.js +28 -0
- package/util/subscription-set/subscription-set.js.map +1 -0
- package/util/test-payload-loader.d.ts +26 -0
- package/util/test-payload-loader.js +85 -0
- package/util/test-payload-loader.js.map +1 -0
- package/validation/error.d.ts +48 -0
- package/validation/error.js +78 -0
- package/validation/error.js.map +1 -0
- package/validation/index.d.ts +5 -0
- package/validation/index.js +102 -0
- package/validation/index.js.map +1 -0
- package/validation/input-params.d.ts +14 -0
- package/validation/input-params.js +3 -0
- package/validation/input-params.js.map +1 -0
- package/validation/input-validator.d.ts +16 -0
- package/validation/input-validator.js +123 -0
- package/validation/input-validator.js.map +1 -0
- package/README.md +0 -102
package/README.md
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# EA Framework v3
|
|
2
|
-
|
|
3
|
-
External adapters and its core framework serve as middleware to facilitate connections between Chainlink Nodes and Data Providers (DP). Their main purpose is threefold:
|
|
4
|
-
|
|
5
|
-
- Abstract provider specific details, specifically:
|
|
6
|
-
- Transport (REST, WebSockets, RPC, SSE, etc.)
|
|
7
|
-
- Authentication (login flows, keys)
|
|
8
|
-
- Accept normalized request payloads and translate into the provider's interface (this also includes things like symbols/tickers)
|
|
9
|
-
- Parse provider responses into the desired data points (e.g. price from crypto endpoint)
|
|
10
|
-
- Make the overall system more efficient by using as few resources (e.g. API credits, networking traffic, CPU usage) as possible to fetch data, achieved by features like:
|
|
11
|
-
- Caching: since DPs update data at various times and a request to their API incurs a certain latency, EAs keep a cache of values to
|
|
12
|
-
- Provide responses to the Chainlink Nodes as quickly as possible
|
|
13
|
-
- Communicate with DPs only when necessary
|
|
14
|
-
- Cache Warming: in order to make as many of the requests to EAs be fulfilled from the cache, EAs fetch values from DPs asynchronously to keep the local ones fresh.
|
|
15
|
-
- Batching: the CL Node requests feeds individually, but it's common for DPs to provide batch endpoints to get many data points at once. With Batching, EAs keep track of incoming requests and consolidate them into one batched request.
|
|
16
|
-
- Rate limiting: the EA framework additionally checks request rates (frequency) to make sure they fall within acceptable limits (like quotas for the DP's API, or adjusting based on the NOP's API tier).
|
|
17
|
-
- Perform off chain computations (think aggregations, indexing, or any sort of data processing)
|
|
18
|
-
|
|
19
|
-
By providing a framework that gives users easy access to those features, we reduce the complexity required for Nodes to communicate with DPs since by using EAs there is only one standardized way to do so, while at the same time optimizing said communication so it's as resource efficient as possible. It also makes internal and external development easier and faster, by serving as a strict guideline to implement and add new providers.
|
|
20
|
-
|
|
21
|
-
## Qs
|
|
22
|
-
|
|
23
|
-
- Store entire response in cache?
|
|
24
|
-
- Check for valid result in adapter response?
|
|
25
|
-
|
|
26
|
-
## Env vars
|
|
27
|
-
|
|
28
|
-
These are all existing env vars, marked DONE if they have been ported to this version, or N/A if the new version disregards them altogether.
|
|
29
|
-
|
|
30
|
-
| Name | State | Comments |
|
|
31
|
-
| :----------------------------------------- | :---: | :----------------------------------------------------------- |
|
|
32
|
-
| ADAPTER_URL | - | |
|
|
33
|
-
| API_ENDPOINT | √ | |
|
|
34
|
-
| API_KEY | √ | |
|
|
35
|
-
| API_TIMEOUT | √ | Sets timeout for axios request |
|
|
36
|
-
| API_VERBOSE | √ | Does not return verbose on cache hit |
|
|
37
|
-
| BASE_URL | √ | |
|
|
38
|
-
| CACHE_ENABLED | N/A | Cache is integral to this fw, not including this for now |
|
|
39
|
-
| CACHE_KEY_IGNORED_PROPS | N/A | Not applicable after feed ID generation logic change |
|
|
40
|
-
| CACHE_KEY_GROUP | N/A | Grouping cache data is not needed in v3 |
|
|
41
|
-
| CACHE_MAX_AGE | √ | |
|
|
42
|
-
| CACHE_MAX_ITEMS | - | Should add when replacing obj in local impl with LRU package |
|
|
43
|
-
| CACHE_MIN_AGE | - | Used for rate limiting |
|
|
44
|
-
| CACHE_REDIS_CONNECTION_TIMEOUT | - | TODO: Redis |
|
|
45
|
-
| CACHE_REDIS_HOST | √ | |
|
|
46
|
-
| CACHE_REDIS_MAX_QUEUED_ITEMS | - | TODO: Redis |
|
|
47
|
-
| CACHE_REDIS_MAX_RECONNECT_COOLDOWN | - | TODO: Redis |
|
|
48
|
-
| CACHE_REDIS_PASSWORD | √ | |
|
|
49
|
-
| CACHE_REDIS_PATH | √ | |
|
|
50
|
-
| CACHE_REDIS_PORT | √ | |
|
|
51
|
-
| CACHE_REDIS_TIMEOUT | √ | |
|
|
52
|
-
| CACHE_REDIS_URL | - | TODO: Redis |
|
|
53
|
-
| CACHE_TYPE | √ | |
|
|
54
|
-
| CACHE_UPDATE_AGE_ON_GET | N/A | No longer used in EA currently, apparently |
|
|
55
|
-
| DATA_PROVIDER_URL | - | Legacy var same as ADAPTER_URL |
|
|
56
|
-
| DEBUG | √ | |
|
|
57
|
-
| DEFAULT_WS_HEARTBEAT_INTERVAL | N/A | |
|
|
58
|
-
| EA_HOST | √ | |
|
|
59
|
-
| EA_PORT | √ | |
|
|
60
|
-
| ERROR_CAPACITY | - | Error backoff is not currently in v3 |
|
|
61
|
-
| EXPERIMENTAL_METRICS_ENABLED | √ | Maintaining for backwards compatibility. Defaults to true |
|
|
62
|
-
| LOG_LEVEL | | |
|
|
63
|
-
| METRICS_ENABLED | √ | Defaults to true |
|
|
64
|
-
| METRICS_NAME | √ | |
|
|
65
|
-
| METRICS_PORT | √ | |
|
|
66
|
-
| METRICS_USE_BASE_URL | √ | |
|
|
67
|
-
| NODE_ENV | | |
|
|
68
|
-
| npm_package_version | | |
|
|
69
|
-
| RATE_LIMIT_API_TIER | √ | |
|
|
70
|
-
| RATE_LIMIT_CAPACITY | √ | Used for per minute rate limit if exists |
|
|
71
|
-
| RATE_LIMIT_CAPACITY_MINUTE | √ | Used for per minute rate limit if exists |
|
|
72
|
-
| RATE_LIMIT_CAPACITY_SECOND | √ | Used for per second rate limit if exists |
|
|
73
|
-
| RATE_LIMIT_ENABLED | N/A | Rate limit always enabled in v3 |
|
|
74
|
-
| RECORD | N/A | Not needed in v3 config for integration testing |
|
|
75
|
-
| REQUEST_COALESCING_ENABLED | √ | Overrides transport config option if set |
|
|
76
|
-
| REQUEST_COALESCING_ENTROPY_MAX | | |
|
|
77
|
-
| REQUEST_COALESCING_INTERVAL | | |
|
|
78
|
-
| REQUEST_COALESCING_INTERVAL_COEFFICIENT | | |
|
|
79
|
-
| REQUEST_COALESCING_INTERVAL_MAX | | |
|
|
80
|
-
| REQUEST_COALESCING_MAX_RETRIES | | |
|
|
81
|
-
| RETRY | - | Retry mechanism not yet part of v3 |
|
|
82
|
-
| SERVER_RATE_LIMIT_MAX | | |
|
|
83
|
-
| SERVER_SLOW_DOWN_AFTER_FACTOR | | |
|
|
84
|
-
| SERVER_SLOW_DOWN_DELAY_MS | | |
|
|
85
|
-
| TIMEOUT | X | API_TIMEOUT is used for same purpose |
|
|
86
|
-
| WARMUP_ENABLED | | |
|
|
87
|
-
| WARMUP_INTERVAL | | |
|
|
88
|
-
| WARMUP_SUBSCRIPTION_TTL | | |
|
|
89
|
-
| WARMUP_UNHEALTHY_THRESHOLD | | |
|
|
90
|
-
| WS_API_ENDPOINT | | |
|
|
91
|
-
| WS_API_KEY | | |
|
|
92
|
-
| WS_CONNECTION_KEY | N/A | Connection key is no longer used for WS in v3 |
|
|
93
|
-
| WS_CONNECTION_LIMIT | | |
|
|
94
|
-
| WS_CONNECTION_RETRY_DELAY | | |
|
|
95
|
-
| WS_CONNECTION_RETRY_LIMIT | | |
|
|
96
|
-
| WS_CONNECTION_TTL | | |
|
|
97
|
-
| WS_ENABLED | N/A | Shouldn't be part of this fw |
|
|
98
|
-
| WS_SUBSCRIPTION_LIMIT | | |
|
|
99
|
-
| WS_SUBSCRIPTION_PRIORITY_LIST | | |
|
|
100
|
-
| WS_SUBSCRIPTION_TTL | | |
|
|
101
|
-
| WS_SUBSCRIPTION_UNRESPONSIVE_TTL | | |
|
|
102
|
-
| WS_TIME_UNTIL_HANDLE_NEXT_MESSAGE_OVERRIDE | | |
|