@chainlink/external-adapter-framework 1.6.1 → 1.7.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/adapter/por.d.ts +19 -1
- package/adapter/por.js +6 -2
- package/adapter/por.js.map +1 -1
- package/package.json +1 -1
package/adapter/por.d.ts
CHANGED
|
@@ -17,24 +17,42 @@ export type PoRAddress = Record<string, unknown> & {
|
|
|
17
17
|
chainId: string;
|
|
18
18
|
address: string;
|
|
19
19
|
};
|
|
20
|
+
export type PoRTokenAddress = Record<string, unknown> & {
|
|
21
|
+
network: string;
|
|
22
|
+
contractAddress: string;
|
|
23
|
+
wallets: string[];
|
|
24
|
+
balanceOfSignature?: string;
|
|
25
|
+
decimalsSignature?: string;
|
|
26
|
+
};
|
|
20
27
|
export type PoRAddressResponse = {
|
|
21
28
|
Result: null;
|
|
22
29
|
Data: {
|
|
23
30
|
result: PoRAddress[];
|
|
24
31
|
};
|
|
25
32
|
};
|
|
33
|
+
export type PoRTokenAddressResponse = {
|
|
34
|
+
Result: null;
|
|
35
|
+
Data: {
|
|
36
|
+
result: PoRTokenAddress[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
26
39
|
/**
|
|
27
40
|
* Helper type structure that contains the Response type passed to the generic parameters of an AddressEndpoint
|
|
28
41
|
*/
|
|
29
42
|
export type PoRAddressEndpointGenerics = TransportGenerics & {
|
|
30
43
|
Response: PoRAddressResponse;
|
|
31
44
|
};
|
|
45
|
+
export type PoRTokenAddressEndpointGenerics = TransportGenerics & {
|
|
46
|
+
Response: PoRTokenAddressResponse;
|
|
47
|
+
};
|
|
32
48
|
/**
|
|
33
49
|
* A PoRAddressEndpoint is a specific type of AdapterEndpoint. Meant to comply with standard practices for
|
|
34
50
|
* Data Feeds, its response type must be `PoRAddressResponse`
|
|
35
51
|
*/
|
|
36
52
|
export declare class PoRAddressEndpoint<T extends PoRAddressEndpointGenerics> extends AdapterEndpoint<T> {
|
|
37
53
|
}
|
|
54
|
+
export declare class PoRTokenAddressEndpoint<T extends PoRTokenAddressEndpointGenerics> extends AdapterEndpoint<T> {
|
|
55
|
+
}
|
|
38
56
|
export type PoRBalance = Record<string, unknown> & {
|
|
39
57
|
balance: string;
|
|
40
58
|
};
|
|
@@ -122,7 +140,7 @@ export declare class PoRProviderEndpoint<T extends PoRProviderEndpointGenerics>
|
|
|
122
140
|
}
|
|
123
141
|
/**
|
|
124
142
|
* A PoRAdapter is a specific kind of Adapter that includes at least one PoRTotalBalanceEndpoint,
|
|
125
|
-
* PoRBalanceEndpoint, PoRAddressEndpoint or PoRProviderEndpoint.
|
|
143
|
+
* PoRBalanceEndpoint, PoRAddressEndpoint, PoRTokenAddressEndpoint or PoRProviderEndpoint.
|
|
126
144
|
*/
|
|
127
145
|
export declare class PoRAdapter<T extends SettingsDefinitionMap> extends Adapter<T> {
|
|
128
146
|
constructor(params: AdapterParams<T>);
|
package/adapter/por.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PoRAdapter = exports.PoRProviderEndpoint = exports.PoRTotalBalanceEndpoint = exports.PoRBalanceEndpoint = exports.porBalanceEndpointInputParametersDefinition = exports.PoRAddressEndpoint = void 0;
|
|
3
|
+
exports.PoRAdapter = exports.PoRProviderEndpoint = exports.PoRTotalBalanceEndpoint = exports.PoRBalanceEndpoint = exports.porBalanceEndpointInputParametersDefinition = exports.PoRTokenAddressEndpoint = exports.PoRAddressEndpoint = void 0;
|
|
4
4
|
const endpoint_1 = require("./endpoint");
|
|
5
5
|
const config_1 = require("../config");
|
|
6
6
|
const basic_1 = require("./basic");
|
|
@@ -12,6 +12,9 @@ const metrics_1 = require("../metrics");
|
|
|
12
12
|
class PoRAddressEndpoint extends endpoint_1.AdapterEndpoint {
|
|
13
13
|
}
|
|
14
14
|
exports.PoRAddressEndpoint = PoRAddressEndpoint;
|
|
15
|
+
class PoRTokenAddressEndpoint extends endpoint_1.AdapterEndpoint {
|
|
16
|
+
}
|
|
17
|
+
exports.PoRTokenAddressEndpoint = PoRTokenAddressEndpoint;
|
|
15
18
|
/**
|
|
16
19
|
* Base input parameter config that any [[PoRBalanceEndpoint]] must extend
|
|
17
20
|
*/
|
|
@@ -53,7 +56,7 @@ class PoRProviderEndpoint extends endpoint_1.AdapterEndpoint {
|
|
|
53
56
|
exports.PoRProviderEndpoint = PoRProviderEndpoint;
|
|
54
57
|
/**
|
|
55
58
|
* A PoRAdapter is a specific kind of Adapter that includes at least one PoRTotalBalanceEndpoint,
|
|
56
|
-
* PoRBalanceEndpoint, PoRAddressEndpoint or PoRProviderEndpoint.
|
|
59
|
+
* PoRBalanceEndpoint, PoRAddressEndpoint, PoRTokenAddressEndpoint or PoRProviderEndpoint.
|
|
57
60
|
*/
|
|
58
61
|
class PoRAdapter extends basic_1.Adapter {
|
|
59
62
|
constructor(params) {
|
|
@@ -82,6 +85,7 @@ class PoRAdapter extends basic_1.Adapter {
|
|
|
82
85
|
const porEndpoints = params.endpoints.filter((e) => e instanceof PoRBalanceEndpoint ||
|
|
83
86
|
e instanceof PoRTotalBalanceEndpoint ||
|
|
84
87
|
e instanceof PoRAddressEndpoint ||
|
|
88
|
+
e instanceof PoRTokenAddressEndpoint ||
|
|
85
89
|
e instanceof PoRProviderEndpoint);
|
|
86
90
|
if (!porEndpoints.length) {
|
|
87
91
|
throw new Error(`This PoRAdapter's list of endpoints does not contain a valid PoR endpoint`);
|
package/adapter/por.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"por.js","sourceRoot":"","sources":["../../../src/adapter/por.ts"],"names":[],"mappings":";;;AACA,yCAA4C;AAC5C,sCAAgE;AAChE,mCAAiC;AAIjC,wCAAoC;
|
|
1
|
+
{"version":3,"file":"por.js","sourceRoot":"","sources":["../../../src/adapter/por.ts"],"names":[],"mappings":";;;AACA,yCAA4C;AAC5C,sCAAgE;AAChE,mCAAiC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