@gnolang/gno-js-client is a JavaScript/TypeScript client implementation for Gno chains. It is an extension of the
tm2-js-client, but with Gno-specific functionality.
- Provides the ability to interact with Gno Realms / Packages
- Easy interaction with VM-specific ABCI queries
To install @gnolang/gno-js-client, use your preferred package manager:
yarn add @gnolang/gno-js-clientnpm install @gnolang/gno-js-clientVM queries that the node refuses come back as a successful HTTP response with an error
inside it, so the provider raises them as typed errors. Branch on the class — or on
type, which holds the amino type URL — instead of matching on messages:
import { GnoJSONRPCProvider, NoRenderDeclError } from "@gnolang/gno-js-client";
const provider = await GnoJSONRPCProvider.create("https://rpc.gno.land");
try {
await provider.getRenderOutput("gno.land/p/demo/ufmt", "");
}
catch (err) {
if (err instanceof NoRenderDeclError) {
// the package is there, it just declares no Render function
}
}Every error extends GnoABCIError (itself a TM2Error) and keeps the node's raw log
under log.
For the sake of keeping the README short and sweet, you can find the documentation and usage examples for the package here.