Browse Source

feat: nut09 structs

thesimplekid 1 year ago
parent
commit
a891613bb3
3 changed files with 25 additions and 1 deletions
  1. 2 1
      crates/cashu/Cargo.toml
  2. 2 0
      crates/cashu/src/nuts/mod.rs
  3. 21 0
      crates/cashu/src/nuts/nut09.rs

+ 2 - 1
crates/cashu/Cargo.toml

@@ -15,9 +15,10 @@ description = "Cashu rust wallet and mint library"
 default = ["mint", "wallet", "all-nuts"]
 mint = []
 wallet = []
-all-nuts = ["nut07", "nut08", "nut10", "nut11"]
+all-nuts = ["nut07", "nut08", "nut09", "nut10", "nut11"]
 nut07 = []
 nut08 = []
+nut09 = []
 nut10 = []
 nut11 = ["nut10"]
 

+ 2 - 0
crates/cashu/src/nuts/mod.rs

@@ -9,6 +9,8 @@ pub mod nut06;
 pub mod nut07;
 #[cfg(feature = "nut08")]
 pub mod nut08;
+#[cfg(feature = "nut09")]
+pub mod nut09;
 #[cfg(feature = "nut10")]
 pub mod nut10;
 #[cfg(feature = "nut11")]

+ 21 - 0
crates/cashu/src/nuts/nut09.rs

@@ -0,0 +1,21 @@
+//! Nut-09: Restore signatures
+
+use serde::{Deserialize, Serialize};
+
+use super::{BlindedMessage, BlindedSignature};
+
+/// Restore Request [NUT-09]
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct RestoreRequest {
+    /// Outputs
+    pub outputs: Vec<BlindedMessage>,
+}
+
+/// Restore Response [NUT-09]
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+pub struct RestoreResponse {
+    /// Outputs
+    pub outputs: Vec<BlindedMessage>,
+    /// Signatures
+    pub signatures: Vec<BlindedSignature>,
+}