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::Rng;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let seed = rand::thread_rng().gen::<[u8; 32]>();
let mint_url = "https://testnut.cashu.space";
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::MultiMintWallet;
Modules§
- multi_
mint_ wallet - MultiMint Wallet
- subscription
- Client for subscriptions
- types
- Wallet Types
- util
- Wallet Utility Functions
Structs§
- Auth
Http Client - Http Client
- Auth
Wallet - CDK Auth Wallet
- Http
Client - Http Client
- Melt
Quote - Melt Quote Info
- Mint
Quote - Mint Quote Info
- Prepared
Send - Prepared send
- Send
Memo - Send memo
- Send
Options - Send options
- Wallet
- CDK Wallet
- Wallet
Builder - Builder for creating a new
Wallet
Enums§
- Send
Kind - Send Kind
- Wallet
Subscription - Wallet Subscription filter
Traits§
- Auth
Mint Connector - Interface that connects a wallet to a mint. Typically represents an [HttpClient].
- Mint
Connector - Interface that connects a wallet to a mint. Typically represents an HttpClient.