msggen: Add pay descriptions and maxfee

This commit is contained in:
Christian Decker 2022-04-07 17:23:41 +02:00 committed by Rusty Russell
parent 767da45037
commit 9a8bc777e5
4 changed files with 20 additions and 0 deletions

View file

@ -641,6 +641,7 @@
"ListPays.pays[].bolt11": 6,
"ListPays.pays[].bolt12": 7,
"ListPays.pays[].created_at": 4,
"ListPays.pays[].description": 11,
"ListPays.pays[].destination": 3,
"ListPays.pays[].erroronion": 10,
"ListPays.pays[].label": 5,
@ -763,6 +764,7 @@
"ListSendPays.payments[].bolt11": 10,
"ListSendPays.payments[].bolt12": 11,
"ListSendPays.payments[].created_at": 7,
"ListSendPays.payments[].description": 14,
"ListSendPays.payments[].destination": 6,
"ListSendPays.payments[].erroronion": 13,
"ListSendPays.payments[].groupid": 2,
@ -818,11 +820,13 @@
},
"PayRequest": {
"Pay.bolt11": 1,
"Pay.description": 12,
"Pay.exclude": 10,
"Pay.exemptfee": 7,
"Pay.label": 3,
"Pay.localofferid": 9,
"Pay.maxdelay": 6,
"Pay.maxfee": 11,
"Pay.maxfeepercent": 4,
"Pay.msatoshi": 2,
"Pay.retry_for": 5,

View file

@ -702,6 +702,7 @@ message ListsendpaysPayments {
Amount amount_sent_msat = 8;
optional string label = 9;
optional string bolt11 = 10;
optional string description = 14;
optional string bolt12 = 11;
optional bytes payment_preimage = 12;
optional bytes erroronion = 13;
@ -781,6 +782,8 @@ message PayRequest {
optional Amount exemptfee = 7;
optional bytes localofferid = 9;
repeated string exclude = 10;
optional Amount maxfee = 11;
optional string description = 12;
}
message PayResponse {
@ -1225,6 +1228,7 @@ message ListpaysPays {
uint64 created_at = 4;
optional string label = 5;
optional string bolt11 = 6;
optional string description = 11;
optional string bolt12 = 7;
optional Amount amount_msat = 8;
optional Amount amount_sent_msat = 9;

View file

@ -509,6 +509,7 @@ impl From<&responses::ListsendpaysPayments> for pb::ListsendpaysPayments {
amount_sent_msat: Some(c.amount_sent_msat.into()), // Rule #2 for type msat
label: c.label.clone(), // Rule #2 for type string?
bolt11: c.bolt11.clone(), // Rule #2 for type string?
description: c.description.clone(), // Rule #2 for type string?
bolt12: c.bolt12.clone(), // Rule #2 for type string?
payment_preimage: c.payment_preimage.clone().map(|v| v.to_vec()), // Rule #2 for type secret?
erroronion: c.erroronion.as_ref().map(|v| hex::decode(&v).unwrap()), // Rule #2 for type hex?
@ -908,6 +909,7 @@ impl From<&responses::ListpaysPays> for pb::ListpaysPays {
created_at: c.created_at.clone(), // Rule #2 for type u64
label: c.label.clone(), // Rule #2 for type string?
bolt11: c.bolt11.clone(), // Rule #2 for type string?
description: c.description.clone(), // Rule #2 for type string?
bolt12: c.bolt12.clone(), // Rule #2 for type string?
amount_msat: c.amount_msat.map(|f| f.into()), // Rule #2 for type msat?
amount_sent_msat: c.amount_sent_msat.map(|f| f.into()), // Rule #2 for type msat?
@ -1233,6 +1235,8 @@ impl From<&pb::PayRequest> for requests::PayRequest {
exemptfee: c.exemptfee.as_ref().map(|a| a.into()), // Rule #1 for type msat?
localofferid: c.localofferid.clone().map(|v| hex::encode(v)), // Rule #1 for type hex?
exclude: Some(c.exclude.iter().map(|s| s.into()).collect()), // Rule #4
maxfee: c.maxfee.as_ref().map(|a| a.into()), // Rule #1 for type msat?
description: c.description.clone(), // Rule #1 for type string?
}
}
}

View file

@ -478,6 +478,10 @@ pub mod requests {
pub localofferid: Option<String>,
#[serde(alias = "exclude", skip_serializing_if = "Option::is_none")]
pub exclude: Option<Vec<String>>,
#[serde(alias = "maxfee", skip_serializing_if = "Option::is_none")]
pub maxfee: Option<Amount>,
#[serde(alias = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
@ -1860,6 +1864,8 @@ pub mod responses {
pub label: Option<String>,
#[serde(alias = "bolt11", skip_serializing_if = "Option::is_none")]
pub bolt11: Option<String>,
#[serde(alias = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(alias = "bolt12", skip_serializing_if = "Option::is_none")]
pub bolt12: Option<String>,
#[serde(alias = "payment_preimage", skip_serializing_if = "Option::is_none")]
@ -2643,6 +2649,8 @@ pub mod responses {
pub label: Option<String>,
#[serde(alias = "bolt11", skip_serializing_if = "Option::is_none")]
pub bolt11: Option<String>,
#[serde(alias = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(alias = "bolt12", skip_serializing_if = "Option::is_none")]
pub bolt12: Option<String>,
#[serde(alias = "amount_msat", skip_serializing_if = "Option::is_none")]