Skip to main content

Crate mina_tx_type

Crate mina_tx_type 

Source
Expand description

Mina Protocol transaction types.

This crate provides no_std compatible transaction type definitions for the Mina Protocol. It is designed for use by external projects that need access to Mina transaction types without requiring the full ledger crate’s dependencies.

§Features

  • no_std compatible: Works in embedded and constrained environments such as hardware wallets and WASM runtimes.
  • Standalone: Minimal dependencies, focused purely on type definitions.
  • Documented: All types and fields include rustdoc documentation.

§Transaction Types

Currently supported transaction types:

§Currency Types

  • Amount: Currency amounts in nanomina
  • Fee: Transaction fees in nanomina
  • Signed: Signed quantities with separate magnitude and sign
  • Sign: Sign indicator (positive or negative)

§Example

use mina_tx_type::{Amount, Fee, Coinbase, CoinbaseFeeTransfer};
use mina_signer::CompressedPubKey;

// Create a coinbase transaction
let receiver = CompressedPubKey::empty();
let amount = Amount::new(720_000_000_000); // 720 MINA

let coinbase = Coinbase::new(receiver, amount);
assert!(!coinbase.has_fee_transfer());

Re-exports§

pub use coinbase::Coinbase;
pub use coinbase::CoinbaseFeeTransfer;
pub use currency::Amount;
pub use currency::Fee;
pub use currency::Magnitude;
pub use currency::Sign;
pub use currency::Signed;

Modules§

coinbase
Coinbase transaction types for Mina Protocol.
currency
Currency types for Mina Protocol transactions.