Skip to main content

Crate pallas_traverse

Crate pallas_traverse 

Source
Expand description

A read-only, era-agnostic view over Cardano blocks and transactions.

Where pallas-primitives exposes the raw typed CBOR per era, this crate hides the era split behind MultiEra* enums so a single piece of indexing or analysis code can run against everything from Byron to Conway.

This is the read side of the ledger. For transaction construction see pallas-txbuilder; for ledger-rule validation see pallas-validate.

§Usage

use pallas_traverse::MultiEraBlock;

let block = MultiEraBlock::decode(&cbor_bytes)?;

println!("era={:?} slot={} hash={}", block.era(), block.slot(), block.hash());

for tx in block.txs() {
    for output in tx.outputs() {
        println!("  → {} lovelace", output.lovelace_amount());
    }
}

§Overview

§Feature flags

  • unstable — exposes APIs that are not yet considered stable and may change between minor releases.

§Usage as part of pallas

When depending on the umbrella pallas crate, this crate is re-exported as pallas::ledger::traverse.

Modules§

assets
Helpers for inspecting native and Plutus assets inside outputs and mints.
auxiliary
Helpers for transaction auxiliary data (metadata, native scripts, plutus scripts).
block
Block-level traversal: era detection, header access, transaction iteration.
cert
Helpers for inspecting on-chain certificates across eras.
era
Helpers for Cardano ledger eras and feature gating.
fees
Fee inspection and computation helpers.
governance
Helpers for Conway governance actions, votes, and proposals.
hashes
Stable hash computation for ledger entities (ComputeHash, OriginalHash).
header
Block-header traversal across era-specific header shapes.
input
Helpers for transaction inputs across eras.
meta
Helpers for transaction metadata.
output
Helpers for transaction outputs across eras.
probe
Era detection by probing CBOR shape. Lightweight inspection of block data without full CBOR decoding
redeemers
Helpers for Plutus redeemers.
signers
Helpers for required-signer hashes.
size
Size accounting helpers for transactions and blocks.
time
Slot / epoch / wall-clock conversion helpers.
tx
Transaction-level traversal: inputs, outputs, witnesses, etc.
update
Helpers for protocol-parameter update proposals.
value
Helpers for ada plus multi-asset values across eras.
wellknown
Well-known genesis hashes and parameter snapshots (will move to a genesis crate).
withdrawals
Helpers for reward-account withdrawals.
witnesses
Helpers for Plutus and native witnesses.

Structs§

OutputRef
Reference to a transaction output by transaction hash and output index.

Enums§

Era
The Cardano ledger eras in chronological order.
Error
Errors produced while traversing or decoding multi-era data.
Feature
Feature flags individual eras can be queried for.
MultiEraAsset
A single native or Plutus asset, normalized across eras.
MultiEraBlock
A block normalized across eras.
MultiEraCert
On-chain certificate normalized across eras.
MultiEraGovAction
Conway-era governance action carried by a MultiEraProposal.
MultiEraHeader
A block header normalized across eras, keeping access to its raw CBOR.
MultiEraInput
Transaction input normalized across eras.
MultiEraMeta
Transaction metadata normalized across eras.
MultiEraOutput
Transaction output normalized across eras.
MultiEraPolicyAssets
Multi-asset bundle for a single policy, normalized across eras.
MultiEraProposal
Conway-era governance proposal procedure.
MultiEraRedeemer
Plutus redeemer normalized across eras.
MultiEraSigners
Required-signer hashes normalized across eras.
MultiEraTx
A transaction normalized across eras.
MultiEraUpdate
Protocol-parameter update proposal normalized across eras.
MultiEraValue
Ada-plus-multi-asset value normalized across eras.
MultiEraWithdrawals
Reward-account withdrawals normalized across eras.

Traits§

ComputeHash
Recompute the hash of a value from its current in-memory shape.
OriginalHash
Recover the hash that the value had on the wire, preserving any encoding quirks.