pub struct MeltQuoteCustomResponse<Q> {
pub quote: Q,
pub amount: Amount,
pub fee_reserve: Amount,
pub state: QuoteState,
pub expiry: u64,
pub payment_preimage: Option<String>,
pub change: Option<Vec<BlindSignature>>,
pub request: Option<String>,
pub unit: Option<CurrencyUnit>,
pub extra: Value,
}Expand description
Custom payment method melt quote response
This is a generic response type for custom payment methods.
The extra field allows payment-method-specific fields to be included
without being nested. When serialized, extra fields merge into the parent JSON:
{
"quote": "abc123",
"state": "UNPAID",
"amount": 1000,
"fee_reserve": 10,
"custom_field": "value"
}This separation enables proper validation layering: the mint verifies well-defined fields (amount, fee_reserve, state, etc.) while passing extra through to the gRPC payment processor for method-specific validation.
It also provides a clean upgrade path: when a payment method becomes speced,
its fields can be promoted from extra to well-defined struct fields without
breaking existing clients.
Fields§
§quote: QQuote ID
amount: AmountAmount to be melted
fee_reserve: AmountFee reserve required
state: QuoteStateQuote State
expiry: u64Unix timestamp until the quote is valid
payment_preimage: Option<String>Payment preimage (if payment completed)
change: Option<Vec<BlindSignature>>Change (blinded signatures for overpaid amount)
request: Option<String>Payment request (optional, for reference)
unit: Option<CurrencyUnit>Currency unit
extra: ValueExtra payment-method-specific fields
These fields are flattened into the JSON representation, allowing custom payment methods to include additional data without nesting.
Implementations§
Source§impl<Q> MeltQuoteCustomResponse<Q>where
Q: ToString,
impl<Q> MeltQuoteCustomResponse<Q>where
Q: ToString,
Sourcepub fn to_string_id(&self) -> MeltQuoteCustomResponse<String>
pub fn to_string_id(&self) -> MeltQuoteCustomResponse<String>
Convert the MeltQuoteCustomResponse with a quote type Q to a String
Source§impl<Q> MeltQuoteCustomResponse<Q>
impl<Q> MeltQuoteCustomResponse<Q>
Sourcepub fn change_amount(&self) -> Option<Amount>
pub fn change_amount(&self) -> Option<Amount>
Total change Amount
Trait Implementations§
Source§impl<Q> Clone for MeltQuoteCustomResponse<Q>where
Q: Clone,
impl<Q> Clone for MeltQuoteCustomResponse<Q>where
Q: Clone,
Source§fn clone(&self) -> MeltQuoteCustomResponse<Q>
fn clone(&self) -> MeltQuoteCustomResponse<Q>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Q> Debug for MeltQuoteCustomResponse<Q>where
Q: Debug,
impl<Q> Debug for MeltQuoteCustomResponse<Q>where
Q: Debug,
Source§impl<'de, Q> Deserialize<'de> for MeltQuoteCustomResponse<Q>where
Q: Serialize + for<'a> Deserialize<'a>,
impl<'de, Q> Deserialize<'de> for MeltQuoteCustomResponse<Q>where
Q: Serialize + for<'a> Deserialize<'a>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MeltQuoteCustomResponse<Q>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MeltQuoteCustomResponse<Q>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<MeltQuoteCustomResponse<QuoteId>> for MeltQuoteCustomResponse<String>
Available on crate feature mint only.
impl From<MeltQuoteCustomResponse<QuoteId>> for MeltQuoteCustomResponse<String>
mint only.