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
hash — Hex. SHA-256 hash of the Wasm bytecode.
height — number, optional. Block height to query at. Default 0 (latest).
Returns
CodeResponse — alias for Code. Contains the bytecode and status fields.