starknet/starknet-network-facts

Starknet Network Facts

starknetdocs🏛️ Officialconfidence highhealth 100%
v1.0.0·by keep-starknet-strange·Updated 4/12/2026

When to Use

  • Reasoning about chain behavior assumptions in contract logic.
  • Validating time, fee, and transaction-version dependencies.

When NOT to Use

  • Contract implementation details unrelated to chain behavior.

Quick Start

  1. Identify assumptions in code about tx versions, fee tokens, and timing.
  2. Verify assumptions against current network behavior before release.
  3. Add tests for boundary behavior tied to block timing or tx metadata.

Core Focus

  • transaction version expectations
  • fee token and bounds assumptions
  • block-time-sensitive logic
  • sequencer and inclusion model implications

Workflow

References

starknet.js Example

import { RpcProvider } from "starknet";

const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC! });
const latest = await provider.getBlock("latest");

console.log({
  blockNumber: latest.block_number,
  l1GasPrice: latest.l1_gas_price,
  l2GasPrice: latest.l2_gas_price,
});

Error Codes and Recovery

CodeMeaningRecovery
SNF-001RPC/network fact unavailableRetry with a fallback RPC and compare outputs before acting.
SNF-002Conflicting tx-version assumptionRe-check references and update guards/tests for current tx version behavior.
SNF-003Fee-token assumption mismatchAdd explicit fee-token checks and fee-bound regression tests.