Skip to content

02QueryingChainWasmX

Ivan Angelkoski edited this page Jun 12, 2023 · 4 revisions

⚠️ The Docs have been moved to https://docs.ts.injective.network/querying/querying-chain/querying-chain-wasmx ⚠️

Example code snippets to query the wasmX module on chain

Using gRPC

  • Get parameters related to the wasmX module
import { ChainGrpcWasmXApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcWasmXApi = new ChainGrpcWasmXApi(endpoints.grpc);

const moduleParams = await chainGrpcWasmXApi.fetchModuleParams();

console.log(moduleParams);
  • Get the wasmX module state
import { ChainGrpcWasmXApi } from "@injectivelabs/sdk-ts";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.TestnetK8s);
const chainGrpcWasmXApi = new ChainGrpcWasmXApi(endpoints.grpc);

const moduleState = await chainGrpcWasmXApi.fetchModuleState();

console.log(moduleState);

⚠️ DOCUMENTATION ⚠️

Clone this wiki locally