Types

Core types used by the Fairseq SDK.

Fairseq types are intentionally small so proofs remain auditable. These are the most important types you will use when integrating the SDK.

Transaction

RUST
pub struct Transaction {
    pub hash: String,
    pub timestamp: u64, // Nanoseconds since epoch
}

Requirements:

  • hash must uniquely identify the transaction or order intent.
  • timestamp must be monotonic and deterministic for the batch.

Proof

RUST
pub struct Proof {
    pub id: String,
    pub proof_hash: String,
    pub transactions: Vec<Transaction>,
    pub lighthouse_epoch_start: u64,
    pub lighthouse_epoch_end: u64,
    pub lighthouse_anchor: String,
}

Use proof_hash to publish a commitment on-chain or in batch metadata.

VerificationResult

RUST
pub struct VerificationResult {
    pub valid: bool,
    pub lighthouse_anchor: String,
    pub timestamp_range: (u64, u64),
}

OrderingRule

RUST
pub enum OrderingRule {
    Fifo,
    PriorityFee,
    Custom(Box<dyn Fn(&Transaction, &Transaction) -> Ordering>),
}

Related docs

Was this page helpful? /
Back to docs