|
@@ -1,8 +1,9 @@
|
|
-//! Mint Tokens
|
|
|
|
|
|
+//! Mint Tokens via Bolt11
|
|
// https://github.com/cashubtc/nuts/blob/main/04.md
|
|
// https://github.com/cashubtc/nuts/blob/main/04.md
|
|
use serde::{Deserialize, Serialize};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
use super::{BlindedMessage, BlindedSignature, CurrencyUnit, PaymentMethod};
|
|
use super::{BlindedMessage, BlindedSignature, CurrencyUnit, PaymentMethod};
|
|
|
|
+use crate::types::MintQuote;
|
|
use crate::Amount;
|
|
use crate::Amount;
|
|
|
|
|
|
/// Mint quote request [NUT-04]
|
|
/// Mint quote request [NUT-04]
|
|
@@ -27,6 +28,17 @@ pub struct MintQuoteBolt11Response {
|
|
pub expiry: u64,
|
|
pub expiry: u64,
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+impl From<MintQuote> for MintQuoteBolt11Response {
|
|
|
|
+ fn from(mint_quote: MintQuote) -> MintQuoteBolt11Response {
|
|
|
|
+ MintQuoteBolt11Response {
|
|
|
|
+ quote: mint_quote.id,
|
|
|
|
+ request: mint_quote.request,
|
|
|
|
+ paid: mint_quote.paid,
|
|
|
|
+ expiry: mint_quote.expiry,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
/// Mint request [NUT-04]
|
|
/// Mint request [NUT-04]
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct MintBolt11Request {
|
|
pub struct MintBolt11Request {
|