@polywrap/client-js v0.12.2
@polywrap/client-js
Installation
npm install --save @polywrap/client-jsUsage
Instantiate
Use the PolywrapClient constructor to instantiate the client with the default configuration bundle.
import { PolywrapClient } from "@polywrap/client-js";
const client = new PolywrapClient();Configure
Use the @polywrap/client-config-builder-js package to build a custom configuration for your project.
const config = new PolywrapClientConfigBuilder().addDefaults().build();
const client = new PolywrapClient(config);Invoke
Invoke a wrapper.
const result = await client.invoke({
uri: "wrapscan.io/polywrap/logging@1",
method: "info",
args: {
message: "Hello World!"
}
});
if (!result.ok) throw result.error;
const value = result.value;Reference
Configuration
Below you will find a reference of object definitions which can be used to configure the Polywrap client. Please note that the intended way of configuring the client is to use the PolywrapClientConfigBuilder, as explained above.
PolywrapClient
Constructor
/**
* Instantiate a PolywrapClient
*
* @param config - a client configuration
*/
constructor(config?: CoreClientConfig) 2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago