Fetch options plugin
Following release introduces new Warp plugin which allows to update fetch options for the endpoints and therefore allows custom http configuration.
In order to change fetch options one needs to create an implementation of WarpPlugin interface. process
method will receive following properties:
interface FetchRequest {
input: RequestInfo | URL;
init: Partial<RequestInit>;
}
...and it should return updated fetch options (by returning updated init object). An example of such implementation in src/tools/fetch-options-plugin.ts.
In order to use this plugin, it needs to be attached while creating Warp instance, e.g.:
const warp = WarpFactory.forMainnet().use(new FetchOptionsPlugin());
What's Changed
- feat: fetch options plugin by @asiaziola in #255
Full Changelog: v1.2.39...v1.2.40