API Reference
Complete API reference for the Privacy Boost CLI library (Rust).Generated Documentation
Full API documentation can be generated usingcargo doc:
PrivacyBoostCLI
Main CLI SDK interface for Rust applications.Constructor
config- CLI configuration
Result<PrivacyBoostCLI, CliError>
Example:
Connection & Authentication Methods
authenticate
private_key- Hex-encoded private keykey_source- Optional key derivation source.Nonedefaults toWalletDerived. Options:KeySource::WalletDerived,KeySource::Mnemonic { phrase },KeySource::RawSeed { hex_seed }token_provider- Optional custom token provider for server-mediated auth flows
Result<AuthResult, CliError> - either Authenticated(LoginResult) or CredentialRequired(CredentialChallenge)
submit_credential
authenticate() returns CredentialRequired.
Returns: Result<LoginResult, CliError>
logout
clear_session
is_authenticated
State Accessors
Balance Methods
get_balance
get_all_balances
Vault Operations
deposit
token_address- Token contract addressamount- Amount in wei (as string)
withdraw
token_address- Token contract addressamount- Amount in wei (as string)recipient- Recipient Ethereum address
send
token_address- Token contract addressamount- Amount in wei (as string)recipient_privacy_address- Recipient’s 194-char privacy address
Transaction History
Session Persistence
export_session
import_session
Address Lookup
search_address
identifier- MPK or Ethereum address
Result<IdentityResult, CliError>
Utilities
Module Functions
CliConfig
CLI configuration struct.Constructor
Builder Methods
File Operations
Environment
NetworkPreset
Network preset enumeration.Methods
Local:"local","localhost","dev"OpSepolia:"op-sepolia","optimism-sepolia","opsepolia"
Types
KeySource
authenticate(). WalletDerived derives keys from a wallet signature, Mnemonic from a BIP-39 phrase, and RawSeed from a raw 32-byte hex seed.
AuthResult
LoginResult
TokenBalance
DepositResult
UnshieldResult
TransferResult
Transaction
StatusInfo
IdentityResult
ExportedSession
Re-exported fromprivacy_boost_core::sdk_state::ExportedSession:
CliError
Default Values
Complete Example
See Also
- Getting Started - Basic CLI usage
- Commands Reference - CLI commands
- Network Presets - Network configuration