diff --git a/moksha-core/src/primitives.rs b/moksha-core/src/primitives.rs index b3916270..05cc6e15 100644 --- a/moksha-core/src/primitives.rs +++ b/moksha-core/src/primitives.rs @@ -73,13 +73,13 @@ impl PostSplitResponse { } } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)] pub struct PostSwapRequest { pub inputs: Proofs, pub outputs: Vec, } -#[derive(Clone, Debug, Serialize, Deserialize, Default)] +#[derive(Clone, Debug, Serialize, Deserialize, Default, ToSchema)] pub struct PostSwapResponse { pub signatures: Vec, } diff --git a/moksha-mint/src/server.rs b/moksha-mint/src/server.rs index 793d1832..1b20c4db 100644 --- a/moksha-mint/src/server.rs +++ b/moksha-mint/src/server.rs @@ -85,10 +85,11 @@ pub async fn run_server( get_keys, get_keys_by_id, get_keysets, - post_mint_bolt11, post_mint_quote_bolt11, get_mint_quote_bolt11, post_melt_bolt11, + post_mint_bolt11, + post_swap, get_info, ), components(schemas( @@ -111,6 +112,8 @@ pub async fn run_server( PostMeltBolt11Response, PostMintBolt11Request, PostMintBolt11Response, + PostSwapRequest, + PostSwapResponse, )) )] struct ApiDoc; @@ -312,6 +315,14 @@ async fn get_legacy_keysets(State(mint): State) -> Result, M // ###################################################################################################### +#[utoipa::path( + post, + path = "/v1/swap", + request_body = PostSwapRequest, + responses( + (status = 200, description = "post swap", body = [PostSwapResponse]) + ), + )] async fn post_swap( State(mint): State, Json(swap_request): Json,