@@ -149,6 +149,18 @@ pub enum RoutePath {
149149 /// Mint Blind Auth
150150 #[ serde( rename = "/v1/auth/blind/mint" ) ]
151151 MintBlindAuth ,
152+ /// Bolt12 Mint Quote
153+ #[ serde( rename = "/v1/mint/quote/bolt12" ) ]
154+ MintQuoteBolt12 ,
155+ /// Bolt12 Mint
156+ #[ serde( rename = "/v1/mint/bolt12" ) ]
157+ MintBolt12 ,
158+ /// Bolt12 Melt Quote
159+ #[ serde( rename = "/v1/melt/quote/bolt12" ) ]
160+ MeltQuoteBolt12 ,
161+ /// Bolt12 Quote
162+ #[ serde( rename = "/v1/melt/bolt12" ) ]
163+ MeltBolt12 ,
152164}
153165
154166/// Returns [`RoutePath`]s that match regex
@@ -195,6 +207,8 @@ mod tests {
195207 assert ! ( paths. contains( & RoutePath :: Checkstate ) ) ;
196208 assert ! ( paths. contains( & RoutePath :: Restore ) ) ;
197209 assert ! ( paths. contains( & RoutePath :: MintBlindAuth ) ) ;
210+ assert ! ( paths. contains( & RoutePath :: MintQuoteBolt12 ) ) ;
211+ assert ! ( paths. contains( & RoutePath :: MintBolt12 ) ) ;
198212 }
199213
200214 #[ test]
@@ -203,13 +217,17 @@ mod tests {
203217 let paths = matching_route_paths ( "^/v1/mint/.*" ) . unwrap ( ) ;
204218
205219 // Should match only mint paths
206- assert_eq ! ( paths. len( ) , 2 ) ;
220+ assert_eq ! ( paths. len( ) , 4 ) ;
207221 assert ! ( paths. contains( & RoutePath :: MintQuoteBolt11 ) ) ;
208222 assert ! ( paths. contains( & RoutePath :: MintBolt11 ) ) ;
223+ assert ! ( paths. contains( & RoutePath :: MintQuoteBolt12 ) ) ;
224+ assert ! ( paths. contains( & RoutePath :: MintBolt12 ) ) ;
209225
210226 // Should not match other paths
211227 assert ! ( !paths. contains( & RoutePath :: MeltQuoteBolt11 ) ) ;
212228 assert ! ( !paths. contains( & RoutePath :: MeltBolt11 ) ) ;
229+ assert ! ( !paths. contains( & RoutePath :: MeltQuoteBolt12 ) ) ;
230+ assert ! ( !paths. contains( & RoutePath :: MeltBolt12 ) ) ;
213231 assert ! ( !paths. contains( & RoutePath :: Swap ) ) ;
214232 }
215233
@@ -219,9 +237,11 @@ mod tests {
219237 let paths = matching_route_paths ( ".*/quote/.*" ) . unwrap ( ) ;
220238
221239 // Should match only quote paths
222- assert_eq ! ( paths. len( ) , 2 ) ;
240+ assert_eq ! ( paths. len( ) , 4 ) ;
223241 assert ! ( paths. contains( & RoutePath :: MintQuoteBolt11 ) ) ;
224242 assert ! ( paths. contains( & RoutePath :: MeltQuoteBolt11 ) ) ;
243+ assert ! ( paths. contains( & RoutePath :: MintQuoteBolt12 ) ) ;
244+ assert ! ( paths. contains( & RoutePath :: MeltQuoteBolt12 ) ) ;
225245
226246 // Should not match non-quote paths
227247 assert ! ( !paths. contains( & RoutePath :: MintBolt11 ) ) ;
@@ -336,12 +356,14 @@ mod tests {
336356 "https://example.com/.well-known/openid-configuration"
337357 ) ;
338358 assert_eq ! ( settings. client_id, "client123" ) ;
339- assert_eq ! ( settings. protected_endpoints. len( ) , 3 ) ; // 2 mint paths + 1 swap path
359+ assert_eq ! ( settings. protected_endpoints. len( ) , 5 ) ; // 3 mint paths + 1 swap path
340360
341361 let expected_protected: HashSet < ProtectedEndpoint > = HashSet :: from_iter ( vec ! [
342362 ProtectedEndpoint :: new( Method :: Post , RoutePath :: Swap ) ,
343363 ProtectedEndpoint :: new( Method :: Get , RoutePath :: MintBolt11 ) ,
344364 ProtectedEndpoint :: new( Method :: Get , RoutePath :: MintQuoteBolt11 ) ,
365+ ProtectedEndpoint :: new( Method :: Get , RoutePath :: MintQuoteBolt12 ) ,
366+ ProtectedEndpoint :: new( Method :: Get , RoutePath :: MintBolt12 ) ,
345367 ] ) ;
346368
347369 let deserlized_protected = settings. protected_endpoints . into_iter ( ) . collect ( ) ;
0 commit comments