Skip to main content

cdk_common/
lib.rs

1//! This crate is the base foundation to build things that can interact with the CDK (Cashu
2//! Development Kit) and their internal crates.
3//!
4//! This is meant to contain the shared types, traits and common functions that are used across the
5//! internal crates.
6
7#![doc = include_str!("../README.md")]
8
9pub mod task;
10
11/// Protocol version for gRPC Mint RPC communication
12pub const MINT_RPC_PROTOCOL_VERSION: &str = "1.0.0";
13
14/// Protocol version for gRPC Signatory communication
15pub const SIGNATORY_PROTOCOL_VERSION: &str = "1.0.0";
16
17/// Protocol version for gRPC Payment Processor communication
18pub const PAYMENT_PROCESSOR_PROTOCOL_VERSION: &str = "1.0.0";
19
20#[cfg(feature = "grpc")]
21pub mod grpc;
22
23pub mod common;
24pub mod database;
25pub mod error;
26#[cfg(feature = "mint")]
27pub mod melt;
28#[cfg(feature = "mint")]
29pub mod mint;
30#[cfg(feature = "mint")]
31pub mod payment;
32pub mod pub_sub;
33#[cfg(feature = "mint")]
34pub mod state;
35pub mod subscription;
36#[cfg(feature = "wallet")]
37pub mod wallet;
38pub mod ws;
39
40// re-exporting external crates
41pub use bitcoin;
42pub use cashu::amount::{self, Amount};
43pub use cashu::lightning_invoice::{self, Bolt11Invoice};
44pub use cashu::nuts::{self, *};
45#[cfg(feature = "mint")]
46pub use cashu::quote_id::{self, *};
47pub use cashu::{dhke, ensure_cdk, mint_url, secret, util, SECP256K1};
48/// Re-export cdk-http-client types
49#[cfg(feature = "http")]
50pub use cdk_http_client::{
51    fetch, HttpClient, HttpClientBuilder, HttpError, RawResponse, RequestBuilder, Response,
52};
53// Re-export common types
54pub use common::FinalizedMelt;
55pub use error::Error;
56/// Re-export parking_lot for reuse
57pub use parking_lot;