Skip to main content

Wallet

Struct Wallet 

Source
pub struct Wallet { /* private fields */ }
Expand description

FFI-compatible Wallet

Implementations§

Source§

impl Wallet

Source

pub fn new( mint_url: String, unit: CurrencyUnit, mnemonic: String, store: WalletStore, config: WalletConfig, ) -> Result<Self, FfiError>

Create a new Wallet

Accepts a WalletStore which can be:

  • Sqlite { path } — built-in Rust SQLite backend
  • Postgres { url } — built-in Rust Postgres backend
  • Custom { db } — foreign-language implementation of WalletDatabase
Source

pub fn mint_url(&self) -> MintUrl

Get the mint URL

Source

pub fn unit(&self) -> CurrencyUnit

Get the currency unit

Source

pub 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.

§Arguments
  • ttl_secs - Optional TTL in seconds. If None, cache never expires and is always used.
§Example
// Cache expires after 5 minutes
wallet.set_metadata_cache_ttl(Some(300));

// Cache never expires (default)
wallet.set_metadata_cache_ttl(None);
Source

pub async fn total_balance(&self) -> Result<Amount, FfiError>

Get total balance

Source

pub async fn total_pending_balance(&self) -> Result<Amount, FfiError>

Get total pending balance

Source

pub async fn total_reserved_balance(&self) -> Result<Amount, FfiError>

Get total reserved balance

Source

pub async fn fetch_mint_info(&self) -> Result<Option<MintInfo>, FfiError>

Get mint info from mint

Source

pub async fn load_mint_info(&self) -> Result<MintInfo, FfiError>

Load mint info

This will get mint info from cache if it is fresh

Source

pub async fn receive( &self, token: Arc<Token>, options: ReceiveOptions, ) -> Result<Amount, FfiError>

Receive tokens

Source

pub async fn restore(&self) -> Result<Restored, FfiError>

Restore wallet from seed

Source

pub async fn restore_with_opts( &self, opts: NUT13Options, ) -> Result<Restored, FfiError>

Restore wallet from seed with custom NUT-13 options

Source

pub async fn verify_token_dleq(&self, token: Arc<Token>) -> Result<(), FfiError>

Verify token DLEQ proofs

Source

pub async fn receive_proofs( &self, proofs: Proofs, options: ReceiveOptions, memo: Option<String>, token: Option<String>, ) -> Result<Amount, FfiError>

Receive proofs directly

Source

pub async fn get_pending_sends(&self) -> Result<Vec<String>, FfiError>

Get all pending send operations

Source

pub async fn revoke_send( &self, operation_id: String, ) -> Result<Amount, FfiError>

Revoke a pending send operation

Source

pub async fn check_send_status( &self, operation_id: String, ) -> Result<bool, FfiError>

Check status of a pending send operation

Source

pub async fn prepare_send( &self, amount: Amount, options: SendOptions, ) -> Result<Arc<PreparedSend>, FfiError>

Prepare a send operation

Source

pub async fn mint_quote( &self, payment_method: PaymentMethod, amount: Option<Amount>, description: Option<String>, extra: Option<String>, ) -> Result<MintQuote, FfiError>

Get a mint quote

Source

pub async fn check_mint_quote( &self, quote_id: String, ) -> Result<MintQuote, FfiError>

Check a mint quote status from the mint.

Calls GET /v1/mint/quote/{method}/{quote_id} per NUT-04. Updates local store with current state from mint. 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.

Source

pub async fn check_mint_quote_status( &self, quote_id: String, ) -> Result<MintQuote, FfiError>

Check a mint quote status from the mint.

Calls GET /v1/mint/quote/{method}/{quote_id} per NUT-04. Updates local store with current state from mint. 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.

Source

pub async fn fetch_mint_quote( &self, quote_id: String, payment_method: Option<PaymentMethod>, ) -> Result<MintQuote, FfiError>

Fetch a mint quote from the mint and store it locally

Works with all payment methods (Bolt11, Bolt12, and custom payment methods).

§Arguments
  • quote_id - The ID of the quote to fetch
  • payment_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.
Source

pub async fn mint( &self, quote_id: String, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Result<Proofs, FfiError>

Mint tokens

Source

pub async fn prepare_melt( &self, quote_id: String, ) -> Result<PreparedMelt, FfiError>

Prepare a melt operation

Returns a PreparedMelt that can be confirmed or cancelled.

Source

pub async fn prepare_melt_proofs( &self, quote_id: String, proofs: Proofs, ) -> Result<PreparedMelt, FfiError>

Prepare a melt operation with specific proofs

This method allows melting proofs that may not be in the wallet’s database, similar to how receive_proofs handles external proofs. The proofs will be added to the database and used for the melt operation.

§Arguments
  • quote_id - The melt quote ID (obtained from melt_quote)
  • proofs - The proofs to melt (can be external proofs not in the wallet’s database)
§Returns

A PreparedMelt that can be confirmed or cancelled

Source

pub async fn prepare_melt_token( &self, quote_id: String, encoded_token: String, ) -> Result<PreparedMelt, FfiError>

Prepare a melt operation from an encoded token

Decodes the token internally (handling keyset state for v2 keysets), extracts proofs, and prepares the melt operation.

§Arguments
  • quote_id - The melt quote ID (obtained from melt_quote)
  • encoded_token - The encoded token string (cashuA or cashuB format)
§Returns

A PreparedMelt that can be confirmed or cancelled

Source

pub async fn mint_unified( &self, quote_id: String, amount_split_target: SplitTarget, spending_conditions: Option<SpendingConditions>, ) -> Result<Proofs, FfiError>

Source

pub async fn melt_quote( &self, method: PaymentMethod, request: String, options: Option<MeltOptions>, extra: Option<String>, ) -> Result<MeltQuote, FfiError>

Get a melt quote using a unified interface for any payment method

This method supports bolt11, bolt12, and custom payment methods. For custom methods, you can pass extra JSON data that will be forwarded to the payment processor.

§Arguments
  • method - Payment method to use (bolt11, bolt12, or custom)
  • request - Payment request string (invoice, offer, or custom format)
  • options - Optional melt options (MPP, amountless, etc.)
  • extra - Optional JSON string with extra payment-method-specific fields (for custom methods)
Source

pub async fn quote_onchain_melt_options( &self, address: String, amount: Amount, max_fee_amount: Option<Amount>, ) -> Result<Vec<MeltQuote>, FfiError>

Fetch available onchain melt quote options.

Each returned quote represents one selectable confirmation target/fee reserve. Pass the chosen quote to select_onchain_melt_quote, then prepare and confirm the returned quote ID through the normal melt flow.

Source

pub async fn select_onchain_melt_quote( &self, quote: MeltQuote, ) -> Result<MeltQuote, FfiError>

Persist the selected onchain melt quote before preparing it.

Source

pub async fn check_melt_quote_status( &self, quote_id: String, ) -> Result<MeltQuote, FfiError>

Check melt quote status and attempt to complete any in-progress saga.

Source

pub async fn finalize_pending_melts( &self, ) -> Result<Vec<FinalizedMelt>, FfiError>

Finalize pending melt operations for this wallet.

Source

pub async fn swap( &self, amount: Option<Amount>, amount_split_target: SplitTarget, input_proofs: Proofs, spending_conditions: Option<SpendingConditions>, include_fees: bool, ) -> Result<Option<Proofs>, FfiError>

Swap proofs

Source

pub async fn get_proofs_by_states( &self, states: Vec<ProofState>, ) -> Result<Proofs, FfiError>

Get proofs by states

Source

pub async fn check_proofs_spent( &self, proofs: Proofs, ) -> Result<Vec<bool>, FfiError>

Check if proofs are spent

Source

pub async fn list_transactions( &self, direction: Option<TransactionDirection>, ) -> Result<Vec<Transaction>, FfiError>

List transactions

Source

pub async fn get_transaction( &self, id: TransactionId, ) -> Result<Option<Transaction>, FfiError>

Get transaction by ID

Source

pub async fn get_proofs_for_transaction( &self, id: TransactionId, ) -> Result<Vec<Proof>, FfiError>

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.

Source

pub async fn revert_transaction( &self, id: TransactionId, ) -> Result<(), FfiError>

Revert a transaction

Source

pub async fn subscribe( &self, params: SubscribeParams, ) -> Result<Arc<ActiveSubscription>, FfiError>

Subscribe to wallet events

Source

pub async fn subscribe_mint_quote_state( &self, quote_ids: Vec<String>, payment_method: PaymentMethod, ) -> Result<Arc<ActiveSubscription>, FfiError>

Subscribe to mint quote state updates

Convenience method that creates a subscription to receive notifications when any of the given mint quotes change state (e.g., Unpaid → Paid → Issued).

Use recv() on the returned ActiveSubscription to receive updates as NotificationPayload::MintQuoteUpdate.

All quote IDs must belong to the same payment method.

§Arguments
  • quote_ids - The IDs of the mint quotes to monitor
  • payment_method - The payment method of the quotes
Source

pub async fn refresh_keysets(&self) -> Result<Vec<KeySetInfo>, FfiError>

Refresh keysets from the mint

Source

pub async fn get_active_keyset(&self) -> Result<KeySetInfo, FfiError>

Get the active keyset for the wallet’s unit

Source

pub async fn get_keyset_fees_by_id( &self, keyset_id: String, ) -> Result<u64, FfiError>

Get fees for a specific keyset ID

Source

pub async fn load_keyset_keys( &self, keyset_id: String, ) -> Result<Keys, FfiError>

Load keys for a specific keyset

Source

pub async fn get_mint_keysets( &self, filter: KeysetFilter, ) -> Result<Vec<KeySetInfo>, FfiError>

Get keysets for this wallet’s unit with filter

Source

pub async fn load_mint_keysets(&self) -> Result<Vec<KeySetInfo>, FfiError>

Load active keysets

Source

pub async fn fetch_active_keyset(&self) -> Result<KeySetInfo, FfiError>

Fetch active keyset with lowest fees

Source

pub async fn get_keyset_fees_and_amounts( &self, ) -> Result<HashMap<String, FeeAndAmounts>, FfiError>

Get fees and amounts for all keysets

Source

pub async fn get_keyset_fees_and_amounts_by_id( &self, keyset_id: String, ) -> Result<FeeAndAmounts, FfiError>

Get fees and amounts for a specific keyset

Source

pub async fn get_keyset_count_fee( &self, keyset_id: String, count: u64, ) -> Result<Amount, FfiError>

Get fee for count of proofs in a keyset

Source

pub async fn check_all_pending_proofs(&self) -> Result<Amount, FfiError>

Check all pending proofs and return the total amount still pending

This function checks orphaned pending proofs (not managed by active sagas) with the mint and marks spent proofs accordingly.

Source

pub async fn recover_incomplete_sagas(&self) -> Result<RecoveryReport, FfiError>

Recover from incomplete wallet sagas after a crash

Handles interrupted swap, send, receive, issue, and melt operations. Requires network access to the mint for states that need external status checks.

Source

pub async fn calculate_fee( &self, proof_count: u32, keyset_id: String, ) -> Result<Amount, FfiError>

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

Source

pub async fn pay_request( &self, payment_request: Arc<PaymentRequest>, custom_amount: Option<Amount>, ) -> Result<(), FfiError>

Pay a NUT-18 payment request

This method prepares and sends a payment for the given payment request. It will use the Nostr or HTTP transport specified in the request.

§Arguments
  • payment_request - The NUT-18 payment request to pay
  • custom_amount - Optional amount to pay (required if request has no amount)
Source§

impl Wallet

BIP353 methods for Wallet

Source

pub async fn melt_bip353_quote( &self, bip353_address: String, amount_msat: Amount, network: BitcoinNetwork, ) -> Result<MeltQuote, FfiError>

Get a quote for a BIP353 melt

This method resolves a BIP353 address (e.g., “alice@example.com”) to a Bitcoin payment instruction, requires a BOLT12 offer, and then creates a melt quote for it.

The network parameter controls which on-chain address prefixes are accepted in the resolved URI.

Source

pub async fn melt_lightning_address_quote( &self, lightning_address: String, amount_msat: Amount, ) -> Result<MeltQuote, FfiError>

Get a quote for a Lightning address melt

This method resolves a Lightning address (e.g., “alice@example.com”) to a Lightning invoice and then creates a melt quote for that invoice.

Source

pub async fn melt_human_readable( &self, address: String, amount_msat: Amount, network: BitcoinNetwork, ) -> Result<MeltQuote, FfiError>

Get a quote for a human-readable address melt

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:

  1. If the mint supports Bolt12, it tries BIP353 first
  2. Falls back to Lightning address only if BIP353 resolution fails
  3. If BIP353 resolves but has no usable BOLT12 offer, it does NOT fall back
  4. 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.

Source

pub async fn melt_human_readable_quote( &self, address: String, amount_msat: Amount, network: BitcoinNetwork, ) -> Result<MeltQuote, FfiError>

Get a quote for a human-readable address melt

Accepts a human-readable address that could be either a BIP353 address or a Lightning address. Tries BIP353 first if mint supports Bolt12, falls back to Lightning address.

Source§

impl Wallet

Auth methods for Wallet

Source

pub async fn set_cat(&self, cat: String) -> Result<(), FfiError>

Set Clear Auth Token (CAT) for authentication

Source

pub async fn set_refresh_token( &self, refresh_token: String, ) -> Result<(), FfiError>

Set refresh token for authentication

Source

pub async fn refresh_access_token(&self) -> Result<(), FfiError>

Refresh access token using the stored refresh token

Source

pub async fn mint_blind_auth(&self, amount: Amount) -> Result<Proofs, FfiError>

Mint blind auth tokens

Source

pub async fn get_unspent_auth_proofs(&self) -> Result<Vec<AuthProof>, FfiError>

Get unspent auth proofs

Trait Implementations§

Source§

impl<UT> LiftRef<UT> for Wallet

Source§

impl<UT> LowerError<UT> for Wallet

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for Wallet

Source§

type ReturnType = <Arc<Wallet> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
Source§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for Wallet

Source§

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,

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

Source§

type Error = FfiError

Error type
Source§

type Amount = Amount

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

type MintUrl = MintUrl

Mint URL type
Source§

type CurrencyUnit = CurrencyUnit

Currency unit type
Source§

type MintInfo = MintInfo

Mint info type
Source§

type KeySetInfo = KeySetInfo

Keyset info type
Source§

type MintQuote = MintQuote

Mint quote type
Source§

type MeltQuote = MeltQuote

Melt quote type
Source§

type PaymentMethod = PaymentMethod

Payment method type
Source§

type MeltOptions = MeltOptions

Melt options type
Source§

type OperationId = String

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

type PreparedSend<'a> = Arc<PreparedSend>

Prepared send type
Source§

type PreparedMelt<'a> = PreparedMelt

Prepared melt type
Source§

type Subscription = Arc<ActiveSubscription>

Active subscription handle for receiving notifications
Source§

type SubscribeParams = SubscribeParams

Subscribe params type
Source§

type RecoveryReport = RecoveryReport

Saga recovery report type
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 recover_incomplete_sagas<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::RecoveryReport, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Recover from incomplete operations after a crash
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<Arc<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<String>, 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: String, ) -> 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: String, ) -> 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<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<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 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,

Prepare a melt operation from an encoded token Read more
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 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,

Restore wallet from seed with custom NUT13Options
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<Arc<ActiveSubscription>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to mint quote state updates Read more
Source§

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

Set metadata cache TTL (time-to-live) in seconds Read more
Source§

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

Subscribe to wallet events
Source§

fn melt_bip353_quote<'life0, 'life1, 'async_trait>( &'life0 self, bip353_address: &'life1 str, amount_msat: Self::Amount, network: Network, ) -> 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 BIP353 address
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 melt_human_readable_quote<'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 Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a melt quote for a human-readable address Read more
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 Read more
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 'life0: 'async_trait, Self: 'async_trait,

Load active keysets (alias for get_mint_keysets with Active filter)
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,

Get a melt quote for a human-readable address (alias for 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,

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<Vec<Proof>, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Mint tokens for a quote (alias for mint)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>
where T: Sized,

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

Source§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
Source§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
Source§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
Source§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more