diff --git a/crates/cdk-axum/src/lib.rs b/crates/cdk-axum/src/lib.rs index 8351d9a8..7910da6d 100644 --- a/crates/cdk-axum/src/lib.rs +++ b/crates/cdk-axum/src/lib.rs @@ -17,6 +17,7 @@ use cdk::nuts::nut00::{ }; use cdk::nuts::nut01::{Keys, KeysResponse, PublicKey, SecretKey}; use cdk::nuts::nut02::{Id, KeySet, KeySetInfo, KeySetVersion, KeysetResponse}; +use cdk::nuts::nut03::{SwapRequest, SwapResponse}; use cdk::nuts::nut04; use cdk::nuts::nut04::{ MintBolt11Request, MintBolt11Response, MintMethodSettings, MintQuoteBolt11Request, @@ -88,6 +89,8 @@ pub struct MintState { PublicKey, SecretKey, SupportedSettings, + SwapRequest, + SwapResponse, Witness, nut04::Settings, nut05::Settings, @@ -104,7 +107,8 @@ pub struct MintState { post_mint_bolt11, get_melt_bolt11_quote, get_check_melt_bolt11_quote, - post_melt_bolt11 + post_melt_bolt11, + post_swap ) )] /// OpenAPI spec for the mint's v1 APIs diff --git a/crates/cdk-axum/src/router_handlers.rs b/crates/cdk-axum/src/router_handlers.rs index 00197ddd..fbd89920 100644 --- a/crates/cdk-axum/src/router_handlers.rs +++ b/crates/cdk-axum/src/router_handlers.rs @@ -311,6 +311,21 @@ pub async fn get_mint_info(State(state): State) -> Result, Json(payload): Json, diff --git a/crates/cdk/src/nuts/nut03.rs b/crates/cdk/src/nuts/nut03.rs index eca008ba..101a0f57 100644 --- a/crates/cdk/src/nuts/nut03.rs +++ b/crates/cdk/src/nuts/nut03.rs @@ -34,8 +34,10 @@ pub struct PreSwap { /// Split Request [NUT-06] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))] pub struct SwapRequest { /// Proofs that are to be spent in `Split` + #[cfg_attr(feature = "mint", schema(value_type = Vec))] pub inputs: Proofs, /// Blinded Messages for Mint to sign pub outputs: Vec, @@ -64,6 +66,7 @@ impl SwapRequest { /// Split Response [NUT-06] #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr(feature = "mint", derive(utoipa::ToSchema))] pub struct SwapResponse { /// Promises pub signatures: Vec,