pub struct Wallet {
pub mint_url: MintUrl,
pub unit: CurrencyUnit,
pub localstore: Arc<dyn WalletDatabase<Error> + Send + Sync>,
pub metadata_cache: Arc<MintMetadataCache>,
pub target_proof_count: usize,
/* private fields */
}Expand description
CDK Wallet
The CDK Wallet is a high level cashu wallet.
A Wallet is for a single mint and single unit.
§Initialization
After creating a wallet, call Wallet::recover_incomplete_sagas to recover
from interrupted operations (swap, send, receive, melt). This is required to
prevent proofs from being stuck in reserved states after a crash.
For pending mint quotes, call Wallet::mint_unissued_quotes which checks
quote states with the mint and mints available tokens. This makes network calls.
Fields§
§mint_url: MintUrlMint Url
unit: CurrencyUnitUnit
localstore: Arc<dyn WalletDatabase<Error> + Send + Sync>Storage backend
metadata_cache: Arc<MintMetadataCache>Mint metadata cache for this mint (lock-free cached access to keys, keysets, and mint info)
target_proof_count: usizeThe targeted amount of proofs to have at each size
Implementations§
Source§impl Wallet
impl Wallet
Sourcepub async fn mint_blind_auth(&self, amount: Amount) -> Result<Proofs, Error>
pub async fn mint_blind_auth(&self, amount: Amount) -> Result<Proofs, Error>
Mint blind auth tokens
Sourcepub async fn get_unspent_auth_proofs(&self) -> Result<Vec<AuthProof>, Error>
pub async fn get_unspent_auth_proofs(&self) -> Result<Vec<AuthProof>, Error>
Get unspent auth proofs
Sourcepub async fn set_cat(&self, cat: String) -> Result<(), Error>
pub async fn set_cat(&self, cat: String) -> Result<(), Error>
Set Clear Auth Token (CAT) for authentication
Sourcepub async fn set_refresh_token(
&self,
refresh_token: String,
) -> Result<(), Error>
pub async fn set_refresh_token( &self, refresh_token: String, ) -> Result<(), Error>
Set refresh for authentication
Sourcepub async fn refresh_access_token(&self) -> Result<(), Error>
pub async fn refresh_access_token(&self) -> Result<(), Error>
Refresh CAT token
Sourcepub async fn set_auth_client(&self, auth_wallet: Option<AuthWallet>)
pub async fn set_auth_client(&self, auth_wallet: Option<AuthWallet>)
Set the auth client (AuthWallet) for this wallet
This allows updating the auth wallet without recreating the wallet. Also updates the client’s auth wallet to keep them in sync.
Source§impl Wallet
impl Wallet
Sourcepub async fn total_balance(&self) -> Result<Amount, Error>
pub async fn total_balance(&self) -> Result<Amount, Error>
Total unspent balance of wallet
Sourcepub async fn total_pending_balance(&self) -> Result<Amount, Error>
pub async fn total_pending_balance(&self) -> Result<Amount, Error>
Total pending balance
Sourcepub async fn total_reserved_balance(&self) -> Result<Amount, Error>
pub async fn total_reserved_balance(&self) -> Result<Amount, Error>
Total reserved balance
Source§impl Wallet
impl Wallet
Sourcepub async fn mint_quote(
&self,
method: PaymentMethod,
amount: Option<Amount>,
description: Option<String>,
extra: Option<String>,
) -> Result<MintQuote, Error>
pub async fn mint_quote( &self, method: PaymentMethod, amount: Option<Amount>, description: Option<String>, extra: Option<String>, ) -> Result<MintQuote, Error>
Create a mint quote for the given payment method and amount
Sourcepub async fn check_mint_quote_status(
&self,
quote_id: &str,
) -> Result<MintQuote, Error>
pub async fn check_mint_quote_status( &self, quote_id: &str, ) -> Result<MintQuote, Error>
Check the status of a single mint quote from the mint.
Calls GET /v1/mint/quote/{method}/{quote_id} per NUT-04.
Updates local store with current state from mint.
Returns the persisted quote, including its database version and ownership.
Rejects a mismatched response quote ID before changing local state.
If there was a crashed mid-mint (pending saga), attempts to complete it.
Does NOT mint tokens directly - use mint() for that.
Note: The mint quote must be known to the wallet (stored locally) for this
function to work. If the quote is not stored locally, use fetch_mint_quote
instead.
Sourcepub async fn check_mint_quote(&self, quote_id: &str) -> Result<MintQuote, Error>
pub async fn check_mint_quote(&self, quote_id: &str) -> Result<MintQuote, Error>
Check a mint quote status (alias for check_mint_quote_status)
Sourcepub async fn check_all_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
pub async fn check_all_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
Check all unissued mint quote states from the mint.
Calls GET /v1/mint/quote/{method}/{quote_id} per NUT-04 for each quote.
Updates local store with current state from mint for each quote.
If there was a crashed mid-mint (pending saga), attempts to complete it.
Does NOT mint tokens directly - use mint() or mint_unissued_quotes() for that.
Sourcepub async fn mint_unissued_quotes(&self) -> Result<Amount, Error>
pub async fn mint_unissued_quotes(&self) -> Result<Amount, Error>
Refresh states and mint all unissued quotes that have mintable amounts. Uses NUT-29 batch quote checks and batch minting automatically when the mint advertises support for the quotes’ payment method. Returns the total amount minted across all quotes.
§Privacy
This method retrieves all unissued mint quotes from the local store and checks their state with the mint. This has a negative privacy effect of linking all these quotes to a single wallet session.
Sourcepub async fn get_active_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
pub async fn get_active_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
Get active mint quotes Returns mint quotes that are not expired and not yet issued.
Sourcepub async fn get_unissued_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
pub async fn get_unissued_mint_quotes(&self) -> Result<Vec<MintQuote>, Error>
Get unissued mint quotes Returns bolt11 quotes where nothing has been issued yet (amount_issued = 0) and all bolt12 quotes. Includes unpaid bolt11 quotes to allow checking with the mint if they’ve been paid (wallet state may be outdated). Filters out quotes from other mints and units. Does not filter by expiry time to allow checking with the mint if expired quotes can still be minted.
Sourcepub async fn mint(
&self,
quote_id: &str,
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
) -> Result<Proofs, Error>
pub async fn mint( &self, quote_id: &str, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Result<Proofs, Error>
Mint
Sourcepub async fn mint_unified(
&self,
quote_id: &str,
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
) -> Result<Proofs, Error>
pub async fn mint_unified( &self, quote_id: &str, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Result<Proofs, Error>
Mint tokens for a quote (alias for mint)
Sourcepub async fn fetch_mint_quote(
&self,
quote_id: &str,
payment_method: Option<PaymentMethod>,
) -> Result<MintQuote, Error>
pub async fn fetch_mint_quote( &self, quote_id: &str, payment_method: Option<PaymentMethod>, ) -> Result<MintQuote, Error>
Fetch a mint quote from the mint and store it locally
This method contacts the mint to get the current state of a quote, creates or updates the quote in local storage, and returns the stored quote.
Works with all payment methods (Bolt11, Bolt12, and custom payment methods).
A quote not created by this wallet instance, such as one fetched after
restoring from seed, is stored without its NUT-20 signing key. Use
Self::fetch_mint_quote_with_key_search to recover that key.
§Arguments
quote_id- The ID of the quote to fetchpayment_method- The payment method for the quote. Required if the quote is not already stored locally. If the quote exists locally, the stored payment method will be used and this parameter is ignored.
§Errors
Returns Error::PaymentMethodRequired if the quote is not found locally
and no payment method is provided.
Returns Error::InvalidMintResponse if the response quote ID does not match.
Sourcepub async fn fetch_mint_quote_with_key_search(
&self,
quote_id: &str,
payment_method: Option<PaymentMethod>,
key_search_limit: u32,
) -> Result<MintQuote, Error>
pub async fn fetch_mint_quote_with_key_search( &self, quote_id: &str, payment_method: Option<PaymentMethod>, key_search_limit: u32, ) -> Result<MintQuote, Error>
Fetch a mint quote and try to recover its NUT-20 signing key from the seed.
Use this after restoring a wallet from seed to claim a quote whose ID is
known but whose signing key was lost with the old database. Plain
Self::fetch_mint_quote never searches.
The mint reports the public key the quote is locked to. This method derives
the wallet’s NUT-20 keys at counters 0..key_search_limit (capped at the
BIP32 non-hardened index boundary) and stores the first one that matches.
On a match, the wallet’s NUT-20 counter is advanced past that index so new
quotes never reuse it.
Returns Ok even if no key matched. Check quote.secret_key.is_some() on
the result: if set, call Self::mint; if not, retry with a larger limit.
The quote stays stored either way.
The search is skipped when the quote already has a key, is not locked, is
an NpubCash quote (its key comes from the NpubCash identity), or
key_search_limit is zero. Keys that were generated randomly rather than
derived from the seed cannot be recovered.
See crates/cdk/examples/restore-mint-quote.rs for a complete example.
§Arguments
quote_id- The ID of the quote to recoverpayment_method- As forSelf::fetch_mint_quotekey_search_limit- Exclusive upper bound on counters to try. It must exceed the index the original wallet used for this quote, which is below the number of locked quotes it created. Each key costs a BIP32 derivation.
§Errors
Same as Self::fetch_mint_quote, plus key derivation or database errors.
Sourcepub async fn batch_check_mint_quote_status(
&self,
quote_ids: &[&str],
) -> Result<Vec<MintQuote>, Error>
pub async fn batch_check_mint_quote_status( &self, quote_ids: &[&str], ) -> Result<Vec<MintQuote>, Error>
Batch check status of multiple mint quotes from the mint.
Calls POST /v1/mint/quote/{method}/check per NUT-29.
All quotes must share the same payment method.
Updates local store with current state from mint for each quote.
Rejects mismatched response counts or quote IDs before updating any quote.
Sourcepub async fn batch_mint(
&self,
quote_ids: &[&str],
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
external_keys: Option<HashMap<String, SecretKey>>,
) -> Result<Proofs, Error>
pub async fn batch_mint( &self, quote_ids: &[&str], amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, external_keys: Option<HashMap<String, SecretKey>>, ) -> Result<Proofs, Error>
Mint tokens for multiple quotes in a single batch operation.
Calls POST /v1/mint/{method}/batch per NUT-29.
All quotes must share the same payment method and unit.
Uses the saga pattern for crash recovery.
§Arguments
quote_ids- Array of unique quote IDs to mintamount_split_target- How to split the minted amount into proofsspending_conditions- Optional conditions to attach to the proofsexternal_keys- Optional signing keys for quotes not in local store
Source§impl Wallet
impl Wallet
Sourcepub async fn keysets(
&self,
policy: KeysetLoadPolicy,
) -> Result<Vec<KeySet>, Error>
pub async fn keysets( &self, policy: KeysetLoadPolicy, ) -> Result<Vec<KeySet>, Error>
Get all keysets for this wallet’s unit.
Tries a fresh fetch from the mint. On failure, falls back to any cached/persisted data. Only hard-fails when the cache is empty (first-ever fetch).
Sourcepub async fn active_keyset(&self) -> Result<KeySet, Error>
pub async fn active_keyset(&self) -> Result<KeySet, Error>
Get the active keyset with the lowest fees.
Filters the output of keysets() for active keysets
and returns the one with the minimum input_fee_ppk.
Sourcepub async fn active_keyset_with_policy(
&self,
policy: KeysetLoadPolicy,
) -> Result<KeySet, Error>
pub async fn active_keyset_with_policy( &self, policy: KeysetLoadPolicy, ) -> Result<KeySet, Error>
Get the active keyset using a specific KeysetLoadPolicy.
Same as active_keyset() but lets callers
control whether the network may be contacted.
Sourcepub async fn keyset_with_policy(
&self,
keyset_id: Id,
policy: KeysetLoadPolicy,
) -> Result<KeySet, Error>
pub async fn keyset_with_policy( &self, keyset_id: Id, policy: KeysetLoadPolicy, ) -> Result<KeySet, Error>
Get a single keyset by ID using a specific KeysetLoadPolicy.
Sourcepub async fn get_keyset_fees_and_amounts(
&self,
) -> Result<KeysetFeeAndAmounts, Error>
pub async fn get_keyset_fees_and_amounts( &self, ) -> Result<KeysetFeeAndAmounts, Error>
Get keyset fees and amounts for all keysets
Sourcepub async fn get_keyset_fees_and_amounts_with_policy(
&self,
policy: KeysetLoadPolicy,
) -> Result<KeysetFeeAndAmounts, Error>
pub async fn get_keyset_fees_and_amounts_with_policy( &self, policy: KeysetLoadPolicy, ) -> Result<KeysetFeeAndAmounts, Error>
Same as get_keyset_fees_and_amounts()
but lets callers control the KeysetLoadPolicy.
Sourcepub async fn get_keyset_fees_by_id(&self, keyset_id: Id) -> Result<u64, Error>
pub async fn get_keyset_fees_by_id(&self, keyset_id: Id) -> Result<u64, Error>
Get the input fee rate for a specific keyset ID
Sourcepub async fn get_keyset_fees_and_amounts_by_id(
&self,
keyset_id: Id,
) -> Result<FeeAndAmounts, Error>
pub async fn get_keyset_fees_and_amounts_by_id( &self, keyset_id: Id, ) -> Result<FeeAndAmounts, Error>
Get keyset fees and amounts for a specific keyset ID
Sourcepub async fn get_keyset_fees_and_amounts_by_id_with_policy(
&self,
keyset_id: Id,
policy: KeysetLoadPolicy,
) -> Result<FeeAndAmounts, Error>
pub async fn get_keyset_fees_and_amounts_by_id_with_policy( &self, keyset_id: Id, policy: KeysetLoadPolicy, ) -> Result<FeeAndAmounts, Error>
Get keyset fees and amounts for a specific keyset ID using a specific
KeysetLoadPolicy.
Source§impl Wallet
impl Wallet
Sourcepub async fn melt_bip353_quote(
&self,
bip353_address: &str,
amount_msat: impl Into<Amount>,
network: Network,
) -> Result<MeltQuote, Error>
pub async fn melt_bip353_quote( &self, bip353_address: &str, amount_msat: impl Into<Amount>, network: Network, ) -> Result<MeltQuote, Error>
Melt Quote for BIP353 human-readable address
This method resolves a BIP353 address (e.g., “alice@example.com”) to a Bitcoin payment instruction, requires a BOLT12 offer in that instruction, and then creates a melt quote for that offer.
§Arguments
bip353_address- Human-readable address in the format “user@domain.com”amount_msat- Amount to pay in millisatoshisnetwork- Bitcoin network for on-chain address validation in the resolved URI
§Returns
A MeltQuote that can be used to execute the payment
§Errors
This method will return an error if:
- The BIP353 address format is invalid
- DNS resolution fails or DNSSEC validation fails
- No BOLT12 offer is found in the payment instructions
- The mint fails to provide a quote for the offer
§Example
use cdk::Amount;
let quote = wallet
.melt_bip353_quote(
"alice@example.com",
Amount::from(100_000), // 100 sats in msat
bitcoin::Network::Bitcoin,
)
.await?;Source§impl Wallet
impl Wallet
Sourcepub async fn melt_lightning_address_quote(
&self,
lightning_address: &str,
amount_msat: impl Into<Amount>,
) -> Result<MeltQuote, Error>
pub async fn melt_lightning_address_quote( &self, lightning_address: &str, amount_msat: impl Into<Amount>, ) -> Result<MeltQuote, Error>
Melt Quote for Lightning address
This method resolves a Lightning address (e.g., “alice@example.com”) to a Lightning invoice and then creates a melt quote for that invoice.
§Arguments
lightning_address- Lightning address in the format “user@domain.com”amount_msat- Amount to pay in millisatoshis
§Returns
A MeltQuote that can be used to execute the payment
§Errors
This method will return an error if:
- The Lightning address format is invalid
- HTTP request to the Lightning address service fails
- The amount is outside the acceptable range
- The service returns an error
- The mint fails to provide a quote for the invoice
§Example
use cdk::Amount;
let quote = wallet
.melt_lightning_address_quote("alice@example.com", Amount::from(100_000)) // 100 sats in msat
.await?;Source§impl Wallet
impl Wallet
Source§impl Wallet
impl Wallet
Sourcepub async fn cross_mint_transfer_quote_max(
&self,
target_wallet: &Wallet,
) -> Result<CrossMintTransferQuote, Error>
pub async fn cross_mint_transfer_quote_max( &self, target_wallet: &Wallet, ) -> Result<CrossMintTransferQuote, Error>
Create quotes for transferring the maximum amount allowed by the source balance and both mints’ advertised BOLT11 limits.
The destination wallet creates a BOLT11 mint quote and this wallet asks its mint for the corresponding melt quote. Because the melt fee reserve can depend on the invoice amount, the method repeats this process until the destination amount fits the source balance after both the melt fee reserve and the input fee for all unspent source proofs.
The returned plan assumes all currently unspent source proofs are used.
To preserve that accounting, prepare the melt with
Wallet::prepare_melt_proofs and confirm it with
MeltConfirmOptions::skip_swap.
The melt fee is a reserve. If the actual Lightning fee is lower, the source mint can return the difference as change, so a successful melt may leave a small source balance.
The returned plan covers one Lightning payment. If an advertised quote maximum is below the source balance, complete the plan and call this method again to transfer the remaining balance.
§Remote side effects
Finding the maximum can require several probes because the source mint’s fee reserve is only known after the destination mint creates an invoice. Every probe creates a mint quote at the destination and a melt quote at the source. Only the returned pair is persisted locally; the other remote quotes cannot be cancelled and remain at their mints until they expire. Avoid calling this method speculatively or in an unbounded loop.
Sourcepub async fn prepare_melt(
&self,
quote_id: &str,
metadata: HashMap<String, String>,
) -> Result<PreparedMelt<'_>, Error>
pub async fn prepare_melt( &self, quote_id: &str, metadata: HashMap<String, String>, ) -> Result<PreparedMelt<'_>, Error>
Prepare a melt operation without executing it.
Sourcepub async fn prepare_melt_proofs(
&self,
quote_id: &str,
proofs: Proofs,
metadata: HashMap<String, String>,
) -> Result<PreparedMelt<'_>, Error>
pub async fn prepare_melt_proofs( &self, quote_id: &str, proofs: Proofs, metadata: HashMap<String, String>, ) -> Result<PreparedMelt<'_>, Error>
Prepare a melt operation with specific proofs.
Sourcepub async fn prepare_melt_token(
&self,
quote_id: &str,
encoded_token: &str,
metadata: HashMap<String, String>,
) -> Result<PreparedMelt<'_>, Error>
pub async fn prepare_melt_token( &self, quote_id: &str, encoded_token: &str, metadata: HashMap<String, String>, ) -> Result<PreparedMelt<'_>, Error>
Prepare a melt operation from an encoded token.
Decodes the token, validates unit and mint URL, extracts proofs,
and delegates to prepare_melt_proofs.
Sourcepub async fn finalize_pending_melts(&self) -> Result<Vec<FinalizedMelt>, Error>
pub async fn finalize_pending_melts(&self) -> Result<Vec<FinalizedMelt>, Error>
Finalize pending melt operations.
Sourcepub async fn get_active_melt_quotes(&self) -> Result<Vec<MeltQuote>, Error>
pub async fn get_active_melt_quotes(&self) -> Result<Vec<MeltQuote>, Error>
Get all active melt quotes from the wallet
Sourcepub async fn get_pending_melt_quotes(&self) -> Result<Vec<MeltQuote>, Error>
pub async fn get_pending_melt_quotes(&self) -> Result<Vec<MeltQuote>, Error>
Get pending melt quotes
Sourcepub async fn melt_human_readable_quote(
&self,
address: &str,
amount_msat: impl Into<Amount>,
network: Network,
) -> Result<MeltQuote, Error>
pub async fn melt_human_readable_quote( &self, address: &str, amount_msat: impl Into<Amount>, network: Network, ) -> Result<MeltQuote, Error>
Get a melt quote for a human-readable address
This method accepts a human-readable address that could be either a BIP353 address or a Lightning address. It intelligently determines which to try based on mint support:
- If the mint supports Bolt12, it tries BIP353 first
- Falls back to Lightning address only if BIP353 resolution fails
- If BIP353 resolves but does not contain a usable BOLT12 offer, it does NOT fall back
- If the mint doesn’t support Bolt12, it tries Lightning address directly
The network parameter is forwarded to the BIP353 resolver for on-chain address
validation in the resolved URI.
Sourcepub async fn melt_human_readable(
&self,
address: &str,
amount_msat: impl Into<Amount>,
network: Network,
) -> Result<MeltQuote, Error>
pub async fn melt_human_readable( &self, address: &str, amount_msat: impl Into<Amount>, network: Network, ) -> Result<MeltQuote, Error>
Get a melt quote for a human-readable address (alias for melt_human_readable_quote)
Sourcepub async fn melt_quote<T, R>(
&self,
method: T,
request: R,
options: Option<MeltOptions>,
extra: Option<String>,
) -> Result<MeltQuote, Error>
pub async fn melt_quote<T, R>( &self, method: T, request: R, options: Option<MeltOptions>, extra: Option<String>, ) -> Result<MeltQuote, Error>
Melt quote for all payment methods
Accepts Bolt11Invoice, Offer, String, or &str for the request parameter.
§Onchain
The onchain payment method is not reachable through this generic
entry point: onchain melt quotes require a payout amount (the address
alone is insufficient) and the mint returns an array of candidate fee
tiers that must be selected explicitly. Callers needing onchain should
use Wallet::quote_onchain_melt_options to fetch the candidate quotes
and Wallet::select_onchain_melt_quote to persist the chosen one.
Invoking melt_quote with KnownMethod::Onchain returns
Error::UnsupportedPaymentMethod.
Source§impl Wallet
impl Wallet
Sourcepub fn set_metadata_cache_ttl(&self, ttl: Option<Duration>)
pub fn set_metadata_cache_ttl(&self, ttl: Option<Duration>)
Sets the metadata cache TTL.
The TTL determines how often the wallet re-fetches keysets and mint info. Because the cache is shared, this affects all wallets using the same mint.
None means cached data never expires. Default: 1 hour.
Sourcepub fn get_metadata_cache_info(&self) -> FreshnessStatus
pub fn get_metadata_cache_info(&self) -> FreshnessStatus
Get information about metadata cache info
Source§impl Wallet
impl Wallet
Sourcepub async fn prepare_pay_request(
&self,
payment_request: PaymentRequest,
custom_amount: Option<Amount>,
) -> Result<PreparedPaymentRequest, Error>
pub async fn prepare_pay_request( &self, payment_request: PaymentRequest, custom_amount: Option<Amount>, ) -> Result<PreparedPaymentRequest, Error>
Prepare a NUT-18 payment request and freeze its selected mint fees.
The returned payment must be explicitly completed with
PreparedPaymentRequest::confirm or released with
PreparedPaymentRequest::cancel.
Source§impl Wallet
impl Wallet
Sourcepub async fn get_unspent_proofs(&self) -> Result<Proofs, Error>
pub async fn get_unspent_proofs(&self) -> Result<Proofs, Error>
Get unspent proofs for mint
Sourcepub async fn get_proofs_by_states(
&self,
states: Vec<State>,
) -> Result<Proofs, Error>
pub async fn get_proofs_by_states( &self, states: Vec<State>, ) -> Result<Proofs, Error>
Get proofs filtered by states
Sourcepub async fn get_proofs_with(
&self,
state: Option<Vec<State>>,
spending_conditions: Option<Vec<SpendingConditions>>,
) -> Result<Proofs, Error>
pub async fn get_proofs_with( &self, state: Option<Vec<State>>, spending_conditions: Option<Vec<SpendingConditions>>, ) -> Result<Proofs, Error>
Get this wallet’s Proofs that match the args
Sourcepub async fn unreserve_proofs(&self, ys: Vec<PublicKey>) -> Result<(), Error>
pub async fn unreserve_proofs(&self, ys: Vec<PublicKey>) -> Result<(), Error>
Return proofs to unspent allowing them to be selected and spent
Sourcepub async fn check_proofs_spent(
&self,
proofs: Proofs,
) -> Result<Vec<ProofState>, Error>
pub async fn check_proofs_spent( &self, proofs: Proofs, ) -> Result<Vec<ProofState>, Error>
NUT-07 Check the state of a Proof with the mint
Sourcepub async fn check_all_pending_proofs(&self) -> Result<Amount, Error>
pub async fn check_all_pending_proofs(&self) -> Result<Amount, Error>
Checks pending proofs for spent status and marks spent proofs accordingly.
§Legacy Recovery Function
This function is intended for recovering orphaned proofs that were stuck
in Pending, Reserved, or PendingSpent state before the saga pattern
was implemented, or proofs whose saga was deleted without proper cleanup.
Important: This function only operates on proofs that are NOT currently
associated with an active saga operation (i.e., used_by_operation is None).
Proofs managed by active sagas are skipped to avoid interfering with in-flight
operations.
For proofs that are part of active sagas, use the appropriate saga recovery
mechanism (recover_incomplete_sagas) or saga-specific methods like
SendSaga::revoke().
§Returns
The total amount of orphaned proofs that remain pending (not spent by the mint) after checking.
Sourcepub fn select_exact_proofs(
amount: Amount,
proofs: Proofs,
active_keyset_ids: &Vec<Id>,
fees_and_keyset_amounts: &KeysetFeeAndAmounts,
include_fees: bool,
) -> Result<(Proofs, Option<(Proof, Amount)>), Error>
pub fn select_exact_proofs( amount: Amount, proofs: Proofs, active_keyset_ids: &Vec<Id>, fees_and_keyset_amounts: &KeysetFeeAndAmounts, include_fees: bool, ) -> Result<(Proofs, Option<(Proof, Amount)>), Error>
Select exact proofs
This function is similar to select_proofs but it the selected proofs will not exceed the
requested Amount, it will include a Proof and the exacto amount needed form that Proof to
perform a swap.
The intent is to perform a swap with info, or include the Proof as part of the return if the swap is not needed or if the swap failed.
Source§impl Wallet
impl Wallet
Sourcepub async fn receive_proofs(
&self,
proofs: Proofs,
opts: ReceiveOptions,
memo: Option<String>,
token: Option<String>,
) -> Result<Amount, Error>
pub async fn receive_proofs( &self, proofs: Proofs, opts: ReceiveOptions, memo: Option<String>, token: Option<String>, ) -> Result<Amount, Error>
Receive proofs using the saga pattern
This is the internal implementation that uses the saga pattern for proper crash recovery and compensation.
Sourcepub async fn receive(
&self,
encoded_token: &str,
opts: ReceiveOptions,
) -> Result<Amount, Error>
pub async fn receive( &self, encoded_token: &str, opts: ReceiveOptions, ) -> Result<Amount, Error>
Receive
§Synopsis
use std::sync::Arc;
use cdk::amount::SplitTarget;
use cdk_sqlite::wallet::memory;
use cdk::nuts::CurrencyUnit;
use cdk::wallet::{ReceiveOptions, Wallet};
use rand::random;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let seed = random::<[u8; 64]>();
let mint_url = "https://testnut.cashudevkit.org";
let unit = CurrencyUnit::Sat;
let localstore = memory::empty().await?;
let wallet = Wallet::new(mint_url, unit, Arc::new(localstore), seed, None).unwrap();
let token = "cashuAeyJ0b2tlbiI6W3sicHJvb2ZzIjpbeyJhbW91bnQiOjEsInNlY3JldCI6ImI0ZjVlNDAxMDJhMzhiYjg3NDNiOTkwMzU5MTU1MGYyZGEzZTQxNWEzMzU0OTUyN2M2MmM5ZDc5MGVmYjM3MDUiLCJDIjoiMDIzYmU1M2U4YzYwNTMwZWVhOWIzOTQzZmRhMWEyY2U3MWM3YjNmMGNmMGRjNmQ4NDZmYTc2NWFhZjc3OWZhODFkIiwiaWQiOiIwMDlhMWYyOTMyNTNlNDFlIn1dLCJtaW50IjoiaHR0cHM6Ly90ZXN0bnV0LmNhc2h1LnNwYWNlIn1dLCJ1bml0Ijoic2F0In0=";
let amount_receive = wallet.receive(token, ReceiveOptions::default()).await?;
Ok(())
}Sourcepub async fn receive_raw(
&self,
binary_token: &Vec<u8>,
opts: ReceiveOptions,
) -> Result<Amount, Error>
pub async fn receive_raw( &self, binary_token: &Vec<u8>, opts: ReceiveOptions, ) -> Result<Amount, Error>
Receive
§Synopsis
use std::sync::Arc;
use cdk::amount::SplitTarget;
use cdk_sqlite::wallet::memory;
use cdk::nuts::CurrencyUnit;
use cdk::wallet::{ReceiveOptions, Wallet};
use cdk::util::hex;
use rand::random;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let seed = random::<[u8; 64]>();
let mint_url = "https://testnut.cashudevkit.org";
let unit = CurrencyUnit::Sat;
let localstore = memory::empty().await?;
let wallet = Wallet::new(mint_url, unit, Arc::new(localstore), seed, None).unwrap();
let token_raw = hex::decode("6372617742a4617481a261694800ad268c4d1f5826617081a3616101617378403961366462623834376264323332626137366462306466313937323136623239643362386363313435353363643237383237666331636339343266656462346561635821038618543ffb6b8695df4ad4babcde92a34a96bdcd97dcee0d7ccf98d4721267926164695468616e6b20796f75616d75687474703a2f2f6c6f63616c686f73743a33333338617563736174").unwrap();
let amount_receive = wallet.receive_raw(&token_raw, ReceiveOptions::default()).await?;
Ok(())
}Source§impl Wallet
impl Wallet
Sourcepub async fn recover_incomplete_sagas(&self) -> Result<RecoveryReport, Error>
pub async fn recover_incomplete_sagas(&self) -> Result<RecoveryReport, Error>
Recover from incomplete operations after a crash. Call on startup.
Handles interrupted swap, send, receive, and melt operations to prevent proofs from being stuck in reserved states. Requires network connection.
Source§impl Wallet
impl Wallet
Sourcepub async fn prepare_send(
&self,
amount: Amount,
opts: SendOptions,
) -> Result<PreparedSend<'_>, Error>
pub async fn prepare_send( &self, amount: Amount, opts: SendOptions, ) -> Result<PreparedSend<'_>, Error>
Prepare a send transaction
This function prepares a send transaction by selecting proofs to send and proofs to swap. By doing so, it ensures that the wallet user is able to view the fees associated with the send transaction before confirming.
§Example
let prepared = wallet
.prepare_send(Amount::from(10), SendOptions::default())
.await?;
println!("Fee: {}", prepared.fee());
let token = prepared.confirm(None).await?;Sourcepub async fn get_pending_sends(&self) -> Result<Vec<Uuid>, Error>
pub async fn get_pending_sends(&self) -> Result<Vec<Uuid>, Error>
Returns operation IDs for pending sends (tokens created but not claimed).
Source§impl Wallet
impl Wallet
Sourcepub async fn wait_and_mint_quote(
&self,
quote: MintQuote,
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
timeout_duration: Duration,
) -> Result<Proofs, Error>
pub async fn wait_and_mint_quote( &self, quote: MintQuote, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, timeout_duration: Duration, ) -> Result<Proofs, Error>
Mints a mint quote once it is paid
Source§impl Wallet
impl Wallet
Sourcepub fn proof_stream(
&self,
quote: MintQuote,
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
) -> SingleMintQuoteProofStream<'_>
pub fn proof_stream( &self, quote: MintQuote, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> SingleMintQuoteProofStream<'_>
Streams all proofs from a single mint quote
Sourcepub fn mints_proof_stream(
&self,
quotes: Vec<MintQuote>,
amount_split_target: SplitTarget,
spending_conditions: Option<SpendingConditions>,
) -> MultipleMintQuoteProofStream<'_>
pub fn mints_proof_stream( &self, quotes: Vec<MintQuote>, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> MultipleMintQuoteProofStream<'_>
Streams all new proofs for a set of mints
Sourcepub fn payment_stream<T>(&self, events: T) -> PaymentStream<'_>where
T: Into<WaitableEvent>,
pub fn payment_stream<T>(&self, events: T) -> PaymentStream<'_>where
T: Into<WaitableEvent>,
Returns a BoxFuture that will wait for payment on the given event with a timeout check
Source§impl Wallet
impl Wallet
Sourcepub async fn swap(
&self,
amount: Option<Amount>,
amount_split_target: SplitTarget,
input_proofs: Proofs,
spending_conditions: Option<SpendingConditions>,
include_fees: bool,
use_p2bk: bool,
) -> Result<Option<Proofs>, Error>
pub async fn swap( &self, amount: Option<Amount>, amount_split_target: SplitTarget, input_proofs: Proofs, spending_conditions: Option<SpendingConditions>, include_fees: bool, use_p2bk: bool, ) -> Result<Option<Proofs>, Error>
Swap proofs using the saga pattern.
This method reserves the input proofs before performing the swap, ensuring they cannot be used by concurrent operations.
Source§impl Wallet
impl Wallet
Sourcepub async fn list_transactions(
&self,
direction: Option<TransactionDirection>,
) -> Result<Vec<Transaction>, Error>
pub async fn list_transactions( &self, direction: Option<TransactionDirection>, ) -> Result<Vec<Transaction>, Error>
List transactions
Sourcepub async fn get_transaction(
&self,
id: TransactionId,
) -> Result<Option<Transaction>, Error>
pub async fn get_transaction( &self, id: TransactionId, ) -> Result<Option<Transaction>, Error>
Get transaction by ID
Sourcepub async fn get_proofs_for_transaction(
&self,
id: TransactionId,
) -> Result<Proofs, Error>
pub async fn get_proofs_for_transaction( &self, id: TransactionId, ) -> Result<Proofs, Error>
Get proofs for a transaction by transaction ID
This retrieves all proofs associated with a transaction by looking up the transaction’s Y values and fetching the corresponding proofs.
Sourcepub async fn revert_transaction(&self, id: TransactionId) -> Result<(), Error>
pub async fn revert_transaction(&self, id: TransactionId) -> Result<(), Error>
Revert a transaction by reclaiming unspent proofs.
For transactions created by the saga pattern (with saga_id set), this
function loads the associated send saga and calls revoke() on it, which
properly handles the saga lifecycle including state transitions and cleanup.
For legacy transactions (without saga_id), this function checks the proofs
with the mint and marks any spent proofs accordingly. Unspent proofs are
left in their current state for manual recovery.
§Errors
Returns an error if:
- The transaction is not found
- The transaction is not outgoing
- The saga is not in a revocable state (e.g., already completed)
- The token has already been claimed by the recipient
Source§impl Wallet
impl Wallet
Sourcepub fn new(
mint_url: &str,
unit: CurrencyUnit,
localstore: Arc<dyn WalletDatabase<Error> + Send + Sync>,
seed: [u8; 64],
target_proof_count: Option<usize>,
) -> Result<Self, Error>
pub fn new( mint_url: &str, unit: CurrencyUnit, localstore: Arc<dyn WalletDatabase<Error> + Send + Sync>, seed: [u8; 64], target_proof_count: Option<usize>, ) -> Result<Self, Error>
Create new Wallet using the builder pattern
§Synopsis
use std::sync::Arc;
use bitcoin::bip32::Xpriv;
use cdk::nuts::CurrencyUnit;
use cdk::wallet::{Wallet, WalletBuilder};
use cdk_sqlite::wallet::memory;
use rand::random;
async fn test() -> anyhow::Result<()> {
let seed = random::<[u8; 64]>();
let mint_url = "https://testnut.cashudevkit.org";
let unit = CurrencyUnit::Sat;
let localstore = memory::empty().await?;
let wallet = WalletBuilder::new()
.mint_url(mint_url.parse().unwrap())
.unit(unit)
.localstore(Arc::new(localstore))
.seed(seed)
.build();
Ok(())
}Sourcepub fn set_rate_limiting_config(&self, config: RateLimitConfig)
pub fn set_rate_limiting_config(&self, config: RateLimitConfig)
Replace the client-side rate-limit configuration at runtime.
Applies to every host the wallet’s limiter paces, not only the mint: the buckets already in use and any created later. That includes third-party hosts the wallet’s transport reaches, such as an LNURL service or an OIDC provider.
It is a no-op when the wallet paces nothing, either because rate limiting
was disabled (WalletBuilder::without_rate_limiting) or because a
custom client (WalletBuilder::client/WalletBuilder::shared_client)
replaced the main transport and no rate-limited auth client remains. With
a custom main client plus a CAT it reconfigures only the blind-auth
client’s pacing.
When the wallet was built through a WalletRepository, the limiter is
shared with every other wallet in that repository, so this reconfigures
pacing repository-wide.
Wallet::is_rate_limited reports whether the call took effect, since
the no-op cases are otherwise silent.
Sourcepub fn disable_rate_limiting(&self)
pub fn disable_rate_limiting(&self)
Disable client-side rate limiting at runtime.
Has the same reach as Wallet::set_rate_limiting_config: every host the
wallet’s limiter paces, repository-wide for a repository-built wallet, and
a no-op when the wallet paces nothing.
Sourcepub fn is_rate_limited(&self) -> bool
pub fn is_rate_limited(&self) -> bool
Whether this wallet’s requests are being paced right now.
False both when pacing was turned off and when the wallet paces nothing
at all, which is the case Wallet::set_rate_limiting_config silently
ignores.
Sourcepub async fn flush_rate_limits(&self)
pub async fn flush_rate_limits(&self)
Wait until the rate-limit budget this wallet has drawn down has been handed to storage.
Persistence is otherwise best effort: the request path never waits for the store, and dropping a wallet leaves the final write to a detached background task. A caller that does not await this barrier can rebuild the wallet, or tear down the runtime, before that write lands, and the rebuilt wallet then starts with a full burst. Await it before dropping a wallet whose budget must carry over.
The wait is bounded, so a slow or hung store cannot hang shutdown; on timeout the budget is simply not persisted.
Has the same reach as Wallet::set_rate_limiting_config: every host
the wallet’s limiter paces, repository-wide for a wallet built through a
WalletRepository, and a no-op when the wallet paces nothing.
Sourcepub async fn subscribe<T: Into<WalletParams>>(
&self,
query: T,
) -> Result<ActiveSubscription, Error>
pub async fn subscribe<T: Into<WalletParams>>( &self, query: T, ) -> Result<ActiveSubscription, Error>
Subscribe to events
Sourcepub fn oidc_client(
&self,
openid_discovery: String,
client_id: Option<String>,
) -> OidcClient
pub fn oidc_client( &self, openid_discovery: String, client_id: Option<String>, ) -> OidcClient
Create an OIDC client using this wallet’s mint connector transport.
Sourcepub async fn subscribe_mint_quote_state(
&self,
quote_ids: Vec<String>,
method: PaymentMethod,
) -> Result<ActiveSubscription, Error>
pub async fn subscribe_mint_quote_state( &self, quote_ids: Vec<String>, method: PaymentMethod, ) -> Result<ActiveSubscription, Error>
Subscribe to mint quote state changes for the given quote IDs and payment method
Sourcepub async fn get_proofs_fee(
&self,
proofs: &Proofs,
) -> Result<ProofsFeeBreakdown, Error>
pub async fn get_proofs_fee( &self, proofs: &Proofs, ) -> Result<ProofsFeeBreakdown, Error>
Fee required to redeem proof set
Sourcepub async fn get_proofs_fee_by_count(
&self,
proofs_per_keyset: HashMap<Id, u64>,
) -> Result<ProofsFeeBreakdown, Error>
pub async fn get_proofs_fee_by_count( &self, proofs_per_keyset: HashMap<Id, u64>, ) -> Result<ProofsFeeBreakdown, Error>
Fee required to redeem proof set by count
Sourcepub async fn get_keyset_count_fee(
&self,
keyset_id: &Id,
count: u64,
) -> Result<Amount, Error>
pub async fn get_keyset_count_fee( &self, keyset_id: &Id, count: u64, ) -> Result<Amount, Error>
Get fee for count of proofs in a keyset
Sourcepub async fn get_keyset_count_fee_with_policy(
&self,
keyset_id: &Id,
count: u64,
policy: KeysetLoadPolicy,
) -> Result<Amount, Error>
pub async fn get_keyset_count_fee_with_policy( &self, keyset_id: &Id, count: u64, policy: KeysetLoadPolicy, ) -> Result<Amount, Error>
Calculate fee for a given number of proofs using a specific
KeysetLoadPolicy.
Sourcepub async fn calculate_fee(
&self,
proof_count: u64,
keyset_id: Id,
) -> Result<Amount, Error>
pub async fn calculate_fee( &self, proof_count: u64, keyset_id: Id, ) -> Result<Amount, Error>
Calculate fee for a given number of proofs with the specified keyset
Sourcepub async fn update_mint_url(
&mut self,
new_mint_url: MintUrl,
) -> Result<(), Error>
pub async fn update_mint_url( &mut self, new_mint_url: MintUrl, ) -> Result<(), Error>
Update Mint information and related entries in the event a mint changes its URL
Sourcepub async fn fetch_mint_info(&self) -> Result<Option<MintInfo>, Error>
pub async fn fetch_mint_info(&self) -> Result<Option<MintInfo>, Error>
Query mint for current mint information
Sourcepub async fn load_mint_info(&self) -> Result<MintInfo, Error>
pub async fn load_mint_info(&self) -> Result<MintInfo, Error>
Load mint info from cache
This is a helper function that loads the mint info from the metadata cache
using the configured TTL. Unlike fetch_mint_info(), this does not make
a network call if the cache is fresh.
Sourcepub async fn restore(&self) -> Result<Restored, Error>
pub async fn restore(&self) -> Result<Restored, Error>
Restore proofs from the mint using the NUT-13 spec defaults (batch size 100, gap 3).
This is a thin wrapper over
Wallet::restore_with_opts. Call that
directly if you need to override the batch size or gap limit.
Sourcepub async fn restore_with_opts(
&self,
opts: NUT13Options,
) -> Result<Restored, Error>
pub async fn restore_with_opts( &self, opts: NUT13Options, ) -> Result<Restored, Error>
Restore proofs from the mint using the given NUT13Options.
Scans each keyset in batches of opts.batch_size blinded messages
and stops after opts.max_gap consecutive empty batches. Lowering
batch_size trades scan latency for a gentler request pattern.
Sourcepub async fn verify_token_p2pk(
&self,
token: &Token,
spending_conditions: SpendingConditions,
) -> Result<(), Error>
pub async fn verify_token_p2pk( &self, token: &Token, spending_conditions: SpendingConditions, ) -> Result<(), Error>
Verify all proofs in token have meet the required spend Can be used to allow a wallet to accept payments offline while reducing the risk of claiming back to the limits let by the spending_conditions
Sourcepub async fn verify_token_dleq(&self, token: &Token) -> Result<(), Error>
pub async fn verify_token_dleq(&self, token: &Token) -> Result<(), Error>
Verify all proofs in token have a valid DLEQ proof
Sourcepub fn set_client(&mut self, client: Arc<dyn MintConnector + Send + Sync>)
pub fn set_client(&mut self, client: Arc<dyn MintConnector + Send + Sync>)
Set the client (MintConnector) for this wallet
This allows updating the connector without recreating the wallet.
Sourcepub fn mint_connector(&self) -> Arc<dyn MintConnector + Send + Sync> ⓘ
pub fn mint_connector(&self) -> Arc<dyn MintConnector + Send + Sync> ⓘ
Get the connector used by this wallet.
Sourcepub fn set_target_proof_count(&mut self, count: usize)
pub fn set_target_proof_count(&mut self, count: usize)
Set the target proof count for this wallet
This controls how many proofs of each denomination the wallet tries to maintain.
Sourcepub async fn generate_public_key(&self) -> Result<PublicKey, Error>
pub async fn generate_public_key(&self) -> Result<PublicKey, Error>
generates and stores public key in database
Sourcepub async fn get_public_key(
&self,
pubkey: &PublicKey,
) -> Result<Option<P2PKSigningKey>, Error>
pub async fn get_public_key( &self, pubkey: &PublicKey, ) -> Result<Option<P2PKSigningKey>, Error>
gets public key by it’s hex value
Sourcepub async fn get_public_keys(&self) -> Result<Vec<P2PKSigningKey>, Error>
pub async fn get_public_keys(&self) -> Result<Vec<P2PKSigningKey>, Error>
gets list of stored public keys in database
Sourcepub async fn get_latest_public_key(
&self,
) -> Result<Option<P2PKSigningKey>, Error>
pub async fn get_latest_public_key( &self, ) -> Result<Option<P2PKSigningKey>, Error>
Gets the latest generated P2PK signing key (most recently created)
Trait Implementations§
Source§impl Wallet for Wallet
impl Wallet for Wallet
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,
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,
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,
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,
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,
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
Source§type CurrencyUnit = CurrencyUnit
type CurrencyUnit = CurrencyUnit
Source§type KeySetInfo = KeySet
type KeySetInfo = KeySet
Source§type CrossMintTransferQuote = CrossMintTransferQuote
type CrossMintTransferQuote = CrossMintTransferQuote
Source§type PaymentMethod = PaymentMethod
type PaymentMethod = PaymentMethod
Source§type MeltOptions = MeltOptions
type MeltOptions = MeltOptions
Source§type OperationId = Uuid
type OperationId = Uuid
Uuid, FFI uses String)Source§type PreparedSend<'a> = PreparedSend<'a>
type PreparedSend<'a> = PreparedSend<'a>
Source§type PreparedMelt<'a> = PreparedMelt<'a>
type PreparedMelt<'a> = PreparedMelt<'a>
Source§type Subscription = RemoteActiveConsumer<SubscriptionClient>
type Subscription = RemoteActiveConsumer<SubscriptionClient>
Source§type RecoveryReport = RecoveryReport
type RecoveryReport = RecoveryReport
Source§fn unit(&self) -> CurrencyUnit
fn unit(&self) -> CurrencyUnit
Source§fn total_balance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn total_balance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn total_pending_balance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn total_reserved_balance<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn fetch_mint_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<MintInfo>, 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<MintInfo>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn load_mint_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<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<MintInfo, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn keysets<'life0, 'async_trait>(
&'life0 self,
policy: KeysetLoadPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeySet>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn keysets<'life0, 'async_trait>(
&'life0 self,
policy: KeysetLoadPolicy,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeySet>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn active_keyset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn active_keyset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn keyset<'life0, 'async_trait>(
&'life0 self,
keyset_id: Id,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn keyset<'life0, 'async_trait>(
&'life0 self,
keyset_id: Id,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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,
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,
Source§fn get_keyset_count_fee<'life0, 'life1, 'async_trait>(
&'life0 self,
keyset_id: &'life1 Id,
count: u64,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: '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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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,
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,
Source§fn mint_quote<'life0, 'async_trait>(
&'life0 self,
method: PaymentMethod,
amount: Option<Amount>,
description: Option<String>,
extra: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MintQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mint_quote<'life0, 'async_trait>(
&'life0 self,
method: PaymentMethod,
amount: Option<Amount>,
description: Option<String>,
extra: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MintQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn melt_quote<'life0, 'async_trait>(
&'life0 self,
method: PaymentMethod,
request: String,
options: Option<MeltOptions>,
extra: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn melt_quote<'life0, 'async_trait>(
&'life0 self,
method: PaymentMethod,
request: String,
options: Option<MeltOptions>,
extra: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn cross_mint_transfer_quote_max<'life0, 'life1, 'async_trait>(
&'life0 self,
target_wallet: &'life1 Self,
) -> Pin<Box<dyn Future<Output = Result<CrossMintTransferQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn cross_mint_transfer_quote_max<'life0, 'life1, 'async_trait>(
&'life0 self,
target_wallet: &'life1 Self,
) -> Pin<Box<dyn Future<Output = Result<CrossMintTransferQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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,
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,
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,
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,
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,
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,
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,
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,
Source§fn check_all_pending_proofs<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Amount, 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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn recover_incomplete_sagas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecoveryReport, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recover_incomplete_sagas<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<RecoveryReport, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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,
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,
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,
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,
Source§fn calculate_fee<'life0, 'async_trait>(
&'life0 self,
proof_count: u64,
keyset_id: Id,
) -> Pin<Box<dyn Future<Output = Result<Amount, 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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn receive<'life0, 'life1, 'async_trait>(
&'life0 self,
encoded_token: &'life1 str,
options: ReceiveOptions,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn receive<'life0, 'life1, 'async_trait>(
&'life0 self,
encoded_token: &'life1 str,
options: ReceiveOptions,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: '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<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn prepare_send<'life0, 'async_trait>(
&'life0 self,
amount: Amount,
options: SendOptions,
) -> Pin<Box<dyn Future<Output = Result<PreparedSend<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn prepare_send<'life0, 'async_trait>(
&'life0 self,
amount: Amount,
options: SendOptions,
) -> Pin<Box<dyn Future<Output = Result<PreparedSend<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_pending_sends<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>, 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<Uuid>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn revoke_send<'life0, 'async_trait>(
&'life0 self,
operation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn revoke_send<'life0, 'async_trait>(
&'life0 self,
operation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn check_send_status<'life0, 'async_trait>(
&'life0 self,
operation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_send_status<'life0, 'async_trait>(
&'life0 self,
operation_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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,
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,
Source§fn mint_unissued_quotes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mint_unissued_quotes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn check_mint_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MintQuote, 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<MintQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn fetch_mint_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
payment_method: Option<PaymentMethod>,
) -> Pin<Box<dyn Future<Output = Result<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<PaymentMethod>,
) -> Pin<Box<dyn Future<Output = Result<MintQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn fetch_mint_quote_with_key_search<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
payment_method: Option<Self::PaymentMethod>,
key_search_limit: u32,
) -> 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_with_key_search<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
payment_method: Option<Self::PaymentMethod>,
key_search_limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Self::MintQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn prepare_melt<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
metadata: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<PreparedMelt<'_>, 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<PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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<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<PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn prepare_melt_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
encoded_token: &'life2 str,
metadata: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn prepare_melt_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
encoded_token: &'life2 str,
metadata: HashMap<String, String>,
) -> Pin<Box<dyn Future<Output = Result<PreparedMelt<'_>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn swap<'life0, 'async_trait>(
&'life0 self,
amount: Option<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 swap<'life0, 'async_trait>(
&'life0 self,
amount: Option<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,
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,
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,
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,
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,
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,
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,
Source§fn mint_blind_auth<'life0, 'async_trait>(
&'life0 self,
amount: Amount,
) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mint_blind_auth<'life0, 'async_trait>(
&'life0 self,
amount: Amount,
) -> Pin<Box<dyn Future<Output = Result<Proofs, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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,
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,
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,
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,
Source§fn restore_with_opts<'life0, 'async_trait>(
&'life0 self,
opts: NUT13Options,
) -> Pin<Box<dyn Future<Output = Result<Restored, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restore_with_opts<'life0, 'async_trait>(
&'life0 self,
opts: NUT13Options,
) -> Pin<Box<dyn Future<Output = Result<Restored, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
NUT13OptionsSource§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 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,
Source§fn subscribe_mint_quote_state<'life0, 'async_trait>(
&'life0 self,
quote_ids: Vec<String>,
method: PaymentMethod,
) -> Pin<Box<dyn Future<Output = Result<ActiveSubscription, 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: PaymentMethod,
) -> Pin<Box<dyn Future<Output = Result<ActiveSubscription, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn set_metadata_cache_ttl(&self, ttl_secs: Option<u64>)
fn set_metadata_cache_ttl(&self, ttl_secs: Option<u64>)
Source§fn set_rate_limiting_config(&self, config: Option<RateLimitConfig>)
fn set_rate_limiting_config(&self, config: Option<RateLimitConfig>)
None. Read moreSource§fn is_rate_limited(&self) -> bool
fn is_rate_limited(&self) -> bool
Source§fn flush_rate_limits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush_rate_limits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn subscribe<'life0, 'async_trait>(
&'life0 self,
params: WalletParams,
) -> Pin<Box<dyn Future<Output = Result<ActiveSubscription, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
params: WalletParams,
) -> Pin<Box<dyn Future<Output = Result<ActiveSubscription, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn melt_bip353_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
bip353_address: &'life1 str,
amount_msat: Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn melt_bip353_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
bip353_address: &'life1 str,
amount_msat: Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn melt_lightning_address_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
lightning_address: &'life1 str,
amount_msat: Amount,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn melt_lightning_address_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
lightning_address: &'life1 str,
amount_msat: Amount,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn melt_human_readable_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
amount_msat: Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn melt_human_readable_quote<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
amount_msat: Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<MeltQuote, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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,
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,
Source§fn melt_human_readable<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
amount_msat: Self::Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn melt_human_readable<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 str,
amount_msat: Self::Amount,
network: Network,
) -> Pin<Box<dyn Future<Output = Result<Self::MeltQuote, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
melt_human_readable_quote)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
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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<Vec<Proof>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: '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<Vec<Proof>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
mint)Auto Trait Implementations§
impl !RefUnwindSafe for Wallet
impl !UnwindSafe for Wallet
impl Freeze for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnsafeUnpin for Wallet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request