The Polywrap Client accepts a
ClientConfig argument at construction.
While the default Client Config is sufficient for some use cases, you will likely want to customize it. The config you provide to the client will modify and add to the default configuration.
PolywrapClient can be configured to redirect URIs, use different plugins,
register interface implementations, set environmental variables, and customize URI resolution.
URI Redirects can be used to redirect queries from one URI to another. This redirection occurs in all queries to the URI, even in cases where one wrapper calls another during its execution.
To use a plugin wrapper, it has to be registered in the
Each item in the array of plugins contains the URI at which the plugin will be invoked and a
PluginPackage is a factory function the
PolywrapClient uses to create new
instances of the plugin.
Each plugin can have its own configuration.
Users can declare custom implementations for an interface by providing the interface URI and one or more URIs that resolve to implementations.
Users can provide wrapper-specific environmental variables by providing the wrapper URI and an object with strings as keys.
By default, the Client can resolve ENS, IPFS, and filesystem URIs. It is possible to use custom URI Resolvers as well. Documentation on how to do so is coming soon!