Wasm

Example code snippets to query the wasm module on chain

Using gRPC

Fetch contacts' account balance Note that pagination parameters can be passed to obtain additional accounts.

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

const endpoints = getNetworkEndpoints(Network.Testnet)
const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc)

const contractAddress = 'inj...'
const pagination = {...} as PaginationOption

const contractAccountsBalance = await chainGrpcWasmApi.fetchContractAccountsBalance({
    contractAddress,
    pagination /* optional pagination options */
})

console.log(contractAccountsBalance)

Fetch contract history

Fetch the state of a smart contract

Fetch the raw state of a smart contract

Fetch the codes associated with a contract

Fetch info associated with a contract code

Fetch the contracts associated with a code

Last updated