@chainlink/external-adapter-framework 0.33.1 → 0.33.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/README.md
CHANGED
|
@@ -40,6 +40,8 @@ yarn # Install yarn dependencies
|
|
|
40
40
|
- [HTTP](./docs/components/transport-types/http-transport.md)
|
|
41
41
|
- [WebSocket](./docs/components/transport-types/websocket-transport.md)
|
|
42
42
|
- [SSE](./docs/components/transport-types/sse-transport.md)
|
|
43
|
+
- [Subscription](./docs/components/transport-types/subscription-transport.md)
|
|
44
|
+
- [Streaming](./docs/components/transport-types/streaming-transport.md)
|
|
43
45
|
- [Custom](./docs/components/transport-types/custom-transport.md)
|
|
44
46
|
- Guides
|
|
45
47
|
- [Porting a v2 EA to v3](./docs/guides/porting-a-v2-ea-to-v3.md)
|
|
@@ -5,8 +5,7 @@ import {
|
|
|
5
5
|
AdapterRequest,
|
|
6
6
|
AdapterResponse,
|
|
7
7
|
} from '@chainlink/external-adapter-framework/util'
|
|
8
|
-
import {
|
|
9
|
-
import { BaseEndpointTypes } from '../endpoint/<%= inputEndpointName %>'
|
|
8
|
+
import { BaseEndpointTypes, inputParameters } from '../endpoint/<%= inputEndpointName %>'
|
|
10
9
|
|
|
11
10
|
<% if (includeComments) { -%>
|
|
12
11
|
// CustomTransport extends base types from endpoint and adds additional, Provider-specific types (if needed).
|
|
@@ -23,7 +22,7 @@ export type CustomTransportTypes = BaseEndpointTypes & {
|
|
|
23
22
|
// different protocol, or you need custom functionality that built-in transports don't support. For example, custom, multistep authentication
|
|
24
23
|
// for requests, paginated requests, on-chain data retrieval using third party libraries, and so on.
|
|
25
24
|
<% } -%>
|
|
26
|
-
export class CustomTransport
|
|
25
|
+
export class CustomTransport implements Transport<CustomTransportTypes> {
|
|
27
26
|
<% if (includeComments) { -%>
|
|
28
27
|
// name of the transport, used for logging
|
|
29
28
|
<% } -%>
|
|
@@ -31,7 +30,7 @@ export class CustomTransport<T extends CustomTransportTypes> implements Transpor
|
|
|
31
30
|
<% if (includeComments) { -%>
|
|
32
31
|
// cache instance for caching responses from provider
|
|
33
32
|
<% } -%>
|
|
34
|
-
responseCache!: ResponseCache<
|
|
33
|
+
responseCache!: ResponseCache<CustomTransportTypes>
|
|
35
34
|
<% if (includeComments) { -%>
|
|
36
35
|
// instance of Requester to be used for data fetching. Use this instance to perform http calls
|
|
37
36
|
<% } -%>
|
|
@@ -41,7 +40,7 @@ export class CustomTransport<T extends CustomTransportTypes> implements Transpor
|
|
|
41
40
|
// REQUIRED. Transport will be automatically initialized by the framework using this method. It will be called with transport
|
|
42
41
|
// dependencies, adapter settings, endpoint name, and transport name as arguments. Use this method to initialize transport state
|
|
43
42
|
<% } -%>
|
|
44
|
-
async initialize(dependencies: TransportDependencies<
|
|
43
|
+
async initialize(dependencies: TransportDependencies<CustomTransportTypes>, _adapterSettings: CustomTransportTypes['Settings'], _endpointName: string, transportName: string): Promise<void> {
|
|
45
44
|
this.responseCache = dependencies.responseCache
|
|
46
45
|
this.requester = dependencies.requester
|
|
47
46
|
this.name = transportName
|
|
@@ -52,7 +51,7 @@ export class CustomTransport<T extends CustomTransportTypes> implements Transpor
|
|
|
52
51
|
// request, process it,save it in the cache and return to user.
|
|
53
52
|
<% } -%>
|
|
54
53
|
async foregroundExecute(
|
|
55
|
-
req: AdapterRequest<
|
|
54
|
+
req: AdapterRequest<typeof inputParameters.validated>
|
|
56
55
|
): Promise<AdapterResponse<CustomTransportTypes['Response']>> {
|
|
57
56
|
|
|
58
57
|
// Custom transport logic
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainlink/external-adapter-framework",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.2",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"ajv": "8.11.0",
|
|
8
|
-
"axios": "1.
|
|
8
|
+
"axios": "1.6.0",
|
|
9
9
|
"eventsource": "2.0.2",
|
|
10
10
|
"fastify": "4.13.0",
|
|
11
11
|
"ioredis": "5.2.3",
|