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

getCode

Fetch a stored Wasm code blob by its hash.

Signature

function getCode(
  client: Client,
  parameters: {
    hash: Hex
    height?: number
  },
): Promise<CodeResponse>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const code = await client.getCode({ hash: "0xabc123..." })

Parameters

hashHex. SHA-256 hash of the Wasm bytecode.

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

Returns

CodeResponse — alias for Code. Contains the bytecode and status fields.

See also