Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

queryWasmRaw

Read a raw base64 value from a contract's storage at a specific key.

Signature

function queryWasmRaw(
  client: Client,
  parameters: {
    contract: Address
    key: Base64
    height?: number
  },
): Promise<WasmRawResponse>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
import { encodeBase64, encodeUtf8 } from "@left-curve/encoding"
import type { Address } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const contract: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
const key = encodeBase64(encodeUtf8("config"))
const value = await client.queryWasmRaw({ contract, key })

Parameters

contractAddress. The contract to read from.

keyBase64. The storage key, base64-encoded.

heightnumber, optional. Block height to query at. Default 0 (latest).

Returns

WasmRawResponseBase64 | undefined. Undefined when no value is stored at the key.

Notes

  • For typed queries, use queryWasmSmart instead — it serializes a JSON message and decodes the typed response.

See also