@chainlink/external-adapter-framework 0.0.56 → 0.0.57

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/cache/metrics.js CHANGED
@@ -73,6 +73,9 @@ const baseLabels = [
73
73
  // labelNames: [...baseLabels, 'cache_hit'] as const,
74
74
  // buckets: [0.01, 0.1, 1, 10],
75
75
  // })
76
+ if (process.env['METRICS_ENABLED'] === 'false') {
77
+ client.register.clear();
78
+ }
76
79
  const cacheDataGetCount = new client.Counter({
77
80
  name: 'cache_data_get_count',
78
81
  help: 'A counter that increments every time a value is fetched from the cache',
package/config/index.d.ts CHANGED
@@ -191,7 +191,7 @@ export declare const BaseSettings: {
191
191
  readonly description: "Maximum amount of characters that the common part of the cache key or feed ID can have";
192
192
  readonly type: "number";
193
193
  readonly default: 300;
194
- readonly validate: (value?: number | undefined) => "MAX_COMMON_KEY_SIZE must be a number between 150 and 500" | undefined;
194
+ readonly validate: (value?: number) => "MAX_COMMON_KEY_SIZE must be a number between 150 and 500" | undefined;
195
195
  };
196
196
  readonly REST_TRANSPORT_MAX_RATE_LIMIT_RETRIES: {
197
197
  readonly description: "Maximum amount of times the Rest Transport will attempt to set up a request when blocked by the rate limiter";
@@ -6,7 +6,7 @@ export declare const customSettings: {
6
6
  readonly type: "number";
7
7
  readonly required: false;
8
8
  readonly default: 500;
9
- readonly validate: (value?: number | undefined) => string | undefined;
9
+ readonly validate: (value?: number) => string | undefined;
10
10
  };
11
11
  readonly PRIVATE_KEY: {
12
12
  readonly description: "";
@@ -22,6 +22,6 @@ interface ResultEntry {
22
22
  value: number;
23
23
  params: AdapterRequestParams;
24
24
  }
25
- export declare const buildGlobalRequestBody: (apiKey?: string | undefined) => AxiosRequestConfig<never>;
25
+ export declare const buildGlobalRequestBody: (apiKey?: string) => AxiosRequestConfig<never>;
26
26
  export declare const constructEntry: (res: AxiosResponse<ProviderResponseBody>, requestPayload: AdapterRequestParams, resultPath: 'total_market_cap' | 'market_cap_percentage') => ResultEntry | undefined;
27
27
  export {};
@@ -1,4 +1,4 @@
1
1
  /// <reference types="node" />
2
2
  import { Adapter } from '../../../../src/adapter';
3
3
  export declare const adapter: Adapter<import("../../../config").SettingsMap>;
4
- export declare const server: () => Promise<import("fastify").FastifyInstance<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> | undefined>;
4
+ export declare const server: () => Promise<import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> | undefined>;
package/index.d.ts CHANGED
@@ -8,4 +8,4 @@ import { Adapter, AdapterDependencies } from './adapter';
8
8
  * @param dependencies - an optional object with adapter dependencies to inject
9
9
  * @returns a Promise that resolves to the http.Server listening for connections
10
10
  */
11
- export declare const expose: (adapter: Adapter, dependencies?: Partial<AdapterDependencies> | undefined) => Promise<FastifyInstance | undefined>;
11
+ export declare const expose: (adapter: Adapter, dependencies?: Partial<AdapterDependencies>) => Promise<FastifyInstance | undefined>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainlink/external-adapter-framework",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "main": "dist/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -44,7 +44,7 @@ export interface BackgroundExecuteRateLimiter extends RateLimiter {
44
44
  * @param limits - the rate limit tier set for the adapter
45
45
  * @returns the most restrictive of the set options, in requests per second
46
46
  */
47
- export declare const consolidateTierLimits: (limits?: AdapterRateLimitTier | undefined) => number;
47
+ export declare const consolidateTierLimits: (limits?: AdapterRateLimitTier) => number;
48
48
  /**
49
49
  * Validates rate limiting tiers specified for the adapter, and returns the one to use.
50
50
  *
@@ -52,5 +52,5 @@ export declare const consolidateTierLimits: (limits?: AdapterRateLimitTier | und
52
52
  * @param tiers - the adapter config listing the different available API tiers
53
53
  * @returns the specified API tier, or a default one if none are specified
54
54
  */
55
- export declare const getRateLimitingTier: (config: AdapterConfig, tiers?: Record<string, AdapterRateLimitTier> | undefined) => AdapterRateLimitTier | undefined;
55
+ export declare const getRateLimitingTier: (config: AdapterConfig, tiers?: Record<string, AdapterRateLimitTier>) => AdapterRateLimitTier | undefined;
56
56
  export declare const buildRateLimitTiersFromConfig: (config: AdapterConfig) => AdapterRateLimitTier | undefined;
@@ -1,7 +1,7 @@
1
1
  import * as client from 'prom-client';
2
2
  import { AdapterContext } from '../adapter';
3
3
  import { SettingsMap } from '../config';
4
- export declare const dataProviderMetricsLabel: (providerStatusCode?: number | undefined, method?: string) => {
4
+ export declare const dataProviderMetricsLabel: (providerStatusCode?: number, method?: string) => {
5
5
  provider_status_code: number | undefined;
6
6
  method: string;
7
7
  };