@chainlink/external-adapter-framework 0.7.1 → 0.8.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/basic.d.ts +6 -50
- package/adapter/basic.js +2 -165
- package/adapter/basic.js.map +1 -1
- package/adapter/endpoint.d.ts +6 -6
- package/adapter/endpoint.js +0 -1
- package/adapter/endpoint.js.map +1 -1
- package/adapter/price.d.ts +8 -38
- package/adapter/price.js +1 -43
- package/adapter/price.js.map +1 -1
- package/adapter/types.d.ts +14 -37
- package/background-executor.js +4 -19
- package/background-executor.js.map +1 -1
- package/cache/index.d.ts +16 -9
- package/cache/index.js +46 -4
- package/cache/index.js.map +1 -1
- package/config/index.d.ts +1 -19
- package/config/index.js +29 -54
- package/config/index.js.map +1 -1
- package/examples/bank-frick/accounts.d.ts +25 -17
- package/examples/bank-frick/accounts.js +13 -23
- package/examples/bank-frick/accounts.js.map +1 -1
- package/examples/bank-frick/index.d.ts +15 -1
- package/examples/bank-frick/index.js +1 -1
- package/examples/coingecko/src/crypto-utils.d.ts +4 -18
- package/examples/coingecko/src/crypto-utils.js +2 -1
- package/examples/coingecko/src/crypto-utils.js.map +1 -1
- package/examples/coingecko/src/endpoint/coins.d.ts +3 -20
- package/examples/coingecko/src/endpoint/coins.js +2 -2
- package/examples/coingecko/src/endpoint/coins.js.map +1 -1
- package/examples/coingecko/src/endpoint/crypto-marketcap.d.ts +2 -2
- package/examples/coingecko/src/endpoint/crypto-marketcap.js +2 -2
- package/examples/coingecko/src/endpoint/crypto-marketcap.js.map +1 -1
- package/examples/coingecko/src/endpoint/crypto-volume.d.ts +2 -2
- package/examples/coingecko/src/endpoint/crypto-volume.js +2 -2
- package/examples/coingecko/src/endpoint/crypto-volume.js.map +1 -1
- package/examples/coingecko/src/endpoint/crypto.d.ts +4 -2
- package/examples/coingecko/src/endpoint/crypto.js +2 -2
- package/examples/coingecko/src/endpoint/crypto.js.map +1 -1
- package/examples/coingecko/src/endpoint/dominance.d.ts +2 -2
- package/examples/coingecko/src/endpoint/dominance.js +2 -2
- package/examples/coingecko/src/endpoint/dominance.js.map +1 -1
- package/examples/coingecko/src/endpoint/global-marketcap.d.ts +2 -2
- package/examples/coingecko/src/endpoint/global-marketcap.js +2 -2
- package/examples/coingecko/src/endpoint/global-marketcap.js.map +1 -1
- package/examples/coingecko/src/global-utils.d.ts +3 -18
- package/examples/coingecko/src/global-utils.js.map +1 -1
- package/examples/coingecko/src/index.js +1 -1
- package/examples/coingecko-old/batch-warming.d.ts +7 -0
- package/examples/coingecko-old/batch-warming.js +54 -0
- package/examples/coingecko-old/batch-warming.js.map +1 -0
- package/examples/coingecko-old/index.d.ts +2 -0
- package/examples/coingecko-old/index.js +12 -0
- package/examples/coingecko-old/index.js.map +1 -0
- package/examples/coingecko-old/rest.d.ts +12 -0
- package/examples/coingecko-old/rest.js +55 -0
- package/examples/coingecko-old/rest.js.map +1 -0
- package/examples/cryptocompare/src/endpoints/crypto.d.ts +2 -14
- package/examples/cryptocompare/src/endpoints/crypto.js.map +1 -1
- package/examples/cryptocompare/src/index.js +1 -1
- package/examples/genesis/index.js +1 -1
- package/examples/genesis/sseStream.d.ts +2 -13
- package/examples/genesis/sseStream.js +1 -4
- package/examples/genesis/sseStream.js.map +1 -1
- package/examples/ncfx/config/index.d.ts +12 -0
- package/examples/ncfx/config/index.js +16 -0
- package/examples/ncfx/config/index.js.map +1 -0
- package/examples/ncfx/index.d.ts +13 -0
- package/examples/ncfx/index.js +12 -0
- package/examples/ncfx/index.js.map +1 -0
- package/examples/ncfx/websocket.d.ts +47 -0
- package/examples/ncfx/websocket.js +74 -0
- package/examples/ncfx/websocket.js.map +1 -0
- package/index.d.ts +0 -1
- package/index.js +6 -4
- package/index.js.map +1 -1
- package/metrics/index.d.ts +0 -2
- package/metrics/index.js +4 -5
- package/metrics/index.js.map +1 -1
- package/metrics/util.d.ts +5 -5
- package/metrics/util.js.map +1 -1
- package/package.json +9 -7
- package/rate-limiting/background/fixed-frequency.d.ts +3 -2
- package/rate-limiting/background/fixed-frequency.js.map +1 -1
- package/rate-limiting/index.d.ts +4 -4
- package/rate-limiting/index.js +1 -1
- package/rate-limiting/index.js.map +1 -1
- package/rate-limiting/request/simple-counting.d.ts +3 -2
- package/rate-limiting/request/simple-counting.js.map +1 -1
- package/transports/batch-warming.d.ts +15 -33
- package/transports/batch-warming.js +16 -43
- package/transports/batch-warming.js.map +1 -1
- package/transports/index.d.ts +31 -65
- package/transports/index.js +59 -2
- package/transports/index.js.map +1 -1
- package/transports/metrics.d.ts +2 -2
- package/transports/metrics.js +2 -2
- package/transports/metrics.js.map +1 -1
- package/transports/rest.d.ts +14 -31
- package/transports/rest.js +25 -17
- package/transports/rest.js.map +1 -1
- package/transports/sse.d.ts +20 -40
- package/transports/sse.js +8 -10
- package/transports/sse.js.map +1 -1
- package/transports/websocket.d.ts +25 -40
- package/transports/websocket.js +13 -10
- package/transports/websocket.js.map +1 -1
- package/util/logger.d.ts +0 -2
- package/util/logger.js +7 -4
- package/util/logger.js.map +1 -1
- package/util/request.d.ts +10 -46
- package/util/subscription-set/subscription-set.d.ts +1 -1
- package/util/subscription-set/subscription-set.js +1 -1
- package/util/subscription-set/subscription-set.js.map +1 -1
- package/util/test-payload-loader.d.ts +0 -1
- package/util/test-payload-loader.js +1 -2
- package/util/test-payload-loader.js.map +1 -1
- package/validation/error.d.ts +3 -1
- package/validation/error.js +4 -2
- package/validation/error.js.map +1 -1
- package/validation/index.js +17 -26
- package/validation/index.js.map +1 -1
- package/validation/input-params.d.ts +1 -0
- package/validation/input-params.js +28 -0
- package/validation/input-params.js.map +1 -1
- package/validation/input-validator.js +2 -1
- package/validation/input-validator.js.map +1 -1
- package/validation/override-functions.d.ts +3 -0
- package/validation/override-functions.js +41 -0
- package/validation/override-functions.js.map +1 -0
- package/README.md +0 -67
- package/transports/routing.d.ts +0 -21
- package/transports/routing.js +0 -50
- package/transports/routing.js.map +0 -1
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.accountsRestEndpoint = exports.BankFrickAccountsTransport = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const util_1 = require("./util");
|
|
9
|
+
const util_2 = require("../../util");
|
|
10
10
|
const error_1 = require("../../validation/error");
|
|
11
|
-
const
|
|
12
|
-
const logger = (0,
|
|
11
|
+
const adapter_1 = require("../../adapter");
|
|
12
|
+
const logger = (0, util_2.makeLogger)('BankFrickTransport');
|
|
13
13
|
// Note: this is a shallow pattern that only checks for a country code since IBANs in the sandbox are invalid
|
|
14
14
|
const ibanPattern = /^[A-Z]{2}[A-Z\d]{14,30}$/;
|
|
15
15
|
const inputParameters = {
|
|
@@ -47,6 +47,9 @@ class BankFrickAccountsTransport {
|
|
|
47
47
|
async initialize(dependencies) {
|
|
48
48
|
this.cache = dependencies.cache;
|
|
49
49
|
}
|
|
50
|
+
async hasBeenSetUp() {
|
|
51
|
+
return false; // Return false since we aren't coalescing requests
|
|
52
|
+
}
|
|
50
53
|
/**
|
|
51
54
|
* Creates an AxiosRequestConfig object for fetching a page of accounts from the Bank Frick API
|
|
52
55
|
*/
|
|
@@ -87,7 +90,7 @@ class BankFrickAccountsTransport {
|
|
|
87
90
|
else if (AuthErrors[response.status]) {
|
|
88
91
|
// We've encountered a known auth error, so try to refresh the token before making another request
|
|
89
92
|
logger.info('Auth error received from the Bank Frick API, attempting to refresh the token');
|
|
90
|
-
this.token = await (0,
|
|
93
|
+
this.token = await (0, util_1.generateJWT)(config, signingAlgorithm);
|
|
91
94
|
}
|
|
92
95
|
else if (retryNumber === config.REST_TRANSPORT_MAX_RATE_LIMIT_RETRIES) {
|
|
93
96
|
throw new error_1.AdapterError({
|
|
@@ -96,7 +99,7 @@ class BankFrickAccountsTransport {
|
|
|
96
99
|
});
|
|
97
100
|
}
|
|
98
101
|
logger.debug(`Sleeping for ${config.REST_TRANSPORT_MS_BETWEEN_RATE_LIMIT_RETRIES}ms before retrying`);
|
|
99
|
-
await (0,
|
|
102
|
+
await (0, util_2.sleep)(config.REST_TRANSPORT_MS_BETWEEN_RATE_LIMIT_RETRIES);
|
|
100
103
|
response = await axios_1.default.request(axiosRequest);
|
|
101
104
|
}
|
|
102
105
|
return response;
|
|
@@ -120,7 +123,7 @@ class BankFrickAccountsTransport {
|
|
|
120
123
|
* Fetches pages of data from the Bank Frick API, scans for accounts by IBAN, and returns the balance
|
|
121
124
|
* of all found accounts. Returns a 404 if any IBAN isn't found.
|
|
122
125
|
*/
|
|
123
|
-
async
|
|
126
|
+
async setup(req, config) {
|
|
124
127
|
const { ibanIDs, signingAlgorithm } = req.requestContext.data;
|
|
125
128
|
const { PAGE_SIZE = 500 } = config;
|
|
126
129
|
logger.debug(`Validating input: ${JSON.stringify(req.requestContext.data)}`);
|
|
@@ -134,7 +137,7 @@ class BankFrickAccountsTransport {
|
|
|
134
137
|
}
|
|
135
138
|
// Refresh the token if it isn't set
|
|
136
139
|
if (!this.token) {
|
|
137
|
-
this.token = await (0,
|
|
140
|
+
this.token = await (0, util_1.generateJWT)(config, signingAlgorithm);
|
|
138
141
|
}
|
|
139
142
|
let sum = 0;
|
|
140
143
|
let position = 0;
|
|
@@ -165,9 +168,7 @@ class BankFrickAccountsTransport {
|
|
|
165
168
|
if (keys.length > 0) {
|
|
166
169
|
logger.error(`Could not find all accounts, returning 404: ${keys.join(', ')}`);
|
|
167
170
|
const res = {
|
|
168
|
-
data:
|
|
169
|
-
result: 0,
|
|
170
|
-
},
|
|
171
|
+
data: 0,
|
|
171
172
|
statusCode: 404,
|
|
172
173
|
result: 0,
|
|
173
174
|
};
|
|
@@ -175,9 +176,7 @@ class BankFrickAccountsTransport {
|
|
|
175
176
|
}
|
|
176
177
|
logger.debug('Was able to find all accounts, returning balance across all accounts: ', sum);
|
|
177
178
|
const res = {
|
|
178
|
-
data:
|
|
179
|
-
result: sum,
|
|
180
|
-
},
|
|
179
|
+
data: sum,
|
|
181
180
|
statusCode: 200,
|
|
182
181
|
result: sum,
|
|
183
182
|
};
|
|
@@ -190,14 +189,5 @@ exports.accountsRestEndpoint = new adapter_1.AdapterEndpoint({
|
|
|
190
189
|
name: 'accounts',
|
|
191
190
|
transport: new BankFrickAccountsTransport(),
|
|
192
191
|
inputParameters,
|
|
193
|
-
cacheKeyGenerator: (data) => {
|
|
194
|
-
const sortedData = Object.keys(data)
|
|
195
|
-
.sort()
|
|
196
|
-
.reduce((a, i) => {
|
|
197
|
-
a[i] = data[i];
|
|
198
|
-
return a;
|
|
199
|
-
}, {});
|
|
200
|
-
return `accounts-${JSON.stringify(sortedData)}`;
|
|
201
|
-
},
|
|
202
192
|
});
|
|
203
193
|
//# sourceMappingURL=accounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../src/examples/bank-frick/accounts.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAgE;
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../src/examples/bank-frick/accounts.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAgE;AAUhE,iCAAoC;AACpC,qCAA+E;AAE/E,kDAAqD;AAGrD,2CAAoE;AAEpE,MAAM,MAAM,GAAG,IAAA,iBAAU,EAAC,oBAAoB,CAAC,CAAA;AAE/C,6GAA6G;AAC7G,MAAM,WAAW,GAAG,0BAA0B,CAAA;AAC9C,MAAM,eAAe,GAAoB;IACvC,OAAO,EAAE;QACP,WAAW,EAAE,yDAAyD;QACtE,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,OAAO;KACd;IACD,gBAAgB,EAAE;QAChB,WAAW,EACT,oHAAoH;QACtH,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,YAAY;QACrB,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAA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,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;YAC9E,MAAM,GAAG,GAAG;gBACV,IAAI,EAAE,CAAC;gBACP,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,CAAC;aACV,CAAA;YACD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,CAAA;SAC7E;QAED,MAAM,CAAC,KAAK,CAAC,wEAAwE,EAAE,GAAG,CAAC,CAAA;QAC3F,MAAM,GAAG,GAAG;YACV,IAAI,EAAE,GAAG;YACT,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,GAAG;SACZ,CAAA;QACD,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,CAAA;QAC5E,OAAO,GAAG,CAAA;IACZ,CAAC;CACF;AAvLD,gEAuLC;AAEY,QAAA,oBAAoB,GAAG,IAAI,yBAAe,CAAC;IACtD,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,IAAI,0BAA0B,EAAE;IAC3C,eAAe;CAChB,CAAC,CAAA"}
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
import { Adapter } from '../../adapter';
|
|
2
|
-
export declare const adapter: Adapter<
|
|
2
|
+
export declare const adapter: Adapter<{
|
|
3
|
+
readonly PAGE_SIZE: {
|
|
4
|
+
readonly description: "The number of accounts to fetch per call to /accounts. Must be >= 1 and <= 500.";
|
|
5
|
+
readonly type: "number";
|
|
6
|
+
readonly required: false;
|
|
7
|
+
readonly default: 500;
|
|
8
|
+
readonly validate: (value?: number | undefined) => string | undefined;
|
|
9
|
+
};
|
|
10
|
+
readonly PRIVATE_KEY: {
|
|
11
|
+
readonly description: "";
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly required: true;
|
|
14
|
+
readonly validate: (value: string) => string | undefined;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -5,7 +5,7 @@ const adapter_1 = require("../../adapter");
|
|
|
5
5
|
const accounts_1 = require("./accounts");
|
|
6
6
|
const config_1 = require("./config");
|
|
7
7
|
exports.adapter = new adapter_1.Adapter({
|
|
8
|
-
name: '
|
|
8
|
+
name: 'bank-frick',
|
|
9
9
|
defaultEndpoint: 'accounts',
|
|
10
10
|
endpoints: [accounts_1.accountsRestEndpoint],
|
|
11
11
|
customSettings: config_1.customSettings,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRequestConfig, HttpResponse } from '../../../transports';
|
|
2
|
-
import { AdapterConfig
|
|
2
|
+
import { AdapterConfig } from '../../../config';
|
|
3
3
|
export interface CryptoRequestParams {
|
|
4
4
|
coinid?: string;
|
|
5
5
|
base?: string;
|
|
@@ -15,7 +15,7 @@ export declare const cryptoInputParams: {
|
|
|
15
15
|
readonly aliases: readonly ["from", "coin"];
|
|
16
16
|
readonly type: "string";
|
|
17
17
|
readonly description: "The symbol of symbols of the currency to query";
|
|
18
|
-
readonly required:
|
|
18
|
+
readonly required: true;
|
|
19
19
|
};
|
|
20
20
|
readonly quote: {
|
|
21
21
|
readonly aliases: readonly ["to", "market"];
|
|
@@ -35,7 +35,7 @@ export interface ProviderResponseBody {
|
|
|
35
35
|
[quote: string]: number;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
interface
|
|
38
|
+
interface ResultEntryWithoutOverrides {
|
|
39
39
|
value: number;
|
|
40
40
|
params: {
|
|
41
41
|
quote: string;
|
|
@@ -43,20 +43,6 @@ interface ResultEntry {
|
|
|
43
43
|
coinid?: string;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
export declare type CryptoEndpointTypes = {
|
|
47
|
-
Request: {
|
|
48
|
-
Params: CryptoRequestParams;
|
|
49
|
-
};
|
|
50
|
-
Response: {
|
|
51
|
-
Data: ProviderResponseBody;
|
|
52
|
-
Result: number;
|
|
53
|
-
};
|
|
54
|
-
CustomSettings: SettingsMap;
|
|
55
|
-
Provider: {
|
|
56
|
-
RequestBody: ProviderRequestBody;
|
|
57
|
-
ResponseBody: ProviderResponseBody;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
46
|
export declare const buildBatchedRequestBody: (params: CryptoRequestParams[], config: AdapterConfig) => HttpRequestConfig<ProviderRequestBody>;
|
|
61
|
-
export declare const constructEntry: (res: HttpResponse<ProviderResponseBody>, requestPayload: CryptoRequestParams, resultPath: string) =>
|
|
47
|
+
export declare const constructEntry: (res: HttpResponse<ProviderResponseBody>, requestPayload: CryptoRequestParams, resultPath: string) => ResultEntryWithoutOverrides | undefined;
|
|
62
48
|
export {};
|
|
@@ -13,7 +13,7 @@ exports.cryptoInputParams = {
|
|
|
13
13
|
aliases: ['from', 'coin'],
|
|
14
14
|
type: 'string',
|
|
15
15
|
description: 'The symbol of symbols of the currency to query',
|
|
16
|
-
required:
|
|
16
|
+
required: true,
|
|
17
17
|
},
|
|
18
18
|
quote: {
|
|
19
19
|
aliases: ['to', 'market'],
|
|
@@ -54,6 +54,7 @@ const constructEntry = (res, requestPayload, resultPath) => {
|
|
|
54
54
|
else {
|
|
55
55
|
entry.params.base = requestPayload.base;
|
|
56
56
|
}
|
|
57
|
+
delete entry.params.overrides;
|
|
57
58
|
return entry;
|
|
58
59
|
};
|
|
59
60
|
exports.constructEntry = constructEntry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-utils.js","sourceRoot":"","sources":["../../../../../src/examples/coingecko/src/crypto-utils.ts"],"names":[],"mappings":";;;AACA,qCAAiE;AAEjE,iDAAiD;
|
|
1
|
+
{"version":3,"file":"crypto-utils.js","sourceRoot":"","sources":["../../../../../src/examples/coingecko/src/crypto-utils.ts"],"names":[],"mappings":";;;AACA,qCAAiE;AAEjE,iDAAiD;AAUpC,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE;QACN,WAAW,EAAE,8BAA8B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,MAAM,IAAK,cAAc,CAAC,IAAe,CAAA;IACvE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IACtE,IAAI,CAAC,YAAY,EAAE;QACjB,MAAM,CAAC,IAAI,CAAC,aAAa,cAAc,CAAC,KAAK,0BAA0B,MAAM,EAAE,CAAC,CAAA;QAChF,OAAM;KACP;IACD,MAAM,KAAK,GAAG;QACZ,MAAM,EAAE,cAAc;QACtB,KAAK,EAAE,YAAY;KACL,CAAA;IAChB,IAAI,cAAc,CAAC,MAAM,EAAE;QACzB,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAA;KAC5C;SAAM;QACL,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,cAAc,CAAC,IAAI,CAAA;KACxC;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,SAAS,CAAA;IAC7B,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAvBY,QAAA,cAAc,kBAuB1B"}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import { InputParameters } from '../../../../../src/validation';
|
|
2
1
|
import { AdapterEndpoint } from '../../../../adapter';
|
|
3
|
-
import {
|
|
4
|
-
import { EmptyObject } from '../../../../util';
|
|
2
|
+
import { InputParameters } from '../../../../../src/validation';
|
|
5
3
|
export declare const inputParameters: InputParameters;
|
|
6
|
-
interface CoinsResponse {
|
|
4
|
+
export interface CoinsResponse {
|
|
7
5
|
id: string;
|
|
8
6
|
symbol: string;
|
|
9
7
|
name: string;
|
|
10
8
|
}
|
|
11
|
-
declare
|
|
12
|
-
Request: {
|
|
13
|
-
Params: EmptyObject;
|
|
14
|
-
};
|
|
15
|
-
Response: {
|
|
16
|
-
Data: CoinsResponse;
|
|
17
|
-
Result: null;
|
|
18
|
-
};
|
|
19
|
-
CustomSettings: SettingsMap;
|
|
20
|
-
Provider: {
|
|
21
|
-
RequestBody: never;
|
|
22
|
-
ResponseBody: CoinsResponse;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare const endpoint: AdapterEndpoint<EndpointTypes>;
|
|
26
|
-
export {};
|
|
9
|
+
export declare const endpoint: AdapterEndpoint<import("../../../../util/request").AdapterRequestData, CoinsResponse[], import("../../../../config").SettingsMap>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.endpoint = exports.inputParameters = void 0;
|
|
4
|
-
const transports_1 = require("../../../../../src/transports");
|
|
5
4
|
const adapter_1 = require("../../../../adapter");
|
|
5
|
+
const transports_1 = require("../../../../../src/transports");
|
|
6
6
|
const config_1 = require("../config");
|
|
7
7
|
exports.inputParameters = {};
|
|
8
8
|
const restEndpointTransport = new transports_1.RestTransport({
|
|
@@ -20,7 +20,7 @@ const restEndpointTransport = new transports_1.RestTransport({
|
|
|
20
20
|
return {
|
|
21
21
|
data: res.data,
|
|
22
22
|
statusCode: 200,
|
|
23
|
-
result:
|
|
23
|
+
result: res.data,
|
|
24
24
|
};
|
|
25
25
|
},
|
|
26
26
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coins.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/coins.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"coins.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/coins.ts"],"names":[],"mappings":";;;AACA,iDAAqD;AACrD,8DAA8F;AAG9F,sCAAkE;AAErD,QAAA,eAAe,GAAoB,EAAE,CAAA;AAQlD,MAAM,qBAAqB,GAAG,IAAI,0BAAa,CAAC;IAC9C,cAAc,EAAE,CAAC,CAAiB,EAAE,MAAqB,EAAoC,EAAE;QAC7F,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,yBAAgB,CAAC,CAAC,CAAC,6BAAoB,CAAA;QACxE,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QAChF,OAAO;YACL,OAAO;YACP,GAAG,EAAE,aAAa;YAClB,MAAM,EAAE,KAAK;YACb,MAAM;SACP,CAAA;IACH,CAAC;IACD,aAAa,EAAE,CACb,GAAmB,EACnB,GAAkC,EACA,EAAE;QACpC,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,UAAU,EAAE,GAAG;YACf,MAAM,EAAE,GAAG,CAAC,IAAI;SACjB,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,iBAAiB,EAAE;YACjB,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,yBAAe,CAAC;IAC1C,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,qBAAqB;IAChC,eAAe,EAAf,uBAAe;CAChB,CAAC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AdapterEndpoint } from '../../../../adapter';
|
|
2
|
-
import {
|
|
3
|
-
export declare const endpoint: AdapterEndpoint<
|
|
2
|
+
import { CryptoRequestParams } from '../crypto-utils';
|
|
3
|
+
export declare const endpoint: AdapterEndpoint<CryptoRequestParams, unknown, import("../../../../config").SettingsMap>;
|
|
@@ -5,8 +5,8 @@ const adapter_1 = require("../../../../adapter");
|
|
|
5
5
|
const batch_warming_1 = require("../../../../transports/batch-warming");
|
|
6
6
|
const crypto_utils_1 = require("../crypto-utils");
|
|
7
7
|
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
8
|
-
prepareRequest: (params,
|
|
9
|
-
const requestBody = (0, crypto_utils_1.buildBatchedRequestBody)(params,
|
|
8
|
+
prepareRequest: (params, context) => {
|
|
9
|
+
const requestBody = (0, crypto_utils_1.buildBatchedRequestBody)(params, context.adapterConfig);
|
|
10
10
|
requestBody.params.include_market_cap = true;
|
|
11
11
|
return requestBody;
|
|
12
12
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-marketcap.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto-marketcap.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"crypto-marketcap.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto-marketcap.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,wEAA4E;AAE5E,kDAOwB;AAExB,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA6B,EAC7B,OAAuB,EACiB,EAAE;QAC1C,MAAM,WAAW,GAAG,IAAA,sCAAuB,EAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;QAC1E,WAAW,CAAC,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAA;QAC5C,OAAO,WAAW,CAAA;IACpB,CAAC;IACD,aAAa,EAAE,CACb,MAA6B,EAC7B,GAAuC,EACA,EAAE;QACzC,MAAM,OAAO,GAAG,EAA2C,CAAA;QAC3D,KAAK,MAAM,cAAc,IAAI,MAAM,EAAE;YACnC,MAAM,KAAK,GAAG,IAAA,6BAAc,EAC1B,GAAG,EACH,cAAc,EACd,GAAG,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CACnD,CAAA;YACD,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACpB;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,yBAAe,CAAC;IAC1C,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAE,gCAAiB;CACnC,CAAC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AdapterEndpoint } from '../../../../adapter';
|
|
2
|
-
import {
|
|
3
|
-
export declare const endpoint: AdapterEndpoint<
|
|
2
|
+
import { CryptoRequestParams } from '../crypto-utils';
|
|
3
|
+
export declare const endpoint: AdapterEndpoint<CryptoRequestParams, unknown, import("../../../../config").SettingsMap>;
|
|
@@ -5,8 +5,8 @@ const adapter_1 = require("../../../../adapter");
|
|
|
5
5
|
const batch_warming_1 = require("../../../../transports/batch-warming");
|
|
6
6
|
const crypto_utils_1 = require("../crypto-utils");
|
|
7
7
|
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
8
|
-
prepareRequest: (params,
|
|
9
|
-
const requestBody = (0, crypto_utils_1.buildBatchedRequestBody)(params,
|
|
8
|
+
prepareRequest: (params, context) => {
|
|
9
|
+
const requestBody = (0, crypto_utils_1.buildBatchedRequestBody)(params, context.adapterConfig);
|
|
10
10
|
requestBody.params.include_24hr_vol = true;
|
|
11
11
|
return requestBody;
|
|
12
12
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto-volume.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto-volume.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"crypto-volume.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto-volume.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,wEAA4E;AAE5E,kDAOwB;AAExB,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA6B,EAC7B,OAAuB,EACiB,EAAE;QAC1C,MAAM,WAAW,GAAG,IAAA,sCAAuB,EAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;QAC1E,WAAW,CAAC,MAAM,CAAC,gBAAgB,GAAG,IAAI,CAAA;QAC1C,OAAO,WAAW,CAAA;IACpB,CAAC;IACD,aAAa,EAAE,CACb,MAA6B,EAC7B,GAAuC,EACA,EAAE;QACzC,MAAM,OAAO,GAAG,EAA2C,CAAA;QAC3D,KAAK,MAAM,cAAc,IAAI,MAAM,EAAE;YACnC,MAAM,KAAK,GAAG,IAAA,6BAAc,EAC1B,GAAG,EACH,cAAc,EACd,GAAG,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,UAAU,CAChD,CAAA;YACD,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACpB;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,yBAAe,CAAC;IAC1C,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,CAAC,eAAe,CAAC;IAC1B,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAE,gCAAiB;CACnC,CAAC,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { PriceEndpoint } from '../../../../adapter';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare const endpoint: PriceEndpoint<{
|
|
3
|
+
base: string;
|
|
4
|
+
quote: string;
|
|
5
|
+
}, unknown, import("../../../../config").SettingsMap>;
|
|
@@ -5,8 +5,8 @@ const adapter_1 = require("../../../../adapter");
|
|
|
5
5
|
const batch_warming_1 = require("../../../../transports/batch-warming");
|
|
6
6
|
const crypto_utils_1 = require("../crypto-utils");
|
|
7
7
|
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
8
|
-
prepareRequest: (params,
|
|
9
|
-
return (0, crypto_utils_1.buildBatchedRequestBody)(params,
|
|
8
|
+
prepareRequest: (params, context) => {
|
|
9
|
+
return (0, crypto_utils_1.buildBatchedRequestBody)(params, context.adapterConfig);
|
|
10
10
|
},
|
|
11
11
|
parseResponse: (params, res) => {
|
|
12
12
|
const entries = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/crypto.ts"],"names":[],"mappings":";;;AACA,iDAAmE;AACnE,wEAA4E;AAE5E,kDAOwB;AAExB,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA6B,EAC7B,OAAuB,EACiB,EAAE;QAC1C,OAAO,IAAA,sCAAuB,EAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,CAAA;IAC/D,CAAC;IACD,aAAa,EAAE,CACb,MAA6B,EAC7B,GAAuC,EACA,EAAE;QACzC,MAAM,OAAO,GAAG,EAA2C,CAAA;QAC3D,KAAK,MAAM,cAAc,IAAI,MAAM,EAAE;YACnC,MAAM,KAAK,GAAG,IAAA,6BAAc,EAAC,GAAG,EAAE,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;YACrF,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACpB;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,uBAAa,CAAC;IACxC,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,CAAC,gBAAgB,EAAE,SAAS,EAAE,OAAO,CAAC;IAC/C,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAE,gCAAiB;CACnC,CAAC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AdapterEndpoint } from '../../../../adapter';
|
|
2
|
-
import {
|
|
3
|
-
export declare const endpoint: AdapterEndpoint<
|
|
2
|
+
import { AdapterRequestParams } from '../global-utils';
|
|
3
|
+
export declare const endpoint: AdapterEndpoint<AdapterRequestParams, unknown, import("../../../../config").SettingsMap>;
|
|
@@ -5,8 +5,8 @@ const adapter_1 = require("../../../../adapter");
|
|
|
5
5
|
const batch_warming_1 = require("../../../../transports/batch-warming");
|
|
6
6
|
const global_utils_1 = require("../global-utils");
|
|
7
7
|
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
8
|
-
prepareRequest: (params,
|
|
9
|
-
return (0, global_utils_1.buildGlobalRequestBody)(
|
|
8
|
+
prepareRequest: (params, context) => {
|
|
9
|
+
return (0, global_utils_1.buildGlobalRequestBody)(context.adapterConfig.API_KEY);
|
|
10
10
|
},
|
|
11
11
|
parseResponse: (params, res) => {
|
|
12
12
|
const entries = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dominance.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/dominance.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dominance.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/dominance.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,wEAA4E;AAE5E,kDAMwB;AAExB,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA8B,EAC9B,OAAuB,EACG,EAAE;QAC5B,OAAO,IAAA,qCAAsB,EAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9D,CAAC;IACD,aAAa,EAAE,CACb,MAA8B,EAC9B,GAAuC,EACC,EAAE;QAC1C,MAAM,OAAO,GAAG,EAA4C,CAAA;QAC5D,KAAK,MAAM,cAAc,IAAI,MAAM,EAAE;YACnC,MAAM,KAAK,GAAG,IAAA,6BAAc,EAAC,GAAG,EAAE,cAAc,EAAE,uBAAuB,CAAC,CAAA;YAC1E,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACpB;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,yBAAe,CAAC;IAC1C,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,uBAAuB,CAAC;IAClC,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAf,8BAAe;CAChB,CAAC,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AdapterEndpoint } from '../../../../adapter';
|
|
2
|
-
import {
|
|
3
|
-
export declare const endpoint: AdapterEndpoint<
|
|
2
|
+
import { AdapterRequestParams } from '../global-utils';
|
|
3
|
+
export declare const endpoint: AdapterEndpoint<AdapterRequestParams, unknown, import("../../../../config").SettingsMap>;
|
|
@@ -5,8 +5,8 @@ const adapter_1 = require("../../../../adapter");
|
|
|
5
5
|
const batch_warming_1 = require("../../../../transports/batch-warming");
|
|
6
6
|
const global_utils_1 = require("../global-utils");
|
|
7
7
|
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
8
|
-
prepareRequest: (params,
|
|
9
|
-
return (0, global_utils_1.buildGlobalRequestBody)(
|
|
8
|
+
prepareRequest: (params, context) => {
|
|
9
|
+
return (0, global_utils_1.buildGlobalRequestBody)(context.adapterConfig.API_KEY);
|
|
10
10
|
},
|
|
11
11
|
parseResponse: (params, res) => {
|
|
12
12
|
const entries = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-marketcap.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/global-marketcap.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"global-marketcap.js","sourceRoot":"","sources":["../../../../../../src/examples/coingecko/src/endpoint/global-marketcap.ts"],"names":[],"mappings":";;;AACA,iDAAqE;AACrE,wEAA4E;AAE5E,kDAMwB;AAExB,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA8B,EAC9B,OAAuB,EACG,EAAE;QAC5B,OAAO,IAAA,qCAAsB,EAAC,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IAC9D,CAAC;IACD,aAAa,EAAE,CACb,MAA8B,EAC9B,GAAuC,EACC,EAAE;QAC1C,MAAM,OAAO,GAAG,EAA4C,CAAA;QAC5D,KAAK,MAAM,cAAc,IAAI,MAAM,EAAE;YACnC,MAAM,KAAK,GAAG,IAAA,6BAAc,EAAC,GAAG,EAAE,cAAc,EAAE,kBAAkB,CAAC,CAAA;YACrE,IAAI,KAAK,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;aACpB;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,QAAQ,GAAG,IAAI,yBAAe,CAAC;IAC1C,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,SAAS,EAAE,sBAAsB;IACjC,eAAe,EAAf,8BAAe;CAChB,CAAC,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HttpRequestConfig, HttpResponse } from '../../../transports';
|
|
2
2
|
import { InputParameters } from '../../../validation';
|
|
3
|
-
import { SettingsMap } from '../../../config';
|
|
4
3
|
export declare const inputParameters: InputParameters;
|
|
5
|
-
export interface
|
|
4
|
+
export interface AdapterRequestParams {
|
|
6
5
|
market: string;
|
|
7
6
|
}
|
|
8
7
|
export interface ProviderResponseBody {
|
|
@@ -21,22 +20,8 @@ export interface ProviderResponseBody {
|
|
|
21
20
|
}
|
|
22
21
|
interface ResultEntry {
|
|
23
22
|
value: number;
|
|
24
|
-
params:
|
|
23
|
+
params: AdapterRequestParams;
|
|
25
24
|
}
|
|
26
|
-
export declare type GlobalEndpointTypes = {
|
|
27
|
-
Request: {
|
|
28
|
-
Params: GlobalRequestParams;
|
|
29
|
-
};
|
|
30
|
-
Response: {
|
|
31
|
-
Data: ProviderResponseBody;
|
|
32
|
-
Result: number;
|
|
33
|
-
};
|
|
34
|
-
CustomSettings: SettingsMap;
|
|
35
|
-
Provider: {
|
|
36
|
-
RequestBody: never;
|
|
37
|
-
ResponseBody: ProviderResponseBody;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
25
|
export declare const buildGlobalRequestBody: (apiKey?: string) => HttpRequestConfig<never>;
|
|
41
|
-
export declare const constructEntry: (res: HttpResponse<ProviderResponseBody>, requestPayload:
|
|
26
|
+
export declare const constructEntry: (res: HttpResponse<ProviderResponseBody>, requestPayload: AdapterRequestParams, resultPath: 'total_market_cap' | 'market_cap_percentage') => ResultEntry | undefined;
|
|
42
27
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../../../src/examples/coingecko/src/global-utils.ts"],"names":[],"mappings":";;;AACA,qCAAiE;AACjE,iDAAiD;
|
|
1
|
+
{"version":3,"file":"global-utils.js","sourceRoot":"","sources":["../../../../../src/examples/coingecko/src/global-utils.ts"],"names":[],"mappings":";;;AACA,qCAAiE;AACjE,iDAAiD;AAGjD,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,0BAA0B,CAAC,CAAA;AAExC,QAAA,eAAe,GAAoB;IAC9C,MAAM,EAAE;QACN,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;QACxB,WAAW,EAAE,iCAAiC;QAC9C,QAAQ,EAAE,IAAI;KACf;CACF,CAAA;AA0BM,MAAM,sBAAsB,GAAG,CAAC,MAAe,EAA4B,EAAE;IAClF,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,yBAAgB,CAAC,CAAC,CAAC,6BAAoB;QACzD,GAAG,EAAE,SAAS;QACd,MAAM,EAAE,KAAK;QACb,MAAM,EAAE;YACN,gBAAgB,EAAE,MAAM;SACzB;KACF,CAAA;AACH,CAAC,CAAA;AATY,QAAA,sBAAsB,0BASlC;AAEM,MAAM,cAAc,GAAG,CAC5B,GAAuC,EACvC,cAAoC,EACpC,UAAwD,EAC/B,EAAE;IAC3B,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;IAChC,IAAI,CAAC,UAAU,EAAE;QACf,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC7B,OAAM;KACP;IAED,MAAM,kBAAkB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAA;IACjD,IAAI,CAAC,kBAAkB,EAAE;QACvB,MAAM,CAAC,IAAI,CAAC,aAAa,UAAU,aAAa,CAAC,CAAA;QACjD,OAAM;KACP;IAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;IACtE,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,CAAC,IAAI,CAAC,aAAa,cAAc,CAAC,MAAM,aAAa,CAAC,CAAA;QAC5D,OAAM;KACP;IAED,OAAO;QACL,MAAM,EAAE,cAAc;QACtB,KAAK,EAAE,MAAM;KACd,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,cAAc,kBA2B1B"}
|
|
@@ -10,7 +10,7 @@ const overrides_json_1 = __importDefault(require("./config/overrides.json"));
|
|
|
10
10
|
const endpoint_1 = require("./endpoint");
|
|
11
11
|
exports.adapter = new adapter_1.PriceAdapter({
|
|
12
12
|
defaultEndpoint: 'crypto',
|
|
13
|
-
name: '
|
|
13
|
+
name: 'coingecko',
|
|
14
14
|
endpoints: [endpoint_1.crypto, endpoint_1.coins, endpoint_1.cryptoMarketcap, endpoint_1.cryptoVolume, endpoint_1.dominance, endpoint_1.globalMarketcap],
|
|
15
15
|
overrides: overrides_json_1.default['coingecko'],
|
|
16
16
|
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.batchEndpoint = void 0;
|
|
4
|
+
const adapter_1 = require("../../adapter");
|
|
5
|
+
const batch_warming_1 = require("../../transports/batch-warming");
|
|
6
|
+
const DEFAULT_URL = 'https://pro-api.coingecko.com/api/v3';
|
|
7
|
+
const inputParameters = {
|
|
8
|
+
coinid: {
|
|
9
|
+
description: 'The CoinGecko id or array of ids of the coin(s) to query (Note: because of current limitations to use a dummy base will need to be supplied)',
|
|
10
|
+
required: false,
|
|
11
|
+
},
|
|
12
|
+
base: {
|
|
13
|
+
aliases: ['from', 'coin'],
|
|
14
|
+
description: 'The symbol or array of symbols of the currency to query',
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
quote: {
|
|
18
|
+
aliases: ['to', 'market'],
|
|
19
|
+
description: 'The symbol of the currency to convert to',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
const batchEndpointTransport = new batch_warming_1.BatchWarmingTransport({
|
|
24
|
+
prepareRequest: (params, context) => {
|
|
25
|
+
return {
|
|
26
|
+
baseURL: DEFAULT_URL,
|
|
27
|
+
url: '/simple/price',
|
|
28
|
+
method: 'GET',
|
|
29
|
+
params: {
|
|
30
|
+
ids: [...new Set(params.map((p) => p.base))].join(','),
|
|
31
|
+
vs_currencies: [...new Set(params.map((p) => p.quote))].join(','),
|
|
32
|
+
x_cg_pro_api_key: context.adapterConfig.API_KEY,
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
parseResponse: (params, res) => {
|
|
37
|
+
const entries = [];
|
|
38
|
+
for (const [base, entry] of Object.entries(res.data)) {
|
|
39
|
+
for (const [quote, price] of Object.entries(entry)) {
|
|
40
|
+
entries.push({
|
|
41
|
+
params: { base, quote },
|
|
42
|
+
value: price,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return entries;
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
exports.batchEndpoint = new adapter_1.AdapterEndpoint({
|
|
50
|
+
name: 'batch',
|
|
51
|
+
transport: batchEndpointTransport,
|
|
52
|
+
inputParameters,
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=batch-warming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-warming.js","sourceRoot":"","sources":["../../../../src/examples/coingecko-old/batch-warming.ts"],"names":[],"mappings":";;;AACA,2CAA+D;AAC/D,kEAAsE;AAItE,MAAM,WAAW,GAAG,sCAAsC,CAAA;AAO1D,MAAM,eAAe,GAAoB;IACvC,MAAM,EAAE;QACN,WAAW,EACT,8IAA8I;QAChJ,QAAQ,EAAE,KAAK;KAChB;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,yDAAyD;QACtE,QAAQ,EAAE,IAAI;KACf;IACD,KAAK,EAAE;QACL,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC;QACzB,WAAW,EAAE,0CAA0C;QACvD,QAAQ,EAAE,IAAI;KACf;CACF,CAAA;AAYD,MAAM,sBAAsB,GAAG,IAAI,qCAAqB,CAAC;IACvD,cAAc,EAAE,CACd,MAA8B,EAC9B,OAAuB,EACkB,EAAE;QAC3C,OAAO;YACL,OAAO,EAAE,WAAW;YACpB,GAAG,EAAE,eAAe;YACpB,MAAM,EAAE,KAAK;YACb,MAAM,EAAE;gBACN,GAAG,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACtD,aAAa,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACjE,gBAAgB,EAAE,OAAO,CAAC,aAAa,CAAC,OAAO;aAChD;SACF,CAAA;IACH,CAAC;IACD,aAAa,EAAE,CACb,MAA8B,EAC9B,GAAwC,EACA,EAAE;QAC1C,MAAM,OAAO,GAAG,EAA4C,CAAA;QAC5D,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACpD,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;gBAClD,OAAO,CAAC,IAAI,CAAC;oBACX,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;oBACvB,KAAK,EAAE,KAAK;iBACb,CAAC,CAAA;aACH;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF,CAAC,CAAA;AAEW,QAAA,aAAa,GAAG,IAAI,yBAAe,CAAC;IAC/C,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,sBAAsB;IACjC,eAAe;CAChB,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.adapter = void 0;
|
|
4
|
+
const adapter_1 = require("../../adapter");
|
|
5
|
+
const batch_warming_1 = require("./batch-warming");
|
|
6
|
+
const rest_1 = require("./rest");
|
|
7
|
+
exports.adapter = new adapter_1.Adapter({
|
|
8
|
+
name: 'coingecko',
|
|
9
|
+
defaultEndpoint: 'batch',
|
|
10
|
+
endpoints: [rest_1.restEndpoint, batch_warming_1.batchEndpoint],
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/examples/coingecko-old/index.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,mDAA+C;AAC/C,iCAAqC;AAExB,QAAA,OAAO,GAAG,IAAI,iBAAO,CAAC;IACjC,IAAI,EAAE,WAAW;IACjB,eAAe,EAAE,OAAO;IACxB,SAAS,EAAE,CAAC,mBAAY,EAAE,6BAAa,CAAC;CACzC,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AdapterEndpoint } from '../../adapter';
|
|
2
|
+
interface AdapterRequestParams {
|
|
3
|
+
base: string;
|
|
4
|
+
quote: string;
|
|
5
|
+
}
|
|
6
|
+
interface ProviderResponseBody {
|
|
7
|
+
[base: string]: {
|
|
8
|
+
[quote: string]: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare const restEndpoint: AdapterEndpoint<AdapterRequestParams, ProviderResponseBody, import("../../config").SettingsMap>;
|
|
12
|
+
export {};
|