Skip to main content

Crate csv_adapter_aptos

Crate csv_adapter_aptos 

Source
Expand description

Aptos Adapter for CSV (Client-Side Validation)

This adapter implements the AnchorLayer trait for Aptos, using resources with key + delete as seals.

§Architecture

  • Seals: Move resources that can be deleted once (via move_from)
  • Anchors: Events emitted when seal resources are deleted
  • Finality: HotStuff consensus provides deterministic finality via 2f+1 certification

§Usage

use csv_adapter_aptos::{AptosAnchorLayer, AptosConfig, AptosNetwork};

// Create adapter with mock RPC for testing
let adapter = AptosAnchorLayer::with_mock().unwrap();

// Or with configuration
let config = AptosConfig::new(AptosNetwork::Devnet);
// let rpc = ...;
// let adapter = AptosAnchorLayer::from_config(config, rpc).unwrap();

§Production

Enable the rpc feature to use real Aptos RPC calls:

[dependencies]
csv-adapter-aptos = { version = "0.1", features = ["rpc"] }

Re-exports§

pub use adapter::AptosAnchorLayer;
pub use checkpoint::CheckpointVerifier;
pub use config::AptosConfig;
pub use config::AptosNetwork;
pub use config::CheckpointConfig;
pub use error::AptosError;
pub use proofs::CommitmentEventBuilder;
pub use proofs::EventProof;
pub use proofs::EventProofVerifier;
pub use proofs::StateProof;
pub use proofs::StateProofVerifier;
pub use proofs::TransactionProof;
pub use real_rpc::AptosRpcClient;
pub use rpc::MockAptosRpc;
pub use rpc::AptosBlockInfo;
pub use rpc::AptosEvent;
pub use rpc::AptosLedgerInfo;
pub use rpc::AptosResource;
pub use rpc::AptosRpc;
pub use rpc::AptosTransaction;
pub use seal::SealRecord;
pub use seal::SealRegistry;
pub use seal::SealStore;
pub use types::AptosAnchorRef;
pub use types::AptosFinalityProof;
pub use types::AptosInclusionProof;
pub use types::AptosSealRef;

Modules§

adapter
Aptos AnchorLayer implementation with production-grade features
checkpoint
Aptos checkpoint finality verifier
config
Aptos adapter configuration
error
Aptos adapter error types
merkle
Aptos Merkle Accumulator implementation
proofs
Proof verification for the Aptos adapter
real_rpc
Real Aptos RPC client using REST API
rpc
Aptos RPC trait and mock implementation
seal
Seal registry for the Aptos adapter
signatures
Aptos signature verification (Ed25519)
types
Aptos-specific type definitions