The programs in crates/kuatia/examples/ drive a real ledger over SQLite in
memory, so each one runs with no setup:
cargo run -p kuatia --example create_accounts
cargo run -p kuatia --example fund_and_trade
cargo run -p kuatia --example withdraw
cargo run -p kuatia --example inflight_hold
cargo run -p kuatia --example escrow
They are included below from source, so what the book shows is the code cargo
test compiles.
{{#include ../../crates/kuatia/examples/create_accounts.rs}}
A deposit into two accounts, then a cross-asset trade settled as one transfer: each asset conserves independently, so a swap needs no special verb.
{{#include ../../crates/kuatia/examples/fund_and_trade.rs}}
{{#include ../../crates/kuatia/examples/withdraw.rs}}
Authorize, confirm and void through a per-destination holding subaccount; see inflight holds.
{{#include ../../crates/kuatia/examples/inflight_hold.rs}}
Explained in Pending states.
{{#include ../../crates/kuatia/examples/escrow.rs}}