> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theblockchainlibrary.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Code Examples

> Minimal developer examples connected to canonical topics.

# Code Examples

Minimal developer examples connected to canonical topics.

<CardGroup cols={2}>
  <Card title="Fetch a Block with JSON-RPC" href="/generated/code-examples/fetch-a-block-with-json-rpc" icon="code">Query a block by number through a JSON-RPC endpoint and inspect its basic fields.</Card>
  <Card title="Fetch a Transaction Receipt" href="/generated/code-examples/fetch-a-transaction-receipt" icon="code">Retrieve a transaction receipt and inspect status, gas usage, logs, and block placement.</Card>
  <Card title="Validate an Address Format" href="/generated/code-examples/validate-an-address-format" icon="code">Perform basic client-side validation before presenting a blockchain address to a user.</Card>
  <Card title="Read a Contract Method" href="/generated/code-examples/read-a-contract-method" icon="code">Call a read-only smart-contract method through an RPC provider.</Card>
  <Card title="Quote a Token Amount Safely" href="/generated/code-examples/quote-a-token-amount-safely" icon="code">Demonstrate integer-safe token amount handling and decimal conversion without floating-point assumptions.</Card>
  <Card title="Identify Network and Chain ID" href="/generated/code-examples/identify-network-and-chain-id" icon="code">Detect the connected chain ID before sending a transaction or directing a user to a Layer-2 network.</Card>
  <Card title="RPC Failover Pattern" href="/generated/code-examples/rpc-failover-pattern" icon="code">Try multiple RPC endpoints in sequence when the primary endpoint is unavailable.</Card>
  <Card title="Represent a Cross-Chain Message" href="/generated/code-examples/represent-a-cross-chain-message" icon="code">Model a typed cross-chain message envelope for application-level validation.</Card>
  <Card title="Estimate Fixed Transaction Budget" href="/generated/code-examples/estimate-fixed-transaction-budget" icon="code">Calculate a simple transaction budget when a network uses a predictable fixed transaction cost.</Card>
  <Card title="Agent Transaction Policy" href="/generated/code-examples/agent-transaction-policy" icon="code">Represent an allowlisted transaction policy for an autonomous software agent.</Card>
</CardGroup>
