### Manage Wallet Synchronization Source: https://context7.com/zingolabs/zingolib/llms.txt Demonstrates how to start, pause, resume, stop, and await wallet synchronization tasks. It also shows how to check the current sync mode using the LightClient. ```rust use zingolib::lightclient::LightClient; use pepper_sync::wallet::SyncMode; async fn sync_wallet(lightclient: &mut LightClient) { lightclient.sync().await.expect("Failed to start sync"); match lightclient.sync_mode() { SyncMode::Running => println!("Sync is running"), SyncMode::Paused => println!("Sync is paused"), SyncMode::NotRunning => println!("Sync not running"), SyncMode::Shutdown => println!("Sync shutting down"), } lightclient.pause_sync().expect("Failed to pause"); lightclient.resume_sync().expect("Failed to resume"); lightclient.stop_sync().expect("Failed to stop"); let result = lightclient.await_sync().await.expect("Sync failed"); println!("Sync complete: {}", result); } async fn sync_and_wait(lightclient: &mut LightClient) { let result = lightclient.sync_and_await().await.expect("Sync failed"); println!("Synced to height: {:?}", result); } ``` -------------------------------- ### Launch Lightwalletd for Regtest Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Starts the lightwalletd server for connecting to a regtest network. It uses insecure connections, specifies data and log directories, and points to the zcashd configuration. ```bash lightwalletd --no-tls-very-insecure --data-dir /home/user/tmp/lwd_regtest/data/ --log-file /home/user/tmp/lwd_regtest/logs/lwd.log --zcash-conf-path /home/user/tmp/zcashd_regtest/zcash.conf --config /home/user/tmp/lwd_regtest/lightwalletd.yml ``` -------------------------------- ### Launch Zcashd for Regtest Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Starts the zcashd daemon in regtest mode, configured to print to console and use a specified configuration and data directory. Debugging is enabled. ```bash zcashd --printtoconsole --conf=/home/user/tmp/zcashd_regtest/zcash.conf --datadir=/home/user/tmp/zcashd_regtest/data -debug=1 ``` -------------------------------- ### Build and Run zingo-cli Source: https://context7.com/zingolabs/zingolib/llms.txt Provides instructions and examples for building the zingo-cli application using Cargo and running it with various configurations, including different networks (mainnet, testnet, regtest), custom servers, and wallet restoration from a seed phrase. ```bash # Build the CLI cargo build --release -p zingo-cli # Run with default mainnet settings ./target/release/zingo-cli --data-dir /path/to/wallet # Run on testnet ./target/release/zingo-cli --chain testnet --data-dir /path/to/testnet-wallet # Run on regtest with custom server ./target/release/zingo-cli --chain regtest --server 127.0.0.1:9067 --data-dir /path/to/regtest-wallet # Restore from seed ./target/release/zingo-cli --data-dir /path/to/wallet --seed "24 word mnemonic phrase" --birthday 2000000 # Non-interactive mode with sync ./target/release/zingo-cli --data-dir /path/to/wallet --waitsync balance ``` -------------------------------- ### Initialize LightClient with Mnemonic Phrase Source: https://context7.com/zingolabs/zingolib/llms.txt Demonstrates how to create a full-access Zingo LightClient using a mnemonic phrase, birthday height, and custom sync settings. This setup requires a valid indexer URI and wallet directory path. ```rust use zingolib::config::{ChainType, ClientConfig, WalletConfig}; use zingolib::lightclient::LightClient; use zingolib::wallet::WalletSettings; use pepper_sync::config::{SyncConfig, TransparentAddressDiscovery, PerformanceLevel}; use std::num::NonZeroU32; let config = ClientConfig::builder() .set_chain_type(ChainType::Mainnet) .set_indexer_uri("https://zec.rocks:443".parse().unwrap()) .set_wallet_dir("/path/to/wallet/dir".into()) .set_wallet_name("zingo-wallet.dat".to_string()) .set_wallet_config(WalletConfig::MnemonicPhrase { mnemonic_phrase: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about".to_string(), no_of_accounts: NonZeroU32::try_from(1).unwrap(), birthday: 2000000, wallet_settings: WalletSettings { sync_config: SyncConfig { transparent_address_discovery: TransparentAddressDiscovery::minimal(), performance_level: PerformanceLevel::High, }, min_confirmations: NonZeroU32::try_from(3).unwrap(), }, }) .build(); let mut lightclient = LightClient::new(config, false).expect("Failed to create wallet"); ``` -------------------------------- ### Example Lightwalletd Configuration for Regtest Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md A sample lightwalletd.yml configuration file for running lightwalletd in regtest mode. It specifies the gRPC bind address, cache size, log file, log level, and the path to the zcashd configuration. ```yaml grpc-bind-addr: 127.0.0.1:9067 cache-size: 10 log-file: /home/user/tmp/lwd_regtest/logs/lwd.log log-level: 10 zcash-conf-path: /home/user/tmp/zcashd_regtest/zcash.conf ``` -------------------------------- ### Example Zcashd Configuration for Regtest Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md A sample zcash.conf file for running zcashd in regtest mode. It includes blockchain parameters, metadata storage settings, RPC server options, and experimental features. ```ini ### Blockchain Configuration regtest=1 nuparams=5ba81b19:1 # Overwinter nuparams=76b809bb:1 # Sapling nuparams=2bb40e60:1 # Blossom nuparams=f5b9230b:1 # Heartwood nuparams=c2d6d0b4:1 # Canopy nuparams=c8e71055:1 # NU6 nuparams=4dec4df0:1 # NU6_1 https://zips.z.cash/zip-0255#nu6.1deployment ### MetaData Storage and Retrieval # txindex: # https://zcash.readthedocs.io/en/latest/rtd_pages/zcash_conf_guide.html#miscellaneous-options txindex=1 # insightexplorer: # https://zcash.readthedocs.io/en/latest/rtd_pages/insight_explorer.html?highlight=insightexplorer#additional-getrawtransaction-fields insightexplorer=1 experimentalfeatures=1 lightwalletd=1 ### RPC Server Interface Options: # https://zcash.readthedocs.io/en/latest/rtd_pages/zcash_conf_guide.html#json-rpc-options rpcuser=xxxxxx rpcpassword=xxxxxx rpcport=8232 rpcallowip=127.0.0.1 # Buried config option to allow non-canonical RPC-PORT: # https://zcash.readthedocs.io/en/latest/rtd_pages/zcash_conf_guide.html#zcash-conf-guide listen=0 i-am-aware-zcashd-will-be-replaced-by-zebrad-and-zallet-in-2025=1 ### Zcashd Help provides documentation of the following: mineraddress=uregtest1zkuzfv5m3yhv2j4fmvq5rjurkxenxyq8r7h4daun2zkznrjaa8ra8asgdm8wwgwjvlwwrxx7347r8w0ee6dqyw4rufw4wg9djwcr6frzkezmdw6dud3wsm99eany5r8wgsctlxquu009nzd6hsme2tcsk0v3sgjvxa70er7h27z5epr67p5q767s2z5gt88paru56mxpm6pwz0cu35m minetolocalwallet=0 # This is set to false so that we can mine to a wallet, other than the zcashd wallet. ``` -------------------------------- ### Common zingo-cli Commands Reference Source: https://context7.com/zingolabs/zingolib/llms.txt A reference guide for common commands used in the zingo-cli, categorized into Wallet Management, Sync Operations, Addresses, Balances, and Transactions. This helps users interact with and manage their Zingo wallets effectively. ```text # Wallet Management help - List all commands recovery_info - Display seed phrase and birthday export_ufvk - Export unified full viewing key wallet_kind - Show wallet type and capabilities birthday - Show wallet birthday height quit - Exit CLI (saves wallet) # Sync Operations sync run - Start blockchain sync sync status - Show sync progress sync pause - Pause sync sync stop - Stop sync rescan - Clear and resync from birthday # Addresses addresses - List unified addresses t_addresses - List transparent addresses new_address oz - Create new unified address (o=Orchard, z=Sapling) new_taddress - Create new transparent address check_address - Check if address belongs to wallet # Balances balance - Show balance by pool spendable_balance - Show spendable balance max_send_value - Max sendable to address # Transactions send "memo" - Propose send send_all "memo" - Propose send all shielded funds shield - Propose shield transparent funds confirm - Confirm and broadcast proposal quicksend - Send without confirmation quickshield - Shield without confirmation ``` -------------------------------- ### GET /wallet/recovery Source: https://context7.com/zingolabs/zingolib/llms.txt Exports wallet recovery information including the seed phrase and birthday. ```APIDOC ## GET /wallet/recovery ### Description Retrieves the recovery information required to restore the wallet on another device. ### Method GET ### Endpoint Internal Rust API: `lightclient.wallet().read().await.recovery_info()` ### Response #### Success Response (200) - **seed_phrase** (string) - The 24-word mnemonic phrase. - **birthday** (integer) - The wallet birthday height. - **no_of_accounts** (integer) - Total number of accounts in the wallet. #### Response Example { "seed_phrase": "word1 word2 ...", "birthday": 2000000, "no_of_accounts": 1 } ``` -------------------------------- ### Configure Zcash Network Chain Types Source: https://context7.com/zingolabs/zingolib/llms.txt Examples of defining the target Zcash network (Mainnet, Testnet, or Regtest) for the Zingo library. Includes parsing from strings and custom activation heights for local development. ```rust use zingolib::config::ChainType; use zingo_common_components::protocol::ActivationHeights; let mainnet = ChainType::Mainnet; let testnet = ChainType::Testnet; let regtest = ChainType::Regtest(ActivationHeights::default()); let chain: ChainType = "mainnet".try_into().expect("Invalid chain type"); ``` -------------------------------- ### GET /financial-insights Source: https://context7.com/zingolabs/zingolib/llms.txt Retrieves aggregated spending data including total value, spend counts, and memo bytes per address. ```APIDOC ## GET /financial-insights ### Description Retrieves aggregated financial data from the light client, specifically total value sent, number of sends, and memo bytes per address. ### Method GET ### Endpoint Internal Rust API: `lightclient.do_total_value_to_address()`, `lightclient.do_total_spends_to_address()`, `lightclient.do_total_memobytes_to_address()` ### Response #### Success Response (200) - **data** (JSON) - Aggregated financial metrics mapped by address. #### Response Example { "zs1...": { "total_value": 100000, "send_count": 5, "memo_bytes": 128 } } ``` -------------------------------- ### Get Wallet Recovery Information with ZingoLib Source: https://context7.com/zingolabs/zingolib/llms.txt Retrieves and prints the seed phrase, birthday, and number of accounts for wallet recovery. If the wallet was loaded from a key instead of a mnemonic, it indicates that no mnemonic is available. ```rust use zingolib::lightclient::LightClient; async fn get_recovery_info(lightclient: &LightClient) { if let Some(recovery) = lightclient.wallet().read().await.recovery_info() { println!("Seed phrase: {}", recovery.seed_phrase); println!("Birthday: {}", recovery.birthday); println!("Accounts: {}", recovery.no_of_accounts); } else { println!("No mnemonic available (wallet loaded from key)"); } } ``` -------------------------------- ### Get Spendable Shielded Balance in Rust Source: https://context7.com/zingolabs/zingolib/llms.txt Calculates the total spendable balance for a specific account, accounting for confirmations and dust filtering. It specifically targets shielded pools. ```rust use zingolib::lightclient::LightClient; async fn get_spendable(lightclient: &LightClient) { let wallet = lightclient.wallet().read().await; let account_id = zip32::AccountId::ZERO; let spendable = wallet.shielded_spendable_balance(account_id, false).expect("Failed to get spendable balance"); println!("Spendable shielded balance: {} ZAT", spendable.into_u64()); } ``` -------------------------------- ### Get Financial Insights with ZingoLib Source: https://context7.com/zingolabs/zingolib/llms.txt Retrieves aggregated spending data by address for privacy-preserving financial insights. It fetches total value sent, number of sends, and memo bytes sent to each address. ```rust use zingolib::lightclient::LightClient; async fn get_insights(lightclient: &LightClient) { // Total value sent to each address let value_by_address = lightclient .do_total_value_to_address() .await .expect("Failed to get value totals"); println!("Value by address: {}", json::JsonValue::from(value_by_address).pretty(2)); // Number of sends to each address let sends_by_address = lightclient .do_total_spends_to_address() .await .expect("Failed to get send counts"); println!("Sends by address: {}", json::JsonValue::from(sends_by_address).pretty(2)); // Memo bytes sent to each address let memo_bytes = lightclient .do_total_memobytes_to_address() .await .expect("Failed to get memo totals"); println!("Memo bytes by address: {}", json::JsonValue::from(memo_bytes).pretty(2)); } ``` -------------------------------- ### Initialize View-Only Wallet with UFVK Source: https://context7.com/zingolabs/zingolib/llms.txt Shows how to initialize a LightClient in view-only mode using a Unified Full Viewing Key (UFVK). This is useful for monitoring balances and transactions without providing spending authority. ```rust use zingolib::config::{ChainType, ClientConfig, WalletConfig}; use zingolib::lightclient::LightClient; use zingolib::wallet::WalletSettings; let config = ClientConfig::builder() .set_chain_type(ChainType::Mainnet) .set_wallet_config(WalletConfig::Ufvk { ufvk: "uview1...".to_string(), birthday: 2000000, wallet_settings: WalletSettings::default(), }) .build(); let lightclient = LightClient::new(config, false).expect("Failed to create view-only wallet"); ``` -------------------------------- ### Generate Transparent Addresses Source: https://context7.com/zingolabs/zingolib/llms.txt Demonstrates the creation of standalone transparent addresses, including options for gap enforcement to maintain wallet address hygiene. ```rust use zingolib::lightclient::LightClient; async fn generate_transparent_address(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let (id, address) = lightclient .generate_transparent_address(account_id, true) .await .expect("Failed to generate transparent address"); println!("Transparent address: {:?}", address); } ``` -------------------------------- ### Perform Quick Send Transaction Source: https://context7.com/zingolabs/zingolib/llms.txt Executes a single-step transaction by combining proposal and confirmation. It requires a LightClient instance, a recipient address, and the amount in Zatoshis. ```rust use zingolib::lightclient::LightClient; use zingolib::data::receivers::{Receiver, transaction_request_from_receivers}; use zcash_protocol::value::Zatoshis; async fn quick_send(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let address = zingolib::utils::conversion::address_from_str( "u1recipient..." ).expect("Invalid address"); let amount = Zatoshis::from_u64(50_000).expect("Invalid amount"); let receivers = vec![Receiver::new(address, amount, None)]; let request = transaction_request_from_receivers(receivers) .expect("Failed to create request"); let txids = lightclient .quick_send(request, account_id, true) // true = resume sync .await .expect("Failed to send"); println!("Sent transaction: {}", txids.first()); } ``` -------------------------------- ### Create Wallet Backup with ZingoLib Source: https://context7.com/zingolabs/zingolib/llms.txt Creates a timestamped backup of the wallet file using the provided LightClient instance. This function ensures that the wallet data is safely backed up. ```rust use zingolib::lightclient::LightClient; fn backup_wallet(lightclient: &LightClient) { lightclient.backup_wallet_file().expect("Failed to create backup"); println!("Wallet backed up to: {}", lightclient.wallet_dir().unwrap().display()); } ``` -------------------------------- ### Generate Unified Addresses Source: https://context7.com/zingolabs/zingolib/llms.txt Shows how to create new unified addresses with specific receiver types, such as Orchard and Sapling, using the LightClient. ```rust use zingolib::lightclient::LightClient; use zingolib::wallet::keys::unified::ReceiverSelection; use zcash_protocol::consensus::Parameters; async fn generate_addresses(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let receivers = ReceiverSelection { orchard: true, sapling: true, }; let (id, address) = lightclient .generate_unified_address(receivers, account_id) .await .expect("Failed to generate address"); let encoded = address.encode(&lightclient.chain_type()); println!("New unified address: {}", encoded); } ``` -------------------------------- ### Query Account Balances in Rust Source: https://context7.com/zingolabs/zingolib/llms.txt Retrieves detailed balance breakdowns by pool (Orchard, Sapling, Transparent) and converts them to JSON. Requires a valid LightClient instance and an AccountId. ```rust use zingolib::lightclient::LightClient; use zingolib::wallet::balance::AccountBalance; async fn get_balance(lightclient: &LightClient) { let account_id = zip32::AccountId::ZERO; let balance: AccountBalance = lightclient.account_balance(account_id).await.expect("Failed to get balance"); if let Some(confirmed) = balance.confirmed_orchard_balance { println!("Confirmed Orchard: {} ZAT", confirmed.into_u64()); } let balance_json: json::JsonValue = balance.into(); println!("{}", balance_json.pretty(2)); } ``` -------------------------------- ### Run Zingo CLI on Mainnet Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Executes the Zingo CLI, connecting to the main Zcash network. It can use the default wallet location or a specified data directory. ```bash ./target/release/zingo-cli ./target/release/zingo-cli --chain mainnet ./target/release/zingo-cli --data-dir /path/to/mainnet-wallet ``` -------------------------------- ### Build Zingo CLI with Cargo Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Builds the zingo-cli binary in release mode using Cargo. The resulting binary is placed in the target/release directory. ```bash cargo build --release -p zingo-cli ``` -------------------------------- ### Run Zingo CLI on Testnet Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Executes the Zingo CLI, connecting to the Zcash test network. It supports specifying a custom data directory for wallet storage. ```bash ./target/release/zingo-cli --chain testnet ./target/release/zingo-cli --chain testnet --data-dir /path/to/testnet-wallet ``` -------------------------------- ### Propose and Send Transaction in Rust Source: https://context7.com/zingolabs/zingolib/llms.txt Implements the recommended two-step transaction flow: proposing a transaction to calculate fees and then confirming to broadcast. This ensures users are aware of costs before sending. ```rust use zingolib::lightclient::LightClient; use zingolib::data::receivers::{Receiver, transaction_request_from_receivers}; use zingolib::data::proposal; use zcash_protocol::value::Zatoshis; async fn propose_and_send(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let address = zingolib::utils::conversion::address_from_str("u1recipient...").expect("Invalid address"); let amount = Zatoshis::from_u64(100_000).expect("Invalid amount"); let request = transaction_request_from_receivers(vec![Receiver::new(address, amount, None)]).expect("Failed to create request"); let proposal = lightclient.propose_send(request, account_id).await.expect("Failed to create proposal"); let fee = proposal::total_fee(&proposal).expect("Failed to calculate fee"); println!("Transaction fee: {} ZAT", fee.into_u64()); let txids = lightclient.send_stored_proposal(true).await.expect("Failed to send transaction"); for txid in txids.iter() { println!("Broadcast transaction: {}", txid); } } ``` -------------------------------- ### Run Zingo CLI on Regtest Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Executes the Zingo CLI in regtest mode, connecting to a local Zcash network. Requires specifying the server address and a data directory. ```bash ./target/release/zingo-cli --chain regtest --server 127.0.0.1:9067 --data-dir ~/tmp/regtest_temp ``` -------------------------------- ### Retrieve Wallet Addresses in Rust Source: https://context7.com/zingolabs/zingolib/llms.txt Fetches unified and transparent addresses from the lightclient as JSON. This is useful for displaying wallet identity information. ```rust use zingolib::lightclient::LightClient; async fn list_addresses(lightclient: &LightClient) { let unified = lightclient.unified_addresses_json().await; println!("Unified addresses:\n{}", unified.pretty(2)); let transparent = lightclient.transparent_addresses_json().await; println!("Transparent addresses:\n{}", transparent.pretty(2)); } ``` -------------------------------- ### POST /wallet/persistence Source: https://context7.com/zingolabs/zingolib/llms.txt Manages wallet state persistence, including automatic save tasks and manual backups. ```APIDOC ## POST /wallet/persistence ### Description Handles wallet lifecycle operations including starting the background save task, waiting for pending saves, and creating manual backups. ### Method POST ### Endpoint Internal Rust API: `lightclient.save_task()`, `lightclient.backup_wallet_file()` ### Request Body - **action** (string) - Required - The persistence action to perform (e.g., 'start_save', 'backup', 'shutdown'). ### Response #### Success Response (200) - **status** (string) - Confirmation of the persistence operation. ``` -------------------------------- ### Generate Blocks with Zcash-cli Source: https://github.com/zingolabs/zingolib/blob/dev/zingo-cli/README.md Generates a single block on the regtest network using the zcash-cli command, targeting a specific zcashd configuration file. ```bash zcash-cli -conf=/home/user/tmp/zcashd_regtest/zcash.conf generate 1 ``` -------------------------------- ### Rescan Wallet Data Source: https://context7.com/zingolabs/zingolib/llms.txt Explains how to clear existing wallet data and perform a rescan from the birthday height, either asynchronously or by waiting for completion. ```rust use zingolib::lightclient::LightClient; async fn rescan_wallet(lightclient: &mut LightClient) { lightclient.rescan().await.expect("Failed to start rescan"); let result = lightclient.rescan_and_await().await.expect("Rescan failed"); println!("Rescan complete: {}", result); } ``` -------------------------------- ### Manage Wallet Persistence with ZingoLib Source: https://context7.com/zingolabs/zingolib/llms.txt Handles wallet state persistence by managing a save task, checking for save errors, waiting for saves to complete, and shutting down the save task. It also includes functionality for manual saving of the wallet to a file. ```rust use zingolib::lightclient::LightClient; async fn manage_wallet_persistence(lightclient: &mut LightClient) { // Start the save task (monitors wallet.save_required flag) lightclient.save_task().await; // Check for save errors if let Err(e) = lightclient.check_save_error().await { eprintln!("Save error: {}", e); } // Wait for pending save to complete lightclient.wait_for_save().await; // Shutdown save task cleanly lightclient.shutdown_save_task().await.expect("Failed to shutdown save"); // Manual save through wallet let wallet_bytes = lightclient.wallet().write().await.save() .expect("Serialization failed"); if let Some(bytes) = wallet_bytes { std::fs::write(lightclient.wallet_path(), bytes) .expect("Failed to write wallet file"); } } ``` -------------------------------- ### Shield Transparent Funds Source: https://context7.com/zingolabs/zingolib/llms.txt Provides methods to shield transparent funds to the Orchard pool, either via a multi-step proposal process or a single quick-shield function. ```rust use zingolib::lightclient::LightClient; async fn shield_transparent(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; // Propose shielding let proposal = lightclient .propose_shield(account_id) .await .expect("Failed to propose shield"); // Get shielding details from first step let step = proposal.steps().first(); let fee = step.balance().fee_required(); println!("Shield fee: {} ZAT", fee.into_u64()); // Confirm and broadcast let txids = lightclient .send_stored_proposal(true) .await .expect("Failed to shield"); println!("Shielded in transaction: {}", txids.first()); } // Quick shield without proposal confirmation async fn quick_shield(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let txids = lightclient .quick_shield(account_id) .await .expect("Failed to quick shield"); println!("Shielded funds: {}", txids.first()); } ``` -------------------------------- ### Light Client and Wallet Updates Source: https://github.com/zingolabs/zingolib/blob/dev/zingolib/CHANGELOG.md This section details changes and additions to the ZingoLib's light client and wallet functionalities, including error handling, synchronization, and transaction management. ```APIDOC ## Light Client Updates ### Description Updates to the light client module, including error handling and synchronization parameters. ### Method N/A (Informational) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## Wallet Updates ### Description Modifications to the wallet module, encompassing transaction management, error handling, and utility functions. ### Method N/A (Informational) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## Error Handling Updates ### Description Changes to various error types across the light client and wallet modules, including additions, removals, and modifications to existing error variants. ### Method N/A (Informational) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ## Removed Functionalities ### Description Details on functionalities that have been removed from the ZingoLib, including specific methods and modules. ### Method N/A (Informational) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ``` -------------------------------- ### Retrieve Transaction History and Value Transfers Source: https://context7.com/zingolabs/zingolib/llms.txt Functions to fetch transaction summaries and detailed value transfers from the wallet, including filtering capabilities for messages. ```rust use zingolib::lightclient::LightClient; async fn get_transactions(lightclient: &LightClient) { // Get transaction summaries (sorted by block height) let summaries = lightclient .transaction_summaries(false) // false = ascending order .await .expect("Failed to get transactions"); println!("{}", summaries); } async fn get_value_transfers(lightclient: &LightClient) { // Get all value transfers let transfers = lightclient .value_transfers(false) // false = ascending by value .await .expect("Failed to get value transfers"); println!("{}", transfers); // Filter messages by content let messages = lightclient .messages_containing(Some("hello")) .await .expect("Failed to filter messages"); println!("Messages containing 'hello': {}", json::JsonValue::from(messages).pretty(2)); } ``` -------------------------------- ### Send All Shielded Funds Source: https://context7.com/zingolabs/zingolib/llms.txt Sends the entire shielded balance to a specified address. It calculates the maximum sendable value, creates a proposal, and then confirms the transaction. ```rust use zingolib::lightclient::LightClient; use zcash_protocol::memo::MemoBytes; async fn send_all(lightclient: &mut LightClient) { let account_id = zip32::AccountId::ZERO; let address = zcash_address::ZcashAddress::try_from_encoded( "u1recipient..." ).expect("Invalid address"); let memo = Some(MemoBytes::from_bytes(b"Sending all funds").expect("Invalid memo")); let zennies_for_zingo = false; // Optional 0.01 ZEC developer donation // First get max sendable value let max_value = lightclient .max_send_value(address.clone(), zennies_for_zingo, account_id) .await .expect("Failed to calculate max value"); println!("Max sendable: {} ZAT", max_value.into_u64()); // Propose send all let proposal = lightclient .propose_send_all(address, zennies_for_zingo, memo, account_id) .await .expect("Failed to propose send all"); // Confirm and send let txids = lightclient .send_stored_proposal(true) .await .expect("Failed to send"); println!("Sent all funds in transaction: {}", txids.first()); } ``` -------------------------------- ### Poll Sync Status and Recovery Source: https://context7.com/zingolabs/zingolib/llms.txt Provides methods to check the progress of a background sync task without blocking the main thread and how to retrieve recovery recommendations upon failure. ```rust use zingolib::lightclient::LightClient; use zingolib::data::PollReport; fn check_sync_progress(lightclient: &mut LightClient) { match lightclient.poll_sync() { PollReport::NoHandle => println!("Sync task not started"), PollReport::NotReady => println!("Sync still in progress"), PollReport::Ready(Ok(result)) => println!("Sync complete: {}", result), PollReport::Ready(Err(e)) => println!("Sync failed: {}", e), } if let Some((action, description)) = lightclient.poll_sync_recovery() { println!("Recovery action: {:?}, Error: {}", action, description); } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.