lib.rs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #![doc = include_str!("../README.md")]
  7. pub mod task;
  8. /// Protocol version for gRPC Mint RPC communication
  9. pub const MINT_RPC_PROTOCOL_VERSION: &str = "1.0.0";
  10. /// Protocol version for gRPC Signatory communication
  11. pub const SIGNATORY_PROTOCOL_VERSION: &str = "1.0.0";
  12. /// Protocol version for gRPC Payment Processor communication
  13. pub const PAYMENT_PROCESSOR_PROTOCOL_VERSION: &str = "1.0.0";
  14. #[cfg(feature = "grpc")]
  15. pub mod grpc;
  16. pub mod common;
  17. pub mod database;
  18. pub mod error;
  19. #[cfg(feature = "mint")]
  20. pub mod melt;
  21. #[cfg(feature = "mint")]
  22. pub mod mint;
  23. #[cfg(feature = "mint")]
  24. pub mod payment;
  25. pub mod pub_sub;
  26. #[cfg(feature = "mint")]
  27. pub mod state;
  28. pub mod subscription;
  29. #[cfg(feature = "wallet")]
  30. pub mod wallet;
  31. pub mod ws;
  32. // re-exporting external crates
  33. pub use bitcoin;
  34. pub use cashu::amount::{self, Amount};
  35. pub use cashu::lightning_invoice::{self, Bolt11Invoice};
  36. pub use cashu::nuts::{self, *};
  37. #[cfg(feature = "mint")]
  38. pub use cashu::quote_id::{self, *};
  39. pub use cashu::{dhke, ensure_cdk, mint_url, secret, util, SECP256K1};
  40. /// Re-export cdk-http-client WebSocket client
  41. #[cfg(feature = "http")]
  42. pub use cdk_http_client::ws as ws_client;
  43. /// Re-export cdk-http-client types
  44. #[cfg(feature = "http")]
  45. pub use cdk_http_client::{
  46. fetch, HttpClient, HttpClientBuilder, HttpError, RawResponse, RequestBuilder, Response,
  47. };
  48. // Re-export common types
  49. pub use common::FinalizedMelt;
  50. pub use error::Error;
  51. /// Re-export parking_lot for reuse
  52. pub use parking_lot;