Skip to main content

Wallet

Trait Wallet 

Source
pub trait Wallet: Send + Sync {
Show 73 associated items type Error: Error + Send + Sync + 'static; type Amount: Clone + Send + Sync; type MintUrl: Clone + Send + Sync; type CurrencyUnit: Clone + Send + Sync; type MintInfo: Clone + Send + Sync; type KeySetInfo: Clone + Send + Sync; type MintQuote: Clone + Send + Sync; type MeltQuote: Clone + Send + Sync; type PaymentMethod: Clone + Send + Sync; type MeltOptions: Clone + Send + Sync; type OperationId: Clone + Send + Sync; type PreparedSend<'a>: Send + Sync where Self: 'a; type PreparedMelt<'a>: Send + Sync where Self: 'a; type Subscription: Send + Sync; type SubscribeParams: Clone + Send + Sync; // Required methods fn mint_url(&self) -> Self::MintUrl; fn unit(&self) -> Self::CurrencyUnit; fn total_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn total_pending_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn total_reserved_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fetch_mint_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::MintInfo>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn load_mint_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::MintInfo, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn refresh_keysets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_active_keyset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::KeySetInfo, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn load_keyset_keys<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<Keys, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_mint_keysets<'life0, 'async_trait>( &'life0 self, filter: KeysetFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn fetch_active_keyset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::KeySetInfo, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_keyset_fees_and_amounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<KeysetFeeAndAmounts, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_keyset_count_fee<'life0, 'life1, 'async_trait>( &'life0 self, keyset_id: &'life1 Id, count: u64, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_keyset_fees_and_amounts_by_id<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<FeeAndAmounts, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mint_quote<'life0, 'async_trait>( &'life0 self, method: Self::PaymentMethod, amount: Option<Self::Amount>, description: Option<String>, extra: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn melt_quote<'life0, 'async_trait>( &'life0 self, method: Self::PaymentMethod, request: String, options: Option<Self::MeltOptions>, extra: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_transactions<'life0, 'async_trait>( &'life0 self, direction: Option<TransactionDirection>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Transaction>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_proofs_for_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn revert_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_all_pending_proofs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_proofs_spent<'life0, 'async_trait>( &'life0 self, proofs: Proofs, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProofState>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_keyset_fees_by_id<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<u64, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn calculate_fee<'life0, 'async_trait>( &'life0 self, proof_count: u64, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn receive<'life0, 'life1, 'async_trait>( &'life0 self, encoded_token: &'life1 str, options: ReceiveOptions, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn receive_proofs<'life0, 'async_trait>( &'life0 self, proofs: Proofs, options: ReceiveOptions, memo: Option<String>, token: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn prepare_send<'life0, 'async_trait>( &'life0 self, amount: Self::Amount, options: SendOptions, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedSend<'_>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_pending_sends<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::OperationId>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn revoke_send<'life0, 'async_trait>( &'life0 self, operation_id: Self::OperationId, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn check_send_status<'life0, 'async_trait>( &'life0 self, operation_id: Self::OperationId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mint<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn check_mint_quote_status<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn fetch_mint_quote<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, payment_method: Option<Self::PaymentMethod>, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn prepare_melt<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn prepare_melt_proofs<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, proofs: Proofs, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn swap<'life0, 'async_trait>( &'life0 self, amount: Option<Self::Amount>, split_target: SplitTarget, input_proofs: Proofs, spending_conditions: Option<SpendingConditions>, include_fees: bool, use_p2bk: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<Proofs>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_cat<'life0, 'async_trait>( &'life0 self, cat: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_refresh_token<'life0, 'async_trait>( &'life0 self, refresh_token: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn refresh_access_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mint_blind_auth<'life0, 'async_trait>( &'life0 self, amount: Self::Amount, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_unspent_auth_proofs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthProof>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn restore<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Restored, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn verify_token_dleq<'life0, 'life1, 'async_trait>( &'life0 self, token_str: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn pay_request<'life0, 'async_trait>( &'life0 self, request: PaymentRequest, custom_amount: Option<Self::Amount>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn subscribe_mint_quote_state<'life0, 'async_trait>( &'life0 self, quote_ids: Vec<String>, method: Self::PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<Self::Subscription, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn set_metadata_cache_ttl(&self, ttl_secs: Option<u64>); fn subscribe<'life0, 'async_trait>( &'life0 self, params: Self::SubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<Self::Subscription, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn melt_lightning_address_quote<'life0, 'life1, 'async_trait>( &'life0 self, lightning_address: &'life1 str, amount_msat: Self::Amount, ) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_proofs_by_states<'life0, 'async_trait>( &'life0 self, states: Vec<State>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn generate_public_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PublicKey, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_public_key<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 PublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_public_keys<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_public_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_signing_key<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 PublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<SecretKey>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn load_mint_keysets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn check_mint_quote<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn mint_unified<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

Unified wallet trait providing a common interface for wallet operations.

This trait abstracts over different wallet implementations (CDK wallet, FFI wrappers, etc.) and provides a consistent interface for balance queries, minting, melting, keyset management, and other core wallet operations.

All domain types are associated types so each implementation can use its own type system (e.g. FFI-friendly records vs native Rust types).

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

Error type

Source

type Amount: Clone + Send + Sync

Amount type (e.g. cdk_common::Amount or FFI Amount)

Source

type MintUrl: Clone + Send + Sync

Mint URL type

Source

type CurrencyUnit: Clone + Send + Sync

Currency unit type

Source

type MintInfo: Clone + Send + Sync

Mint info type

Source

type KeySetInfo: Clone + Send + Sync

Keyset info type

Source

type MintQuote: Clone + Send + Sync

Mint quote type

Source

type MeltQuote: Clone + Send + Sync

Melt quote type

Source

type PaymentMethod: Clone + Send + Sync

Payment method type

Source

type MeltOptions: Clone + Send + Sync

Melt options type

Source

type OperationId: Clone + Send + Sync

Operation ID type (CDK uses Uuid, FFI uses String)

Source

type PreparedSend<'a>: Send + Sync where Self: 'a

Prepared send type

Source

type PreparedMelt<'a>: Send + Sync where Self: 'a

Prepared melt type

Source

type Subscription: Send + Sync

Active subscription handle for receiving notifications

Source

type SubscribeParams: Clone + Send + Sync

Subscribe params type

Required Methods§

Source

fn mint_url(&self) -> Self::MintUrl

Get the mint URL this wallet is connected to

Source

fn unit(&self) -> Self::CurrencyUnit

Get the currency unit of this wallet

Source

fn total_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Total unspent balance of the wallet

Source

fn total_pending_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Total pending balance of the wallet

Source

fn total_reserved_balance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Total reserved balance of the wallet

Source

fn fetch_mint_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Self::MintInfo>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch mint info from the mint (always makes a network call)

Source

fn load_mint_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::MintInfo, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load mint info (from cache if fresh, otherwise fetches)

Source

fn refresh_keysets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refresh keysets from the mint (always fetches fresh data)

Source

fn get_active_keyset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::KeySetInfo, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the active keyset with lowest fees

Source

fn load_keyset_keys<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<Keys, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load keys for a specific keyset from cache or mint

Source

fn get_mint_keysets<'life0, 'async_trait>( &'life0 self, filter: KeysetFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get keysets for this wallet’s unit, filtered by active/all

Source

fn fetch_active_keyset<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::KeySetInfo, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the active keyset with lowest fees

Source

fn get_keyset_fees_and_amounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<KeysetFeeAndAmounts, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get fees and available amounts for all keysets

Source

fn get_keyset_count_fee<'life0, 'life1, 'async_trait>( &'life0 self, keyset_id: &'life1 Id, count: u64, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get fee for count of proofs in a keyset

Source

fn get_keyset_fees_and_amounts_by_id<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<FeeAndAmounts, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get fees and amounts for a specific keyset ID

Source

fn mint_quote<'life0, 'async_trait>( &'life0 self, method: Self::PaymentMethod, amount: Option<Self::Amount>, description: Option<String>, extra: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a mint quote for the given payment method

Source

fn melt_quote<'life0, 'async_trait>( &'life0 self, method: Self::PaymentMethod, request: String, options: Option<Self::MeltOptions>, extra: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a melt quote for the given payment method

Source

fn list_transactions<'life0, 'async_trait>( &'life0 self, direction: Option<TransactionDirection>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Transaction>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List transactions, optionally filtered by direction

Source

fn get_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Transaction>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a transaction by ID

Source

fn get_proofs_for_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get proofs for a transaction by transaction ID

Source

fn revert_transaction<'life0, 'async_trait>( &'life0 self, id: TransactionId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Revert a transaction by reclaiming unspent proofs

Source

fn check_all_pending_proofs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check all pending proofs and return total amount still pending

Source

fn check_proofs_spent<'life0, 'async_trait>( &'life0 self, proofs: Proofs, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProofState>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if proofs are spent

Source

fn get_keyset_fees_by_id<'life0, 'async_trait>( &'life0 self, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<u64, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get fees for a specific keyset ID

Source

fn calculate_fee<'life0, 'async_trait>( &'life0 self, proof_count: u64, keyset_id: Id, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Calculate fee for a given number of proofs with the specified keyset

Source

fn receive<'life0, 'life1, 'async_trait>( &'life0 self, encoded_token: &'life1 str, options: ReceiveOptions, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Receive an encoded token

Source

fn receive_proofs<'life0, 'async_trait>( &'life0 self, proofs: Proofs, options: ReceiveOptions, memo: Option<String>, token: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive proofs directly

Source

fn prepare_send<'life0, 'async_trait>( &'life0 self, amount: Self::Amount, options: SendOptions, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedSend<'_>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Prepare a send transaction

Source

fn get_pending_sends<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::OperationId>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get pending send operation IDs

Source

fn revoke_send<'life0, 'async_trait>( &'life0 self, operation_id: Self::OperationId, ) -> Pin<Box<dyn Future<Output = Result<Self::Amount, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Revoke a pending send operation

Source

fn check_send_status<'life0, 'async_trait>( &'life0 self, operation_id: Self::OperationId, ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if a pending send has been claimed

Source

fn mint<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mint tokens for a quote

Source

fn check_mint_quote_status<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check mint quote status

Source

fn fetch_mint_quote<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, payment_method: Option<Self::PaymentMethod>, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch a mint quote from the mint and store it locally

Source

fn prepare_melt<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prepare a melt operation

Source

fn prepare_melt_proofs<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, proofs: Proofs, metadata: HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Self::PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prepare a melt operation with specific proofs

Source

fn swap<'life0, 'async_trait>( &'life0 self, amount: Option<Self::Amount>, split_target: SplitTarget, input_proofs: Proofs, spending_conditions: Option<SpendingConditions>, include_fees: bool, use_p2bk: bool, ) -> Pin<Box<dyn Future<Output = Result<Option<Proofs>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Swap proofs

Source

fn set_cat<'life0, 'async_trait>( &'life0 self, cat: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set Clear Auth Token (CAT)

Source

fn set_refresh_token<'life0, 'async_trait>( &'life0 self, refresh_token: String, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set refresh token

Source

fn refresh_access_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Refresh access token using stored refresh token

Source

fn mint_blind_auth<'life0, 'async_trait>( &'life0 self, amount: Self::Amount, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Mint blind auth tokens

Source

fn get_unspent_auth_proofs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AuthProof>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get unspent auth proofs

Source

fn restore<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Restored, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Restore wallet from seed

Source

fn verify_token_dleq<'life0, 'life1, 'async_trait>( &'life0 self, token_str: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Verify DLEQ proofs in a token

Source

fn pay_request<'life0, 'async_trait>( &'life0 self, request: PaymentRequest, custom_amount: Option<Self::Amount>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pay a NUT-18 payment request

Source

fn subscribe_mint_quote_state<'life0, 'async_trait>( &'life0 self, quote_ids: Vec<String>, method: Self::PaymentMethod, ) -> Pin<Box<dyn Future<Output = Result<Self::Subscription, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to mint quote state updates

Returns a subscription handle that receives notifications when any of the given mint quotes change state (e.g., Unpaid → Paid → Issued).

Source

fn set_metadata_cache_ttl(&self, ttl_secs: Option<u64>)

Set metadata cache TTL (time-to-live) in seconds

Controls how long cached mint metadata (keysets, keys, mint info) is considered fresh before requiring a refresh from the mint server. If None, cache never expires and is always used.

Source

fn subscribe<'life0, 'async_trait>( &'life0 self, params: Self::SubscribeParams, ) -> Pin<Box<dyn Future<Output = Result<Self::Subscription, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to wallet events

Source

fn melt_lightning_address_quote<'life0, 'life1, 'async_trait>( &'life0 self, lightning_address: &'life1 str, amount_msat: Self::Amount, ) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a melt quote for a Lightning address

Source

fn get_proofs_by_states<'life0, 'async_trait>( &'life0 self, states: Vec<State>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get proofs filtered by states

Returns all proofs whose state matches any of the given states. The Spent state is typically excluded since spent proofs are removed from the database.

Source

fn generate_public_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PublicKey, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

generates and stores public key in database

Source

fn get_public_key<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 PublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

gets public key by it’s hex value

Source

fn get_public_keys<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

gets list of stored public keys in database

Source

fn get_latest_public_key<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<P2PKSigningKey>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the latest generated P2PK signing key (most recently created)

Source

fn get_signing_key<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 PublicKey, ) -> Pin<Box<dyn Future<Output = Result<Option<SecretKey>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

try to get secret key from p2pk signing key in localstore

Provided Methods§

Source

fn load_mint_keysets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Self::KeySetInfo>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load active keysets (alias for get_mint_keysets with Active filter)

Source

fn check_mint_quote<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check a mint quote status (alias for check_mint_quote_status)

Source

fn mint_unified<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 str, split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Mint tokens for a quote (alias for mint)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§