WasmX

Example code snippets to query the wasmX module on chain

Using gRPC

import { ChainGrpcWasmXApi } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'

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

const moduleParams = await chainGrpcWasmXApi.fetchModuleParams()

console.log(moduleParams)

Fetch the wasmX module state

import { ChainGrpcWasmXApi } from '@injectivelabs/sdk-ts'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'

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

const moduleState = await chainGrpcWasmXApi.fetchModuleState()

console.log(moduleState)

Last updated