Remove params for client
This commit is contained in:
parent
d12ef9b3a0
commit
548797f60a
|
@ -11,9 +11,6 @@ type InstrumentedHttpProviderOptions = Required<Pick<HttpClientOptions, "url" |
|
||||||
* A simple HTTP client with exponential backoff retries and 429 handling.
|
* A simple HTTP client with exponential backoff retries and 429 handling.
|
||||||
*/
|
*/
|
||||||
export class InstrumentedHttpProvider {
|
export class InstrumentedHttpProvider {
|
||||||
private initialDelay: number = 1_000;
|
|
||||||
private maxDelay: number = 60_000;
|
|
||||||
private retries: number = 0;
|
|
||||||
private timeout: number = 5_000;
|
private timeout: number = 5_000;
|
||||||
private url: string;
|
private url: string;
|
||||||
health: ProviderHealthInstrumentation;
|
health: ProviderHealthInstrumentation;
|
||||||
|
@ -21,9 +18,6 @@ export class InstrumentedHttpProvider {
|
||||||
private logger: winston.Logger = winston.child({ module: "InstrumentedHttpProvider" });
|
private logger: winston.Logger = winston.child({ module: "InstrumentedHttpProvider" });
|
||||||
|
|
||||||
constructor(options: InstrumentedHttpProviderOptions) {
|
constructor(options: InstrumentedHttpProviderOptions) {
|
||||||
options?.initialDelay && (this.initialDelay = options.initialDelay);
|
|
||||||
options?.maxDelay && (this.maxDelay = options.maxDelay);
|
|
||||||
options?.retries && (this.retries = options.retries);
|
|
||||||
options?.timeout && (this.timeout = options.timeout);
|
options?.timeout && (this.timeout = options.timeout);
|
||||||
|
|
||||||
if (!options.url) throw new Error("URL is required");
|
if (!options.url) throw new Error("URL is required");
|
||||||
|
@ -78,8 +72,5 @@ export class InstrumentedHttpProvider {
|
||||||
export type HttpClientOptions = {
|
export type HttpClientOptions = {
|
||||||
chain?: string;
|
chain?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
initialDelay?: number;
|
|
||||||
maxDelay?: number;
|
|
||||||
retries?: number;
|
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue