-
Notifications
You must be signed in to change notification settings - Fork 195
02QueryingChainWasmX
Ivan Angelkoski edited this page Jun 12, 2023
·
4 revisions
Example code snippets to query the wasmX module on chain
- 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);
Powering the future of decentralized finance.