Implementation of the Polywrap client in JavaScript.
npm install @polywrap/client
# or
yarn add @polywrap/client
Create a new Polywrap client config builder instance, add the bundles you want to use, and then create a new Polywrap client instance with the config.
import {
PolywrapClient,
PolywrapClientConfigBuilder
} from "@polywrap/client";
const builder = new PolywrapClientConfigBuilder();
builder.addBundle("sys");
const client = new PolywrapClient(builder.build());
const result = await client.invoke<boolean>({
uri: "wrapscan.io/polywrap/[email protected]",
method: "info",
args: {
message: "Hello from hello world wrap!",
}
});
if (!result.ok) {
throw Error("Log message error: " + result.error);
}
For any questions or problems, please visit our Discord.