From 34f42e2a18c0627fcd4814dc4aa11cd30a8ba83b Mon Sep 17 00:00:00 2001 From: blorgon1 <102304575+blorgon1@users.noreply.github.com> Date: Tue, 4 Jul 2023 10:26:25 -0400 Subject: [PATCH] feat: accept other openapi configuration --- src/client/RosettaRestClientFactory.ts | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/client/RosettaRestClientFactory.ts b/src/client/RosettaRestClientFactory.ts index f06a725..62cdd67 100644 --- a/src/client/RosettaRestClientFactory.ts +++ b/src/client/RosettaRestClientFactory.ts @@ -18,10 +18,10 @@ import { BlockApi, CallApi, Configuration, + ConfigurationParameters, ConstructionApi, EventsApi, MempoolApi, - Middleware, NetworkApi, SearchApi, } from '../openapi'; @@ -29,21 +29,11 @@ import { /** * Params used to create a client factory. */ -interface RestClientFactoryParams { +interface RestClientFactoryParams extends Omit { /** * The rest url of the Rosetta service. E.g: http://localhost:8080/ */ url: string; - - /** - * Optional fetch api. - */ - fetchApi?: unknown; - - /** - * Middleware for pre/post request customizations. - */ - middleware?: Middleware[]; } /** @@ -64,9 +54,9 @@ export class RosettaRestClientFactory { const fetchApi = configs.fetchApi || (typeof window !== 'undefined' && window.fetch.bind(window)) || fetch; this.configuration = new Configuration({ + ...configs, basePath: configs.url, fetchApi: fetchApi, - middleware: configs.middleware || [], }); }