Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions src/client/RosettaRestClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,22 @@ import {
BlockApi,
CallApi,
Configuration,
ConfigurationParameters,
ConstructionApi,
EventsApi,
MempoolApi,
Middleware,
NetworkApi,
SearchApi,
} from '../openapi';

/**
* Params used to create a client factory.
*/
interface RestClientFactoryParams {
interface RestClientFactoryParams extends Omit<ConfigurationParameters, 'basePath'> {
/**
* 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[];
}

/**
Expand All @@ -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 || [],
});
}

Expand Down