Skip to main content

Crate xrpl_mithril_tx

Crate xrpl_mithril_tx 

Source
Expand description

Transaction building, autofilling, and submission for the XRPL.

This crate provides:

§Examples

Full pipeline: build a payment, autofill network fields, sign, and submit.

use xrpl_mithril_tx::builder::PaymentBuilder;
use xrpl_mithril_tx::reliable::submit_transaction;
use xrpl_mithril_client::JsonRpcClient;
use xrpl_mithril_wallet::{Wallet, Algorithm};
use xrpl_mithril_types::{Amount, XrpAmount};

// Connect to testnet
let client = JsonRpcClient::new("https://s.altnet.rippletest.net:51234")?;

// Load a funded wallet
let wallet = Wallet::from_seed_encoded("sEdT7wHTCLzDG7Ue4312Kp4QA389Xmb")?;

// Build a payment
let unsigned = PaymentBuilder::new()
    .account(*wallet.account_id())
    .destination("rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe".parse()?)
    .amount(Amount::Xrp(XrpAmount::from_drops(1_000_000)?))
    .build()?;

// Autofill, sign, and submit in one call
let result = submit_transaction(&client, unsigned, &wallet).await?;
println!("Validated in ledger {}: {}", result.ledger_index, result.result_code);

Re-exports§

pub use error::TxError;
pub use reliable::sign_transaction;
pub use reliable::submit_transaction;
pub use submit::submit_and_wait;
pub use submit::TransactionResult;

Modules§

autofill
Transaction autofill – populates Fee, Sequence, and LastLedgerSequence by querying the network.
builder
Fluent transaction builders for common XRPL transaction types.
error
Error types for transaction building, autofill, and submission.
reliable
High-level convenience functions for the complete transaction lifecycle.
submit
Transaction submission and validation waiting.