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

queryBlock

Fetch a block (by height or latest) with its transactions and cron outcomes.

Signature

function queryBlock(
  client: Client,
  parameters?: { height?: number },
): Promise<IndexedBlock>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const block = await client.queryBlock({ height: 12345 })
const latest = await client.queryBlock()

Parameters

heightnumber, optional. Block height. Omit for latest.

Returns

IndexedBlock{ blockHeight, createdAt, hash, appHash, cronsOutcomes, transactions }. Each IndexedTransaction carries hash, sender, type, messages, and gas accounting.

See also