Module wallet

Module wallet 

Source
Expand description

§CDK Wallet

The CDK Wallet is a high level Cashu wallet. The Wallet is for a single mint and single unit. Multiple Wallets can be created to support multi mints and multi units.

§Example

§Create Wallet

  use std::sync::Arc;
  use cdk::nuts::CurrencyUnit;
  use cdk::wallet::Wallet;
  use cdk_sqlite::wallet::memory;
  use rand::random;

  #[tokio::main]
  async fn main() -> anyhow::Result<()> {
    let seed = random::<[u8; 64]>();
    let mint_url = "https://fake.thesimplekid.dev";
    let unit = CurrencyUnit::Sat;

    let localstore = memory::empty().await?;
    let wallet = Wallet::new(mint_url, unit, Arc::new(localstore), seed, None);
    Ok(())
  }

Re-exports§

pub use multi_mint_wallet::MultiMintReceiveOptions;
pub use multi_mint_wallet::MultiMintSendOptions;
pub use multi_mint_wallet::MultiMintWallet;

Modules§

multi_mint_wallet
MultiMint Wallet
payment_request
Utilities for paying NUT-18 Payment Requests.
subscription
Client for subscriptions
types
Wallet Types
util
Wallet Utility Functions

Structs§

AuthWallet
CDK Auth Wallet
BaseAuthHttpClient
Http Client
BaseHttpClient
Http Client
MeltQuote
Melt Quote Info
MintQuote
Mint Quote Info
PreparedSend
Prepared send
ReceiveOptions
Receive options
SendMemo
Send memo
SendOptions
Send options
Wallet
CDK Wallet
WalletBuilder
Builder for creating a new Wallet

Enums§

SendKind
Send Kind
WalletSubscription
Wallet Subscription filter

Traits§

AuthMintConnector
Interface that connects a wallet to a mint. Typically represents an HttpClient.
HttpTransport
Expected HTTP Transport
MintConnector
Interface that connects a wallet to a mint. Typically represents an HttpClient.

Type Aliases§

AuthHttpClient
Auth HTTP Client with async transport
HttpClient
Http Client with async transport