1
2use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Debug, Serialize, Deserialize)]
16#[serde(tag = "method", content = "params")]
17#[serde(rename_all = "lowercase")]
18pub enum Request {
19 Getinfo(requests::GetinfoRequest),
20 ListPeers(requests::ListpeersRequest),
21 ListFunds(requests::ListfundsRequest),
22 SendPay(requests::SendpayRequest),
23 ListChannels(requests::ListchannelsRequest),
24 AddGossip(requests::AddgossipRequest),
25 AddPsbtOutput(requests::AddpsbtoutputRequest),
26 #[serde(rename = "autoclean-once")]
27 AutoCleanOnce(requests::AutocleanonceRequest),
28 #[serde(rename = "autoclean-status")]
29 AutoCleanStatus(requests::AutocleanstatusRequest),
30 CheckMessage(requests::CheckmessageRequest),
31 Close(requests::CloseRequest),
32 Connect(requests::ConnectRequest),
33 CreateInvoice(requests::CreateinvoiceRequest),
34 Datastore(requests::DatastoreRequest),
35 DatastoreUsage(requests::DatastoreusageRequest),
36 CreateOnion(requests::CreateonionRequest),
37 DelDatastore(requests::DeldatastoreRequest),
38 DelInvoice(requests::DelinvoiceRequest),
39 #[serde(rename = "dev-forget-channel")]
40 DevForgetChannel(requests::DevforgetchannelRequest),
41 EmergencyRecover(requests::EmergencyrecoverRequest),
42 GetEmergencyRecoverData(requests::GetemergencyrecoverdataRequest),
43 ExposeSecret(requests::ExposesecretRequest),
44 Recover(requests::RecoverRequest),
45 RecoverChannel(requests::RecoverchannelRequest),
46 Invoice(requests::InvoiceRequest),
47 InvoiceRequest(requests::InvoicerequestRequest),
48 DisableInvoiceRequest(requests::DisableinvoicerequestRequest),
49 ListInvoiceRequests(requests::ListinvoicerequestsRequest),
50 ListDatastore(requests::ListdatastoreRequest),
51 ListInvoices(requests::ListinvoicesRequest),
52 SendOnion(requests::SendonionRequest),
53 ListSendPays(requests::ListsendpaysRequest),
54 ListTransactions(requests::ListtransactionsRequest),
55 MakeSecret(requests::MakesecretRequest),
56 Pay(requests::PayRequest),
57 ListNodes(requests::ListnodesRequest),
58 WaitAnyInvoice(requests::WaitanyinvoiceRequest),
59 WaitInvoice(requests::WaitinvoiceRequest),
60 WaitSendPay(requests::WaitsendpayRequest),
61 NewAddr(requests::NewaddrRequest),
62 Withdraw(requests::WithdrawRequest),
63 KeySend(requests::KeysendRequest),
64 FundPsbt(requests::FundpsbtRequest),
65 SendPsbt(requests::SendpsbtRequest),
66 SignPsbt(requests::SignpsbtRequest),
67 UtxoPsbt(requests::UtxopsbtRequest),
68 TxDiscard(requests::TxdiscardRequest),
69 TxPrepare(requests::TxprepareRequest),
70 TxSend(requests::TxsendRequest),
71 ListPeerChannels(requests::ListpeerchannelsRequest),
72 ListClosedChannels(requests::ListclosedchannelsRequest),
73 DecodePay(requests::DecodepayRequest),
74 Decode(requests::DecodeRequest),
75 DelPay(requests::DelpayRequest),
76 DelForward(requests::DelforwardRequest),
77 DisableOffer(requests::DisableofferRequest),
78 EnableOffer(requests::EnableofferRequest),
79 Disconnect(requests::DisconnectRequest),
80 Feerates(requests::FeeratesRequest),
81 FetchBip353(requests::Fetchbip353Request),
82 FetchInvoice(requests::FetchinvoiceRequest),
83 #[serde(rename = "fundchannel_cancel")]
84 FundChannelCancel(requests::FundchannelCancelRequest),
85 #[serde(rename = "fundchannel_complete")]
86 FundChannelComplete(requests::FundchannelCompleteRequest),
87 FundChannel(requests::FundchannelRequest),
88 #[serde(rename = "fundchannel_start")]
89 FundChannelStart(requests::FundchannelStartRequest),
90 GetLog(requests::GetlogRequest),
91 FunderUpdate(requests::FunderupdateRequest),
92 GetRoute(requests::GetrouteRequest),
93 ListAddresses(requests::ListaddressesRequest),
94 ListForwards(requests::ListforwardsRequest),
95 ListOffers(requests::ListoffersRequest),
96 ListPays(requests::ListpaysRequest),
97 ListHtlcs(requests::ListhtlcsRequest),
98 MultiFundChannel(requests::MultifundchannelRequest),
99 MultiWithdraw(requests::MultiwithdrawRequest),
100 Offer(requests::OfferRequest),
101 #[serde(rename = "openchannel_abort")]
102 OpenChannelAbort(requests::OpenchannelAbortRequest),
103 #[serde(rename = "openchannel_bump")]
104 OpenChannelBump(requests::OpenchannelBumpRequest),
105 #[serde(rename = "openchannel_init")]
106 OpenChannelInit(requests::OpenchannelInitRequest),
107 #[serde(rename = "openchannel_signed")]
108 OpenChannelSigned(requests::OpenchannelSignedRequest),
109 #[serde(rename = "openchannel_update")]
110 OpenChannelUpdate(requests::OpenchannelUpdateRequest),
111 Ping(requests::PingRequest),
112 Plugin(requests::PluginRequest),
113 RenePayStatus(requests::RenepaystatusRequest),
114 RenePay(requests::RenepayRequest),
115 ReserveInputs(requests::ReserveinputsRequest),
116 SendCustomMsg(requests::SendcustommsgRequest),
117 SendInvoice(requests::SendinvoiceRequest),
118 SetChannel(requests::SetchannelRequest),
119 SetConfig(requests::SetconfigRequest),
120 SetPsbtVersion(requests::SetpsbtversionRequest),
121 SignInvoice(requests::SigninvoiceRequest),
122 SignMessage(requests::SignmessageRequest),
123 #[serde(rename = "splice_init")]
124 SpliceInit(requests::SpliceInitRequest),
125 #[serde(rename = "splice_signed")]
126 SpliceSigned(requests::SpliceSignedRequest),
127 #[serde(rename = "splice_update")]
128 SpliceUpdate(requests::SpliceUpdateRequest),
129 #[serde(rename = "dev-splice")]
130 DevSplice(requests::DevspliceRequest),
131 UnreserveInputs(requests::UnreserveinputsRequest),
132 UpgradeWallet(requests::UpgradewalletRequest),
133 WaitBlockHeight(requests::WaitblockheightRequest),
134 Wait(requests::WaitRequest),
135 ListConfigs(requests::ListconfigsRequest),
136 Stop(requests::StopRequest),
137 Help(requests::HelpRequest),
138 PreApproveKeysend(requests::PreapprovekeysendRequest),
139 PreApproveInvoice(requests::PreapproveinvoiceRequest),
140 StaticBackup(requests::StaticbackupRequest),
141 #[serde(rename = "bkpr-channelsapy")]
142 BkprChannelsApy(requests::BkprchannelsapyRequest),
143 #[serde(rename = "bkpr-dumpincomecsv")]
144 BkprDumpIncomeCsv(requests::BkprdumpincomecsvRequest),
145 #[serde(rename = "bkpr-inspect")]
146 BkprInspect(requests::BkprinspectRequest),
147 #[serde(rename = "bkpr-listaccountevents")]
148 BkprListAccountEvents(requests::BkprlistaccounteventsRequest),
149 #[serde(rename = "bkpr-listbalances")]
150 BkprListBalances(requests::BkprlistbalancesRequest),
151 #[serde(rename = "bkpr-listincome")]
152 BkprListIncome(requests::BkprlistincomeRequest),
153 #[serde(rename = "bkpr-editdescriptionbypaymentid")]
154 BkprEditDescriptionByPaymentId(requests::BkpreditdescriptionbypaymentidRequest),
155 #[serde(rename = "bkpr-editdescriptionbyoutpoint")]
156 BkprEditDescriptionByOutpoint(requests::BkpreditdescriptionbyoutpointRequest),
157 BlacklistRune(requests::BlacklistruneRequest),
158 CheckRune(requests::CheckruneRequest),
159 CreateRune(requests::CreateruneRequest),
160 ShowRunes(requests::ShowrunesRequest),
161 #[serde(rename = "askrene-unreserve")]
162 AskReneUnreserve(requests::AskreneunreserveRequest),
163 #[serde(rename = "askrene-listlayers")]
164 AskReneListLayers(requests::AskrenelistlayersRequest),
165 #[serde(rename = "askrene-create-layer")]
166 AskReneCreateLayer(requests::AskrenecreatelayerRequest),
167 #[serde(rename = "askrene-remove-layer")]
168 AskReneRemoveLayer(requests::AskreneremovelayerRequest),
169 #[serde(rename = "askrene-reserve")]
170 AskReneReserve(requests::AskrenereserveRequest),
171 #[serde(rename = "askrene-age")]
172 AskReneAge(requests::AskreneageRequest),
173 GetRoutes(requests::GetroutesRequest),
174 #[serde(rename = "askrene-disable-node")]
175 AskReneDisableNode(requests::AskrenedisablenodeRequest),
176 #[serde(rename = "askrene-inform-channel")]
177 AskReneInformChannel(requests::AskreneinformchannelRequest),
178 #[serde(rename = "askrene-create-channel")]
179 AskReneCreateChannel(requests::AskrenecreatechannelRequest),
180 #[serde(rename = "askrene-update-channel")]
181 AskReneUpdateChannel(requests::AskreneupdatechannelRequest),
182 #[serde(rename = "askrene-bias-channel")]
183 AskReneBiasChannel(requests::AskrenebiaschannelRequest),
184 #[serde(rename = "askrene-listreservations")]
185 AskReneListReservations(requests::AskrenelistreservationsRequest),
186 InjectPaymentOnion(requests::InjectpaymentonionRequest),
187 InjectOnionMessage(requests::InjectonionmessageRequest),
188 Xpay(requests::XpayRequest),
189 SignMessageWithKey(requests::SignmessagewithkeyRequest),
190}
191
192#[derive(Clone, Debug, Serialize, Deserialize)]
193#[serde(tag = "method", content = "result")]
194#[serde(rename_all = "lowercase")]
195pub enum Response {
196 Getinfo(responses::GetinfoResponse),
197 ListPeers(responses::ListpeersResponse),
198 ListFunds(responses::ListfundsResponse),
199 SendPay(responses::SendpayResponse),
200 ListChannels(responses::ListchannelsResponse),
201 AddGossip(responses::AddgossipResponse),
202 AddPsbtOutput(responses::AddpsbtoutputResponse),
203 #[serde(rename = "autoclean-once")]
204 AutoCleanOnce(responses::AutocleanonceResponse),
205 #[serde(rename = "autoclean-status")]
206 AutoCleanStatus(responses::AutocleanstatusResponse),
207 CheckMessage(responses::CheckmessageResponse),
208 Close(responses::CloseResponse),
209 Connect(responses::ConnectResponse),
210 CreateInvoice(responses::CreateinvoiceResponse),
211 Datastore(responses::DatastoreResponse),
212 DatastoreUsage(responses::DatastoreusageResponse),
213 CreateOnion(responses::CreateonionResponse),
214 DelDatastore(responses::DeldatastoreResponse),
215 DelInvoice(responses::DelinvoiceResponse),
216 #[serde(rename = "dev-forget-channel")]
217 DevForgetChannel(responses::DevforgetchannelResponse),
218 EmergencyRecover(responses::EmergencyrecoverResponse),
219 GetEmergencyRecoverData(responses::GetemergencyrecoverdataResponse),
220 ExposeSecret(responses::ExposesecretResponse),
221 Recover(responses::RecoverResponse),
222 RecoverChannel(responses::RecoverchannelResponse),
223 Invoice(responses::InvoiceResponse),
224 InvoiceRequest(responses::InvoicerequestResponse),
225 DisableInvoiceRequest(responses::DisableinvoicerequestResponse),
226 ListInvoiceRequests(responses::ListinvoicerequestsResponse),
227 ListDatastore(responses::ListdatastoreResponse),
228 ListInvoices(responses::ListinvoicesResponse),
229 SendOnion(responses::SendonionResponse),
230 ListSendPays(responses::ListsendpaysResponse),
231 ListTransactions(responses::ListtransactionsResponse),
232 MakeSecret(responses::MakesecretResponse),
233 Pay(responses::PayResponse),
234 ListNodes(responses::ListnodesResponse),
235 WaitAnyInvoice(responses::WaitanyinvoiceResponse),
236 WaitInvoice(responses::WaitinvoiceResponse),
237 WaitSendPay(responses::WaitsendpayResponse),
238 NewAddr(responses::NewaddrResponse),
239 Withdraw(responses::WithdrawResponse),
240 KeySend(responses::KeysendResponse),
241 FundPsbt(responses::FundpsbtResponse),
242 SendPsbt(responses::SendpsbtResponse),
243 SignPsbt(responses::SignpsbtResponse),
244 UtxoPsbt(responses::UtxopsbtResponse),
245 TxDiscard(responses::TxdiscardResponse),
246 TxPrepare(responses::TxprepareResponse),
247 TxSend(responses::TxsendResponse),
248 ListPeerChannels(responses::ListpeerchannelsResponse),
249 ListClosedChannels(responses::ListclosedchannelsResponse),
250 DecodePay(responses::DecodepayResponse),
251 Decode(responses::DecodeResponse),
252 DelPay(responses::DelpayResponse),
253 DelForward(responses::DelforwardResponse),
254 DisableOffer(responses::DisableofferResponse),
255 EnableOffer(responses::EnableofferResponse),
256 Disconnect(responses::DisconnectResponse),
257 Feerates(responses::FeeratesResponse),
258 FetchBip353(responses::Fetchbip353Response),
259 FetchInvoice(responses::FetchinvoiceResponse),
260 #[serde(rename = "fundchannel_cancel")]
261 FundChannelCancel(responses::FundchannelCancelResponse),
262 #[serde(rename = "fundchannel_complete")]
263 FundChannelComplete(responses::FundchannelCompleteResponse),
264 FundChannel(responses::FundchannelResponse),
265 #[serde(rename = "fundchannel_start")]
266 FundChannelStart(responses::FundchannelStartResponse),
267 GetLog(responses::GetlogResponse),
268 FunderUpdate(responses::FunderupdateResponse),
269 GetRoute(responses::GetrouteResponse),
270 ListAddresses(responses::ListaddressesResponse),
271 ListForwards(responses::ListforwardsResponse),
272 ListOffers(responses::ListoffersResponse),
273 ListPays(responses::ListpaysResponse),
274 ListHtlcs(responses::ListhtlcsResponse),
275 MultiFundChannel(responses::MultifundchannelResponse),
276 MultiWithdraw(responses::MultiwithdrawResponse),
277 Offer(responses::OfferResponse),
278 #[serde(rename = "openchannel_abort")]
279 OpenChannelAbort(responses::OpenchannelAbortResponse),
280 #[serde(rename = "openchannel_bump")]
281 OpenChannelBump(responses::OpenchannelBumpResponse),
282 #[serde(rename = "openchannel_init")]
283 OpenChannelInit(responses::OpenchannelInitResponse),
284 #[serde(rename = "openchannel_signed")]
285 OpenChannelSigned(responses::OpenchannelSignedResponse),
286 #[serde(rename = "openchannel_update")]
287 OpenChannelUpdate(responses::OpenchannelUpdateResponse),
288 Ping(responses::PingResponse),
289 Plugin(responses::PluginResponse),
290 RenePayStatus(responses::RenepaystatusResponse),
291 RenePay(responses::RenepayResponse),
292 ReserveInputs(responses::ReserveinputsResponse),
293 SendCustomMsg(responses::SendcustommsgResponse),
294 SendInvoice(responses::SendinvoiceResponse),
295 SetChannel(responses::SetchannelResponse),
296 SetConfig(responses::SetconfigResponse),
297 SetPsbtVersion(responses::SetpsbtversionResponse),
298 SignInvoice(responses::SigninvoiceResponse),
299 SignMessage(responses::SignmessageResponse),
300 #[serde(rename = "splice_init")]
301 SpliceInit(responses::SpliceInitResponse),
302 #[serde(rename = "splice_signed")]
303 SpliceSigned(responses::SpliceSignedResponse),
304 #[serde(rename = "splice_update")]
305 SpliceUpdate(responses::SpliceUpdateResponse),
306 #[serde(rename = "dev-splice")]
307 DevSplice(responses::DevspliceResponse),
308 UnreserveInputs(responses::UnreserveinputsResponse),
309 UpgradeWallet(responses::UpgradewalletResponse),
310 WaitBlockHeight(responses::WaitblockheightResponse),
311 Wait(responses::WaitResponse),
312 ListConfigs(responses::ListconfigsResponse),
313 Stop(responses::StopResponse),
314 Help(responses::HelpResponse),
315 PreApproveKeysend(responses::PreapprovekeysendResponse),
316 PreApproveInvoice(responses::PreapproveinvoiceResponse),
317 StaticBackup(responses::StaticbackupResponse),
318 #[serde(rename = "bkpr-channelsapy")]
319 BkprChannelsApy(responses::BkprchannelsapyResponse),
320 #[serde(rename = "bkpr-dumpincomecsv")]
321 BkprDumpIncomeCsv(responses::BkprdumpincomecsvResponse),
322 #[serde(rename = "bkpr-inspect")]
323 BkprInspect(responses::BkprinspectResponse),
324 #[serde(rename = "bkpr-listaccountevents")]
325 BkprListAccountEvents(responses::BkprlistaccounteventsResponse),
326 #[serde(rename = "bkpr-listbalances")]
327 BkprListBalances(responses::BkprlistbalancesResponse),
328 #[serde(rename = "bkpr-listincome")]
329 BkprListIncome(responses::BkprlistincomeResponse),
330 #[serde(rename = "bkpr-editdescriptionbypaymentid")]
331 BkprEditDescriptionByPaymentId(responses::BkpreditdescriptionbypaymentidResponse),
332 #[serde(rename = "bkpr-editdescriptionbyoutpoint")]
333 BkprEditDescriptionByOutpoint(responses::BkpreditdescriptionbyoutpointResponse),
334 BlacklistRune(responses::BlacklistruneResponse),
335 CheckRune(responses::CheckruneResponse),
336 CreateRune(responses::CreateruneResponse),
337 ShowRunes(responses::ShowrunesResponse),
338 #[serde(rename = "askrene-unreserve")]
339 AskReneUnreserve(responses::AskreneunreserveResponse),
340 #[serde(rename = "askrene-listlayers")]
341 AskReneListLayers(responses::AskrenelistlayersResponse),
342 #[serde(rename = "askrene-create-layer")]
343 AskReneCreateLayer(responses::AskrenecreatelayerResponse),
344 #[serde(rename = "askrene-remove-layer")]
345 AskReneRemoveLayer(responses::AskreneremovelayerResponse),
346 #[serde(rename = "askrene-reserve")]
347 AskReneReserve(responses::AskrenereserveResponse),
348 #[serde(rename = "askrene-age")]
349 AskReneAge(responses::AskreneageResponse),
350 GetRoutes(responses::GetroutesResponse),
351 #[serde(rename = "askrene-disable-node")]
352 AskReneDisableNode(responses::AskrenedisablenodeResponse),
353 #[serde(rename = "askrene-inform-channel")]
354 AskReneInformChannel(responses::AskreneinformchannelResponse),
355 #[serde(rename = "askrene-create-channel")]
356 AskReneCreateChannel(responses::AskrenecreatechannelResponse),
357 #[serde(rename = "askrene-update-channel")]
358 AskReneUpdateChannel(responses::AskreneupdatechannelResponse),
359 #[serde(rename = "askrene-bias-channel")]
360 AskReneBiasChannel(responses::AskrenebiaschannelResponse),
361 #[serde(rename = "askrene-listreservations")]
362 AskReneListReservations(responses::AskrenelistreservationsResponse),
363 InjectPaymentOnion(responses::InjectpaymentonionResponse),
364 InjectOnionMessage(responses::InjectonionmessageResponse),
365 Xpay(responses::XpayResponse),
366 SignMessageWithKey(responses::SignmessagewithkeyResponse),
367}
368
369
370pub trait IntoRequest: Into<Request> {
371 type Response: TryFrom<Response, Error = TryFromResponseError>;
372}
373
374pub trait TypedRequest {
375 type Response;
376
377 fn method(&self) -> &str;
378}
379
380#[derive(Debug)]
381pub struct TryFromResponseError;
382
383pub mod requests {
384 #[allow(unused_imports)]
385 use crate::primitives::*;
386 #[allow(unused_imports)]
387 use serde::{{Deserialize, Serialize}};
388 use core::fmt::Debug;
389 use super::{IntoRequest, Request, TypedRequest};
390 #[derive(Clone, Debug, Deserialize, Serialize)]
391 pub struct GetinfoRequest {
392 }
393
394 impl From<GetinfoRequest> for Request {
395 fn from(r: GetinfoRequest) -> Self {
396 Request::Getinfo(r)
397 }
398 }
399
400 impl IntoRequest for GetinfoRequest {
401 type Response = super::responses::GetinfoResponse;
402 }
403
404 impl TypedRequest for GetinfoRequest {
405 type Response = super::responses::GetinfoResponse;
406
407 fn method(&self) -> &str {
408 "getinfo"
409 }
410 }
411 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
413 #[allow(non_camel_case_types)]
414 pub enum ListpeersLevel {
415 #[serde(rename = "io")]
416 IO = 0,
417 #[serde(rename = "debug")]
418 DEBUG = 1,
419 #[serde(rename = "info")]
420 INFO = 2,
421 #[serde(rename = "unusual")]
422 UNUSUAL = 3,
423 #[serde(rename = "trace")]
424 TRACE = 4,
425 }
426
427 impl TryFrom<i32> for ListpeersLevel {
428 type Error = anyhow::Error;
429 fn try_from(c: i32) -> Result<ListpeersLevel, anyhow::Error> {
430 match c {
431 0 => Ok(ListpeersLevel::IO),
432 1 => Ok(ListpeersLevel::DEBUG),
433 2 => Ok(ListpeersLevel::INFO),
434 3 => Ok(ListpeersLevel::UNUSUAL),
435 4 => Ok(ListpeersLevel::TRACE),
436 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeersLevel", o)),
437 }
438 }
439 }
440
441 impl ToString for ListpeersLevel {
442 fn to_string(&self) -> String {
443 match self {
444 ListpeersLevel::IO => "IO",
445 ListpeersLevel::TRACE => "TRACE",
446 ListpeersLevel::DEBUG => "DEBUG",
447 ListpeersLevel::INFO => "INFO",
448 ListpeersLevel::UNUSUAL => "UNUSUAL",
449 }.to_string()
450 }
451 }
452
453 #[derive(Clone, Debug, Deserialize, Serialize)]
454 pub struct ListpeersRequest {
455 #[serde(skip_serializing_if = "Option::is_none")]
456 pub id: Option<PublicKey>,
457 #[serde(skip_serializing_if = "Option::is_none")]
458 pub level: Option<ListpeersLevel>,
459 }
460
461 impl From<ListpeersRequest> for Request {
462 fn from(r: ListpeersRequest) -> Self {
463 Request::ListPeers(r)
464 }
465 }
466
467 impl IntoRequest for ListpeersRequest {
468 type Response = super::responses::ListpeersResponse;
469 }
470
471 impl TypedRequest for ListpeersRequest {
472 type Response = super::responses::ListpeersResponse;
473
474 fn method(&self) -> &str {
475 "listpeers"
476 }
477 }
478 #[derive(Clone, Debug, Deserialize, Serialize)]
479 pub struct ListfundsRequest {
480 #[serde(skip_serializing_if = "Option::is_none")]
481 pub spent: Option<bool>,
482 }
483
484 impl From<ListfundsRequest> for Request {
485 fn from(r: ListfundsRequest) -> Self {
486 Request::ListFunds(r)
487 }
488 }
489
490 impl IntoRequest for ListfundsRequest {
491 type Response = super::responses::ListfundsResponse;
492 }
493
494 impl TypedRequest for ListfundsRequest {
495 type Response = super::responses::ListfundsResponse;
496
497 fn method(&self) -> &str {
498 "listfunds"
499 }
500 }
501 #[derive(Clone, Debug, Deserialize, Serialize)]
502 pub struct SendpayRoute {
503 pub amount_msat: Amount,
504 pub channel: ShortChannelId,
505 pub delay: u32,
506 pub id: PublicKey,
507 }
508
509 #[derive(Clone, Debug, Deserialize, Serialize)]
510 pub struct SendpayRequest {
511 #[serde(skip_serializing_if = "Option::is_none")]
512 pub amount_msat: Option<Amount>,
513 #[serde(skip_serializing_if = "Option::is_none")]
514 pub bolt11: Option<String>,
515 #[serde(skip_serializing_if = "Option::is_none")]
516 pub description: Option<String>,
517 #[serde(skip_serializing_if = "Option::is_none")]
518 pub groupid: Option<u64>,
519 #[serde(skip_serializing_if = "Option::is_none")]
520 pub label: Option<String>,
521 #[serde(skip_serializing_if = "Option::is_none")]
522 pub localinvreqid: Option<String>,
523 #[serde(skip_serializing_if = "Option::is_none")]
524 pub partid: Option<u64>,
525 #[serde(skip_serializing_if = "Option::is_none")]
526 pub payment_metadata: Option<String>,
527 #[serde(skip_serializing_if = "Option::is_none")]
528 pub payment_secret: Option<Secret>,
529 pub payment_hash: Sha256,
530 pub route: Vec<SendpayRoute>,
531 }
532
533 impl From<SendpayRequest> for Request {
534 fn from(r: SendpayRequest) -> Self {
535 Request::SendPay(r)
536 }
537 }
538
539 impl IntoRequest for SendpayRequest {
540 type Response = super::responses::SendpayResponse;
541 }
542
543 impl TypedRequest for SendpayRequest {
544 type Response = super::responses::SendpayResponse;
545
546 fn method(&self) -> &str {
547 "sendpay"
548 }
549 }
550 #[derive(Clone, Debug, Deserialize, Serialize)]
551 pub struct ListchannelsRequest {
552 #[serde(skip_serializing_if = "Option::is_none")]
553 pub destination: Option<PublicKey>,
554 #[serde(skip_serializing_if = "Option::is_none")]
555 pub short_channel_id: Option<ShortChannelId>,
556 #[serde(skip_serializing_if = "Option::is_none")]
557 pub source: Option<PublicKey>,
558 }
559
560 impl From<ListchannelsRequest> for Request {
561 fn from(r: ListchannelsRequest) -> Self {
562 Request::ListChannels(r)
563 }
564 }
565
566 impl IntoRequest for ListchannelsRequest {
567 type Response = super::responses::ListchannelsResponse;
568 }
569
570 impl TypedRequest for ListchannelsRequest {
571 type Response = super::responses::ListchannelsResponse;
572
573 fn method(&self) -> &str {
574 "listchannels"
575 }
576 }
577 #[derive(Clone, Debug, Deserialize, Serialize)]
578 pub struct AddgossipRequest {
579 pub message: String,
580 }
581
582 impl From<AddgossipRequest> for Request {
583 fn from(r: AddgossipRequest) -> Self {
584 Request::AddGossip(r)
585 }
586 }
587
588 impl IntoRequest for AddgossipRequest {
589 type Response = super::responses::AddgossipResponse;
590 }
591
592 impl TypedRequest for AddgossipRequest {
593 type Response = super::responses::AddgossipResponse;
594
595 fn method(&self) -> &str {
596 "addgossip"
597 }
598 }
599 #[derive(Clone, Debug, Deserialize, Serialize)]
600 pub struct AddpsbtoutputRequest {
601 #[serde(skip_serializing_if = "Option::is_none")]
602 pub destination: Option<String>,
603 #[serde(skip_serializing_if = "Option::is_none")]
604 pub initialpsbt: Option<String>,
605 #[serde(skip_serializing_if = "Option::is_none")]
606 pub locktime: Option<u32>,
607 pub satoshi: Amount,
608 }
609
610 impl From<AddpsbtoutputRequest> for Request {
611 fn from(r: AddpsbtoutputRequest) -> Self {
612 Request::AddPsbtOutput(r)
613 }
614 }
615
616 impl IntoRequest for AddpsbtoutputRequest {
617 type Response = super::responses::AddpsbtoutputResponse;
618 }
619
620 impl TypedRequest for AddpsbtoutputRequest {
621 type Response = super::responses::AddpsbtoutputResponse;
622
623 fn method(&self) -> &str {
624 "addpsbtoutput"
625 }
626 }
627 #[derive(Clone, Debug, Deserialize, Serialize)]
628 pub struct AutocleanonceRequest {
629 pub subsystem: AutocleanSubsystem,
631 pub age: u64,
632 }
633
634 impl From<AutocleanonceRequest> for Request {
635 fn from(r: AutocleanonceRequest) -> Self {
636 Request::AutoCleanOnce(r)
637 }
638 }
639
640 impl IntoRequest for AutocleanonceRequest {
641 type Response = super::responses::AutocleanonceResponse;
642 }
643
644 impl TypedRequest for AutocleanonceRequest {
645 type Response = super::responses::AutocleanonceResponse;
646
647 fn method(&self) -> &str {
648 "autoclean-once"
649 }
650 }
651 #[derive(Clone, Debug, Deserialize, Serialize)]
652 pub struct AutocleanstatusRequest {
653 #[serde(skip_serializing_if = "Option::is_none")]
654 pub subsystem: Option<AutocleanSubsystem>,
655 }
656
657 impl From<AutocleanstatusRequest> for Request {
658 fn from(r: AutocleanstatusRequest) -> Self {
659 Request::AutoCleanStatus(r)
660 }
661 }
662
663 impl IntoRequest for AutocleanstatusRequest {
664 type Response = super::responses::AutocleanstatusResponse;
665 }
666
667 impl TypedRequest for AutocleanstatusRequest {
668 type Response = super::responses::AutocleanstatusResponse;
669
670 fn method(&self) -> &str {
671 "autoclean-status"
672 }
673 }
674 #[derive(Clone, Debug, Deserialize, Serialize)]
675 pub struct CheckmessageRequest {
676 #[serde(skip_serializing_if = "Option::is_none")]
677 pub pubkey: Option<PublicKey>,
678 pub message: String,
679 pub zbase: String,
680 }
681
682 impl From<CheckmessageRequest> for Request {
683 fn from(r: CheckmessageRequest) -> Self {
684 Request::CheckMessage(r)
685 }
686 }
687
688 impl IntoRequest for CheckmessageRequest {
689 type Response = super::responses::CheckmessageResponse;
690 }
691
692 impl TypedRequest for CheckmessageRequest {
693 type Response = super::responses::CheckmessageResponse;
694
695 fn method(&self) -> &str {
696 "checkmessage"
697 }
698 }
699 #[derive(Clone, Debug, Deserialize, Serialize)]
700 pub struct CloseRequest {
701 #[serde(skip_serializing_if = "Option::is_none")]
702 pub destination: Option<String>,
703 #[serde(skip_serializing_if = "Option::is_none")]
704 pub fee_negotiation_step: Option<String>,
705 #[serde(skip_serializing_if = "Option::is_none")]
706 pub force_lease_closed: Option<bool>,
707 #[serde(skip_serializing_if = "Option::is_none")]
708 pub unilateraltimeout: Option<u32>,
709 #[serde(skip_serializing_if = "Option::is_none")]
710 pub wrong_funding: Option<Outpoint>,
711 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
712 pub feerange: Option<Vec<Feerate>>,
713 pub id: String,
714 }
715
716 impl From<CloseRequest> for Request {
717 fn from(r: CloseRequest) -> Self {
718 Request::Close(r)
719 }
720 }
721
722 impl IntoRequest for CloseRequest {
723 type Response = super::responses::CloseResponse;
724 }
725
726 impl TypedRequest for CloseRequest {
727 type Response = super::responses::CloseResponse;
728
729 fn method(&self) -> &str {
730 "close"
731 }
732 }
733 #[derive(Clone, Debug, Deserialize, Serialize)]
734 pub struct ConnectRequest {
735 #[serde(skip_serializing_if = "Option::is_none")]
736 pub host: Option<String>,
737 #[serde(skip_serializing_if = "Option::is_none")]
738 pub port: Option<u16>,
739 pub id: String,
740 }
741
742 impl From<ConnectRequest> for Request {
743 fn from(r: ConnectRequest) -> Self {
744 Request::Connect(r)
745 }
746 }
747
748 impl IntoRequest for ConnectRequest {
749 type Response = super::responses::ConnectResponse;
750 }
751
752 impl TypedRequest for ConnectRequest {
753 type Response = super::responses::ConnectResponse;
754
755 fn method(&self) -> &str {
756 "connect"
757 }
758 }
759 #[derive(Clone, Debug, Deserialize, Serialize)]
760 pub struct CreateinvoiceRequest {
761 pub invstring: String,
762 pub label: String,
763 pub preimage: String,
764 }
765
766 impl From<CreateinvoiceRequest> for Request {
767 fn from(r: CreateinvoiceRequest) -> Self {
768 Request::CreateInvoice(r)
769 }
770 }
771
772 impl IntoRequest for CreateinvoiceRequest {
773 type Response = super::responses::CreateinvoiceResponse;
774 }
775
776 impl TypedRequest for CreateinvoiceRequest {
777 type Response = super::responses::CreateinvoiceResponse;
778
779 fn method(&self) -> &str {
780 "createinvoice"
781 }
782 }
783 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
785 #[allow(non_camel_case_types)]
786 pub enum DatastoreMode {
787 #[serde(rename = "must-create")]
788 MUST_CREATE = 0,
789 #[serde(rename = "must-replace")]
790 MUST_REPLACE = 1,
791 #[serde(rename = "create-or-replace")]
792 CREATE_OR_REPLACE = 2,
793 #[serde(rename = "must-append")]
794 MUST_APPEND = 3,
795 #[serde(rename = "create-or-append")]
796 CREATE_OR_APPEND = 4,
797 }
798
799 impl TryFrom<i32> for DatastoreMode {
800 type Error = anyhow::Error;
801 fn try_from(c: i32) -> Result<DatastoreMode, anyhow::Error> {
802 match c {
803 0 => Ok(DatastoreMode::MUST_CREATE),
804 1 => Ok(DatastoreMode::MUST_REPLACE),
805 2 => Ok(DatastoreMode::CREATE_OR_REPLACE),
806 3 => Ok(DatastoreMode::MUST_APPEND),
807 4 => Ok(DatastoreMode::CREATE_OR_APPEND),
808 o => Err(anyhow::anyhow!("Unknown variant {} for enum DatastoreMode", o)),
809 }
810 }
811 }
812
813 impl ToString for DatastoreMode {
814 fn to_string(&self) -> String {
815 match self {
816 DatastoreMode::MUST_CREATE => "MUST_CREATE",
817 DatastoreMode::MUST_REPLACE => "MUST_REPLACE",
818 DatastoreMode::CREATE_OR_REPLACE => "CREATE_OR_REPLACE",
819 DatastoreMode::MUST_APPEND => "MUST_APPEND",
820 DatastoreMode::CREATE_OR_APPEND => "CREATE_OR_APPEND",
821 }.to_string()
822 }
823 }
824
825 #[derive(Clone, Debug, Deserialize, Serialize)]
826 pub struct DatastoreRequest {
827 #[serde(skip_serializing_if = "Option::is_none")]
828 pub generation: Option<u64>,
829 #[serde(skip_serializing_if = "Option::is_none")]
830 pub hex: Option<String>,
831 #[serde(skip_serializing_if = "Option::is_none")]
832 pub mode: Option<DatastoreMode>,
833 #[serde(skip_serializing_if = "Option::is_none")]
834 pub string: Option<String>,
835 pub key: Vec<String>,
836 }
837
838 impl From<DatastoreRequest> for Request {
839 fn from(r: DatastoreRequest) -> Self {
840 Request::Datastore(r)
841 }
842 }
843
844 impl IntoRequest for DatastoreRequest {
845 type Response = super::responses::DatastoreResponse;
846 }
847
848 impl TypedRequest for DatastoreRequest {
849 type Response = super::responses::DatastoreResponse;
850
851 fn method(&self) -> &str {
852 "datastore"
853 }
854 }
855 #[derive(Clone, Debug, Deserialize, Serialize)]
856 pub struct DatastoreusageRequest {
857 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
858 pub key: Option<Vec<String>>,
859 }
860
861 impl From<DatastoreusageRequest> for Request {
862 fn from(r: DatastoreusageRequest) -> Self {
863 Request::DatastoreUsage(r)
864 }
865 }
866
867 impl IntoRequest for DatastoreusageRequest {
868 type Response = super::responses::DatastoreusageResponse;
869 }
870
871 impl TypedRequest for DatastoreusageRequest {
872 type Response = super::responses::DatastoreusageResponse;
873
874 fn method(&self) -> &str {
875 "datastoreusage"
876 }
877 }
878 #[derive(Clone, Debug, Deserialize, Serialize)]
879 pub struct CreateonionHops {
880 pub payload: String,
881 pub pubkey: PublicKey,
882 }
883
884 #[derive(Clone, Debug, Deserialize, Serialize)]
885 pub struct CreateonionRequest {
886 #[serde(skip_serializing_if = "Option::is_none")]
887 pub onion_size: Option<u16>,
888 #[serde(skip_serializing_if = "Option::is_none")]
889 pub session_key: Option<Secret>,
890 pub assocdata: String,
891 pub hops: Vec<CreateonionHops>,
892 }
893
894 impl From<CreateonionRequest> for Request {
895 fn from(r: CreateonionRequest) -> Self {
896 Request::CreateOnion(r)
897 }
898 }
899
900 impl IntoRequest for CreateonionRequest {
901 type Response = super::responses::CreateonionResponse;
902 }
903
904 impl TypedRequest for CreateonionRequest {
905 type Response = super::responses::CreateonionResponse;
906
907 fn method(&self) -> &str {
908 "createonion"
909 }
910 }
911 #[derive(Clone, Debug, Deserialize, Serialize)]
912 pub struct DeldatastoreRequest {
913 #[serde(skip_serializing_if = "Option::is_none")]
914 pub generation: Option<u64>,
915 pub key: Vec<String>,
916 }
917
918 impl From<DeldatastoreRequest> for Request {
919 fn from(r: DeldatastoreRequest) -> Self {
920 Request::DelDatastore(r)
921 }
922 }
923
924 impl IntoRequest for DeldatastoreRequest {
925 type Response = super::responses::DeldatastoreResponse;
926 }
927
928 impl TypedRequest for DeldatastoreRequest {
929 type Response = super::responses::DeldatastoreResponse;
930
931 fn method(&self) -> &str {
932 "deldatastore"
933 }
934 }
935 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
937 #[allow(non_camel_case_types)]
938 pub enum DelinvoiceStatus {
939 #[serde(rename = "paid")]
940 PAID = 0,
941 #[serde(rename = "expired")]
942 EXPIRED = 1,
943 #[serde(rename = "unpaid")]
944 UNPAID = 2,
945 }
946
947 impl TryFrom<i32> for DelinvoiceStatus {
948 type Error = anyhow::Error;
949 fn try_from(c: i32) -> Result<DelinvoiceStatus, anyhow::Error> {
950 match c {
951 0 => Ok(DelinvoiceStatus::PAID),
952 1 => Ok(DelinvoiceStatus::EXPIRED),
953 2 => Ok(DelinvoiceStatus::UNPAID),
954 o => Err(anyhow::anyhow!("Unknown variant {} for enum DelinvoiceStatus", o)),
955 }
956 }
957 }
958
959 impl ToString for DelinvoiceStatus {
960 fn to_string(&self) -> String {
961 match self {
962 DelinvoiceStatus::PAID => "PAID",
963 DelinvoiceStatus::EXPIRED => "EXPIRED",
964 DelinvoiceStatus::UNPAID => "UNPAID",
965 }.to_string()
966 }
967 }
968
969 #[derive(Clone, Debug, Deserialize, Serialize)]
970 pub struct DelinvoiceRequest {
971 #[serde(skip_serializing_if = "Option::is_none")]
972 pub desconly: Option<bool>,
973 pub status: DelinvoiceStatus,
975 pub label: String,
976 }
977
978 impl From<DelinvoiceRequest> for Request {
979 fn from(r: DelinvoiceRequest) -> Self {
980 Request::DelInvoice(r)
981 }
982 }
983
984 impl IntoRequest for DelinvoiceRequest {
985 type Response = super::responses::DelinvoiceResponse;
986 }
987
988 impl TypedRequest for DelinvoiceRequest {
989 type Response = super::responses::DelinvoiceResponse;
990
991 fn method(&self) -> &str {
992 "delinvoice"
993 }
994 }
995 #[derive(Clone, Debug, Deserialize, Serialize)]
996 pub struct DevforgetchannelRequest {
997 #[serde(skip_serializing_if = "Option::is_none")]
998 pub channel_id: Option<Sha256>,
999 #[serde(skip_serializing_if = "Option::is_none")]
1000 pub force: Option<bool>,
1001 #[serde(skip_serializing_if = "Option::is_none")]
1002 pub short_channel_id: Option<ShortChannelId>,
1003 pub id: PublicKey,
1004 }
1005
1006 impl From<DevforgetchannelRequest> for Request {
1007 fn from(r: DevforgetchannelRequest) -> Self {
1008 Request::DevForgetChannel(r)
1009 }
1010 }
1011
1012 impl IntoRequest for DevforgetchannelRequest {
1013 type Response = super::responses::DevforgetchannelResponse;
1014 }
1015
1016 impl TypedRequest for DevforgetchannelRequest {
1017 type Response = super::responses::DevforgetchannelResponse;
1018
1019 fn method(&self) -> &str {
1020 "dev-forget-channel"
1021 }
1022 }
1023 #[derive(Clone, Debug, Deserialize, Serialize)]
1024 pub struct EmergencyrecoverRequest {
1025 }
1026
1027 impl From<EmergencyrecoverRequest> for Request {
1028 fn from(r: EmergencyrecoverRequest) -> Self {
1029 Request::EmergencyRecover(r)
1030 }
1031 }
1032
1033 impl IntoRequest for EmergencyrecoverRequest {
1034 type Response = super::responses::EmergencyrecoverResponse;
1035 }
1036
1037 impl TypedRequest for EmergencyrecoverRequest {
1038 type Response = super::responses::EmergencyrecoverResponse;
1039
1040 fn method(&self) -> &str {
1041 "emergencyrecover"
1042 }
1043 }
1044 #[derive(Clone, Debug, Deserialize, Serialize)]
1045 pub struct GetemergencyrecoverdataRequest {
1046 }
1047
1048 impl From<GetemergencyrecoverdataRequest> for Request {
1049 fn from(r: GetemergencyrecoverdataRequest) -> Self {
1050 Request::GetEmergencyRecoverData(r)
1051 }
1052 }
1053
1054 impl IntoRequest for GetemergencyrecoverdataRequest {
1055 type Response = super::responses::GetemergencyrecoverdataResponse;
1056 }
1057
1058 impl TypedRequest for GetemergencyrecoverdataRequest {
1059 type Response = super::responses::GetemergencyrecoverdataResponse;
1060
1061 fn method(&self) -> &str {
1062 "getemergencyrecoverdata"
1063 }
1064 }
1065 #[derive(Clone, Debug, Deserialize, Serialize)]
1066 pub struct ExposesecretRequest {
1067 #[serde(skip_serializing_if = "Option::is_none")]
1068 pub identifier: Option<String>,
1069 pub passphrase: String,
1070 }
1071
1072 impl From<ExposesecretRequest> for Request {
1073 fn from(r: ExposesecretRequest) -> Self {
1074 Request::ExposeSecret(r)
1075 }
1076 }
1077
1078 impl IntoRequest for ExposesecretRequest {
1079 type Response = super::responses::ExposesecretResponse;
1080 }
1081
1082 impl TypedRequest for ExposesecretRequest {
1083 type Response = super::responses::ExposesecretResponse;
1084
1085 fn method(&self) -> &str {
1086 "exposesecret"
1087 }
1088 }
1089 #[derive(Clone, Debug, Deserialize, Serialize)]
1090 pub struct RecoverRequest {
1091 pub hsmsecret: String,
1092 }
1093
1094 impl From<RecoverRequest> for Request {
1095 fn from(r: RecoverRequest) -> Self {
1096 Request::Recover(r)
1097 }
1098 }
1099
1100 impl IntoRequest for RecoverRequest {
1101 type Response = super::responses::RecoverResponse;
1102 }
1103
1104 impl TypedRequest for RecoverRequest {
1105 type Response = super::responses::RecoverResponse;
1106
1107 fn method(&self) -> &str {
1108 "recover"
1109 }
1110 }
1111 #[derive(Clone, Debug, Deserialize, Serialize)]
1112 pub struct RecoverchannelRequest {
1113 pub scb: Vec<String>,
1114 }
1115
1116 impl From<RecoverchannelRequest> for Request {
1117 fn from(r: RecoverchannelRequest) -> Self {
1118 Request::RecoverChannel(r)
1119 }
1120 }
1121
1122 impl IntoRequest for RecoverchannelRequest {
1123 type Response = super::responses::RecoverchannelResponse;
1124 }
1125
1126 impl TypedRequest for RecoverchannelRequest {
1127 type Response = super::responses::RecoverchannelResponse;
1128
1129 fn method(&self) -> &str {
1130 "recoverchannel"
1131 }
1132 }
1133 #[derive(Clone, Debug, Deserialize, Serialize)]
1134 pub struct InvoiceRequest {
1135 #[serde(skip_serializing_if = "Option::is_none")]
1136 pub cltv: Option<u32>,
1137 #[serde(skip_serializing_if = "Option::is_none")]
1138 pub deschashonly: Option<bool>,
1139 #[serde(skip_serializing_if = "Option::is_none")]
1140 pub expiry: Option<u64>,
1141 #[serde(skip_serializing_if = "Option::is_none")]
1142 pub preimage: Option<String>,
1143 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1144 pub exposeprivatechannels: Option<Vec<ShortChannelId>>,
1145 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1146 pub fallbacks: Option<Vec<String>>,
1147 pub amount_msat: AmountOrAny,
1148 pub description: String,
1149 pub label: String,
1150 }
1151
1152 impl From<InvoiceRequest> for Request {
1153 fn from(r: InvoiceRequest) -> Self {
1154 Request::Invoice(r)
1155 }
1156 }
1157
1158 impl IntoRequest for InvoiceRequest {
1159 type Response = super::responses::InvoiceResponse;
1160 }
1161
1162 impl TypedRequest for InvoiceRequest {
1163 type Response = super::responses::InvoiceResponse;
1164
1165 fn method(&self) -> &str {
1166 "invoice"
1167 }
1168 }
1169 #[derive(Clone, Debug, Deserialize, Serialize)]
1170 pub struct InvoicerequestRequest {
1171 #[serde(skip_serializing_if = "Option::is_none")]
1172 pub absolute_expiry: Option<u64>,
1173 #[serde(skip_serializing_if = "Option::is_none")]
1174 pub issuer: Option<String>,
1175 #[serde(skip_serializing_if = "Option::is_none")]
1176 pub label: Option<String>,
1177 #[serde(skip_serializing_if = "Option::is_none")]
1178 pub single_use: Option<bool>,
1179 pub amount: Amount,
1180 pub description: String,
1181 }
1182
1183 impl From<InvoicerequestRequest> for Request {
1184 fn from(r: InvoicerequestRequest) -> Self {
1185 Request::InvoiceRequest(r)
1186 }
1187 }
1188
1189 impl IntoRequest for InvoicerequestRequest {
1190 type Response = super::responses::InvoicerequestResponse;
1191 }
1192
1193 impl TypedRequest for InvoicerequestRequest {
1194 type Response = super::responses::InvoicerequestResponse;
1195
1196 fn method(&self) -> &str {
1197 "invoicerequest"
1198 }
1199 }
1200 #[derive(Clone, Debug, Deserialize, Serialize)]
1201 pub struct DisableinvoicerequestRequest {
1202 pub invreq_id: String,
1203 }
1204
1205 impl From<DisableinvoicerequestRequest> for Request {
1206 fn from(r: DisableinvoicerequestRequest) -> Self {
1207 Request::DisableInvoiceRequest(r)
1208 }
1209 }
1210
1211 impl IntoRequest for DisableinvoicerequestRequest {
1212 type Response = super::responses::DisableinvoicerequestResponse;
1213 }
1214
1215 impl TypedRequest for DisableinvoicerequestRequest {
1216 type Response = super::responses::DisableinvoicerequestResponse;
1217
1218 fn method(&self) -> &str {
1219 "disableinvoicerequest"
1220 }
1221 }
1222 #[derive(Clone, Debug, Deserialize, Serialize)]
1223 pub struct ListinvoicerequestsRequest {
1224 #[serde(skip_serializing_if = "Option::is_none")]
1225 pub active_only: Option<bool>,
1226 #[serde(skip_serializing_if = "Option::is_none")]
1227 pub invreq_id: Option<String>,
1228 }
1229
1230 impl From<ListinvoicerequestsRequest> for Request {
1231 fn from(r: ListinvoicerequestsRequest) -> Self {
1232 Request::ListInvoiceRequests(r)
1233 }
1234 }
1235
1236 impl IntoRequest for ListinvoicerequestsRequest {
1237 type Response = super::responses::ListinvoicerequestsResponse;
1238 }
1239
1240 impl TypedRequest for ListinvoicerequestsRequest {
1241 type Response = super::responses::ListinvoicerequestsResponse;
1242
1243 fn method(&self) -> &str {
1244 "listinvoicerequests"
1245 }
1246 }
1247 #[derive(Clone, Debug, Deserialize, Serialize)]
1248 pub struct ListdatastoreRequest {
1249 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1250 pub key: Option<Vec<String>>,
1251 }
1252
1253 impl From<ListdatastoreRequest> for Request {
1254 fn from(r: ListdatastoreRequest) -> Self {
1255 Request::ListDatastore(r)
1256 }
1257 }
1258
1259 impl IntoRequest for ListdatastoreRequest {
1260 type Response = super::responses::ListdatastoreResponse;
1261 }
1262
1263 impl TypedRequest for ListdatastoreRequest {
1264 type Response = super::responses::ListdatastoreResponse;
1265
1266 fn method(&self) -> &str {
1267 "listdatastore"
1268 }
1269 }
1270 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
1272 #[allow(non_camel_case_types)]
1273 pub enum ListinvoicesIndex {
1274 #[serde(rename = "created")]
1275 CREATED = 0,
1276 #[serde(rename = "updated")]
1277 UPDATED = 1,
1278 }
1279
1280 impl TryFrom<i32> for ListinvoicesIndex {
1281 type Error = anyhow::Error;
1282 fn try_from(c: i32) -> Result<ListinvoicesIndex, anyhow::Error> {
1283 match c {
1284 0 => Ok(ListinvoicesIndex::CREATED),
1285 1 => Ok(ListinvoicesIndex::UPDATED),
1286 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListinvoicesIndex", o)),
1287 }
1288 }
1289 }
1290
1291 impl ToString for ListinvoicesIndex {
1292 fn to_string(&self) -> String {
1293 match self {
1294 ListinvoicesIndex::CREATED => "CREATED",
1295 ListinvoicesIndex::UPDATED => "UPDATED",
1296 }.to_string()
1297 }
1298 }
1299
1300 #[derive(Clone, Debug, Deserialize, Serialize)]
1301 pub struct ListinvoicesRequest {
1302 #[serde(skip_serializing_if = "Option::is_none")]
1303 pub index: Option<ListinvoicesIndex>,
1304 #[serde(skip_serializing_if = "Option::is_none")]
1305 pub invstring: Option<String>,
1306 #[serde(skip_serializing_if = "Option::is_none")]
1307 pub label: Option<String>,
1308 #[serde(skip_serializing_if = "Option::is_none")]
1309 pub limit: Option<u32>,
1310 #[serde(skip_serializing_if = "Option::is_none")]
1311 pub offer_id: Option<String>,
1312 #[serde(skip_serializing_if = "Option::is_none")]
1313 pub payment_hash: Option<String>,
1314 #[serde(skip_serializing_if = "Option::is_none")]
1315 pub start: Option<u64>,
1316 }
1317
1318 impl From<ListinvoicesRequest> for Request {
1319 fn from(r: ListinvoicesRequest) -> Self {
1320 Request::ListInvoices(r)
1321 }
1322 }
1323
1324 impl IntoRequest for ListinvoicesRequest {
1325 type Response = super::responses::ListinvoicesResponse;
1326 }
1327
1328 impl TypedRequest for ListinvoicesRequest {
1329 type Response = super::responses::ListinvoicesResponse;
1330
1331 fn method(&self) -> &str {
1332 "listinvoices"
1333 }
1334 }
1335 #[derive(Clone, Debug, Deserialize, Serialize)]
1336 pub struct SendonionFirstHop {
1337 pub amount_msat: Amount,
1338 pub delay: u16,
1339 pub id: PublicKey,
1340 }
1341
1342 #[derive(Clone, Debug, Deserialize, Serialize)]
1343 pub struct SendonionRequest {
1344 #[serde(skip_serializing_if = "Option::is_none")]
1345 pub amount_msat: Option<Amount>,
1346 #[serde(skip_serializing_if = "Option::is_none")]
1347 pub bolt11: Option<String>,
1348 #[serde(skip_serializing_if = "Option::is_none")]
1349 pub description: Option<String>,
1350 #[serde(skip_serializing_if = "Option::is_none")]
1351 pub destination: Option<PublicKey>,
1352 #[serde(skip_serializing_if = "Option::is_none")]
1353 pub groupid: Option<u64>,
1354 #[serde(skip_serializing_if = "Option::is_none")]
1355 pub label: Option<String>,
1356 #[serde(skip_serializing_if = "Option::is_none")]
1357 pub localinvreqid: Option<Sha256>,
1358 #[serde(skip_serializing_if = "Option::is_none")]
1359 pub partid: Option<u16>,
1360 #[serde(skip_serializing_if = "Option::is_none")]
1361 pub total_amount_msat: Option<Amount>,
1362 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1363 pub shared_secrets: Option<Vec<Secret>>,
1364 pub first_hop: SendonionFirstHop,
1365 pub onion: String,
1366 pub payment_hash: Sha256,
1367 }
1368
1369 impl From<SendonionRequest> for Request {
1370 fn from(r: SendonionRequest) -> Self {
1371 Request::SendOnion(r)
1372 }
1373 }
1374
1375 impl IntoRequest for SendonionRequest {
1376 type Response = super::responses::SendonionResponse;
1377 }
1378
1379 impl TypedRequest for SendonionRequest {
1380 type Response = super::responses::SendonionResponse;
1381
1382 fn method(&self) -> &str {
1383 "sendonion"
1384 }
1385 }
1386 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
1388 #[allow(non_camel_case_types)]
1389 pub enum ListsendpaysIndex {
1390 #[serde(rename = "created")]
1391 CREATED = 0,
1392 #[serde(rename = "updated")]
1393 UPDATED = 1,
1394 }
1395
1396 impl TryFrom<i32> for ListsendpaysIndex {
1397 type Error = anyhow::Error;
1398 fn try_from(c: i32) -> Result<ListsendpaysIndex, anyhow::Error> {
1399 match c {
1400 0 => Ok(ListsendpaysIndex::CREATED),
1401 1 => Ok(ListsendpaysIndex::UPDATED),
1402 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListsendpaysIndex", o)),
1403 }
1404 }
1405 }
1406
1407 impl ToString for ListsendpaysIndex {
1408 fn to_string(&self) -> String {
1409 match self {
1410 ListsendpaysIndex::CREATED => "CREATED",
1411 ListsendpaysIndex::UPDATED => "UPDATED",
1412 }.to_string()
1413 }
1414 }
1415
1416 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
1418 #[allow(non_camel_case_types)]
1419 pub enum ListsendpaysStatus {
1420 #[serde(rename = "pending")]
1421 PENDING = 0,
1422 #[serde(rename = "complete")]
1423 COMPLETE = 1,
1424 #[serde(rename = "failed")]
1425 FAILED = 2,
1426 }
1427
1428 impl TryFrom<i32> for ListsendpaysStatus {
1429 type Error = anyhow::Error;
1430 fn try_from(c: i32) -> Result<ListsendpaysStatus, anyhow::Error> {
1431 match c {
1432 0 => Ok(ListsendpaysStatus::PENDING),
1433 1 => Ok(ListsendpaysStatus::COMPLETE),
1434 2 => Ok(ListsendpaysStatus::FAILED),
1435 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListsendpaysStatus", o)),
1436 }
1437 }
1438 }
1439
1440 impl ToString for ListsendpaysStatus {
1441 fn to_string(&self) -> String {
1442 match self {
1443 ListsendpaysStatus::PENDING => "PENDING",
1444 ListsendpaysStatus::COMPLETE => "COMPLETE",
1445 ListsendpaysStatus::FAILED => "FAILED",
1446 }.to_string()
1447 }
1448 }
1449
1450 #[derive(Clone, Debug, Deserialize, Serialize)]
1451 pub struct ListsendpaysRequest {
1452 #[serde(skip_serializing_if = "Option::is_none")]
1453 pub bolt11: Option<String>,
1454 #[serde(skip_serializing_if = "Option::is_none")]
1455 pub index: Option<ListsendpaysIndex>,
1456 #[serde(skip_serializing_if = "Option::is_none")]
1457 pub limit: Option<u32>,
1458 #[serde(skip_serializing_if = "Option::is_none")]
1459 pub payment_hash: Option<Sha256>,
1460 #[serde(skip_serializing_if = "Option::is_none")]
1461 pub start: Option<u64>,
1462 #[serde(skip_serializing_if = "Option::is_none")]
1463 pub status: Option<ListsendpaysStatus>,
1464 }
1465
1466 impl From<ListsendpaysRequest> for Request {
1467 fn from(r: ListsendpaysRequest) -> Self {
1468 Request::ListSendPays(r)
1469 }
1470 }
1471
1472 impl IntoRequest for ListsendpaysRequest {
1473 type Response = super::responses::ListsendpaysResponse;
1474 }
1475
1476 impl TypedRequest for ListsendpaysRequest {
1477 type Response = super::responses::ListsendpaysResponse;
1478
1479 fn method(&self) -> &str {
1480 "listsendpays"
1481 }
1482 }
1483 #[derive(Clone, Debug, Deserialize, Serialize)]
1484 pub struct ListtransactionsRequest {
1485 }
1486
1487 impl From<ListtransactionsRequest> for Request {
1488 fn from(r: ListtransactionsRequest) -> Self {
1489 Request::ListTransactions(r)
1490 }
1491 }
1492
1493 impl IntoRequest for ListtransactionsRequest {
1494 type Response = super::responses::ListtransactionsResponse;
1495 }
1496
1497 impl TypedRequest for ListtransactionsRequest {
1498 type Response = super::responses::ListtransactionsResponse;
1499
1500 fn method(&self) -> &str {
1501 "listtransactions"
1502 }
1503 }
1504 #[derive(Clone, Debug, Deserialize, Serialize)]
1505 pub struct MakesecretRequest {
1506 #[serde(skip_serializing_if = "Option::is_none")]
1507 pub hex: Option<String>,
1508 #[serde(skip_serializing_if = "Option::is_none")]
1509 pub string: Option<String>,
1510 }
1511
1512 impl From<MakesecretRequest> for Request {
1513 fn from(r: MakesecretRequest) -> Self {
1514 Request::MakeSecret(r)
1515 }
1516 }
1517
1518 impl IntoRequest for MakesecretRequest {
1519 type Response = super::responses::MakesecretResponse;
1520 }
1521
1522 impl TypedRequest for MakesecretRequest {
1523 type Response = super::responses::MakesecretResponse;
1524
1525 fn method(&self) -> &str {
1526 "makesecret"
1527 }
1528 }
1529 #[derive(Clone, Debug, Deserialize, Serialize)]
1530 pub struct PayRequest {
1531 #[serde(skip_serializing_if = "Option::is_none")]
1532 pub amount_msat: Option<Amount>,
1533 #[serde(skip_serializing_if = "Option::is_none")]
1534 pub description: Option<String>,
1535 #[serde(skip_serializing_if = "Option::is_none")]
1536 pub exemptfee: Option<Amount>,
1537 #[serde(skip_serializing_if = "Option::is_none")]
1538 pub label: Option<String>,
1539 #[serde(skip_serializing_if = "Option::is_none")]
1540 pub localinvreqid: Option<String>,
1541 #[serde(skip_serializing_if = "Option::is_none")]
1542 pub maxdelay: Option<u16>,
1543 #[serde(skip_serializing_if = "Option::is_none")]
1544 pub maxfee: Option<Amount>,
1545 #[serde(skip_serializing_if = "Option::is_none")]
1546 pub maxfeepercent: Option<f64>,
1547 #[serde(skip_serializing_if = "Option::is_none")]
1548 pub partial_msat: Option<Amount>,
1549 #[serde(skip_serializing_if = "Option::is_none")]
1550 pub retry_for: Option<u16>,
1551 #[serde(skip_serializing_if = "Option::is_none")]
1552 pub riskfactor: Option<f64>,
1553 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1554 pub exclude: Option<Vec<String>>,
1555 pub bolt11: String,
1556 }
1557
1558 impl From<PayRequest> for Request {
1559 fn from(r: PayRequest) -> Self {
1560 Request::Pay(r)
1561 }
1562 }
1563
1564 impl IntoRequest for PayRequest {
1565 type Response = super::responses::PayResponse;
1566 }
1567
1568 impl TypedRequest for PayRequest {
1569 type Response = super::responses::PayResponse;
1570
1571 fn method(&self) -> &str {
1572 "pay"
1573 }
1574 }
1575 #[derive(Clone, Debug, Deserialize, Serialize)]
1576 pub struct ListnodesRequest {
1577 #[serde(skip_serializing_if = "Option::is_none")]
1578 pub id: Option<PublicKey>,
1579 }
1580
1581 impl From<ListnodesRequest> for Request {
1582 fn from(r: ListnodesRequest) -> Self {
1583 Request::ListNodes(r)
1584 }
1585 }
1586
1587 impl IntoRequest for ListnodesRequest {
1588 type Response = super::responses::ListnodesResponse;
1589 }
1590
1591 impl TypedRequest for ListnodesRequest {
1592 type Response = super::responses::ListnodesResponse;
1593
1594 fn method(&self) -> &str {
1595 "listnodes"
1596 }
1597 }
1598 #[derive(Clone, Debug, Deserialize, Serialize)]
1599 pub struct WaitanyinvoiceRequest {
1600 #[serde(skip_serializing_if = "Option::is_none")]
1601 pub lastpay_index: Option<u64>,
1602 #[serde(skip_serializing_if = "Option::is_none")]
1603 pub timeout: Option<u64>,
1604 }
1605
1606 impl From<WaitanyinvoiceRequest> for Request {
1607 fn from(r: WaitanyinvoiceRequest) -> Self {
1608 Request::WaitAnyInvoice(r)
1609 }
1610 }
1611
1612 impl IntoRequest for WaitanyinvoiceRequest {
1613 type Response = super::responses::WaitanyinvoiceResponse;
1614 }
1615
1616 impl TypedRequest for WaitanyinvoiceRequest {
1617 type Response = super::responses::WaitanyinvoiceResponse;
1618
1619 fn method(&self) -> &str {
1620 "waitanyinvoice"
1621 }
1622 }
1623 #[derive(Clone, Debug, Deserialize, Serialize)]
1624 pub struct WaitinvoiceRequest {
1625 pub label: String,
1626 }
1627
1628 impl From<WaitinvoiceRequest> for Request {
1629 fn from(r: WaitinvoiceRequest) -> Self {
1630 Request::WaitInvoice(r)
1631 }
1632 }
1633
1634 impl IntoRequest for WaitinvoiceRequest {
1635 type Response = super::responses::WaitinvoiceResponse;
1636 }
1637
1638 impl TypedRequest for WaitinvoiceRequest {
1639 type Response = super::responses::WaitinvoiceResponse;
1640
1641 fn method(&self) -> &str {
1642 "waitinvoice"
1643 }
1644 }
1645 #[derive(Clone, Debug, Deserialize, Serialize)]
1646 pub struct WaitsendpayRequest {
1647 #[serde(skip_serializing_if = "Option::is_none")]
1648 pub groupid: Option<u64>,
1649 #[serde(skip_serializing_if = "Option::is_none")]
1650 pub partid: Option<u64>,
1651 #[serde(skip_serializing_if = "Option::is_none")]
1652 pub timeout: Option<u32>,
1653 pub payment_hash: Sha256,
1654 }
1655
1656 impl From<WaitsendpayRequest> for Request {
1657 fn from(r: WaitsendpayRequest) -> Self {
1658 Request::WaitSendPay(r)
1659 }
1660 }
1661
1662 impl IntoRequest for WaitsendpayRequest {
1663 type Response = super::responses::WaitsendpayResponse;
1664 }
1665
1666 impl TypedRequest for WaitsendpayRequest {
1667 type Response = super::responses::WaitsendpayResponse;
1668
1669 fn method(&self) -> &str {
1670 "waitsendpay"
1671 }
1672 }
1673 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
1675 #[allow(non_camel_case_types)]
1676 pub enum NewaddrAddresstype {
1677 #[serde(rename = "bech32")]
1678 BECH32 = 0,
1679 #[serde(rename = "all")]
1680 ALL = 2,
1681 #[serde(rename = "p2tr")]
1682 P2TR = 3,
1683 }
1684
1685 impl TryFrom<i32> for NewaddrAddresstype {
1686 type Error = anyhow::Error;
1687 fn try_from(c: i32) -> Result<NewaddrAddresstype, anyhow::Error> {
1688 match c {
1689 0 => Ok(NewaddrAddresstype::BECH32),
1690 2 => Ok(NewaddrAddresstype::ALL),
1691 3 => Ok(NewaddrAddresstype::P2TR),
1692 o => Err(anyhow::anyhow!("Unknown variant {} for enum NewaddrAddresstype", o)),
1693 }
1694 }
1695 }
1696
1697 impl ToString for NewaddrAddresstype {
1698 fn to_string(&self) -> String {
1699 match self {
1700 NewaddrAddresstype::BECH32 => "BECH32",
1701 NewaddrAddresstype::P2TR => "P2TR",
1702 NewaddrAddresstype::ALL => "ALL",
1703 }.to_string()
1704 }
1705 }
1706
1707 #[derive(Clone, Debug, Deserialize, Serialize)]
1708 pub struct NewaddrRequest {
1709 #[serde(skip_serializing_if = "Option::is_none")]
1710 pub addresstype: Option<NewaddrAddresstype>,
1711 }
1712
1713 impl From<NewaddrRequest> for Request {
1714 fn from(r: NewaddrRequest) -> Self {
1715 Request::NewAddr(r)
1716 }
1717 }
1718
1719 impl IntoRequest for NewaddrRequest {
1720 type Response = super::responses::NewaddrResponse;
1721 }
1722
1723 impl TypedRequest for NewaddrRequest {
1724 type Response = super::responses::NewaddrResponse;
1725
1726 fn method(&self) -> &str {
1727 "newaddr"
1728 }
1729 }
1730 #[derive(Clone, Debug, Deserialize, Serialize)]
1731 pub struct WithdrawRequest {
1732 #[serde(skip_serializing_if = "Option::is_none")]
1733 pub feerate: Option<Feerate>,
1734 #[serde(skip_serializing_if = "Option::is_none")]
1735 pub minconf: Option<u16>,
1736 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1737 pub utxos: Option<Vec<Outpoint>>,
1738 pub destination: String,
1739 pub satoshi: AmountOrAll,
1740 }
1741
1742 impl From<WithdrawRequest> for Request {
1743 fn from(r: WithdrawRequest) -> Self {
1744 Request::Withdraw(r)
1745 }
1746 }
1747
1748 impl IntoRequest for WithdrawRequest {
1749 type Response = super::responses::WithdrawResponse;
1750 }
1751
1752 impl TypedRequest for WithdrawRequest {
1753 type Response = super::responses::WithdrawResponse;
1754
1755 fn method(&self) -> &str {
1756 "withdraw"
1757 }
1758 }
1759 #[derive(Clone, Debug, Deserialize, Serialize)]
1760 pub struct KeysendRequest {
1761 #[serde(skip_serializing_if = "Option::is_none")]
1762 pub exemptfee: Option<Amount>,
1763 #[serde(skip_serializing_if = "Option::is_none")]
1764 pub extratlvs: Option<TlvStream>,
1765 #[serde(skip_serializing_if = "Option::is_none")]
1766 pub label: Option<String>,
1767 #[serde(skip_serializing_if = "Option::is_none")]
1768 pub maxdelay: Option<u32>,
1769 #[serde(skip_serializing_if = "Option::is_none")]
1770 pub maxfee: Option<Amount>,
1771 #[serde(skip_serializing_if = "Option::is_none")]
1772 pub maxfeepercent: Option<f64>,
1773 #[serde(skip_serializing_if = "Option::is_none")]
1774 pub retry_for: Option<u32>,
1775 #[serde(skip_serializing_if = "Option::is_none")]
1776 pub routehints: Option<RoutehintList>,
1777 pub amount_msat: Amount,
1778 pub destination: PublicKey,
1779 }
1780
1781 impl From<KeysendRequest> for Request {
1782 fn from(r: KeysendRequest) -> Self {
1783 Request::KeySend(r)
1784 }
1785 }
1786
1787 impl IntoRequest for KeysendRequest {
1788 type Response = super::responses::KeysendResponse;
1789 }
1790
1791 impl TypedRequest for KeysendRequest {
1792 type Response = super::responses::KeysendResponse;
1793
1794 fn method(&self) -> &str {
1795 "keysend"
1796 }
1797 }
1798 #[derive(Clone, Debug, Deserialize, Serialize)]
1799 pub struct FundpsbtRequest {
1800 #[serde(skip_serializing_if = "Option::is_none")]
1801 pub excess_as_change: Option<bool>,
1802 #[serde(skip_serializing_if = "Option::is_none")]
1803 pub locktime: Option<u32>,
1804 #[serde(skip_serializing_if = "Option::is_none")]
1805 pub min_witness_weight: Option<u32>,
1806 #[serde(skip_serializing_if = "Option::is_none")]
1807 pub minconf: Option<u32>,
1808 #[serde(skip_serializing_if = "Option::is_none")]
1809 pub nonwrapped: Option<bool>,
1810 #[serde(skip_serializing_if = "Option::is_none")]
1811 pub opening_anchor_channel: Option<bool>,
1812 #[serde(skip_serializing_if = "Option::is_none")]
1813 pub reserve: Option<u32>,
1814 pub feerate: Feerate,
1815 pub satoshi: AmountOrAll,
1816 pub startweight: u32,
1817 }
1818
1819 impl From<FundpsbtRequest> for Request {
1820 fn from(r: FundpsbtRequest) -> Self {
1821 Request::FundPsbt(r)
1822 }
1823 }
1824
1825 impl IntoRequest for FundpsbtRequest {
1826 type Response = super::responses::FundpsbtResponse;
1827 }
1828
1829 impl TypedRequest for FundpsbtRequest {
1830 type Response = super::responses::FundpsbtResponse;
1831
1832 fn method(&self) -> &str {
1833 "fundpsbt"
1834 }
1835 }
1836 #[derive(Clone, Debug, Deserialize, Serialize)]
1837 pub struct SendpsbtRequest {
1838 #[serde(skip_serializing_if = "Option::is_none")]
1839 pub reserve: Option<u32>,
1840 pub psbt: String,
1841 }
1842
1843 impl From<SendpsbtRequest> for Request {
1844 fn from(r: SendpsbtRequest) -> Self {
1845 Request::SendPsbt(r)
1846 }
1847 }
1848
1849 impl IntoRequest for SendpsbtRequest {
1850 type Response = super::responses::SendpsbtResponse;
1851 }
1852
1853 impl TypedRequest for SendpsbtRequest {
1854 type Response = super::responses::SendpsbtResponse;
1855
1856 fn method(&self) -> &str {
1857 "sendpsbt"
1858 }
1859 }
1860 #[derive(Clone, Debug, Deserialize, Serialize)]
1861 pub struct SignpsbtRequest {
1862 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1863 pub signonly: Option<Vec<u32>>,
1864 pub psbt: String,
1865 }
1866
1867 impl From<SignpsbtRequest> for Request {
1868 fn from(r: SignpsbtRequest) -> Self {
1869 Request::SignPsbt(r)
1870 }
1871 }
1872
1873 impl IntoRequest for SignpsbtRequest {
1874 type Response = super::responses::SignpsbtResponse;
1875 }
1876
1877 impl TypedRequest for SignpsbtRequest {
1878 type Response = super::responses::SignpsbtResponse;
1879
1880 fn method(&self) -> &str {
1881 "signpsbt"
1882 }
1883 }
1884 #[derive(Clone, Debug, Deserialize, Serialize)]
1885 pub struct UtxopsbtRequest {
1886 #[serde(skip_serializing_if = "Option::is_none")]
1887 pub excess_as_change: Option<bool>,
1888 #[serde(skip_serializing_if = "Option::is_none")]
1889 pub locktime: Option<u32>,
1890 #[serde(skip_serializing_if = "Option::is_none")]
1891 pub min_witness_weight: Option<u32>,
1892 #[serde(skip_serializing_if = "Option::is_none")]
1893 pub opening_anchor_channel: Option<bool>,
1894 #[serde(skip_serializing_if = "Option::is_none")]
1895 pub reserve: Option<u32>,
1896 #[serde(skip_serializing_if = "Option::is_none")]
1897 pub reservedok: Option<bool>,
1898 pub feerate: Feerate,
1899 pub satoshi: AmountOrAll,
1900 pub startweight: u32,
1901 pub utxos: Vec<Outpoint>,
1902 }
1903
1904 impl From<UtxopsbtRequest> for Request {
1905 fn from(r: UtxopsbtRequest) -> Self {
1906 Request::UtxoPsbt(r)
1907 }
1908 }
1909
1910 impl IntoRequest for UtxopsbtRequest {
1911 type Response = super::responses::UtxopsbtResponse;
1912 }
1913
1914 impl TypedRequest for UtxopsbtRequest {
1915 type Response = super::responses::UtxopsbtResponse;
1916
1917 fn method(&self) -> &str {
1918 "utxopsbt"
1919 }
1920 }
1921 #[derive(Clone, Debug, Deserialize, Serialize)]
1922 pub struct TxdiscardRequest {
1923 pub txid: String,
1924 }
1925
1926 impl From<TxdiscardRequest> for Request {
1927 fn from(r: TxdiscardRequest) -> Self {
1928 Request::TxDiscard(r)
1929 }
1930 }
1931
1932 impl IntoRequest for TxdiscardRequest {
1933 type Response = super::responses::TxdiscardResponse;
1934 }
1935
1936 impl TypedRequest for TxdiscardRequest {
1937 type Response = super::responses::TxdiscardResponse;
1938
1939 fn method(&self) -> &str {
1940 "txdiscard"
1941 }
1942 }
1943 #[derive(Clone, Debug, Deserialize, Serialize)]
1944 pub struct TxprepareRequest {
1945 #[serde(skip_serializing_if = "Option::is_none")]
1946 pub feerate: Option<Feerate>,
1947 #[serde(skip_serializing_if = "Option::is_none")]
1948 pub minconf: Option<u32>,
1949 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
1950 pub utxos: Option<Vec<Outpoint>>,
1951 pub outputs: Vec<OutputDesc>,
1952 }
1953
1954 impl From<TxprepareRequest> for Request {
1955 fn from(r: TxprepareRequest) -> Self {
1956 Request::TxPrepare(r)
1957 }
1958 }
1959
1960 impl IntoRequest for TxprepareRequest {
1961 type Response = super::responses::TxprepareResponse;
1962 }
1963
1964 impl TypedRequest for TxprepareRequest {
1965 type Response = super::responses::TxprepareResponse;
1966
1967 fn method(&self) -> &str {
1968 "txprepare"
1969 }
1970 }
1971 #[derive(Clone, Debug, Deserialize, Serialize)]
1972 pub struct TxsendRequest {
1973 pub txid: String,
1974 }
1975
1976 impl From<TxsendRequest> for Request {
1977 fn from(r: TxsendRequest) -> Self {
1978 Request::TxSend(r)
1979 }
1980 }
1981
1982 impl IntoRequest for TxsendRequest {
1983 type Response = super::responses::TxsendResponse;
1984 }
1985
1986 impl TypedRequest for TxsendRequest {
1987 type Response = super::responses::TxsendResponse;
1988
1989 fn method(&self) -> &str {
1990 "txsend"
1991 }
1992 }
1993 #[derive(Clone, Debug, Deserialize, Serialize)]
1994 pub struct ListpeerchannelsRequest {
1995 #[serde(skip_serializing_if = "Option::is_none")]
1996 pub id: Option<PublicKey>,
1997 #[serde(skip_serializing_if = "Option::is_none")]
1998 pub short_channel_id: Option<ShortChannelId>,
1999 }
2000
2001 impl From<ListpeerchannelsRequest> for Request {
2002 fn from(r: ListpeerchannelsRequest) -> Self {
2003 Request::ListPeerChannels(r)
2004 }
2005 }
2006
2007 impl IntoRequest for ListpeerchannelsRequest {
2008 type Response = super::responses::ListpeerchannelsResponse;
2009 }
2010
2011 impl TypedRequest for ListpeerchannelsRequest {
2012 type Response = super::responses::ListpeerchannelsResponse;
2013
2014 fn method(&self) -> &str {
2015 "listpeerchannels"
2016 }
2017 }
2018 #[derive(Clone, Debug, Deserialize, Serialize)]
2019 pub struct ListclosedchannelsRequest {
2020 #[serde(skip_serializing_if = "Option::is_none")]
2021 pub id: Option<PublicKey>,
2022 }
2023
2024 impl From<ListclosedchannelsRequest> for Request {
2025 fn from(r: ListclosedchannelsRequest) -> Self {
2026 Request::ListClosedChannels(r)
2027 }
2028 }
2029
2030 impl IntoRequest for ListclosedchannelsRequest {
2031 type Response = super::responses::ListclosedchannelsResponse;
2032 }
2033
2034 impl TypedRequest for ListclosedchannelsRequest {
2035 type Response = super::responses::ListclosedchannelsResponse;
2036
2037 fn method(&self) -> &str {
2038 "listclosedchannels"
2039 }
2040 }
2041 #[derive(Clone, Debug, Deserialize, Serialize)]
2042 pub struct DecodepayRequest {
2043 #[serde(skip_serializing_if = "Option::is_none")]
2044 pub description: Option<String>,
2045 pub bolt11: String,
2046 }
2047
2048 impl From<DecodepayRequest> for Request {
2049 fn from(r: DecodepayRequest) -> Self {
2050 Request::DecodePay(r)
2051 }
2052 }
2053
2054 impl IntoRequest for DecodepayRequest {
2055 type Response = super::responses::DecodepayResponse;
2056 }
2057
2058 impl TypedRequest for DecodepayRequest {
2059 type Response = super::responses::DecodepayResponse;
2060
2061 fn method(&self) -> &str {
2062 "decodepay"
2063 }
2064 }
2065 #[derive(Clone, Debug, Deserialize, Serialize)]
2066 pub struct DecodeRequest {
2067 pub string: String,
2068 }
2069
2070 impl From<DecodeRequest> for Request {
2071 fn from(r: DecodeRequest) -> Self {
2072 Request::Decode(r)
2073 }
2074 }
2075
2076 impl IntoRequest for DecodeRequest {
2077 type Response = super::responses::DecodeResponse;
2078 }
2079
2080 impl TypedRequest for DecodeRequest {
2081 type Response = super::responses::DecodeResponse;
2082
2083 fn method(&self) -> &str {
2084 "decode"
2085 }
2086 }
2087 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2089 #[allow(non_camel_case_types)]
2090 pub enum DelpayStatus {
2091 #[serde(rename = "complete")]
2092 COMPLETE = 0,
2093 #[serde(rename = "failed")]
2094 FAILED = 1,
2095 }
2096
2097 impl TryFrom<i32> for DelpayStatus {
2098 type Error = anyhow::Error;
2099 fn try_from(c: i32) -> Result<DelpayStatus, anyhow::Error> {
2100 match c {
2101 0 => Ok(DelpayStatus::COMPLETE),
2102 1 => Ok(DelpayStatus::FAILED),
2103 o => Err(anyhow::anyhow!("Unknown variant {} for enum DelpayStatus", o)),
2104 }
2105 }
2106 }
2107
2108 impl ToString for DelpayStatus {
2109 fn to_string(&self) -> String {
2110 match self {
2111 DelpayStatus::COMPLETE => "COMPLETE",
2112 DelpayStatus::FAILED => "FAILED",
2113 }.to_string()
2114 }
2115 }
2116
2117 #[derive(Clone, Debug, Deserialize, Serialize)]
2118 pub struct DelpayRequest {
2119 #[serde(skip_serializing_if = "Option::is_none")]
2120 pub groupid: Option<u64>,
2121 #[serde(skip_serializing_if = "Option::is_none")]
2122 pub partid: Option<u64>,
2123 pub status: DelpayStatus,
2125 pub payment_hash: Sha256,
2126 }
2127
2128 impl From<DelpayRequest> for Request {
2129 fn from(r: DelpayRequest) -> Self {
2130 Request::DelPay(r)
2131 }
2132 }
2133
2134 impl IntoRequest for DelpayRequest {
2135 type Response = super::responses::DelpayResponse;
2136 }
2137
2138 impl TypedRequest for DelpayRequest {
2139 type Response = super::responses::DelpayResponse;
2140
2141 fn method(&self) -> &str {
2142 "delpay"
2143 }
2144 }
2145 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2147 #[allow(non_camel_case_types)]
2148 pub enum DelforwardStatus {
2149 #[serde(rename = "settled")]
2150 SETTLED = 0,
2151 #[serde(rename = "local_failed")]
2152 LOCAL_FAILED = 1,
2153 #[serde(rename = "failed")]
2154 FAILED = 2,
2155 }
2156
2157 impl TryFrom<i32> for DelforwardStatus {
2158 type Error = anyhow::Error;
2159 fn try_from(c: i32) -> Result<DelforwardStatus, anyhow::Error> {
2160 match c {
2161 0 => Ok(DelforwardStatus::SETTLED),
2162 1 => Ok(DelforwardStatus::LOCAL_FAILED),
2163 2 => Ok(DelforwardStatus::FAILED),
2164 o => Err(anyhow::anyhow!("Unknown variant {} for enum DelforwardStatus", o)),
2165 }
2166 }
2167 }
2168
2169 impl ToString for DelforwardStatus {
2170 fn to_string(&self) -> String {
2171 match self {
2172 DelforwardStatus::SETTLED => "SETTLED",
2173 DelforwardStatus::LOCAL_FAILED => "LOCAL_FAILED",
2174 DelforwardStatus::FAILED => "FAILED",
2175 }.to_string()
2176 }
2177 }
2178
2179 #[derive(Clone, Debug, Deserialize, Serialize)]
2180 pub struct DelforwardRequest {
2181 pub status: DelforwardStatus,
2183 pub in_channel: ShortChannelId,
2184 pub in_htlc_id: u64,
2185 }
2186
2187 impl From<DelforwardRequest> for Request {
2188 fn from(r: DelforwardRequest) -> Self {
2189 Request::DelForward(r)
2190 }
2191 }
2192
2193 impl IntoRequest for DelforwardRequest {
2194 type Response = super::responses::DelforwardResponse;
2195 }
2196
2197 impl TypedRequest for DelforwardRequest {
2198 type Response = super::responses::DelforwardResponse;
2199
2200 fn method(&self) -> &str {
2201 "delforward"
2202 }
2203 }
2204 #[derive(Clone, Debug, Deserialize, Serialize)]
2205 pub struct DisableofferRequest {
2206 pub offer_id: Sha256,
2207 }
2208
2209 impl From<DisableofferRequest> for Request {
2210 fn from(r: DisableofferRequest) -> Self {
2211 Request::DisableOffer(r)
2212 }
2213 }
2214
2215 impl IntoRequest for DisableofferRequest {
2216 type Response = super::responses::DisableofferResponse;
2217 }
2218
2219 impl TypedRequest for DisableofferRequest {
2220 type Response = super::responses::DisableofferResponse;
2221
2222 fn method(&self) -> &str {
2223 "disableoffer"
2224 }
2225 }
2226 #[derive(Clone, Debug, Deserialize, Serialize)]
2227 pub struct EnableofferRequest {
2228 pub offer_id: Sha256,
2229 }
2230
2231 impl From<EnableofferRequest> for Request {
2232 fn from(r: EnableofferRequest) -> Self {
2233 Request::EnableOffer(r)
2234 }
2235 }
2236
2237 impl IntoRequest for EnableofferRequest {
2238 type Response = super::responses::EnableofferResponse;
2239 }
2240
2241 impl TypedRequest for EnableofferRequest {
2242 type Response = super::responses::EnableofferResponse;
2243
2244 fn method(&self) -> &str {
2245 "enableoffer"
2246 }
2247 }
2248 #[derive(Clone, Debug, Deserialize, Serialize)]
2249 pub struct DisconnectRequest {
2250 #[serde(skip_serializing_if = "Option::is_none")]
2251 pub force: Option<bool>,
2252 pub id: PublicKey,
2253 }
2254
2255 impl From<DisconnectRequest> for Request {
2256 fn from(r: DisconnectRequest) -> Self {
2257 Request::Disconnect(r)
2258 }
2259 }
2260
2261 impl IntoRequest for DisconnectRequest {
2262 type Response = super::responses::DisconnectResponse;
2263 }
2264
2265 impl TypedRequest for DisconnectRequest {
2266 type Response = super::responses::DisconnectResponse;
2267
2268 fn method(&self) -> &str {
2269 "disconnect"
2270 }
2271 }
2272 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2274 #[allow(non_camel_case_types)]
2275 pub enum FeeratesStyle {
2276 #[serde(rename = "perkb")]
2277 PERKB = 0,
2278 #[serde(rename = "perkw")]
2279 PERKW = 1,
2280 }
2281
2282 impl TryFrom<i32> for FeeratesStyle {
2283 type Error = anyhow::Error;
2284 fn try_from(c: i32) -> Result<FeeratesStyle, anyhow::Error> {
2285 match c {
2286 0 => Ok(FeeratesStyle::PERKB),
2287 1 => Ok(FeeratesStyle::PERKW),
2288 o => Err(anyhow::anyhow!("Unknown variant {} for enum FeeratesStyle", o)),
2289 }
2290 }
2291 }
2292
2293 impl ToString for FeeratesStyle {
2294 fn to_string(&self) -> String {
2295 match self {
2296 FeeratesStyle::PERKB => "PERKB",
2297 FeeratesStyle::PERKW => "PERKW",
2298 }.to_string()
2299 }
2300 }
2301
2302 #[derive(Clone, Debug, Deserialize, Serialize)]
2303 pub struct FeeratesRequest {
2304 pub style: FeeratesStyle,
2306 }
2307
2308 impl From<FeeratesRequest> for Request {
2309 fn from(r: FeeratesRequest) -> Self {
2310 Request::Feerates(r)
2311 }
2312 }
2313
2314 impl IntoRequest for FeeratesRequest {
2315 type Response = super::responses::FeeratesResponse;
2316 }
2317
2318 impl TypedRequest for FeeratesRequest {
2319 type Response = super::responses::FeeratesResponse;
2320
2321 fn method(&self) -> &str {
2322 "feerates"
2323 }
2324 }
2325 #[derive(Clone, Debug, Deserialize, Serialize)]
2326 pub struct Fetchbip353Request {
2327 pub address: String,
2328 }
2329
2330 impl From<Fetchbip353Request> for Request {
2331 fn from(r: Fetchbip353Request) -> Self {
2332 Request::FetchBip353(r)
2333 }
2334 }
2335
2336 impl IntoRequest for Fetchbip353Request {
2337 type Response = super::responses::Fetchbip353Response;
2338 }
2339
2340 impl TypedRequest for Fetchbip353Request {
2341 type Response = super::responses::Fetchbip353Response;
2342
2343 fn method(&self) -> &str {
2344 "fetchbip353"
2345 }
2346 }
2347 #[derive(Clone, Debug, Deserialize, Serialize)]
2348 pub struct FetchinvoiceRequest {
2349 #[serde(skip_serializing_if = "Option::is_none")]
2350 pub amount_msat: Option<Amount>,
2351 #[serde(skip_serializing_if = "Option::is_none")]
2352 pub bip353: Option<String>,
2353 #[serde(skip_serializing_if = "Option::is_none")]
2354 pub payer_metadata: Option<String>,
2355 #[serde(skip_serializing_if = "Option::is_none")]
2356 pub payer_note: Option<String>,
2357 #[serde(skip_serializing_if = "Option::is_none")]
2358 pub quantity: Option<u64>,
2359 #[serde(skip_serializing_if = "Option::is_none")]
2360 pub recurrence_counter: Option<u64>,
2361 #[serde(skip_serializing_if = "Option::is_none")]
2362 pub recurrence_label: Option<String>,
2363 #[serde(skip_serializing_if = "Option::is_none")]
2364 pub recurrence_start: Option<f64>,
2365 #[serde(skip_serializing_if = "Option::is_none")]
2366 pub timeout: Option<f64>,
2367 pub offer: String,
2368 }
2369
2370 impl From<FetchinvoiceRequest> for Request {
2371 fn from(r: FetchinvoiceRequest) -> Self {
2372 Request::FetchInvoice(r)
2373 }
2374 }
2375
2376 impl IntoRequest for FetchinvoiceRequest {
2377 type Response = super::responses::FetchinvoiceResponse;
2378 }
2379
2380 impl TypedRequest for FetchinvoiceRequest {
2381 type Response = super::responses::FetchinvoiceResponse;
2382
2383 fn method(&self) -> &str {
2384 "fetchinvoice"
2385 }
2386 }
2387 #[derive(Clone, Debug, Deserialize, Serialize)]
2388 pub struct FundchannelCancelRequest {
2389 pub id: PublicKey,
2390 }
2391
2392 impl From<FundchannelCancelRequest> for Request {
2393 fn from(r: FundchannelCancelRequest) -> Self {
2394 Request::FundChannelCancel(r)
2395 }
2396 }
2397
2398 impl IntoRequest for FundchannelCancelRequest {
2399 type Response = super::responses::FundchannelCancelResponse;
2400 }
2401
2402 impl TypedRequest for FundchannelCancelRequest {
2403 type Response = super::responses::FundchannelCancelResponse;
2404
2405 fn method(&self) -> &str {
2406 "fundchannel_cancel"
2407 }
2408 }
2409 #[derive(Clone, Debug, Deserialize, Serialize)]
2410 pub struct FundchannelCompleteRequest {
2411 pub id: PublicKey,
2412 pub psbt: String,
2413 }
2414
2415 impl From<FundchannelCompleteRequest> for Request {
2416 fn from(r: FundchannelCompleteRequest) -> Self {
2417 Request::FundChannelComplete(r)
2418 }
2419 }
2420
2421 impl IntoRequest for FundchannelCompleteRequest {
2422 type Response = super::responses::FundchannelCompleteResponse;
2423 }
2424
2425 impl TypedRequest for FundchannelCompleteRequest {
2426 type Response = super::responses::FundchannelCompleteResponse;
2427
2428 fn method(&self) -> &str {
2429 "fundchannel_complete"
2430 }
2431 }
2432 #[derive(Clone, Debug, Deserialize, Serialize)]
2433 pub struct FundchannelRequest {
2434 #[serde(skip_serializing_if = "Option::is_none")]
2435 pub announce: Option<bool>,
2436 #[serde(skip_serializing_if = "Option::is_none")]
2437 pub close_to: Option<String>,
2438 #[serde(skip_serializing_if = "Option::is_none")]
2439 pub compact_lease: Option<String>,
2440 #[serde(skip_serializing_if = "Option::is_none")]
2441 pub feerate: Option<Feerate>,
2442 #[serde(skip_serializing_if = "Option::is_none")]
2443 pub minconf: Option<u32>,
2444 #[serde(skip_serializing_if = "Option::is_none")]
2445 pub mindepth: Option<u32>,
2446 #[serde(skip_serializing_if = "Option::is_none")]
2447 pub push_msat: Option<Amount>,
2448 #[serde(skip_serializing_if = "Option::is_none")]
2449 pub request_amt: Option<Amount>,
2450 #[serde(skip_serializing_if = "Option::is_none")]
2451 pub reserve: Option<Amount>,
2452 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
2453 pub channel_type: Option<Vec<u32>>,
2454 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
2455 pub utxos: Option<Vec<Outpoint>>,
2456 pub amount: AmountOrAll,
2457 pub id: PublicKey,
2458 }
2459
2460 impl From<FundchannelRequest> for Request {
2461 fn from(r: FundchannelRequest) -> Self {
2462 Request::FundChannel(r)
2463 }
2464 }
2465
2466 impl IntoRequest for FundchannelRequest {
2467 type Response = super::responses::FundchannelResponse;
2468 }
2469
2470 impl TypedRequest for FundchannelRequest {
2471 type Response = super::responses::FundchannelResponse;
2472
2473 fn method(&self) -> &str {
2474 "fundchannel"
2475 }
2476 }
2477 #[derive(Clone, Debug, Deserialize, Serialize)]
2478 pub struct FundchannelStartRequest {
2479 #[serde(skip_serializing_if = "Option::is_none")]
2480 pub announce: Option<bool>,
2481 #[serde(skip_serializing_if = "Option::is_none")]
2482 pub close_to: Option<String>,
2483 #[serde(skip_serializing_if = "Option::is_none")]
2484 pub feerate: Option<Feerate>,
2485 #[serde(skip_serializing_if = "Option::is_none")]
2486 pub mindepth: Option<u32>,
2487 #[serde(skip_serializing_if = "Option::is_none")]
2488 pub push_msat: Option<Amount>,
2489 #[serde(skip_serializing_if = "Option::is_none")]
2490 pub reserve: Option<Amount>,
2491 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
2492 pub channel_type: Option<Vec<u32>>,
2493 pub amount: Amount,
2494 pub id: PublicKey,
2495 }
2496
2497 impl From<FundchannelStartRequest> for Request {
2498 fn from(r: FundchannelStartRequest) -> Self {
2499 Request::FundChannelStart(r)
2500 }
2501 }
2502
2503 impl IntoRequest for FundchannelStartRequest {
2504 type Response = super::responses::FundchannelStartResponse;
2505 }
2506
2507 impl TypedRequest for FundchannelStartRequest {
2508 type Response = super::responses::FundchannelStartResponse;
2509
2510 fn method(&self) -> &str {
2511 "fundchannel_start"
2512 }
2513 }
2514 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2516 #[allow(non_camel_case_types)]
2517 pub enum GetlogLevel {
2518 #[serde(rename = "broken")]
2519 BROKEN = 0,
2520 #[serde(rename = "unusual")]
2521 UNUSUAL = 1,
2522 #[serde(rename = "info")]
2523 INFO = 2,
2524 #[serde(rename = "debug")]
2525 DEBUG = 3,
2526 #[serde(rename = "io")]
2527 IO = 4,
2528 #[serde(rename = "trace")]
2529 TRACE = 5,
2530 }
2531
2532 impl TryFrom<i32> for GetlogLevel {
2533 type Error = anyhow::Error;
2534 fn try_from(c: i32) -> Result<GetlogLevel, anyhow::Error> {
2535 match c {
2536 0 => Ok(GetlogLevel::BROKEN),
2537 1 => Ok(GetlogLevel::UNUSUAL),
2538 2 => Ok(GetlogLevel::INFO),
2539 3 => Ok(GetlogLevel::DEBUG),
2540 4 => Ok(GetlogLevel::IO),
2541 5 => Ok(GetlogLevel::TRACE),
2542 o => Err(anyhow::anyhow!("Unknown variant {} for enum GetlogLevel", o)),
2543 }
2544 }
2545 }
2546
2547 impl ToString for GetlogLevel {
2548 fn to_string(&self) -> String {
2549 match self {
2550 GetlogLevel::BROKEN => "BROKEN",
2551 GetlogLevel::UNUSUAL => "UNUSUAL",
2552 GetlogLevel::INFO => "INFO",
2553 GetlogLevel::DEBUG => "DEBUG",
2554 GetlogLevel::TRACE => "TRACE",
2555 GetlogLevel::IO => "IO",
2556 }.to_string()
2557 }
2558 }
2559
2560 #[derive(Clone, Debug, Deserialize, Serialize)]
2561 pub struct GetlogRequest {
2562 #[serde(skip_serializing_if = "Option::is_none")]
2563 pub level: Option<GetlogLevel>,
2564 }
2565
2566 impl From<GetlogRequest> for Request {
2567 fn from(r: GetlogRequest) -> Self {
2568 Request::GetLog(r)
2569 }
2570 }
2571
2572 impl IntoRequest for GetlogRequest {
2573 type Response = super::responses::GetlogResponse;
2574 }
2575
2576 impl TypedRequest for GetlogRequest {
2577 type Response = super::responses::GetlogResponse;
2578
2579 fn method(&self) -> &str {
2580 "getlog"
2581 }
2582 }
2583 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2585 #[allow(non_camel_case_types)]
2586 pub enum FunderupdatePolicy {
2587 #[serde(rename = "match")]
2588 MATCH = 0,
2589 #[serde(rename = "available")]
2590 AVAILABLE = 1,
2591 #[serde(rename = "fixed")]
2592 FIXED = 2,
2593 }
2594
2595 impl TryFrom<i32> for FunderupdatePolicy {
2596 type Error = anyhow::Error;
2597 fn try_from(c: i32) -> Result<FunderupdatePolicy, anyhow::Error> {
2598 match c {
2599 0 => Ok(FunderupdatePolicy::MATCH),
2600 1 => Ok(FunderupdatePolicy::AVAILABLE),
2601 2 => Ok(FunderupdatePolicy::FIXED),
2602 o => Err(anyhow::anyhow!("Unknown variant {} for enum FunderupdatePolicy", o)),
2603 }
2604 }
2605 }
2606
2607 impl ToString for FunderupdatePolicy {
2608 fn to_string(&self) -> String {
2609 match self {
2610 FunderupdatePolicy::MATCH => "MATCH",
2611 FunderupdatePolicy::AVAILABLE => "AVAILABLE",
2612 FunderupdatePolicy::FIXED => "FIXED",
2613 }.to_string()
2614 }
2615 }
2616
2617 #[derive(Clone, Debug, Deserialize, Serialize)]
2618 pub struct FunderupdateRequest {
2619 #[serde(skip_serializing_if = "Option::is_none")]
2620 pub channel_fee_max_base_msat: Option<Amount>,
2621 #[serde(skip_serializing_if = "Option::is_none")]
2622 pub channel_fee_max_proportional_thousandths: Option<u32>,
2623 #[serde(skip_serializing_if = "Option::is_none")]
2624 pub compact_lease: Option<String>,
2625 #[serde(skip_serializing_if = "Option::is_none")]
2626 pub fund_probability: Option<u32>,
2627 #[serde(skip_serializing_if = "Option::is_none")]
2628 pub funding_weight: Option<u32>,
2629 #[serde(skip_serializing_if = "Option::is_none")]
2630 pub fuzz_percent: Option<u32>,
2631 #[serde(skip_serializing_if = "Option::is_none")]
2632 pub lease_fee_base_msat: Option<Amount>,
2633 #[serde(skip_serializing_if = "Option::is_none")]
2634 pub lease_fee_basis: Option<u32>,
2635 #[serde(skip_serializing_if = "Option::is_none")]
2636 pub leases_only: Option<bool>,
2637 #[serde(skip_serializing_if = "Option::is_none")]
2638 pub max_their_funding_msat: Option<Amount>,
2639 #[serde(skip_serializing_if = "Option::is_none")]
2640 pub min_their_funding_msat: Option<Amount>,
2641 #[serde(skip_serializing_if = "Option::is_none")]
2642 pub per_channel_max_msat: Option<Amount>,
2643 #[serde(skip_serializing_if = "Option::is_none")]
2644 pub per_channel_min_msat: Option<Amount>,
2645 #[serde(skip_serializing_if = "Option::is_none")]
2646 pub policy: Option<FunderupdatePolicy>,
2647 #[serde(skip_serializing_if = "Option::is_none")]
2648 pub policy_mod: Option<Amount>,
2649 #[serde(skip_serializing_if = "Option::is_none")]
2650 pub reserve_tank_msat: Option<Amount>,
2651 }
2652
2653 impl From<FunderupdateRequest> for Request {
2654 fn from(r: FunderupdateRequest) -> Self {
2655 Request::FunderUpdate(r)
2656 }
2657 }
2658
2659 impl IntoRequest for FunderupdateRequest {
2660 type Response = super::responses::FunderupdateResponse;
2661 }
2662
2663 impl TypedRequest for FunderupdateRequest {
2664 type Response = super::responses::FunderupdateResponse;
2665
2666 fn method(&self) -> &str {
2667 "funderupdate"
2668 }
2669 }
2670 #[derive(Clone, Debug, Deserialize, Serialize)]
2671 pub struct GetrouteRequest {
2672 #[serde(skip_serializing_if = "Option::is_none")]
2673 pub cltv: Option<u32>,
2674 #[serde(skip_serializing_if = "Option::is_none")]
2675 pub fromid: Option<PublicKey>,
2676 #[serde(skip_serializing_if = "Option::is_none")]
2677 pub fuzzpercent: Option<u32>,
2678 #[serde(skip_serializing_if = "Option::is_none")]
2679 pub maxhops: Option<u32>,
2680 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
2681 pub exclude: Option<Vec<String>>,
2682 pub amount_msat: Amount,
2683 pub id: PublicKey,
2684 pub riskfactor: u64,
2685 }
2686
2687 impl From<GetrouteRequest> for Request {
2688 fn from(r: GetrouteRequest) -> Self {
2689 Request::GetRoute(r)
2690 }
2691 }
2692
2693 impl IntoRequest for GetrouteRequest {
2694 type Response = super::responses::GetrouteResponse;
2695 }
2696
2697 impl TypedRequest for GetrouteRequest {
2698 type Response = super::responses::GetrouteResponse;
2699
2700 fn method(&self) -> &str {
2701 "getroute"
2702 }
2703 }
2704 #[derive(Clone, Debug, Deserialize, Serialize)]
2705 pub struct ListaddressesRequest {
2706 #[serde(skip_serializing_if = "Option::is_none")]
2707 pub address: Option<String>,
2708 #[serde(skip_serializing_if = "Option::is_none")]
2709 pub limit: Option<u32>,
2710 #[serde(skip_serializing_if = "Option::is_none")]
2711 pub start: Option<u64>,
2712 }
2713
2714 impl From<ListaddressesRequest> for Request {
2715 fn from(r: ListaddressesRequest) -> Self {
2716 Request::ListAddresses(r)
2717 }
2718 }
2719
2720 impl IntoRequest for ListaddressesRequest {
2721 type Response = super::responses::ListaddressesResponse;
2722 }
2723
2724 impl TypedRequest for ListaddressesRequest {
2725 type Response = super::responses::ListaddressesResponse;
2726
2727 fn method(&self) -> &str {
2728 "listaddresses"
2729 }
2730 }
2731 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2733 #[allow(non_camel_case_types)]
2734 pub enum ListforwardsIndex {
2735 #[serde(rename = "created")]
2736 CREATED = 0,
2737 #[serde(rename = "updated")]
2738 UPDATED = 1,
2739 }
2740
2741 impl TryFrom<i32> for ListforwardsIndex {
2742 type Error = anyhow::Error;
2743 fn try_from(c: i32) -> Result<ListforwardsIndex, anyhow::Error> {
2744 match c {
2745 0 => Ok(ListforwardsIndex::CREATED),
2746 1 => Ok(ListforwardsIndex::UPDATED),
2747 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListforwardsIndex", o)),
2748 }
2749 }
2750 }
2751
2752 impl ToString for ListforwardsIndex {
2753 fn to_string(&self) -> String {
2754 match self {
2755 ListforwardsIndex::CREATED => "CREATED",
2756 ListforwardsIndex::UPDATED => "UPDATED",
2757 }.to_string()
2758 }
2759 }
2760
2761 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2763 #[allow(non_camel_case_types)]
2764 pub enum ListforwardsStatus {
2765 #[serde(rename = "offered")]
2766 OFFERED = 0,
2767 #[serde(rename = "settled")]
2768 SETTLED = 1,
2769 #[serde(rename = "local_failed")]
2770 LOCAL_FAILED = 2,
2771 #[serde(rename = "failed")]
2772 FAILED = 3,
2773 }
2774
2775 impl TryFrom<i32> for ListforwardsStatus {
2776 type Error = anyhow::Error;
2777 fn try_from(c: i32) -> Result<ListforwardsStatus, anyhow::Error> {
2778 match c {
2779 0 => Ok(ListforwardsStatus::OFFERED),
2780 1 => Ok(ListforwardsStatus::SETTLED),
2781 2 => Ok(ListforwardsStatus::LOCAL_FAILED),
2782 3 => Ok(ListforwardsStatus::FAILED),
2783 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListforwardsStatus", o)),
2784 }
2785 }
2786 }
2787
2788 impl ToString for ListforwardsStatus {
2789 fn to_string(&self) -> String {
2790 match self {
2791 ListforwardsStatus::OFFERED => "OFFERED",
2792 ListforwardsStatus::SETTLED => "SETTLED",
2793 ListforwardsStatus::LOCAL_FAILED => "LOCAL_FAILED",
2794 ListforwardsStatus::FAILED => "FAILED",
2795 }.to_string()
2796 }
2797 }
2798
2799 #[derive(Clone, Debug, Deserialize, Serialize)]
2800 pub struct ListforwardsRequest {
2801 #[serde(skip_serializing_if = "Option::is_none")]
2802 pub in_channel: Option<ShortChannelId>,
2803 #[serde(skip_serializing_if = "Option::is_none")]
2804 pub index: Option<ListforwardsIndex>,
2805 #[serde(skip_serializing_if = "Option::is_none")]
2806 pub limit: Option<u32>,
2807 #[serde(skip_serializing_if = "Option::is_none")]
2808 pub out_channel: Option<ShortChannelId>,
2809 #[serde(skip_serializing_if = "Option::is_none")]
2810 pub start: Option<u64>,
2811 #[serde(skip_serializing_if = "Option::is_none")]
2812 pub status: Option<ListforwardsStatus>,
2813 }
2814
2815 impl From<ListforwardsRequest> for Request {
2816 fn from(r: ListforwardsRequest) -> Self {
2817 Request::ListForwards(r)
2818 }
2819 }
2820
2821 impl IntoRequest for ListforwardsRequest {
2822 type Response = super::responses::ListforwardsResponse;
2823 }
2824
2825 impl TypedRequest for ListforwardsRequest {
2826 type Response = super::responses::ListforwardsResponse;
2827
2828 fn method(&self) -> &str {
2829 "listforwards"
2830 }
2831 }
2832 #[derive(Clone, Debug, Deserialize, Serialize)]
2833 pub struct ListoffersRequest {
2834 #[serde(skip_serializing_if = "Option::is_none")]
2835 pub active_only: Option<bool>,
2836 #[serde(skip_serializing_if = "Option::is_none")]
2837 pub offer_id: Option<Sha256>,
2838 }
2839
2840 impl From<ListoffersRequest> for Request {
2841 fn from(r: ListoffersRequest) -> Self {
2842 Request::ListOffers(r)
2843 }
2844 }
2845
2846 impl IntoRequest for ListoffersRequest {
2847 type Response = super::responses::ListoffersResponse;
2848 }
2849
2850 impl TypedRequest for ListoffersRequest {
2851 type Response = super::responses::ListoffersResponse;
2852
2853 fn method(&self) -> &str {
2854 "listoffers"
2855 }
2856 }
2857 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2859 #[allow(non_camel_case_types)]
2860 pub enum ListpaysIndex {
2861 #[serde(rename = "created")]
2862 CREATED = 0,
2863 #[serde(rename = "updated")]
2864 UPDATED = 1,
2865 }
2866
2867 impl TryFrom<i32> for ListpaysIndex {
2868 type Error = anyhow::Error;
2869 fn try_from(c: i32) -> Result<ListpaysIndex, anyhow::Error> {
2870 match c {
2871 0 => Ok(ListpaysIndex::CREATED),
2872 1 => Ok(ListpaysIndex::UPDATED),
2873 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpaysIndex", o)),
2874 }
2875 }
2876 }
2877
2878 impl ToString for ListpaysIndex {
2879 fn to_string(&self) -> String {
2880 match self {
2881 ListpaysIndex::CREATED => "CREATED",
2882 ListpaysIndex::UPDATED => "UPDATED",
2883 }.to_string()
2884 }
2885 }
2886
2887 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2889 #[allow(non_camel_case_types)]
2890 pub enum ListpaysStatus {
2891 #[serde(rename = "pending")]
2892 PENDING = 0,
2893 #[serde(rename = "complete")]
2894 COMPLETE = 1,
2895 #[serde(rename = "failed")]
2896 FAILED = 2,
2897 }
2898
2899 impl TryFrom<i32> for ListpaysStatus {
2900 type Error = anyhow::Error;
2901 fn try_from(c: i32) -> Result<ListpaysStatus, anyhow::Error> {
2902 match c {
2903 0 => Ok(ListpaysStatus::PENDING),
2904 1 => Ok(ListpaysStatus::COMPLETE),
2905 2 => Ok(ListpaysStatus::FAILED),
2906 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpaysStatus", o)),
2907 }
2908 }
2909 }
2910
2911 impl ToString for ListpaysStatus {
2912 fn to_string(&self) -> String {
2913 match self {
2914 ListpaysStatus::PENDING => "PENDING",
2915 ListpaysStatus::COMPLETE => "COMPLETE",
2916 ListpaysStatus::FAILED => "FAILED",
2917 }.to_string()
2918 }
2919 }
2920
2921 #[derive(Clone, Debug, Deserialize, Serialize)]
2922 pub struct ListpaysRequest {
2923 #[serde(skip_serializing_if = "Option::is_none")]
2924 pub bolt11: Option<String>,
2925 #[serde(skip_serializing_if = "Option::is_none")]
2926 pub index: Option<ListpaysIndex>,
2927 #[serde(skip_serializing_if = "Option::is_none")]
2928 pub limit: Option<u32>,
2929 #[serde(skip_serializing_if = "Option::is_none")]
2930 pub payment_hash: Option<Sha256>,
2931 #[serde(skip_serializing_if = "Option::is_none")]
2932 pub start: Option<u64>,
2933 #[serde(skip_serializing_if = "Option::is_none")]
2934 pub status: Option<ListpaysStatus>,
2935 }
2936
2937 impl From<ListpaysRequest> for Request {
2938 fn from(r: ListpaysRequest) -> Self {
2939 Request::ListPays(r)
2940 }
2941 }
2942
2943 impl IntoRequest for ListpaysRequest {
2944 type Response = super::responses::ListpaysResponse;
2945 }
2946
2947 impl TypedRequest for ListpaysRequest {
2948 type Response = super::responses::ListpaysResponse;
2949
2950 fn method(&self) -> &str {
2951 "listpays"
2952 }
2953 }
2954 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
2956 #[allow(non_camel_case_types)]
2957 pub enum ListhtlcsIndex {
2958 #[serde(rename = "created")]
2959 CREATED = 0,
2960 #[serde(rename = "updated")]
2961 UPDATED = 1,
2962 }
2963
2964 impl TryFrom<i32> for ListhtlcsIndex {
2965 type Error = anyhow::Error;
2966 fn try_from(c: i32) -> Result<ListhtlcsIndex, anyhow::Error> {
2967 match c {
2968 0 => Ok(ListhtlcsIndex::CREATED),
2969 1 => Ok(ListhtlcsIndex::UPDATED),
2970 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListhtlcsIndex", o)),
2971 }
2972 }
2973 }
2974
2975 impl ToString for ListhtlcsIndex {
2976 fn to_string(&self) -> String {
2977 match self {
2978 ListhtlcsIndex::CREATED => "CREATED",
2979 ListhtlcsIndex::UPDATED => "UPDATED",
2980 }.to_string()
2981 }
2982 }
2983
2984 #[derive(Clone, Debug, Deserialize, Serialize)]
2985 pub struct ListhtlcsRequest {
2986 #[serde(skip_serializing_if = "Option::is_none")]
2987 pub id: Option<String>,
2988 #[serde(skip_serializing_if = "Option::is_none")]
2989 pub index: Option<ListhtlcsIndex>,
2990 #[serde(skip_serializing_if = "Option::is_none")]
2991 pub limit: Option<u32>,
2992 #[serde(skip_serializing_if = "Option::is_none")]
2993 pub start: Option<u64>,
2994 }
2995
2996 impl From<ListhtlcsRequest> for Request {
2997 fn from(r: ListhtlcsRequest) -> Self {
2998 Request::ListHtlcs(r)
2999 }
3000 }
3001
3002 impl IntoRequest for ListhtlcsRequest {
3003 type Response = super::responses::ListhtlcsResponse;
3004 }
3005
3006 impl TypedRequest for ListhtlcsRequest {
3007 type Response = super::responses::ListhtlcsResponse;
3008
3009 fn method(&self) -> &str {
3010 "listhtlcs"
3011 }
3012 }
3013 #[derive(Clone, Debug, Deserialize, Serialize)]
3014 pub struct MultifundchannelDestinations {
3015 #[serde(skip_serializing_if = "Option::is_none")]
3016 pub announce: Option<bool>,
3017 #[serde(skip_serializing_if = "Option::is_none")]
3018 pub close_to: Option<String>,
3019 #[serde(skip_serializing_if = "Option::is_none")]
3020 pub compact_lease: Option<String>,
3021 #[serde(skip_serializing_if = "Option::is_none")]
3022 pub mindepth: Option<u32>,
3023 #[serde(skip_serializing_if = "Option::is_none")]
3024 pub push_msat: Option<Amount>,
3025 #[serde(skip_serializing_if = "Option::is_none")]
3026 pub request_amt: Option<Amount>,
3027 #[serde(skip_serializing_if = "Option::is_none")]
3028 pub reserve: Option<Amount>,
3029 pub amount: AmountOrAll,
3030 pub id: String,
3031 }
3032
3033 #[derive(Clone, Debug, Deserialize, Serialize)]
3034 pub struct MultifundchannelRequest {
3035 #[serde(skip_serializing_if = "Option::is_none")]
3036 pub commitment_feerate: Option<Feerate>,
3037 #[serde(skip_serializing_if = "Option::is_none")]
3038 pub feerate: Option<Feerate>,
3039 #[serde(skip_serializing_if = "Option::is_none")]
3040 pub minchannels: Option<i64>,
3041 #[serde(skip_serializing_if = "Option::is_none")]
3042 pub minconf: Option<i64>,
3043 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
3044 pub utxos: Option<Vec<Outpoint>>,
3045 pub destinations: Vec<MultifundchannelDestinations>,
3046 }
3047
3048 impl From<MultifundchannelRequest> for Request {
3049 fn from(r: MultifundchannelRequest) -> Self {
3050 Request::MultiFundChannel(r)
3051 }
3052 }
3053
3054 impl IntoRequest for MultifundchannelRequest {
3055 type Response = super::responses::MultifundchannelResponse;
3056 }
3057
3058 impl TypedRequest for MultifundchannelRequest {
3059 type Response = super::responses::MultifundchannelResponse;
3060
3061 fn method(&self) -> &str {
3062 "multifundchannel"
3063 }
3064 }
3065 #[derive(Clone, Debug, Deserialize, Serialize)]
3066 pub struct MultiwithdrawRequest {
3067 #[serde(skip_serializing_if = "Option::is_none")]
3068 pub feerate: Option<Feerate>,
3069 #[serde(skip_serializing_if = "Option::is_none")]
3070 pub minconf: Option<u32>,
3071 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
3072 pub utxos: Option<Vec<Outpoint>>,
3073 pub outputs: Vec<OutputDesc>,
3074 }
3075
3076 impl From<MultiwithdrawRequest> for Request {
3077 fn from(r: MultiwithdrawRequest) -> Self {
3078 Request::MultiWithdraw(r)
3079 }
3080 }
3081
3082 impl IntoRequest for MultiwithdrawRequest {
3083 type Response = super::responses::MultiwithdrawResponse;
3084 }
3085
3086 impl TypedRequest for MultiwithdrawRequest {
3087 type Response = super::responses::MultiwithdrawResponse;
3088
3089 fn method(&self) -> &str {
3090 "multiwithdraw"
3091 }
3092 }
3093 #[derive(Clone, Debug, Deserialize, Serialize)]
3094 pub struct OfferRequest {
3095 #[serde(skip_serializing_if = "Option::is_none")]
3096 pub absolute_expiry: Option<u64>,
3097 #[serde(skip_serializing_if = "Option::is_none")]
3098 pub description: Option<String>,
3099 #[serde(skip_serializing_if = "Option::is_none")]
3100 pub issuer: Option<String>,
3101 #[serde(skip_serializing_if = "Option::is_none")]
3102 pub label: Option<String>,
3103 #[serde(skip_serializing_if = "Option::is_none")]
3104 pub optional_recurrence: Option<bool>,
3105 #[serde(skip_serializing_if = "Option::is_none")]
3106 pub proportional_amount: Option<bool>,
3107 #[serde(skip_serializing_if = "Option::is_none")]
3108 pub quantity_max: Option<u64>,
3109 #[serde(skip_serializing_if = "Option::is_none")]
3110 pub recurrence: Option<String>,
3111 #[serde(skip_serializing_if = "Option::is_none")]
3112 pub recurrence_base: Option<String>,
3113 #[serde(skip_serializing_if = "Option::is_none")]
3114 pub recurrence_limit: Option<u32>,
3115 #[serde(skip_serializing_if = "Option::is_none")]
3116 pub recurrence_paywindow: Option<String>,
3117 #[serde(skip_serializing_if = "Option::is_none")]
3118 pub single_use: Option<bool>,
3119 pub amount: String,
3120 }
3121
3122 impl From<OfferRequest> for Request {
3123 fn from(r: OfferRequest) -> Self {
3124 Request::Offer(r)
3125 }
3126 }
3127
3128 impl IntoRequest for OfferRequest {
3129 type Response = super::responses::OfferResponse;
3130 }
3131
3132 impl TypedRequest for OfferRequest {
3133 type Response = super::responses::OfferResponse;
3134
3135 fn method(&self) -> &str {
3136 "offer"
3137 }
3138 }
3139 #[derive(Clone, Debug, Deserialize, Serialize)]
3140 pub struct OpenchannelAbortRequest {
3141 pub channel_id: Sha256,
3142 }
3143
3144 impl From<OpenchannelAbortRequest> for Request {
3145 fn from(r: OpenchannelAbortRequest) -> Self {
3146 Request::OpenChannelAbort(r)
3147 }
3148 }
3149
3150 impl IntoRequest for OpenchannelAbortRequest {
3151 type Response = super::responses::OpenchannelAbortResponse;
3152 }
3153
3154 impl TypedRequest for OpenchannelAbortRequest {
3155 type Response = super::responses::OpenchannelAbortResponse;
3156
3157 fn method(&self) -> &str {
3158 "openchannel_abort"
3159 }
3160 }
3161 #[derive(Clone, Debug, Deserialize, Serialize)]
3162 pub struct OpenchannelBumpRequest {
3163 #[serde(skip_serializing_if = "Option::is_none")]
3164 pub funding_feerate: Option<Feerate>,
3165 pub amount: Amount,
3166 pub channel_id: Sha256,
3167 pub initialpsbt: String,
3168 }
3169
3170 impl From<OpenchannelBumpRequest> for Request {
3171 fn from(r: OpenchannelBumpRequest) -> Self {
3172 Request::OpenChannelBump(r)
3173 }
3174 }
3175
3176 impl IntoRequest for OpenchannelBumpRequest {
3177 type Response = super::responses::OpenchannelBumpResponse;
3178 }
3179
3180 impl TypedRequest for OpenchannelBumpRequest {
3181 type Response = super::responses::OpenchannelBumpResponse;
3182
3183 fn method(&self) -> &str {
3184 "openchannel_bump"
3185 }
3186 }
3187 #[derive(Clone, Debug, Deserialize, Serialize)]
3188 pub struct OpenchannelInitRequest {
3189 #[serde(skip_serializing_if = "Option::is_none")]
3190 pub announce: Option<bool>,
3191 #[serde(skip_serializing_if = "Option::is_none")]
3192 pub close_to: Option<String>,
3193 #[serde(skip_serializing_if = "Option::is_none")]
3194 pub commitment_feerate: Option<Feerate>,
3195 #[serde(skip_serializing_if = "Option::is_none")]
3196 pub compact_lease: Option<String>,
3197 #[serde(skip_serializing_if = "Option::is_none")]
3198 pub funding_feerate: Option<Feerate>,
3199 #[serde(skip_serializing_if = "Option::is_none")]
3200 pub request_amt: Option<Amount>,
3201 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
3202 pub channel_type: Option<Vec<u32>>,
3203 pub amount: Amount,
3204 pub id: PublicKey,
3205 pub initialpsbt: String,
3206 }
3207
3208 impl From<OpenchannelInitRequest> for Request {
3209 fn from(r: OpenchannelInitRequest) -> Self {
3210 Request::OpenChannelInit(r)
3211 }
3212 }
3213
3214 impl IntoRequest for OpenchannelInitRequest {
3215 type Response = super::responses::OpenchannelInitResponse;
3216 }
3217
3218 impl TypedRequest for OpenchannelInitRequest {
3219 type Response = super::responses::OpenchannelInitResponse;
3220
3221 fn method(&self) -> &str {
3222 "openchannel_init"
3223 }
3224 }
3225 #[derive(Clone, Debug, Deserialize, Serialize)]
3226 pub struct OpenchannelSignedRequest {
3227 pub channel_id: Sha256,
3228 pub signed_psbt: String,
3229 }
3230
3231 impl From<OpenchannelSignedRequest> for Request {
3232 fn from(r: OpenchannelSignedRequest) -> Self {
3233 Request::OpenChannelSigned(r)
3234 }
3235 }
3236
3237 impl IntoRequest for OpenchannelSignedRequest {
3238 type Response = super::responses::OpenchannelSignedResponse;
3239 }
3240
3241 impl TypedRequest for OpenchannelSignedRequest {
3242 type Response = super::responses::OpenchannelSignedResponse;
3243
3244 fn method(&self) -> &str {
3245 "openchannel_signed"
3246 }
3247 }
3248 #[derive(Clone, Debug, Deserialize, Serialize)]
3249 pub struct OpenchannelUpdateRequest {
3250 pub channel_id: Sha256,
3251 pub psbt: String,
3252 }
3253
3254 impl From<OpenchannelUpdateRequest> for Request {
3255 fn from(r: OpenchannelUpdateRequest) -> Self {
3256 Request::OpenChannelUpdate(r)
3257 }
3258 }
3259
3260 impl IntoRequest for OpenchannelUpdateRequest {
3261 type Response = super::responses::OpenchannelUpdateResponse;
3262 }
3263
3264 impl TypedRequest for OpenchannelUpdateRequest {
3265 type Response = super::responses::OpenchannelUpdateResponse;
3266
3267 fn method(&self) -> &str {
3268 "openchannel_update"
3269 }
3270 }
3271 #[derive(Clone, Debug, Deserialize, Serialize)]
3272 pub struct PingRequest {
3273 #[serde(skip_serializing_if = "Option::is_none")]
3274 pub len: Option<u16>,
3275 #[serde(skip_serializing_if = "Option::is_none")]
3276 pub pongbytes: Option<u16>,
3277 pub id: PublicKey,
3278 }
3279
3280 impl From<PingRequest> for Request {
3281 fn from(r: PingRequest) -> Self {
3282 Request::Ping(r)
3283 }
3284 }
3285
3286 impl IntoRequest for PingRequest {
3287 type Response = super::responses::PingResponse;
3288 }
3289
3290 impl TypedRequest for PingRequest {
3291 type Response = super::responses::PingResponse;
3292
3293 fn method(&self) -> &str {
3294 "ping"
3295 }
3296 }
3297 #[derive(Clone, Debug, Deserialize, Serialize)]
3298 pub struct PluginRequest {
3299 #[serde(skip_serializing_if = "Option::is_none")]
3300 pub directory: Option<String>,
3301 #[serde(skip_serializing_if = "Option::is_none")]
3302 pub plugin: Option<String>,
3303 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
3304 pub options: Option<Vec<String>>,
3305 pub subcommand: PluginSubcommand,
3307 }
3308
3309 impl From<PluginRequest> for Request {
3310 fn from(r: PluginRequest) -> Self {
3311 Request::Plugin(r)
3312 }
3313 }
3314
3315 impl IntoRequest for PluginRequest {
3316 type Response = super::responses::PluginResponse;
3317 }
3318
3319 impl TypedRequest for PluginRequest {
3320 type Response = super::responses::PluginResponse;
3321
3322 fn method(&self) -> &str {
3323 "plugin"
3324 }
3325 }
3326 #[derive(Clone, Debug, Deserialize, Serialize)]
3327 pub struct RenepaystatusRequest {
3328 #[serde(skip_serializing_if = "Option::is_none")]
3329 pub invstring: Option<String>,
3330 }
3331
3332 impl From<RenepaystatusRequest> for Request {
3333 fn from(r: RenepaystatusRequest) -> Self {
3334 Request::RenePayStatus(r)
3335 }
3336 }
3337
3338 impl IntoRequest for RenepaystatusRequest {
3339 type Response = super::responses::RenepaystatusResponse;
3340 }
3341
3342 impl TypedRequest for RenepaystatusRequest {
3343 type Response = super::responses::RenepaystatusResponse;
3344
3345 fn method(&self) -> &str {
3346 "renepaystatus"
3347 }
3348 }
3349 #[derive(Clone, Debug, Deserialize, Serialize)]
3350 pub struct RenepayRequest {
3351 #[serde(skip_serializing_if = "Option::is_none")]
3352 pub amount_msat: Option<Amount>,
3353 #[serde(skip_serializing_if = "Option::is_none")]
3354 pub description: Option<String>,
3355 #[serde(skip_serializing_if = "Option::is_none")]
3356 pub dev_use_shadow: Option<bool>,
3357 #[serde(skip_serializing_if = "Option::is_none")]
3358 pub label: Option<String>,
3359 #[serde(skip_serializing_if = "Option::is_none")]
3360 pub maxdelay: Option<u32>,
3361 #[serde(skip_serializing_if = "Option::is_none")]
3362 pub maxfee: Option<Amount>,
3363 #[serde(skip_serializing_if = "Option::is_none")]
3364 pub retry_for: Option<u32>,
3365 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
3366 pub exclude: Option<Vec<String>>,
3367 pub invstring: String,
3368 }
3369
3370 impl From<RenepayRequest> for Request {
3371 fn from(r: RenepayRequest) -> Self {
3372 Request::RenePay(r)
3373 }
3374 }
3375
3376 impl IntoRequest for RenepayRequest {
3377 type Response = super::responses::RenepayResponse;
3378 }
3379
3380 impl TypedRequest for RenepayRequest {
3381 type Response = super::responses::RenepayResponse;
3382
3383 fn method(&self) -> &str {
3384 "renepay"
3385 }
3386 }
3387 #[derive(Clone, Debug, Deserialize, Serialize)]
3388 pub struct ReserveinputsRequest {
3389 #[serde(skip_serializing_if = "Option::is_none")]
3390 pub exclusive: Option<bool>,
3391 #[serde(skip_serializing_if = "Option::is_none")]
3392 pub reserve: Option<u32>,
3393 pub psbt: String,
3394 }
3395
3396 impl From<ReserveinputsRequest> for Request {
3397 fn from(r: ReserveinputsRequest) -> Self {
3398 Request::ReserveInputs(r)
3399 }
3400 }
3401
3402 impl IntoRequest for ReserveinputsRequest {
3403 type Response = super::responses::ReserveinputsResponse;
3404 }
3405
3406 impl TypedRequest for ReserveinputsRequest {
3407 type Response = super::responses::ReserveinputsResponse;
3408
3409 fn method(&self) -> &str {
3410 "reserveinputs"
3411 }
3412 }
3413 #[derive(Clone, Debug, Deserialize, Serialize)]
3414 pub struct SendcustommsgRequest {
3415 pub msg: String,
3416 pub node_id: PublicKey,
3417 }
3418
3419 impl From<SendcustommsgRequest> for Request {
3420 fn from(r: SendcustommsgRequest) -> Self {
3421 Request::SendCustomMsg(r)
3422 }
3423 }
3424
3425 impl IntoRequest for SendcustommsgRequest {
3426 type Response = super::responses::SendcustommsgResponse;
3427 }
3428
3429 impl TypedRequest for SendcustommsgRequest {
3430 type Response = super::responses::SendcustommsgResponse;
3431
3432 fn method(&self) -> &str {
3433 "sendcustommsg"
3434 }
3435 }
3436 #[derive(Clone, Debug, Deserialize, Serialize)]
3437 pub struct SendinvoiceRequest {
3438 #[serde(skip_serializing_if = "Option::is_none")]
3439 pub amount_msat: Option<Amount>,
3440 #[serde(skip_serializing_if = "Option::is_none")]
3441 pub quantity: Option<u64>,
3442 #[serde(skip_serializing_if = "Option::is_none")]
3443 pub timeout: Option<u32>,
3444 pub invreq: String,
3445 pub label: String,
3446 }
3447
3448 impl From<SendinvoiceRequest> for Request {
3449 fn from(r: SendinvoiceRequest) -> Self {
3450 Request::SendInvoice(r)
3451 }
3452 }
3453
3454 impl IntoRequest for SendinvoiceRequest {
3455 type Response = super::responses::SendinvoiceResponse;
3456 }
3457
3458 impl TypedRequest for SendinvoiceRequest {
3459 type Response = super::responses::SendinvoiceResponse;
3460
3461 fn method(&self) -> &str {
3462 "sendinvoice"
3463 }
3464 }
3465 #[derive(Clone, Debug, Deserialize, Serialize)]
3466 pub struct SetchannelRequest {
3467 #[serde(skip_serializing_if = "Option::is_none")]
3468 pub enforcedelay: Option<u32>,
3469 #[serde(skip_serializing_if = "Option::is_none")]
3470 pub feebase: Option<Amount>,
3471 #[serde(skip_serializing_if = "Option::is_none")]
3472 pub feeppm: Option<u32>,
3473 #[serde(skip_serializing_if = "Option::is_none")]
3474 pub htlcmax: Option<Amount>,
3475 #[serde(skip_serializing_if = "Option::is_none")]
3476 pub htlcmin: Option<Amount>,
3477 #[serde(skip_serializing_if = "Option::is_none")]
3478 pub ignorefeelimits: Option<bool>,
3479 pub id: String,
3480 }
3481
3482 impl From<SetchannelRequest> for Request {
3483 fn from(r: SetchannelRequest) -> Self {
3484 Request::SetChannel(r)
3485 }
3486 }
3487
3488 impl IntoRequest for SetchannelRequest {
3489 type Response = super::responses::SetchannelResponse;
3490 }
3491
3492 impl TypedRequest for SetchannelRequest {
3493 type Response = super::responses::SetchannelResponse;
3494
3495 fn method(&self) -> &str {
3496 "setchannel"
3497 }
3498 }
3499 #[derive(Clone, Debug, Deserialize, Serialize)]
3500 pub struct SetconfigRequest {
3501 #[serde(skip_serializing_if = "Option::is_none")]
3502 pub transient: Option<bool>,
3503 #[serde(skip_serializing_if = "Option::is_none")]
3504 pub val: Option<String>,
3505 pub config: String,
3506 }
3507
3508 impl From<SetconfigRequest> for Request {
3509 fn from(r: SetconfigRequest) -> Self {
3510 Request::SetConfig(r)
3511 }
3512 }
3513
3514 impl IntoRequest for SetconfigRequest {
3515 type Response = super::responses::SetconfigResponse;
3516 }
3517
3518 impl TypedRequest for SetconfigRequest {
3519 type Response = super::responses::SetconfigResponse;
3520
3521 fn method(&self) -> &str {
3522 "setconfig"
3523 }
3524 }
3525 #[derive(Clone, Debug, Deserialize, Serialize)]
3526 pub struct SetpsbtversionRequest {
3527 pub psbt: String,
3528 pub version: u32,
3529 }
3530
3531 impl From<SetpsbtversionRequest> for Request {
3532 fn from(r: SetpsbtversionRequest) -> Self {
3533 Request::SetPsbtVersion(r)
3534 }
3535 }
3536
3537 impl IntoRequest for SetpsbtversionRequest {
3538 type Response = super::responses::SetpsbtversionResponse;
3539 }
3540
3541 impl TypedRequest for SetpsbtversionRequest {
3542 type Response = super::responses::SetpsbtversionResponse;
3543
3544 fn method(&self) -> &str {
3545 "setpsbtversion"
3546 }
3547 }
3548 #[derive(Clone, Debug, Deserialize, Serialize)]
3549 pub struct SigninvoiceRequest {
3550 pub invstring: String,
3551 }
3552
3553 impl From<SigninvoiceRequest> for Request {
3554 fn from(r: SigninvoiceRequest) -> Self {
3555 Request::SignInvoice(r)
3556 }
3557 }
3558
3559 impl IntoRequest for SigninvoiceRequest {
3560 type Response = super::responses::SigninvoiceResponse;
3561 }
3562
3563 impl TypedRequest for SigninvoiceRequest {
3564 type Response = super::responses::SigninvoiceResponse;
3565
3566 fn method(&self) -> &str {
3567 "signinvoice"
3568 }
3569 }
3570 #[derive(Clone, Debug, Deserialize, Serialize)]
3571 pub struct SignmessageRequest {
3572 pub message: String,
3573 }
3574
3575 impl From<SignmessageRequest> for Request {
3576 fn from(r: SignmessageRequest) -> Self {
3577 Request::SignMessage(r)
3578 }
3579 }
3580
3581 impl IntoRequest for SignmessageRequest {
3582 type Response = super::responses::SignmessageResponse;
3583 }
3584
3585 impl TypedRequest for SignmessageRequest {
3586 type Response = super::responses::SignmessageResponse;
3587
3588 fn method(&self) -> &str {
3589 "signmessage"
3590 }
3591 }
3592 #[derive(Clone, Debug, Deserialize, Serialize)]
3593 pub struct SpliceInitRequest {
3594 #[serde(skip_serializing_if = "Option::is_none")]
3595 pub feerate_per_kw: Option<u32>,
3596 #[serde(skip_serializing_if = "Option::is_none")]
3597 pub force_feerate: Option<bool>,
3598 #[serde(skip_serializing_if = "Option::is_none")]
3599 pub initialpsbt: Option<String>,
3600 pub channel_id: Sha256,
3601 pub relative_amount: i64,
3602 }
3603
3604 impl From<SpliceInitRequest> for Request {
3605 fn from(r: SpliceInitRequest) -> Self {
3606 Request::SpliceInit(r)
3607 }
3608 }
3609
3610 impl IntoRequest for SpliceInitRequest {
3611 type Response = super::responses::SpliceInitResponse;
3612 }
3613
3614 impl TypedRequest for SpliceInitRequest {
3615 type Response = super::responses::SpliceInitResponse;
3616
3617 fn method(&self) -> &str {
3618 "splice_init"
3619 }
3620 }
3621 #[derive(Clone, Debug, Deserialize, Serialize)]
3622 pub struct SpliceSignedRequest {
3623 #[serde(skip_serializing_if = "Option::is_none")]
3624 pub sign_first: Option<bool>,
3625 pub channel_id: Sha256,
3626 pub psbt: String,
3627 }
3628
3629 impl From<SpliceSignedRequest> for Request {
3630 fn from(r: SpliceSignedRequest) -> Self {
3631 Request::SpliceSigned(r)
3632 }
3633 }
3634
3635 impl IntoRequest for SpliceSignedRequest {
3636 type Response = super::responses::SpliceSignedResponse;
3637 }
3638
3639 impl TypedRequest for SpliceSignedRequest {
3640 type Response = super::responses::SpliceSignedResponse;
3641
3642 fn method(&self) -> &str {
3643 "splice_signed"
3644 }
3645 }
3646 #[derive(Clone, Debug, Deserialize, Serialize)]
3647 pub struct SpliceUpdateRequest {
3648 pub channel_id: Sha256,
3649 pub psbt: String,
3650 }
3651
3652 impl From<SpliceUpdateRequest> for Request {
3653 fn from(r: SpliceUpdateRequest) -> Self {
3654 Request::SpliceUpdate(r)
3655 }
3656 }
3657
3658 impl IntoRequest for SpliceUpdateRequest {
3659 type Response = super::responses::SpliceUpdateResponse;
3660 }
3661
3662 impl TypedRequest for SpliceUpdateRequest {
3663 type Response = super::responses::SpliceUpdateResponse;
3664
3665 fn method(&self) -> &str {
3666 "splice_update"
3667 }
3668 }
3669 #[derive(Clone, Debug, Deserialize, Serialize)]
3670 pub struct DevspliceRequest {
3671 #[serde(rename = "dev-wetrun")]
3672 #[serde(skip_serializing_if = "Option::is_none")]
3673 pub dev_wetrun: Option<bool>,
3674 #[serde(skip_serializing_if = "Option::is_none")]
3675 pub debug_log: Option<bool>,
3676 #[serde(skip_serializing_if = "Option::is_none")]
3677 pub dryrun: Option<bool>,
3678 #[serde(skip_serializing_if = "Option::is_none")]
3679 pub force_feerate: Option<bool>,
3680 pub script_or_json: String,
3681 }
3682
3683 impl From<DevspliceRequest> for Request {
3684 fn from(r: DevspliceRequest) -> Self {
3685 Request::DevSplice(r)
3686 }
3687 }
3688
3689 impl IntoRequest for DevspliceRequest {
3690 type Response = super::responses::DevspliceResponse;
3691 }
3692
3693 impl TypedRequest for DevspliceRequest {
3694 type Response = super::responses::DevspliceResponse;
3695
3696 fn method(&self) -> &str {
3697 "dev-splice"
3698 }
3699 }
3700 #[derive(Clone, Debug, Deserialize, Serialize)]
3701 pub struct UnreserveinputsRequest {
3702 #[serde(skip_serializing_if = "Option::is_none")]
3703 pub reserve: Option<u32>,
3704 pub psbt: String,
3705 }
3706
3707 impl From<UnreserveinputsRequest> for Request {
3708 fn from(r: UnreserveinputsRequest) -> Self {
3709 Request::UnreserveInputs(r)
3710 }
3711 }
3712
3713 impl IntoRequest for UnreserveinputsRequest {
3714 type Response = super::responses::UnreserveinputsResponse;
3715 }
3716
3717 impl TypedRequest for UnreserveinputsRequest {
3718 type Response = super::responses::UnreserveinputsResponse;
3719
3720 fn method(&self) -> &str {
3721 "unreserveinputs"
3722 }
3723 }
3724 #[derive(Clone, Debug, Deserialize, Serialize)]
3725 pub struct UpgradewalletRequest {
3726 #[serde(skip_serializing_if = "Option::is_none")]
3727 pub feerate: Option<Feerate>,
3728 #[serde(skip_serializing_if = "Option::is_none")]
3729 pub reservedok: Option<bool>,
3730 }
3731
3732 impl From<UpgradewalletRequest> for Request {
3733 fn from(r: UpgradewalletRequest) -> Self {
3734 Request::UpgradeWallet(r)
3735 }
3736 }
3737
3738 impl IntoRequest for UpgradewalletRequest {
3739 type Response = super::responses::UpgradewalletResponse;
3740 }
3741
3742 impl TypedRequest for UpgradewalletRequest {
3743 type Response = super::responses::UpgradewalletResponse;
3744
3745 fn method(&self) -> &str {
3746 "upgradewallet"
3747 }
3748 }
3749 #[derive(Clone, Debug, Deserialize, Serialize)]
3750 pub struct WaitblockheightRequest {
3751 #[serde(skip_serializing_if = "Option::is_none")]
3752 pub timeout: Option<u32>,
3753 pub blockheight: u32,
3754 }
3755
3756 impl From<WaitblockheightRequest> for Request {
3757 fn from(r: WaitblockheightRequest) -> Self {
3758 Request::WaitBlockHeight(r)
3759 }
3760 }
3761
3762 impl IntoRequest for WaitblockheightRequest {
3763 type Response = super::responses::WaitblockheightResponse;
3764 }
3765
3766 impl TypedRequest for WaitblockheightRequest {
3767 type Response = super::responses::WaitblockheightResponse;
3768
3769 fn method(&self) -> &str {
3770 "waitblockheight"
3771 }
3772 }
3773 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
3775 #[allow(non_camel_case_types)]
3776 pub enum WaitIndexname {
3777 #[serde(rename = "created")]
3778 CREATED = 0,
3779 #[serde(rename = "updated")]
3780 UPDATED = 1,
3781 #[serde(rename = "deleted")]
3782 DELETED = 2,
3783 }
3784
3785 impl TryFrom<i32> for WaitIndexname {
3786 type Error = anyhow::Error;
3787 fn try_from(c: i32) -> Result<WaitIndexname, anyhow::Error> {
3788 match c {
3789 0 => Ok(WaitIndexname::CREATED),
3790 1 => Ok(WaitIndexname::UPDATED),
3791 2 => Ok(WaitIndexname::DELETED),
3792 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitIndexname", o)),
3793 }
3794 }
3795 }
3796
3797 impl ToString for WaitIndexname {
3798 fn to_string(&self) -> String {
3799 match self {
3800 WaitIndexname::CREATED => "CREATED",
3801 WaitIndexname::UPDATED => "UPDATED",
3802 WaitIndexname::DELETED => "DELETED",
3803 }.to_string()
3804 }
3805 }
3806
3807 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
3809 #[allow(non_camel_case_types)]
3810 pub enum WaitSubsystem {
3811 #[serde(rename = "invoices")]
3812 INVOICES = 0,
3813 #[serde(rename = "forwards")]
3814 FORWARDS = 1,
3815 #[serde(rename = "sendpays")]
3816 SENDPAYS = 2,
3817 #[serde(rename = "htlcs")]
3818 HTLCS = 3,
3819 #[serde(rename = "chainmoves")]
3820 CHAINMOVES = 4,
3821 #[serde(rename = "channelmoves")]
3822 CHANNELMOVES = 5,
3823 }
3824
3825 impl TryFrom<i32> for WaitSubsystem {
3826 type Error = anyhow::Error;
3827 fn try_from(c: i32) -> Result<WaitSubsystem, anyhow::Error> {
3828 match c {
3829 0 => Ok(WaitSubsystem::INVOICES),
3830 1 => Ok(WaitSubsystem::FORWARDS),
3831 2 => Ok(WaitSubsystem::SENDPAYS),
3832 3 => Ok(WaitSubsystem::HTLCS),
3833 4 => Ok(WaitSubsystem::CHAINMOVES),
3834 5 => Ok(WaitSubsystem::CHANNELMOVES),
3835 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitSubsystem", o)),
3836 }
3837 }
3838 }
3839
3840 impl ToString for WaitSubsystem {
3841 fn to_string(&self) -> String {
3842 match self {
3843 WaitSubsystem::INVOICES => "INVOICES",
3844 WaitSubsystem::FORWARDS => "FORWARDS",
3845 WaitSubsystem::SENDPAYS => "SENDPAYS",
3846 WaitSubsystem::HTLCS => "HTLCS",
3847 WaitSubsystem::CHAINMOVES => "CHAINMOVES",
3848 WaitSubsystem::CHANNELMOVES => "CHANNELMOVES",
3849 }.to_string()
3850 }
3851 }
3852
3853 #[derive(Clone, Debug, Deserialize, Serialize)]
3854 pub struct WaitRequest {
3855 pub indexname: WaitIndexname,
3857 pub subsystem: WaitSubsystem,
3859 pub nextvalue: u64,
3860 }
3861
3862 impl From<WaitRequest> for Request {
3863 fn from(r: WaitRequest) -> Self {
3864 Request::Wait(r)
3865 }
3866 }
3867
3868 impl IntoRequest for WaitRequest {
3869 type Response = super::responses::WaitResponse;
3870 }
3871
3872 impl TypedRequest for WaitRequest {
3873 type Response = super::responses::WaitResponse;
3874
3875 fn method(&self) -> &str {
3876 "wait"
3877 }
3878 }
3879 #[derive(Clone, Debug, Deserialize, Serialize)]
3880 pub struct ListconfigsRequest {
3881 #[serde(skip_serializing_if = "Option::is_none")]
3882 pub config: Option<String>,
3883 }
3884
3885 impl From<ListconfigsRequest> for Request {
3886 fn from(r: ListconfigsRequest) -> Self {
3887 Request::ListConfigs(r)
3888 }
3889 }
3890
3891 impl IntoRequest for ListconfigsRequest {
3892 type Response = super::responses::ListconfigsResponse;
3893 }
3894
3895 impl TypedRequest for ListconfigsRequest {
3896 type Response = super::responses::ListconfigsResponse;
3897
3898 fn method(&self) -> &str {
3899 "listconfigs"
3900 }
3901 }
3902 #[derive(Clone, Debug, Deserialize, Serialize)]
3903 pub struct StopRequest {
3904 }
3905
3906 impl From<StopRequest> for Request {
3907 fn from(r: StopRequest) -> Self {
3908 Request::Stop(r)
3909 }
3910 }
3911
3912 impl IntoRequest for StopRequest {
3913 type Response = super::responses::StopResponse;
3914 }
3915
3916 impl TypedRequest for StopRequest {
3917 type Response = super::responses::StopResponse;
3918
3919 fn method(&self) -> &str {
3920 "stop"
3921 }
3922 }
3923 #[derive(Clone, Debug, Deserialize, Serialize)]
3924 pub struct HelpRequest {
3925 #[serde(skip_serializing_if = "Option::is_none")]
3926 pub command: Option<String>,
3927 }
3928
3929 impl From<HelpRequest> for Request {
3930 fn from(r: HelpRequest) -> Self {
3931 Request::Help(r)
3932 }
3933 }
3934
3935 impl IntoRequest for HelpRequest {
3936 type Response = super::responses::HelpResponse;
3937 }
3938
3939 impl TypedRequest for HelpRequest {
3940 type Response = super::responses::HelpResponse;
3941
3942 fn method(&self) -> &str {
3943 "help"
3944 }
3945 }
3946 #[derive(Clone, Debug, Deserialize, Serialize)]
3947 pub struct PreapprovekeysendRequest {
3948 pub amount_msat: Amount,
3949 pub destination: PublicKey,
3950 pub payment_hash: String,
3951 }
3952
3953 impl From<PreapprovekeysendRequest> for Request {
3954 fn from(r: PreapprovekeysendRequest) -> Self {
3955 Request::PreApproveKeysend(r)
3956 }
3957 }
3958
3959 impl IntoRequest for PreapprovekeysendRequest {
3960 type Response = super::responses::PreapprovekeysendResponse;
3961 }
3962
3963 impl TypedRequest for PreapprovekeysendRequest {
3964 type Response = super::responses::PreapprovekeysendResponse;
3965
3966 fn method(&self) -> &str {
3967 "preapprovekeysend"
3968 }
3969 }
3970 #[derive(Clone, Debug, Deserialize, Serialize)]
3971 pub struct PreapproveinvoiceRequest {
3972 pub bolt11: String,
3973 }
3974
3975 impl From<PreapproveinvoiceRequest> for Request {
3976 fn from(r: PreapproveinvoiceRequest) -> Self {
3977 Request::PreApproveInvoice(r)
3978 }
3979 }
3980
3981 impl IntoRequest for PreapproveinvoiceRequest {
3982 type Response = super::responses::PreapproveinvoiceResponse;
3983 }
3984
3985 impl TypedRequest for PreapproveinvoiceRequest {
3986 type Response = super::responses::PreapproveinvoiceResponse;
3987
3988 fn method(&self) -> &str {
3989 "preapproveinvoice"
3990 }
3991 }
3992 #[derive(Clone, Debug, Deserialize, Serialize)]
3993 pub struct StaticbackupRequest {
3994 }
3995
3996 impl From<StaticbackupRequest> for Request {
3997 fn from(r: StaticbackupRequest) -> Self {
3998 Request::StaticBackup(r)
3999 }
4000 }
4001
4002 impl IntoRequest for StaticbackupRequest {
4003 type Response = super::responses::StaticbackupResponse;
4004 }
4005
4006 impl TypedRequest for StaticbackupRequest {
4007 type Response = super::responses::StaticbackupResponse;
4008
4009 fn method(&self) -> &str {
4010 "staticbackup"
4011 }
4012 }
4013 #[derive(Clone, Debug, Deserialize, Serialize)]
4014 pub struct BkprchannelsapyRequest {
4015 #[serde(skip_serializing_if = "Option::is_none")]
4016 pub end_time: Option<u64>,
4017 #[serde(skip_serializing_if = "Option::is_none")]
4018 pub start_time: Option<u64>,
4019 }
4020
4021 impl From<BkprchannelsapyRequest> for Request {
4022 fn from(r: BkprchannelsapyRequest) -> Self {
4023 Request::BkprChannelsApy(r)
4024 }
4025 }
4026
4027 impl IntoRequest for BkprchannelsapyRequest {
4028 type Response = super::responses::BkprchannelsapyResponse;
4029 }
4030
4031 impl TypedRequest for BkprchannelsapyRequest {
4032 type Response = super::responses::BkprchannelsapyResponse;
4033
4034 fn method(&self) -> &str {
4035 "bkpr-channelsapy"
4036 }
4037 }
4038 #[derive(Clone, Debug, Deserialize, Serialize)]
4039 pub struct BkprdumpincomecsvRequest {
4040 #[serde(skip_serializing_if = "Option::is_none")]
4041 pub consolidate_fees: Option<bool>,
4042 #[serde(skip_serializing_if = "Option::is_none")]
4043 pub csv_file: Option<String>,
4044 #[serde(skip_serializing_if = "Option::is_none")]
4045 pub end_time: Option<u64>,
4046 #[serde(skip_serializing_if = "Option::is_none")]
4047 pub start_time: Option<u64>,
4048 pub csv_format: String,
4049 }
4050
4051 impl From<BkprdumpincomecsvRequest> for Request {
4052 fn from(r: BkprdumpincomecsvRequest) -> Self {
4053 Request::BkprDumpIncomeCsv(r)
4054 }
4055 }
4056
4057 impl IntoRequest for BkprdumpincomecsvRequest {
4058 type Response = super::responses::BkprdumpincomecsvResponse;
4059 }
4060
4061 impl TypedRequest for BkprdumpincomecsvRequest {
4062 type Response = super::responses::BkprdumpincomecsvResponse;
4063
4064 fn method(&self) -> &str {
4065 "bkpr-dumpincomecsv"
4066 }
4067 }
4068 #[derive(Clone, Debug, Deserialize, Serialize)]
4069 pub struct BkprinspectRequest {
4070 pub account: String,
4071 }
4072
4073 impl From<BkprinspectRequest> for Request {
4074 fn from(r: BkprinspectRequest) -> Self {
4075 Request::BkprInspect(r)
4076 }
4077 }
4078
4079 impl IntoRequest for BkprinspectRequest {
4080 type Response = super::responses::BkprinspectResponse;
4081 }
4082
4083 impl TypedRequest for BkprinspectRequest {
4084 type Response = super::responses::BkprinspectResponse;
4085
4086 fn method(&self) -> &str {
4087 "bkpr-inspect"
4088 }
4089 }
4090 #[derive(Clone, Debug, Deserialize, Serialize)]
4091 pub struct BkprlistaccounteventsRequest {
4092 #[serde(skip_serializing_if = "Option::is_none")]
4093 pub account: Option<String>,
4094 #[serde(skip_serializing_if = "Option::is_none")]
4095 pub payment_id: Option<String>,
4096 }
4097
4098 impl From<BkprlistaccounteventsRequest> for Request {
4099 fn from(r: BkprlistaccounteventsRequest) -> Self {
4100 Request::BkprListAccountEvents(r)
4101 }
4102 }
4103
4104 impl IntoRequest for BkprlistaccounteventsRequest {
4105 type Response = super::responses::BkprlistaccounteventsResponse;
4106 }
4107
4108 impl TypedRequest for BkprlistaccounteventsRequest {
4109 type Response = super::responses::BkprlistaccounteventsResponse;
4110
4111 fn method(&self) -> &str {
4112 "bkpr-listaccountevents"
4113 }
4114 }
4115 #[derive(Clone, Debug, Deserialize, Serialize)]
4116 pub struct BkprlistbalancesRequest {
4117 }
4118
4119 impl From<BkprlistbalancesRequest> for Request {
4120 fn from(r: BkprlistbalancesRequest) -> Self {
4121 Request::BkprListBalances(r)
4122 }
4123 }
4124
4125 impl IntoRequest for BkprlistbalancesRequest {
4126 type Response = super::responses::BkprlistbalancesResponse;
4127 }
4128
4129 impl TypedRequest for BkprlistbalancesRequest {
4130 type Response = super::responses::BkprlistbalancesResponse;
4131
4132 fn method(&self) -> &str {
4133 "bkpr-listbalances"
4134 }
4135 }
4136 #[derive(Clone, Debug, Deserialize, Serialize)]
4137 pub struct BkprlistincomeRequest {
4138 #[serde(skip_serializing_if = "Option::is_none")]
4139 pub consolidate_fees: Option<bool>,
4140 #[serde(skip_serializing_if = "Option::is_none")]
4141 pub end_time: Option<u32>,
4142 #[serde(skip_serializing_if = "Option::is_none")]
4143 pub start_time: Option<u32>,
4144 }
4145
4146 impl From<BkprlistincomeRequest> for Request {
4147 fn from(r: BkprlistincomeRequest) -> Self {
4148 Request::BkprListIncome(r)
4149 }
4150 }
4151
4152 impl IntoRequest for BkprlistincomeRequest {
4153 type Response = super::responses::BkprlistincomeResponse;
4154 }
4155
4156 impl TypedRequest for BkprlistincomeRequest {
4157 type Response = super::responses::BkprlistincomeResponse;
4158
4159 fn method(&self) -> &str {
4160 "bkpr-listincome"
4161 }
4162 }
4163 #[derive(Clone, Debug, Deserialize, Serialize)]
4164 pub struct BkpreditdescriptionbypaymentidRequest {
4165 pub description: String,
4166 pub payment_id: String,
4167 }
4168
4169 impl From<BkpreditdescriptionbypaymentidRequest> for Request {
4170 fn from(r: BkpreditdescriptionbypaymentidRequest) -> Self {
4171 Request::BkprEditDescriptionByPaymentId(r)
4172 }
4173 }
4174
4175 impl IntoRequest for BkpreditdescriptionbypaymentidRequest {
4176 type Response = super::responses::BkpreditdescriptionbypaymentidResponse;
4177 }
4178
4179 impl TypedRequest for BkpreditdescriptionbypaymentidRequest {
4180 type Response = super::responses::BkpreditdescriptionbypaymentidResponse;
4181
4182 fn method(&self) -> &str {
4183 "bkpr-editdescriptionbypaymentid"
4184 }
4185 }
4186 #[derive(Clone, Debug, Deserialize, Serialize)]
4187 pub struct BkpreditdescriptionbyoutpointRequest {
4188 pub description: String,
4189 pub outpoint: String,
4190 }
4191
4192 impl From<BkpreditdescriptionbyoutpointRequest> for Request {
4193 fn from(r: BkpreditdescriptionbyoutpointRequest) -> Self {
4194 Request::BkprEditDescriptionByOutpoint(r)
4195 }
4196 }
4197
4198 impl IntoRequest for BkpreditdescriptionbyoutpointRequest {
4199 type Response = super::responses::BkpreditdescriptionbyoutpointResponse;
4200 }
4201
4202 impl TypedRequest for BkpreditdescriptionbyoutpointRequest {
4203 type Response = super::responses::BkpreditdescriptionbyoutpointResponse;
4204
4205 fn method(&self) -> &str {
4206 "bkpr-editdescriptionbyoutpoint"
4207 }
4208 }
4209 #[derive(Clone, Debug, Deserialize, Serialize)]
4210 pub struct BlacklistruneRequest {
4211 #[serde(skip_serializing_if = "Option::is_none")]
4212 pub end: Option<u64>,
4213 #[serde(skip_serializing_if = "Option::is_none")]
4214 pub relist: Option<bool>,
4215 #[serde(skip_serializing_if = "Option::is_none")]
4216 pub start: Option<u64>,
4217 }
4218
4219 impl From<BlacklistruneRequest> for Request {
4220 fn from(r: BlacklistruneRequest) -> Self {
4221 Request::BlacklistRune(r)
4222 }
4223 }
4224
4225 impl IntoRequest for BlacklistruneRequest {
4226 type Response = super::responses::BlacklistruneResponse;
4227 }
4228
4229 impl TypedRequest for BlacklistruneRequest {
4230 type Response = super::responses::BlacklistruneResponse;
4231
4232 fn method(&self) -> &str {
4233 "blacklistrune"
4234 }
4235 }
4236 #[derive(Clone, Debug, Deserialize, Serialize)]
4237 pub struct CheckruneRequest {
4238 #[serde(skip_serializing_if = "Option::is_none")]
4239 pub method: Option<String>,
4240 #[serde(skip_serializing_if = "Option::is_none")]
4241 pub nodeid: Option<String>,
4242 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
4243 pub params: Option<Vec<String>>,
4244 pub rune: String,
4245 }
4246
4247 impl From<CheckruneRequest> for Request {
4248 fn from(r: CheckruneRequest) -> Self {
4249 Request::CheckRune(r)
4250 }
4251 }
4252
4253 impl IntoRequest for CheckruneRequest {
4254 type Response = super::responses::CheckruneResponse;
4255 }
4256
4257 impl TypedRequest for CheckruneRequest {
4258 type Response = super::responses::CheckruneResponse;
4259
4260 fn method(&self) -> &str {
4261 "checkrune"
4262 }
4263 }
4264 #[derive(Clone, Debug, Deserialize, Serialize)]
4265 pub struct CreateruneRequest {
4266 #[serde(skip_serializing_if = "Option::is_none")]
4267 pub rune: Option<String>,
4268 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
4269 pub restrictions: Option<Vec<String>>,
4270 }
4271
4272 impl From<CreateruneRequest> for Request {
4273 fn from(r: CreateruneRequest) -> Self {
4274 Request::CreateRune(r)
4275 }
4276 }
4277
4278 impl IntoRequest for CreateruneRequest {
4279 type Response = super::responses::CreateruneResponse;
4280 }
4281
4282 impl TypedRequest for CreateruneRequest {
4283 type Response = super::responses::CreateruneResponse;
4284
4285 fn method(&self) -> &str {
4286 "createrune"
4287 }
4288 }
4289 #[derive(Clone, Debug, Deserialize, Serialize)]
4290 pub struct ShowrunesRequest {
4291 #[serde(skip_serializing_if = "Option::is_none")]
4292 pub rune: Option<String>,
4293 }
4294
4295 impl From<ShowrunesRequest> for Request {
4296 fn from(r: ShowrunesRequest) -> Self {
4297 Request::ShowRunes(r)
4298 }
4299 }
4300
4301 impl IntoRequest for ShowrunesRequest {
4302 type Response = super::responses::ShowrunesResponse;
4303 }
4304
4305 impl TypedRequest for ShowrunesRequest {
4306 type Response = super::responses::ShowrunesResponse;
4307
4308 fn method(&self) -> &str {
4309 "showrunes"
4310 }
4311 }
4312 #[derive(Clone, Debug, Deserialize, Serialize)]
4313 pub struct AskreneunreservePath {
4314 #[serde(skip_serializing_if = "Option::is_none")]
4315 pub short_channel_id_dir: Option<ShortChannelIdDir>,
4316 pub amount_msat: Amount,
4317 }
4318
4319 #[derive(Clone, Debug, Deserialize, Serialize)]
4320 pub struct AskreneunreserveRequest {
4321 pub path: Vec<AskreneunreservePath>,
4322 }
4323
4324 impl From<AskreneunreserveRequest> for Request {
4325 fn from(r: AskreneunreserveRequest) -> Self {
4326 Request::AskReneUnreserve(r)
4327 }
4328 }
4329
4330 impl IntoRequest for AskreneunreserveRequest {
4331 type Response = super::responses::AskreneunreserveResponse;
4332 }
4333
4334 impl TypedRequest for AskreneunreserveRequest {
4335 type Response = super::responses::AskreneunreserveResponse;
4336
4337 fn method(&self) -> &str {
4338 "askrene-unreserve"
4339 }
4340 }
4341 #[derive(Clone, Debug, Deserialize, Serialize)]
4342 pub struct AskrenelistlayersRequest {
4343 #[serde(skip_serializing_if = "Option::is_none")]
4344 pub layer: Option<String>,
4345 }
4346
4347 impl From<AskrenelistlayersRequest> for Request {
4348 fn from(r: AskrenelistlayersRequest) -> Self {
4349 Request::AskReneListLayers(r)
4350 }
4351 }
4352
4353 impl IntoRequest for AskrenelistlayersRequest {
4354 type Response = super::responses::AskrenelistlayersResponse;
4355 }
4356
4357 impl TypedRequest for AskrenelistlayersRequest {
4358 type Response = super::responses::AskrenelistlayersResponse;
4359
4360 fn method(&self) -> &str {
4361 "askrene-listlayers"
4362 }
4363 }
4364 #[derive(Clone, Debug, Deserialize, Serialize)]
4365 pub struct AskrenecreatelayerRequest {
4366 #[serde(skip_serializing_if = "Option::is_none")]
4367 pub persistent: Option<bool>,
4368 pub layer: String,
4369 }
4370
4371 impl From<AskrenecreatelayerRequest> for Request {
4372 fn from(r: AskrenecreatelayerRequest) -> Self {
4373 Request::AskReneCreateLayer(r)
4374 }
4375 }
4376
4377 impl IntoRequest for AskrenecreatelayerRequest {
4378 type Response = super::responses::AskrenecreatelayerResponse;
4379 }
4380
4381 impl TypedRequest for AskrenecreatelayerRequest {
4382 type Response = super::responses::AskrenecreatelayerResponse;
4383
4384 fn method(&self) -> &str {
4385 "askrene-create-layer"
4386 }
4387 }
4388 #[derive(Clone, Debug, Deserialize, Serialize)]
4389 pub struct AskreneremovelayerRequest {
4390 pub layer: String,
4391 }
4392
4393 impl From<AskreneremovelayerRequest> for Request {
4394 fn from(r: AskreneremovelayerRequest) -> Self {
4395 Request::AskReneRemoveLayer(r)
4396 }
4397 }
4398
4399 impl IntoRequest for AskreneremovelayerRequest {
4400 type Response = super::responses::AskreneremovelayerResponse;
4401 }
4402
4403 impl TypedRequest for AskreneremovelayerRequest {
4404 type Response = super::responses::AskreneremovelayerResponse;
4405
4406 fn method(&self) -> &str {
4407 "askrene-remove-layer"
4408 }
4409 }
4410 #[derive(Clone, Debug, Deserialize, Serialize)]
4411 pub struct AskrenereservePath {
4412 #[serde(skip_serializing_if = "Option::is_none")]
4413 pub short_channel_id_dir: Option<ShortChannelIdDir>,
4414 pub amount_msat: Amount,
4415 }
4416
4417 #[derive(Clone, Debug, Deserialize, Serialize)]
4418 pub struct AskrenereserveRequest {
4419 pub path: Vec<AskrenereservePath>,
4420 }
4421
4422 impl From<AskrenereserveRequest> for Request {
4423 fn from(r: AskrenereserveRequest) -> Self {
4424 Request::AskReneReserve(r)
4425 }
4426 }
4427
4428 impl IntoRequest for AskrenereserveRequest {
4429 type Response = super::responses::AskrenereserveResponse;
4430 }
4431
4432 impl TypedRequest for AskrenereserveRequest {
4433 type Response = super::responses::AskrenereserveResponse;
4434
4435 fn method(&self) -> &str {
4436 "askrene-reserve"
4437 }
4438 }
4439 #[derive(Clone, Debug, Deserialize, Serialize)]
4440 pub struct AskreneageRequest {
4441 pub cutoff: u64,
4442 pub layer: String,
4443 }
4444
4445 impl From<AskreneageRequest> for Request {
4446 fn from(r: AskreneageRequest) -> Self {
4447 Request::AskReneAge(r)
4448 }
4449 }
4450
4451 impl IntoRequest for AskreneageRequest {
4452 type Response = super::responses::AskreneageResponse;
4453 }
4454
4455 impl TypedRequest for AskreneageRequest {
4456 type Response = super::responses::AskreneageResponse;
4457
4458 fn method(&self) -> &str {
4459 "askrene-age"
4460 }
4461 }
4462 #[derive(Clone, Debug, Deserialize, Serialize)]
4463 pub struct GetroutesRequest {
4464 #[serde(skip_serializing_if = "Option::is_none")]
4465 pub final_cltv: Option<u32>,
4466 #[serde(skip_serializing_if = "Option::is_none")]
4467 pub maxdelay: Option<u32>,
4468 #[serde(skip_serializing_if = "Option::is_none")]
4469 pub maxparts: Option<u32>,
4470 pub amount_msat: Amount,
4471 pub destination: PublicKey,
4472 pub layers: Vec<String>,
4473 pub maxfee_msat: Amount,
4474 pub source: PublicKey,
4475 }
4476
4477 impl From<GetroutesRequest> for Request {
4478 fn from(r: GetroutesRequest) -> Self {
4479 Request::GetRoutes(r)
4480 }
4481 }
4482
4483 impl IntoRequest for GetroutesRequest {
4484 type Response = super::responses::GetroutesResponse;
4485 }
4486
4487 impl TypedRequest for GetroutesRequest {
4488 type Response = super::responses::GetroutesResponse;
4489
4490 fn method(&self) -> &str {
4491 "getroutes"
4492 }
4493 }
4494 #[derive(Clone, Debug, Deserialize, Serialize)]
4495 pub struct AskrenedisablenodeRequest {
4496 pub layer: String,
4497 pub node: PublicKey,
4498 }
4499
4500 impl From<AskrenedisablenodeRequest> for Request {
4501 fn from(r: AskrenedisablenodeRequest) -> Self {
4502 Request::AskReneDisableNode(r)
4503 }
4504 }
4505
4506 impl IntoRequest for AskrenedisablenodeRequest {
4507 type Response = super::responses::AskrenedisablenodeResponse;
4508 }
4509
4510 impl TypedRequest for AskrenedisablenodeRequest {
4511 type Response = super::responses::AskrenedisablenodeResponse;
4512
4513 fn method(&self) -> &str {
4514 "askrene-disable-node"
4515 }
4516 }
4517 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
4519 #[allow(non_camel_case_types)]
4520 pub enum AskreneinformchannelInform {
4521 #[serde(rename = "constrained")]
4522 CONSTRAINED = 0,
4523 #[serde(rename = "unconstrained")]
4524 UNCONSTRAINED = 1,
4525 #[serde(rename = "succeeded")]
4526 SUCCEEDED = 2,
4527 }
4528
4529 impl TryFrom<i32> for AskreneinformchannelInform {
4530 type Error = anyhow::Error;
4531 fn try_from(c: i32) -> Result<AskreneinformchannelInform, anyhow::Error> {
4532 match c {
4533 0 => Ok(AskreneinformchannelInform::CONSTRAINED),
4534 1 => Ok(AskreneinformchannelInform::UNCONSTRAINED),
4535 2 => Ok(AskreneinformchannelInform::SUCCEEDED),
4536 o => Err(anyhow::anyhow!("Unknown variant {} for enum AskreneinformchannelInform", o)),
4537 }
4538 }
4539 }
4540
4541 impl ToString for AskreneinformchannelInform {
4542 fn to_string(&self) -> String {
4543 match self {
4544 AskreneinformchannelInform::CONSTRAINED => "CONSTRAINED",
4545 AskreneinformchannelInform::UNCONSTRAINED => "UNCONSTRAINED",
4546 AskreneinformchannelInform::SUCCEEDED => "SUCCEEDED",
4547 }.to_string()
4548 }
4549 }
4550
4551 #[derive(Clone, Debug, Deserialize, Serialize)]
4552 pub struct AskreneinformchannelRequest {
4553 #[serde(skip_serializing_if = "Option::is_none")]
4554 pub amount_msat: Option<Amount>,
4555 #[serde(skip_serializing_if = "Option::is_none")]
4556 pub inform: Option<AskreneinformchannelInform>,
4557 #[serde(skip_serializing_if = "Option::is_none")]
4558 pub short_channel_id_dir: Option<ShortChannelIdDir>,
4559 pub layer: String,
4560 }
4561
4562 impl From<AskreneinformchannelRequest> for Request {
4563 fn from(r: AskreneinformchannelRequest) -> Self {
4564 Request::AskReneInformChannel(r)
4565 }
4566 }
4567
4568 impl IntoRequest for AskreneinformchannelRequest {
4569 type Response = super::responses::AskreneinformchannelResponse;
4570 }
4571
4572 impl TypedRequest for AskreneinformchannelRequest {
4573 type Response = super::responses::AskreneinformchannelResponse;
4574
4575 fn method(&self) -> &str {
4576 "askrene-inform-channel"
4577 }
4578 }
4579 #[derive(Clone, Debug, Deserialize, Serialize)]
4580 pub struct AskrenecreatechannelRequest {
4581 pub capacity_msat: Amount,
4582 pub destination: PublicKey,
4583 pub layer: String,
4584 pub short_channel_id: ShortChannelId,
4585 pub source: PublicKey,
4586 }
4587
4588 impl From<AskrenecreatechannelRequest> for Request {
4589 fn from(r: AskrenecreatechannelRequest) -> Self {
4590 Request::AskReneCreateChannel(r)
4591 }
4592 }
4593
4594 impl IntoRequest for AskrenecreatechannelRequest {
4595 type Response = super::responses::AskrenecreatechannelResponse;
4596 }
4597
4598 impl TypedRequest for AskrenecreatechannelRequest {
4599 type Response = super::responses::AskrenecreatechannelResponse;
4600
4601 fn method(&self) -> &str {
4602 "askrene-create-channel"
4603 }
4604 }
4605 #[derive(Clone, Debug, Deserialize, Serialize)]
4606 pub struct AskreneupdatechannelRequest {
4607 #[serde(skip_serializing_if = "Option::is_none")]
4608 pub cltv_expiry_delta: Option<u16>,
4609 #[serde(skip_serializing_if = "Option::is_none")]
4610 pub enabled: Option<bool>,
4611 #[serde(skip_serializing_if = "Option::is_none")]
4612 pub fee_base_msat: Option<Amount>,
4613 #[serde(skip_serializing_if = "Option::is_none")]
4614 pub fee_proportional_millionths: Option<u32>,
4615 #[serde(skip_serializing_if = "Option::is_none")]
4616 pub htlc_maximum_msat: Option<Amount>,
4617 #[serde(skip_serializing_if = "Option::is_none")]
4618 pub htlc_minimum_msat: Option<Amount>,
4619 pub layer: String,
4620 pub short_channel_id_dir: ShortChannelIdDir,
4621 }
4622
4623 impl From<AskreneupdatechannelRequest> for Request {
4624 fn from(r: AskreneupdatechannelRequest) -> Self {
4625 Request::AskReneUpdateChannel(r)
4626 }
4627 }
4628
4629 impl IntoRequest for AskreneupdatechannelRequest {
4630 type Response = super::responses::AskreneupdatechannelResponse;
4631 }
4632
4633 impl TypedRequest for AskreneupdatechannelRequest {
4634 type Response = super::responses::AskreneupdatechannelResponse;
4635
4636 fn method(&self) -> &str {
4637 "askrene-update-channel"
4638 }
4639 }
4640 #[derive(Clone, Debug, Deserialize, Serialize)]
4641 pub struct AskrenebiaschannelRequest {
4642 #[serde(skip_serializing_if = "Option::is_none")]
4643 pub description: Option<String>,
4644 #[serde(skip_serializing_if = "Option::is_none")]
4645 pub relative: Option<bool>,
4646 pub bias: i64,
4647 pub layer: String,
4648 pub short_channel_id_dir: ShortChannelIdDir,
4649 }
4650
4651 impl From<AskrenebiaschannelRequest> for Request {
4652 fn from(r: AskrenebiaschannelRequest) -> Self {
4653 Request::AskReneBiasChannel(r)
4654 }
4655 }
4656
4657 impl IntoRequest for AskrenebiaschannelRequest {
4658 type Response = super::responses::AskrenebiaschannelResponse;
4659 }
4660
4661 impl TypedRequest for AskrenebiaschannelRequest {
4662 type Response = super::responses::AskrenebiaschannelResponse;
4663
4664 fn method(&self) -> &str {
4665 "askrene-bias-channel"
4666 }
4667 }
4668 #[derive(Clone, Debug, Deserialize, Serialize)]
4669 pub struct AskrenelistreservationsRequest {
4670 }
4671
4672 impl From<AskrenelistreservationsRequest> for Request {
4673 fn from(r: AskrenelistreservationsRequest) -> Self {
4674 Request::AskReneListReservations(r)
4675 }
4676 }
4677
4678 impl IntoRequest for AskrenelistreservationsRequest {
4679 type Response = super::responses::AskrenelistreservationsResponse;
4680 }
4681
4682 impl TypedRequest for AskrenelistreservationsRequest {
4683 type Response = super::responses::AskrenelistreservationsResponse;
4684
4685 fn method(&self) -> &str {
4686 "askrene-listreservations"
4687 }
4688 }
4689 #[derive(Clone, Debug, Deserialize, Serialize)]
4690 pub struct InjectpaymentonionRequest {
4691 #[serde(skip_serializing_if = "Option::is_none")]
4692 pub destination_msat: Option<Amount>,
4693 #[serde(skip_serializing_if = "Option::is_none")]
4694 pub invstring: Option<String>,
4695 #[serde(skip_serializing_if = "Option::is_none")]
4696 pub label: Option<String>,
4697 #[serde(skip_serializing_if = "Option::is_none")]
4698 pub localinvreqid: Option<Sha256>,
4699 pub amount_msat: Amount,
4700 pub cltv_expiry: u16,
4701 pub groupid: u64,
4702 pub onion: String,
4703 pub partid: u64,
4704 pub payment_hash: Sha256,
4705 }
4706
4707 impl From<InjectpaymentonionRequest> for Request {
4708 fn from(r: InjectpaymentonionRequest) -> Self {
4709 Request::InjectPaymentOnion(r)
4710 }
4711 }
4712
4713 impl IntoRequest for InjectpaymentonionRequest {
4714 type Response = super::responses::InjectpaymentonionResponse;
4715 }
4716
4717 impl TypedRequest for InjectpaymentonionRequest {
4718 type Response = super::responses::InjectpaymentonionResponse;
4719
4720 fn method(&self) -> &str {
4721 "injectpaymentonion"
4722 }
4723 }
4724 #[derive(Clone, Debug, Deserialize, Serialize)]
4725 pub struct InjectonionmessageRequest {
4726 pub message: String,
4727 pub path_key: PublicKey,
4728 }
4729
4730 impl From<InjectonionmessageRequest> for Request {
4731 fn from(r: InjectonionmessageRequest) -> Self {
4732 Request::InjectOnionMessage(r)
4733 }
4734 }
4735
4736 impl IntoRequest for InjectonionmessageRequest {
4737 type Response = super::responses::InjectonionmessageResponse;
4738 }
4739
4740 impl TypedRequest for InjectonionmessageRequest {
4741 type Response = super::responses::InjectonionmessageResponse;
4742
4743 fn method(&self) -> &str {
4744 "injectonionmessage"
4745 }
4746 }
4747 #[derive(Clone, Debug, Deserialize, Serialize)]
4748 pub struct XpayRequest {
4749 #[serde(skip_serializing_if = "Option::is_none")]
4750 pub amount_msat: Option<Amount>,
4751 #[serde(skip_serializing_if = "Option::is_none")]
4752 pub maxdelay: Option<u32>,
4753 #[serde(skip_serializing_if = "Option::is_none")]
4754 pub maxfee: Option<Amount>,
4755 #[serde(skip_serializing_if = "Option::is_none")]
4756 pub partial_msat: Option<Amount>,
4757 #[serde(skip_serializing_if = "Option::is_none")]
4758 pub retry_for: Option<u32>,
4759 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
4760 pub layers: Option<Vec<String>>,
4761 pub invstring: String,
4762 }
4763
4764 impl From<XpayRequest> for Request {
4765 fn from(r: XpayRequest) -> Self {
4766 Request::Xpay(r)
4767 }
4768 }
4769
4770 impl IntoRequest for XpayRequest {
4771 type Response = super::responses::XpayResponse;
4772 }
4773
4774 impl TypedRequest for XpayRequest {
4775 type Response = super::responses::XpayResponse;
4776
4777 fn method(&self) -> &str {
4778 "xpay"
4779 }
4780 }
4781 #[derive(Clone, Debug, Deserialize, Serialize)]
4782 pub struct SignmessagewithkeyRequest {
4783 pub address: String,
4784 pub message: String,
4785 }
4786
4787 impl From<SignmessagewithkeyRequest> for Request {
4788 fn from(r: SignmessagewithkeyRequest) -> Self {
4789 Request::SignMessageWithKey(r)
4790 }
4791 }
4792
4793 impl IntoRequest for SignmessagewithkeyRequest {
4794 type Response = super::responses::SignmessagewithkeyResponse;
4795 }
4796
4797 impl TypedRequest for SignmessagewithkeyRequest {
4798 type Response = super::responses::SignmessagewithkeyResponse;
4799
4800 fn method(&self) -> &str {
4801 "signmessagewithkey"
4802 }
4803 }
4804}
4805
4806
4807pub mod responses {
4808 #[allow(unused_imports)]
4809 use crate::primitives::*;
4810 #[allow(unused_imports)]
4811 use serde::{{Deserialize, Serialize}};
4812 use super::{TryFromResponseError, Response};
4813
4814 #[derive(Clone, Debug, Deserialize, Serialize)]
4815 pub struct GetinfoOurFeatures {
4816 pub channel: String,
4817 pub init: String,
4818 pub invoice: String,
4819 pub node: String,
4820 }
4821
4822 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
4824 #[allow(non_camel_case_types)]
4825 pub enum GetinfoAddressType {
4826 #[serde(rename = "dns")]
4827 DNS = 0,
4828 #[serde(rename = "ipv4")]
4829 IPV4 = 1,
4830 #[serde(rename = "ipv6")]
4831 IPV6 = 2,
4832 #[serde(rename = "torv2")]
4833 TORV2 = 3,
4834 #[serde(rename = "torv3")]
4835 TORV3 = 4,
4836 }
4837
4838 impl TryFrom<i32> for GetinfoAddressType {
4839 type Error = anyhow::Error;
4840 fn try_from(c: i32) -> Result<GetinfoAddressType, anyhow::Error> {
4841 match c {
4842 0 => Ok(GetinfoAddressType::DNS),
4843 1 => Ok(GetinfoAddressType::IPV4),
4844 2 => Ok(GetinfoAddressType::IPV6),
4845 3 => Ok(GetinfoAddressType::TORV2),
4846 4 => Ok(GetinfoAddressType::TORV3),
4847 o => Err(anyhow::anyhow!("Unknown variant {} for enum GetinfoAddressType", o)),
4848 }
4849 }
4850 }
4851
4852 impl ToString for GetinfoAddressType {
4853 fn to_string(&self) -> String {
4854 match self {
4855 GetinfoAddressType::DNS => "DNS",
4856 GetinfoAddressType::IPV4 => "IPV4",
4857 GetinfoAddressType::IPV6 => "IPV6",
4858 GetinfoAddressType::TORV2 => "TORV2",
4859 GetinfoAddressType::TORV3 => "TORV3",
4860 }.to_string()
4861 }
4862 }
4863
4864 #[derive(Clone, Debug, Deserialize, Serialize)]
4865 pub struct GetinfoAddress {
4866 #[serde(skip_serializing_if = "Option::is_none")]
4867 pub address: Option<String>,
4868 #[serde(rename = "type")]
4870 pub item_type: GetinfoAddressType,
4871 pub port: u16,
4872 }
4873
4874 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
4876 #[allow(non_camel_case_types)]
4877 pub enum GetinfoBindingType {
4878 #[serde(rename = "local socket")]
4879 LOCAL_SOCKET = 0,
4880 #[serde(rename = "ipv4")]
4881 IPV4 = 1,
4882 #[serde(rename = "ipv6")]
4883 IPV6 = 2,
4884 #[serde(rename = "torv2")]
4885 TORV2 = 3,
4886 #[serde(rename = "torv3")]
4887 TORV3 = 4,
4888 #[serde(rename = "websocket")]
4889 WEBSOCKET = 5,
4890 }
4891
4892 impl TryFrom<i32> for GetinfoBindingType {
4893 type Error = anyhow::Error;
4894 fn try_from(c: i32) -> Result<GetinfoBindingType, anyhow::Error> {
4895 match c {
4896 0 => Ok(GetinfoBindingType::LOCAL_SOCKET),
4897 1 => Ok(GetinfoBindingType::IPV4),
4898 2 => Ok(GetinfoBindingType::IPV6),
4899 3 => Ok(GetinfoBindingType::TORV2),
4900 4 => Ok(GetinfoBindingType::TORV3),
4901 5 => Ok(GetinfoBindingType::WEBSOCKET),
4902 o => Err(anyhow::anyhow!("Unknown variant {} for enum GetinfoBindingType", o)),
4903 }
4904 }
4905 }
4906
4907 impl ToString for GetinfoBindingType {
4908 fn to_string(&self) -> String {
4909 match self {
4910 GetinfoBindingType::LOCAL_SOCKET => "LOCAL_SOCKET",
4911 GetinfoBindingType::WEBSOCKET => "WEBSOCKET",
4912 GetinfoBindingType::IPV4 => "IPV4",
4913 GetinfoBindingType::IPV6 => "IPV6",
4914 GetinfoBindingType::TORV2 => "TORV2",
4915 GetinfoBindingType::TORV3 => "TORV3",
4916 }.to_string()
4917 }
4918 }
4919
4920 #[derive(Clone, Debug, Deserialize, Serialize)]
4921 pub struct GetinfoBinding {
4922 #[serde(skip_serializing_if = "Option::is_none")]
4923 pub address: Option<String>,
4924 #[serde(skip_serializing_if = "Option::is_none")]
4925 pub port: Option<u16>,
4926 #[serde(skip_serializing_if = "Option::is_none")]
4927 pub socket: Option<String>,
4928 #[serde(skip_serializing_if = "Option::is_none")]
4929 pub subtype: Option<String>,
4930 #[serde(rename = "type")]
4932 pub item_type: GetinfoBindingType,
4933 }
4934
4935 #[derive(Clone, Debug, Deserialize, Serialize)]
4936 pub struct GetinfoResponse {
4937 #[serde(rename = "lightning-dir")]
4938 pub lightning_dir: String,
4939 #[serde(skip_serializing_if = "Option::is_none")]
4940 pub alias: Option<String>,
4941 #[serde(skip_serializing_if = "Option::is_none")]
4942 pub our_features: Option<GetinfoOurFeatures>,
4943 #[serde(skip_serializing_if = "Option::is_none")]
4944 pub warning_bitcoind_sync: Option<String>,
4945 #[serde(skip_serializing_if = "Option::is_none")]
4946 pub warning_lightningd_sync: Option<String>,
4947 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
4948 pub address: Option<Vec<GetinfoAddress>>,
4949 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
4950 pub binding: Option<Vec<GetinfoBinding>>,
4951 pub blockheight: u32,
4952 pub color: String,
4953 pub fees_collected_msat: Amount,
4954 pub id: PublicKey,
4955 pub network: String,
4956 pub num_active_channels: u32,
4957 pub num_inactive_channels: u32,
4958 pub num_peers: u32,
4959 pub num_pending_channels: u32,
4960 pub version: String,
4961 }
4962
4963 impl TryFrom<Response> for GetinfoResponse {
4964 type Error = super::TryFromResponseError;
4965
4966 fn try_from(response: Response) -> Result<Self, Self::Error> {
4967 match response {
4968 Response::Getinfo(response) => Ok(response),
4969 _ => Err(TryFromResponseError)
4970 }
4971 }
4972 }
4973
4974 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
4975 #[allow(non_camel_case_types)]
4976 pub enum ListpeersPeersLogType {
4977 #[serde(rename = "SKIPPED")]
4978 SKIPPED = 0,
4979 #[serde(rename = "BROKEN")]
4980 BROKEN = 1,
4981 #[serde(rename = "UNUSUAL")]
4982 UNUSUAL = 2,
4983 #[serde(rename = "INFO")]
4984 INFO = 3,
4985 #[serde(rename = "DEBUG")]
4986 DEBUG = 4,
4987 #[serde(rename = "IO_IN")]
4988 IO_IN = 5,
4989 #[serde(rename = "IO_OUT")]
4990 IO_OUT = 6,
4991 #[serde(rename = "TRACE")]
4992 TRACE = 7,
4993 }
4994
4995 impl TryFrom<i32> for ListpeersPeersLogType {
4996 type Error = anyhow::Error;
4997 fn try_from(c: i32) -> Result<ListpeersPeersLogType, anyhow::Error> {
4998 match c {
4999 0 => Ok(ListpeersPeersLogType::SKIPPED),
5000 1 => Ok(ListpeersPeersLogType::BROKEN),
5001 2 => Ok(ListpeersPeersLogType::UNUSUAL),
5002 3 => Ok(ListpeersPeersLogType::INFO),
5003 4 => Ok(ListpeersPeersLogType::DEBUG),
5004 5 => Ok(ListpeersPeersLogType::IO_IN),
5005 6 => Ok(ListpeersPeersLogType::IO_OUT),
5006 7 => Ok(ListpeersPeersLogType::TRACE),
5007 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeersPeersLogType", o)),
5008 }
5009 }
5010 }
5011
5012 impl ToString for ListpeersPeersLogType {
5013 fn to_string(&self) -> String {
5014 match self {
5015 ListpeersPeersLogType::SKIPPED => "SKIPPED",
5016 ListpeersPeersLogType::BROKEN => "BROKEN",
5017 ListpeersPeersLogType::UNUSUAL => "UNUSUAL",
5018 ListpeersPeersLogType::INFO => "INFO",
5019 ListpeersPeersLogType::DEBUG => "DEBUG",
5020 ListpeersPeersLogType::TRACE => "TRACE",
5021 ListpeersPeersLogType::IO_IN => "IO_IN",
5022 ListpeersPeersLogType::IO_OUT => "IO_OUT",
5023 }.to_string()
5024 }
5025 }
5026
5027 #[derive(Clone, Debug, Deserialize, Serialize)]
5028 pub struct ListpeersPeersLog {
5029 #[serde(skip_serializing_if = "Option::is_none")]
5030 pub data: Option<String>,
5031 #[serde(skip_serializing_if = "Option::is_none")]
5032 pub log: Option<String>,
5033 #[serde(skip_serializing_if = "Option::is_none")]
5034 pub node_id: Option<PublicKey>,
5035 #[serde(skip_serializing_if = "Option::is_none")]
5036 pub num_skipped: Option<u32>,
5037 #[serde(skip_serializing_if = "Option::is_none")]
5038 pub source: Option<String>,
5039 #[serde(skip_serializing_if = "Option::is_none")]
5040 pub time: Option<String>,
5041 #[serde(rename = "type")]
5043 pub item_type: ListpeersPeersLogType,
5044 }
5045
5046 #[derive(Clone, Debug, Deserialize, Serialize)]
5047 pub struct ListpeersPeers {
5048 #[serde(skip_serializing_if = "Option::is_none")]
5049 pub features: Option<String>,
5050 #[serde(skip_serializing_if = "Option::is_none")]
5051 pub num_channels: Option<u32>,
5052 #[serde(skip_serializing_if = "Option::is_none")]
5053 pub remote_addr: Option<String>,
5054 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
5055 pub log: Option<Vec<ListpeersPeersLog>>,
5056 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
5057 pub netaddr: Option<Vec<String>>,
5058 pub connected: bool,
5059 pub id: PublicKey,
5060 }
5061
5062 #[derive(Clone, Debug, Deserialize, Serialize)]
5063 pub struct ListpeersResponse {
5064 pub peers: Vec<ListpeersPeers>,
5065 }
5066
5067 impl TryFrom<Response> for ListpeersResponse {
5068 type Error = super::TryFromResponseError;
5069
5070 fn try_from(response: Response) -> Result<Self, Self::Error> {
5071 match response {
5072 Response::ListPeers(response) => Ok(response),
5073 _ => Err(TryFromResponseError)
5074 }
5075 }
5076 }
5077
5078 #[derive(Clone, Debug, Deserialize, Serialize)]
5079 pub struct ListfundsChannels {
5080 #[serde(skip_serializing_if = "Option::is_none")]
5081 pub channel_id: Option<Sha256>,
5082 #[serde(skip_serializing_if = "Option::is_none")]
5083 pub short_channel_id: Option<ShortChannelId>,
5084 pub state: ChannelState,
5086 pub amount_msat: Amount,
5087 pub connected: bool,
5088 pub funding_output: u32,
5089 pub funding_txid: String,
5090 pub our_amount_msat: Amount,
5091 pub peer_id: PublicKey,
5092 }
5093
5094 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5095 #[allow(non_camel_case_types)]
5096 pub enum ListfundsOutputsStatus {
5097 #[serde(rename = "unconfirmed")]
5098 UNCONFIRMED = 0,
5099 #[serde(rename = "confirmed")]
5100 CONFIRMED = 1,
5101 #[serde(rename = "spent")]
5102 SPENT = 2,
5103 #[serde(rename = "immature")]
5104 IMMATURE = 3,
5105 }
5106
5107 impl TryFrom<i32> for ListfundsOutputsStatus {
5108 type Error = anyhow::Error;
5109 fn try_from(c: i32) -> Result<ListfundsOutputsStatus, anyhow::Error> {
5110 match c {
5111 0 => Ok(ListfundsOutputsStatus::UNCONFIRMED),
5112 1 => Ok(ListfundsOutputsStatus::CONFIRMED),
5113 2 => Ok(ListfundsOutputsStatus::SPENT),
5114 3 => Ok(ListfundsOutputsStatus::IMMATURE),
5115 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListfundsOutputsStatus", o)),
5116 }
5117 }
5118 }
5119
5120 impl ToString for ListfundsOutputsStatus {
5121 fn to_string(&self) -> String {
5122 match self {
5123 ListfundsOutputsStatus::UNCONFIRMED => "UNCONFIRMED",
5124 ListfundsOutputsStatus::CONFIRMED => "CONFIRMED",
5125 ListfundsOutputsStatus::SPENT => "SPENT",
5126 ListfundsOutputsStatus::IMMATURE => "IMMATURE",
5127 }.to_string()
5128 }
5129 }
5130
5131 #[derive(Clone, Debug, Deserialize, Serialize)]
5132 pub struct ListfundsOutputs {
5133 #[serde(skip_serializing_if = "Option::is_none")]
5134 pub address: Option<String>,
5135 #[serde(skip_serializing_if = "Option::is_none")]
5136 pub blockheight: Option<u32>,
5137 #[serde(skip_serializing_if = "Option::is_none")]
5138 pub redeemscript: Option<String>,
5139 #[serde(skip_serializing_if = "Option::is_none")]
5140 pub reserved_to_block: Option<u32>,
5141 pub status: ListfundsOutputsStatus,
5143 pub amount_msat: Amount,
5144 pub output: u32,
5145 pub reserved: bool,
5146 pub scriptpubkey: String,
5147 pub txid: String,
5148 }
5149
5150 #[derive(Clone, Debug, Deserialize, Serialize)]
5151 pub struct ListfundsResponse {
5152 pub channels: Vec<ListfundsChannels>,
5153 pub outputs: Vec<ListfundsOutputs>,
5154 }
5155
5156 impl TryFrom<Response> for ListfundsResponse {
5157 type Error = super::TryFromResponseError;
5158
5159 fn try_from(response: Response) -> Result<Self, Self::Error> {
5160 match response {
5161 Response::ListFunds(response) => Ok(response),
5162 _ => Err(TryFromResponseError)
5163 }
5164 }
5165 }
5166
5167 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5169 #[allow(non_camel_case_types)]
5170 pub enum SendpayStatus {
5171 #[serde(rename = "pending")]
5172 PENDING = 0,
5173 #[serde(rename = "complete")]
5174 COMPLETE = 1,
5175 }
5176
5177 impl TryFrom<i32> for SendpayStatus {
5178 type Error = anyhow::Error;
5179 fn try_from(c: i32) -> Result<SendpayStatus, anyhow::Error> {
5180 match c {
5181 0 => Ok(SendpayStatus::PENDING),
5182 1 => Ok(SendpayStatus::COMPLETE),
5183 o => Err(anyhow::anyhow!("Unknown variant {} for enum SendpayStatus", o)),
5184 }
5185 }
5186 }
5187
5188 impl ToString for SendpayStatus {
5189 fn to_string(&self) -> String {
5190 match self {
5191 SendpayStatus::PENDING => "PENDING",
5192 SendpayStatus::COMPLETE => "COMPLETE",
5193 }.to_string()
5194 }
5195 }
5196
5197 #[derive(Clone, Debug, Deserialize, Serialize)]
5198 pub struct SendpayResponse {
5199 #[serde(skip_serializing_if = "Option::is_none")]
5200 pub amount_msat: Option<Amount>,
5201 #[serde(skip_serializing_if = "Option::is_none")]
5202 pub bolt11: Option<String>,
5203 #[serde(skip_serializing_if = "Option::is_none")]
5204 pub bolt12: Option<String>,
5205 #[serde(skip_serializing_if = "Option::is_none")]
5206 pub completed_at: Option<u64>,
5207 #[serde(skip_serializing_if = "Option::is_none")]
5208 pub created_index: Option<u64>,
5209 #[serde(skip_serializing_if = "Option::is_none")]
5210 pub destination: Option<PublicKey>,
5211 #[serde(skip_serializing_if = "Option::is_none")]
5212 pub groupid: Option<u64>,
5213 #[serde(skip_serializing_if = "Option::is_none")]
5214 pub label: Option<String>,
5215 #[serde(skip_serializing_if = "Option::is_none")]
5216 pub message: Option<String>,
5217 #[serde(skip_serializing_if = "Option::is_none")]
5218 pub partid: Option<u64>,
5219 #[serde(skip_serializing_if = "Option::is_none")]
5220 pub payment_preimage: Option<Secret>,
5221 #[serde(skip_serializing_if = "Option::is_none")]
5222 pub updated_index: Option<u64>,
5223 pub status: SendpayStatus,
5225 pub amount_sent_msat: Amount,
5226 pub created_at: u64,
5227 pub id: u64,
5228 pub payment_hash: Sha256,
5229 }
5230
5231 impl TryFrom<Response> for SendpayResponse {
5232 type Error = super::TryFromResponseError;
5233
5234 fn try_from(response: Response) -> Result<Self, Self::Error> {
5235 match response {
5236 Response::SendPay(response) => Ok(response),
5237 _ => Err(TryFromResponseError)
5238 }
5239 }
5240 }
5241
5242 #[derive(Clone, Debug, Deserialize, Serialize)]
5243 pub struct ListchannelsChannels {
5244 #[serde(skip_serializing_if = "Option::is_none")]
5245 pub htlc_maximum_msat: Option<Amount>,
5246 pub active: bool,
5247 pub amount_msat: Amount,
5248 pub base_fee_millisatoshi: u32,
5249 pub channel_flags: u8,
5250 pub delay: u32,
5251 pub destination: PublicKey,
5252 pub direction: u32,
5253 pub features: String,
5254 pub fee_per_millionth: u32,
5255 pub htlc_minimum_msat: Amount,
5256 pub last_update: u32,
5257 pub message_flags: u8,
5258 pub public: bool,
5259 pub short_channel_id: ShortChannelId,
5260 pub source: PublicKey,
5261 }
5262
5263 #[derive(Clone, Debug, Deserialize, Serialize)]
5264 pub struct ListchannelsResponse {
5265 pub channels: Vec<ListchannelsChannels>,
5266 }
5267
5268 impl TryFrom<Response> for ListchannelsResponse {
5269 type Error = super::TryFromResponseError;
5270
5271 fn try_from(response: Response) -> Result<Self, Self::Error> {
5272 match response {
5273 Response::ListChannels(response) => Ok(response),
5274 _ => Err(TryFromResponseError)
5275 }
5276 }
5277 }
5278
5279 #[derive(Clone, Debug, Deserialize, Serialize)]
5280 pub struct AddgossipResponse {
5281 }
5282
5283 impl TryFrom<Response> for AddgossipResponse {
5284 type Error = super::TryFromResponseError;
5285
5286 fn try_from(response: Response) -> Result<Self, Self::Error> {
5287 match response {
5288 Response::AddGossip(response) => Ok(response),
5289 _ => Err(TryFromResponseError)
5290 }
5291 }
5292 }
5293
5294 #[derive(Clone, Debug, Deserialize, Serialize)]
5295 pub struct AddpsbtoutputResponse {
5296 pub estimated_added_weight: u32,
5297 pub outnum: u32,
5298 pub psbt: String,
5299 }
5300
5301 impl TryFrom<Response> for AddpsbtoutputResponse {
5302 type Error = super::TryFromResponseError;
5303
5304 fn try_from(response: Response) -> Result<Self, Self::Error> {
5305 match response {
5306 Response::AddPsbtOutput(response) => Ok(response),
5307 _ => Err(TryFromResponseError)
5308 }
5309 }
5310 }
5311
5312 #[derive(Clone, Debug, Deserialize, Serialize)]
5313 pub struct AutocleanonceAutocleanExpiredinvoices {
5314 pub cleaned: u64,
5315 pub uncleaned: u64,
5316 }
5317
5318 #[derive(Clone, Debug, Deserialize, Serialize)]
5319 pub struct AutocleanonceAutocleanFailedforwards {
5320 pub cleaned: u64,
5321 pub uncleaned: u64,
5322 }
5323
5324 #[derive(Clone, Debug, Deserialize, Serialize)]
5325 pub struct AutocleanonceAutocleanFailedpays {
5326 pub cleaned: u64,
5327 pub uncleaned: u64,
5328 }
5329
5330 #[derive(Clone, Debug, Deserialize, Serialize)]
5331 pub struct AutocleanonceAutocleanPaidinvoices {
5332 pub cleaned: u64,
5333 pub uncleaned: u64,
5334 }
5335
5336 #[derive(Clone, Debug, Deserialize, Serialize)]
5337 pub struct AutocleanonceAutocleanSucceededforwards {
5338 pub cleaned: u64,
5339 pub uncleaned: u64,
5340 }
5341
5342 #[derive(Clone, Debug, Deserialize, Serialize)]
5343 pub struct AutocleanonceAutocleanSucceededpays {
5344 pub cleaned: u64,
5345 pub uncleaned: u64,
5346 }
5347
5348 #[derive(Clone, Debug, Deserialize, Serialize)]
5349 pub struct AutocleanonceAutoclean {
5350 #[serde(skip_serializing_if = "Option::is_none")]
5351 pub expiredinvoices: Option<AutocleanonceAutocleanExpiredinvoices>,
5352 #[serde(skip_serializing_if = "Option::is_none")]
5353 pub failedforwards: Option<AutocleanonceAutocleanFailedforwards>,
5354 #[serde(skip_serializing_if = "Option::is_none")]
5355 pub failedpays: Option<AutocleanonceAutocleanFailedpays>,
5356 #[serde(skip_serializing_if = "Option::is_none")]
5357 pub paidinvoices: Option<AutocleanonceAutocleanPaidinvoices>,
5358 #[serde(skip_serializing_if = "Option::is_none")]
5359 pub succeededforwards: Option<AutocleanonceAutocleanSucceededforwards>,
5360 #[serde(skip_serializing_if = "Option::is_none")]
5361 pub succeededpays: Option<AutocleanonceAutocleanSucceededpays>,
5362 }
5363
5364 #[derive(Clone, Debug, Deserialize, Serialize)]
5365 pub struct AutocleanonceResponse {
5366 pub autoclean: AutocleanonceAutoclean,
5367 }
5368
5369 impl TryFrom<Response> for AutocleanonceResponse {
5370 type Error = super::TryFromResponseError;
5371
5372 fn try_from(response: Response) -> Result<Self, Self::Error> {
5373 match response {
5374 Response::AutoCleanOnce(response) => Ok(response),
5375 _ => Err(TryFromResponseError)
5376 }
5377 }
5378 }
5379
5380 #[derive(Clone, Debug, Deserialize, Serialize)]
5381 pub struct AutocleanstatusAutocleanExpiredinvoices {
5382 #[serde(skip_serializing_if = "Option::is_none")]
5383 pub age: Option<u64>,
5384 pub cleaned: u64,
5385 pub enabled: bool,
5386 }
5387
5388 #[derive(Clone, Debug, Deserialize, Serialize)]
5389 pub struct AutocleanstatusAutocleanFailedforwards {
5390 #[serde(skip_serializing_if = "Option::is_none")]
5391 pub age: Option<u64>,
5392 pub cleaned: u64,
5393 pub enabled: bool,
5394 }
5395
5396 #[derive(Clone, Debug, Deserialize, Serialize)]
5397 pub struct AutocleanstatusAutocleanFailedpays {
5398 #[serde(skip_serializing_if = "Option::is_none")]
5399 pub age: Option<u64>,
5400 pub cleaned: u64,
5401 pub enabled: bool,
5402 }
5403
5404 #[derive(Clone, Debug, Deserialize, Serialize)]
5405 pub struct AutocleanstatusAutocleanPaidinvoices {
5406 #[serde(skip_serializing_if = "Option::is_none")]
5407 pub age: Option<u64>,
5408 pub cleaned: u64,
5409 pub enabled: bool,
5410 }
5411
5412 #[derive(Clone, Debug, Deserialize, Serialize)]
5413 pub struct AutocleanstatusAutocleanSucceededforwards {
5414 #[serde(skip_serializing_if = "Option::is_none")]
5415 pub age: Option<u64>,
5416 pub cleaned: u64,
5417 pub enabled: bool,
5418 }
5419
5420 #[derive(Clone, Debug, Deserialize, Serialize)]
5421 pub struct AutocleanstatusAutocleanSucceededpays {
5422 #[serde(skip_serializing_if = "Option::is_none")]
5423 pub age: Option<u64>,
5424 pub cleaned: u64,
5425 pub enabled: bool,
5426 }
5427
5428 #[derive(Clone, Debug, Deserialize, Serialize)]
5429 pub struct AutocleanstatusAutoclean {
5430 #[serde(skip_serializing_if = "Option::is_none")]
5431 pub expiredinvoices: Option<AutocleanstatusAutocleanExpiredinvoices>,
5432 #[serde(skip_serializing_if = "Option::is_none")]
5433 pub failedforwards: Option<AutocleanstatusAutocleanFailedforwards>,
5434 #[serde(skip_serializing_if = "Option::is_none")]
5435 pub failedpays: Option<AutocleanstatusAutocleanFailedpays>,
5436 #[serde(skip_serializing_if = "Option::is_none")]
5437 pub paidinvoices: Option<AutocleanstatusAutocleanPaidinvoices>,
5438 #[serde(skip_serializing_if = "Option::is_none")]
5439 pub succeededforwards: Option<AutocleanstatusAutocleanSucceededforwards>,
5440 #[serde(skip_serializing_if = "Option::is_none")]
5441 pub succeededpays: Option<AutocleanstatusAutocleanSucceededpays>,
5442 }
5443
5444 #[derive(Clone, Debug, Deserialize, Serialize)]
5445 pub struct AutocleanstatusResponse {
5446 pub autoclean: AutocleanstatusAutoclean,
5447 }
5448
5449 impl TryFrom<Response> for AutocleanstatusResponse {
5450 type Error = super::TryFromResponseError;
5451
5452 fn try_from(response: Response) -> Result<Self, Self::Error> {
5453 match response {
5454 Response::AutoCleanStatus(response) => Ok(response),
5455 _ => Err(TryFromResponseError)
5456 }
5457 }
5458 }
5459
5460 #[derive(Clone, Debug, Deserialize, Serialize)]
5461 pub struct CheckmessageResponse {
5462 pub pubkey: PublicKey,
5463 pub verified: bool,
5464 }
5465
5466 impl TryFrom<Response> for CheckmessageResponse {
5467 type Error = super::TryFromResponseError;
5468
5469 fn try_from(response: Response) -> Result<Self, Self::Error> {
5470 match response {
5471 Response::CheckMessage(response) => Ok(response),
5472 _ => Err(TryFromResponseError)
5473 }
5474 }
5475 }
5476
5477 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5479 #[allow(non_camel_case_types)]
5480 pub enum CloseType {
5481 #[serde(rename = "mutual")]
5482 MUTUAL = 0,
5483 #[serde(rename = "unilateral")]
5484 UNILATERAL = 1,
5485 #[serde(rename = "unopened")]
5486 UNOPENED = 2,
5487 }
5488
5489 impl TryFrom<i32> for CloseType {
5490 type Error = anyhow::Error;
5491 fn try_from(c: i32) -> Result<CloseType, anyhow::Error> {
5492 match c {
5493 0 => Ok(CloseType::MUTUAL),
5494 1 => Ok(CloseType::UNILATERAL),
5495 2 => Ok(CloseType::UNOPENED),
5496 o => Err(anyhow::anyhow!("Unknown variant {} for enum CloseType", o)),
5497 }
5498 }
5499 }
5500
5501 impl ToString for CloseType {
5502 fn to_string(&self) -> String {
5503 match self {
5504 CloseType::MUTUAL => "MUTUAL",
5505 CloseType::UNILATERAL => "UNILATERAL",
5506 CloseType::UNOPENED => "UNOPENED",
5507 }.to_string()
5508 }
5509 }
5510
5511 #[derive(Clone, Debug, Deserialize, Serialize)]
5512 pub struct CloseResponse {
5513 #[deprecated]
5514 #[serde(skip_serializing_if = "Option::is_none")]
5515 pub tx: Option<String>,
5516 #[deprecated]
5517 #[serde(skip_serializing_if = "Option::is_none")]
5518 pub txid: Option<String>,
5519 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
5520 pub txids: Option<Vec<String>>,
5521 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
5522 pub txs: Option<Vec<String>>,
5523 #[serde(rename = "type")]
5525 pub item_type: CloseType,
5526 }
5527
5528 impl TryFrom<Response> for CloseResponse {
5529 type Error = super::TryFromResponseError;
5530
5531 fn try_from(response: Response) -> Result<Self, Self::Error> {
5532 match response {
5533 Response::Close(response) => Ok(response),
5534 _ => Err(TryFromResponseError)
5535 }
5536 }
5537 }
5538
5539 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5541 #[allow(non_camel_case_types)]
5542 pub enum ConnectDirection {
5543 #[serde(rename = "in")]
5544 IN = 0,
5545 #[serde(rename = "out")]
5546 OUT = 1,
5547 }
5548
5549 impl TryFrom<i32> for ConnectDirection {
5550 type Error = anyhow::Error;
5551 fn try_from(c: i32) -> Result<ConnectDirection, anyhow::Error> {
5552 match c {
5553 0 => Ok(ConnectDirection::IN),
5554 1 => Ok(ConnectDirection::OUT),
5555 o => Err(anyhow::anyhow!("Unknown variant {} for enum ConnectDirection", o)),
5556 }
5557 }
5558 }
5559
5560 impl ToString for ConnectDirection {
5561 fn to_string(&self) -> String {
5562 match self {
5563 ConnectDirection::IN => "IN",
5564 ConnectDirection::OUT => "OUT",
5565 }.to_string()
5566 }
5567 }
5568
5569 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5571 #[allow(non_camel_case_types)]
5572 pub enum ConnectAddressType {
5573 #[serde(rename = "local socket")]
5574 LOCAL_SOCKET = 0,
5575 #[serde(rename = "ipv4")]
5576 IPV4 = 1,
5577 #[serde(rename = "ipv6")]
5578 IPV6 = 2,
5579 #[serde(rename = "torv2")]
5580 TORV2 = 3,
5581 #[serde(rename = "torv3")]
5582 TORV3 = 4,
5583 }
5584
5585 impl TryFrom<i32> for ConnectAddressType {
5586 type Error = anyhow::Error;
5587 fn try_from(c: i32) -> Result<ConnectAddressType, anyhow::Error> {
5588 match c {
5589 0 => Ok(ConnectAddressType::LOCAL_SOCKET),
5590 1 => Ok(ConnectAddressType::IPV4),
5591 2 => Ok(ConnectAddressType::IPV6),
5592 3 => Ok(ConnectAddressType::TORV2),
5593 4 => Ok(ConnectAddressType::TORV3),
5594 o => Err(anyhow::anyhow!("Unknown variant {} for enum ConnectAddressType", o)),
5595 }
5596 }
5597 }
5598
5599 impl ToString for ConnectAddressType {
5600 fn to_string(&self) -> String {
5601 match self {
5602 ConnectAddressType::LOCAL_SOCKET => "LOCAL_SOCKET",
5603 ConnectAddressType::IPV4 => "IPV4",
5604 ConnectAddressType::IPV6 => "IPV6",
5605 ConnectAddressType::TORV2 => "TORV2",
5606 ConnectAddressType::TORV3 => "TORV3",
5607 }.to_string()
5608 }
5609 }
5610
5611 #[derive(Clone, Debug, Deserialize, Serialize)]
5612 pub struct ConnectAddress {
5613 #[serde(skip_serializing_if = "Option::is_none")]
5614 pub address: Option<String>,
5615 #[serde(skip_serializing_if = "Option::is_none")]
5616 pub port: Option<u16>,
5617 #[serde(skip_serializing_if = "Option::is_none")]
5618 pub socket: Option<String>,
5619 #[serde(rename = "type")]
5621 pub item_type: ConnectAddressType,
5622 }
5623
5624 #[derive(Clone, Debug, Deserialize, Serialize)]
5625 pub struct ConnectResponse {
5626 pub direction: ConnectDirection,
5628 pub address: ConnectAddress,
5629 pub features: String,
5630 pub id: PublicKey,
5631 }
5632
5633 impl TryFrom<Response> for ConnectResponse {
5634 type Error = super::TryFromResponseError;
5635
5636 fn try_from(response: Response) -> Result<Self, Self::Error> {
5637 match response {
5638 Response::Connect(response) => Ok(response),
5639 _ => Err(TryFromResponseError)
5640 }
5641 }
5642 }
5643
5644 #[derive(Clone, Debug, Deserialize, Serialize)]
5645 pub struct CreateinvoicePaidOutpoint {
5646 pub outnum: u32,
5647 pub txid: String,
5648 }
5649
5650 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5652 #[allow(non_camel_case_types)]
5653 pub enum CreateinvoiceStatus {
5654 #[serde(rename = "paid")]
5655 PAID = 0,
5656 #[serde(rename = "expired")]
5657 EXPIRED = 1,
5658 #[serde(rename = "unpaid")]
5659 UNPAID = 2,
5660 }
5661
5662 impl TryFrom<i32> for CreateinvoiceStatus {
5663 type Error = anyhow::Error;
5664 fn try_from(c: i32) -> Result<CreateinvoiceStatus, anyhow::Error> {
5665 match c {
5666 0 => Ok(CreateinvoiceStatus::PAID),
5667 1 => Ok(CreateinvoiceStatus::EXPIRED),
5668 2 => Ok(CreateinvoiceStatus::UNPAID),
5669 o => Err(anyhow::anyhow!("Unknown variant {} for enum CreateinvoiceStatus", o)),
5670 }
5671 }
5672 }
5673
5674 impl ToString for CreateinvoiceStatus {
5675 fn to_string(&self) -> String {
5676 match self {
5677 CreateinvoiceStatus::PAID => "PAID",
5678 CreateinvoiceStatus::EXPIRED => "EXPIRED",
5679 CreateinvoiceStatus::UNPAID => "UNPAID",
5680 }.to_string()
5681 }
5682 }
5683
5684 #[derive(Clone, Debug, Deserialize, Serialize)]
5685 pub struct CreateinvoiceResponse {
5686 #[serde(skip_serializing_if = "Option::is_none")]
5687 pub amount_msat: Option<Amount>,
5688 #[serde(skip_serializing_if = "Option::is_none")]
5689 pub amount_received_msat: Option<Amount>,
5690 #[serde(skip_serializing_if = "Option::is_none")]
5691 pub bolt11: Option<String>,
5692 #[serde(skip_serializing_if = "Option::is_none")]
5693 pub bolt12: Option<String>,
5694 #[serde(skip_serializing_if = "Option::is_none")]
5695 pub created_index: Option<u64>,
5696 #[serde(skip_serializing_if = "Option::is_none")]
5697 pub invreq_payer_note: Option<String>,
5698 #[serde(skip_serializing_if = "Option::is_none")]
5699 pub local_offer_id: Option<String>,
5700 #[serde(skip_serializing_if = "Option::is_none")]
5701 pub paid_at: Option<u64>,
5702 #[serde(skip_serializing_if = "Option::is_none")]
5703 pub paid_outpoint: Option<CreateinvoicePaidOutpoint>,
5704 #[serde(skip_serializing_if = "Option::is_none")]
5705 pub pay_index: Option<u64>,
5706 #[serde(skip_serializing_if = "Option::is_none")]
5707 pub payment_preimage: Option<Secret>,
5708 pub status: CreateinvoiceStatus,
5710 pub description: String,
5711 pub expires_at: u64,
5712 pub label: String,
5713 pub payment_hash: Sha256,
5714 }
5715
5716 impl TryFrom<Response> for CreateinvoiceResponse {
5717 type Error = super::TryFromResponseError;
5718
5719 fn try_from(response: Response) -> Result<Self, Self::Error> {
5720 match response {
5721 Response::CreateInvoice(response) => Ok(response),
5722 _ => Err(TryFromResponseError)
5723 }
5724 }
5725 }
5726
5727 #[derive(Clone, Debug, Deserialize, Serialize)]
5728 pub struct DatastoreResponse {
5729 #[serde(skip_serializing_if = "Option::is_none")]
5730 pub generation: Option<u64>,
5731 #[serde(skip_serializing_if = "Option::is_none")]
5732 pub hex: Option<String>,
5733 #[serde(skip_serializing_if = "Option::is_none")]
5734 pub string: Option<String>,
5735 pub key: Vec<String>,
5736 }
5737
5738 impl TryFrom<Response> for DatastoreResponse {
5739 type Error = super::TryFromResponseError;
5740
5741 fn try_from(response: Response) -> Result<Self, Self::Error> {
5742 match response {
5743 Response::Datastore(response) => Ok(response),
5744 _ => Err(TryFromResponseError)
5745 }
5746 }
5747 }
5748
5749 #[derive(Clone, Debug, Deserialize, Serialize)]
5750 pub struct DatastoreusageDatastoreusage {
5751 pub key: String,
5752 pub total_bytes: u64,
5753 }
5754
5755 #[derive(Clone, Debug, Deserialize, Serialize)]
5756 pub struct DatastoreusageResponse {
5757 pub datastoreusage: DatastoreusageDatastoreusage,
5758 }
5759
5760 impl TryFrom<Response> for DatastoreusageResponse {
5761 type Error = super::TryFromResponseError;
5762
5763 fn try_from(response: Response) -> Result<Self, Self::Error> {
5764 match response {
5765 Response::DatastoreUsage(response) => Ok(response),
5766 _ => Err(TryFromResponseError)
5767 }
5768 }
5769 }
5770
5771 #[derive(Clone, Debug, Deserialize, Serialize)]
5772 pub struct CreateonionResponse {
5773 pub onion: String,
5774 pub shared_secrets: Vec<Secret>,
5775 }
5776
5777 impl TryFrom<Response> for CreateonionResponse {
5778 type Error = super::TryFromResponseError;
5779
5780 fn try_from(response: Response) -> Result<Self, Self::Error> {
5781 match response {
5782 Response::CreateOnion(response) => Ok(response),
5783 _ => Err(TryFromResponseError)
5784 }
5785 }
5786 }
5787
5788 #[derive(Clone, Debug, Deserialize, Serialize)]
5789 pub struct DeldatastoreResponse {
5790 #[serde(skip_serializing_if = "Option::is_none")]
5791 pub generation: Option<u64>,
5792 #[serde(skip_serializing_if = "Option::is_none")]
5793 pub hex: Option<String>,
5794 #[serde(skip_serializing_if = "Option::is_none")]
5795 pub string: Option<String>,
5796 pub key: Vec<String>,
5797 }
5798
5799 impl TryFrom<Response> for DeldatastoreResponse {
5800 type Error = super::TryFromResponseError;
5801
5802 fn try_from(response: Response) -> Result<Self, Self::Error> {
5803 match response {
5804 Response::DelDatastore(response) => Ok(response),
5805 _ => Err(TryFromResponseError)
5806 }
5807 }
5808 }
5809
5810 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5812 #[allow(non_camel_case_types)]
5813 pub enum DelinvoiceStatus {
5814 #[serde(rename = "paid")]
5815 PAID = 0,
5816 #[serde(rename = "expired")]
5817 EXPIRED = 1,
5818 #[serde(rename = "unpaid")]
5819 UNPAID = 2,
5820 }
5821
5822 impl TryFrom<i32> for DelinvoiceStatus {
5823 type Error = anyhow::Error;
5824 fn try_from(c: i32) -> Result<DelinvoiceStatus, anyhow::Error> {
5825 match c {
5826 0 => Ok(DelinvoiceStatus::PAID),
5827 1 => Ok(DelinvoiceStatus::EXPIRED),
5828 2 => Ok(DelinvoiceStatus::UNPAID),
5829 o => Err(anyhow::anyhow!("Unknown variant {} for enum DelinvoiceStatus", o)),
5830 }
5831 }
5832 }
5833
5834 impl ToString for DelinvoiceStatus {
5835 fn to_string(&self) -> String {
5836 match self {
5837 DelinvoiceStatus::PAID => "PAID",
5838 DelinvoiceStatus::EXPIRED => "EXPIRED",
5839 DelinvoiceStatus::UNPAID => "UNPAID",
5840 }.to_string()
5841 }
5842 }
5843
5844 #[derive(Clone, Debug, Deserialize, Serialize)]
5845 pub struct DelinvoiceResponse {
5846 #[serde(skip_serializing_if = "Option::is_none")]
5847 pub amount_msat: Option<Amount>,
5848 #[serde(skip_serializing_if = "Option::is_none")]
5849 pub amount_received_msat: Option<Amount>,
5850 #[serde(skip_serializing_if = "Option::is_none")]
5851 pub bolt11: Option<String>,
5852 #[serde(skip_serializing_if = "Option::is_none")]
5853 pub bolt12: Option<String>,
5854 #[serde(skip_serializing_if = "Option::is_none")]
5855 pub created_index: Option<u64>,
5856 #[serde(skip_serializing_if = "Option::is_none")]
5857 pub description: Option<String>,
5858 #[serde(skip_serializing_if = "Option::is_none")]
5859 pub invreq_payer_note: Option<String>,
5860 #[serde(skip_serializing_if = "Option::is_none")]
5861 pub local_offer_id: Option<String>,
5862 #[serde(skip_serializing_if = "Option::is_none")]
5863 pub paid_at: Option<u64>,
5864 #[serde(skip_serializing_if = "Option::is_none")]
5865 pub pay_index: Option<u64>,
5866 #[serde(skip_serializing_if = "Option::is_none")]
5867 pub payment_preimage: Option<Secret>,
5868 #[serde(skip_serializing_if = "Option::is_none")]
5869 pub updated_index: Option<u64>,
5870 pub status: DelinvoiceStatus,
5872 pub expires_at: u64,
5873 pub label: String,
5874 pub payment_hash: Sha256,
5875 }
5876
5877 impl TryFrom<Response> for DelinvoiceResponse {
5878 type Error = super::TryFromResponseError;
5879
5880 fn try_from(response: Response) -> Result<Self, Self::Error> {
5881 match response {
5882 Response::DelInvoice(response) => Ok(response),
5883 _ => Err(TryFromResponseError)
5884 }
5885 }
5886 }
5887
5888 #[derive(Clone, Debug, Deserialize, Serialize)]
5889 pub struct DevforgetchannelResponse {
5890 pub forced: bool,
5891 pub funding_txid: String,
5892 pub funding_unspent: bool,
5893 }
5894
5895 impl TryFrom<Response> for DevforgetchannelResponse {
5896 type Error = super::TryFromResponseError;
5897
5898 fn try_from(response: Response) -> Result<Self, Self::Error> {
5899 match response {
5900 Response::DevForgetChannel(response) => Ok(response),
5901 _ => Err(TryFromResponseError)
5902 }
5903 }
5904 }
5905
5906 #[derive(Clone, Debug, Deserialize, Serialize)]
5907 pub struct EmergencyrecoverResponse {
5908 pub stubs: Vec<Sha256>,
5909 }
5910
5911 impl TryFrom<Response> for EmergencyrecoverResponse {
5912 type Error = super::TryFromResponseError;
5913
5914 fn try_from(response: Response) -> Result<Self, Self::Error> {
5915 match response {
5916 Response::EmergencyRecover(response) => Ok(response),
5917 _ => Err(TryFromResponseError)
5918 }
5919 }
5920 }
5921
5922 #[derive(Clone, Debug, Deserialize, Serialize)]
5923 pub struct GetemergencyrecoverdataResponse {
5924 pub filedata: String,
5925 }
5926
5927 impl TryFrom<Response> for GetemergencyrecoverdataResponse {
5928 type Error = super::TryFromResponseError;
5929
5930 fn try_from(response: Response) -> Result<Self, Self::Error> {
5931 match response {
5932 Response::GetEmergencyRecoverData(response) => Ok(response),
5933 _ => Err(TryFromResponseError)
5934 }
5935 }
5936 }
5937
5938 #[derive(Clone, Debug, Deserialize, Serialize)]
5939 pub struct ExposesecretResponse {
5940 #[serde(skip_serializing_if = "Option::is_none")]
5941 pub mnemonic: Option<String>,
5942 pub codex32: String,
5943 pub identifier: String,
5944 }
5945
5946 impl TryFrom<Response> for ExposesecretResponse {
5947 type Error = super::TryFromResponseError;
5948
5949 fn try_from(response: Response) -> Result<Self, Self::Error> {
5950 match response {
5951 Response::ExposeSecret(response) => Ok(response),
5952 _ => Err(TryFromResponseError)
5953 }
5954 }
5955 }
5956
5957 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
5958 #[allow(non_camel_case_types)]
5959 pub enum RecoverResult {
5960 #[serde(rename = "Recovery restart in progress")]
5961 RECOVERY_RESTART_IN_PROGRESS = 0,
5962 }
5963
5964 impl TryFrom<i32> for RecoverResult {
5965 type Error = anyhow::Error;
5966 fn try_from(c: i32) -> Result<RecoverResult, anyhow::Error> {
5967 match c {
5968 0 => Ok(RecoverResult::RECOVERY_RESTART_IN_PROGRESS),
5969 o => Err(anyhow::anyhow!("Unknown variant {} for enum RecoverResult", o)),
5970 }
5971 }
5972 }
5973
5974 impl ToString for RecoverResult {
5975 fn to_string(&self) -> String {
5976 match self {
5977 RecoverResult::RECOVERY_RESTART_IN_PROGRESS => "RECOVERY_RESTART_IN_PROGRESS",
5978 }.to_string()
5979 }
5980 }
5981
5982 #[derive(Clone, Debug, Deserialize, Serialize)]
5983 pub struct RecoverResponse {
5984 #[serde(skip_serializing_if = "Option::is_none")]
5985 pub result: Option<RecoverResult>,
5986 }
5987
5988 impl TryFrom<Response> for RecoverResponse {
5989 type Error = super::TryFromResponseError;
5990
5991 fn try_from(response: Response) -> Result<Self, Self::Error> {
5992 match response {
5993 Response::Recover(response) => Ok(response),
5994 _ => Err(TryFromResponseError)
5995 }
5996 }
5997 }
5998
5999 #[derive(Clone, Debug, Deserialize, Serialize)]
6000 pub struct RecoverchannelResponse {
6001 pub stubs: Vec<String>,
6002 }
6003
6004 impl TryFrom<Response> for RecoverchannelResponse {
6005 type Error = super::TryFromResponseError;
6006
6007 fn try_from(response: Response) -> Result<Self, Self::Error> {
6008 match response {
6009 Response::RecoverChannel(response) => Ok(response),
6010 _ => Err(TryFromResponseError)
6011 }
6012 }
6013 }
6014
6015 #[derive(Clone, Debug, Deserialize, Serialize)]
6016 pub struct InvoiceResponse {
6017 #[serde(skip_serializing_if = "Option::is_none")]
6018 pub created_index: Option<u64>,
6019 #[serde(skip_serializing_if = "Option::is_none")]
6020 pub warning_capacity: Option<String>,
6021 #[serde(skip_serializing_if = "Option::is_none")]
6022 pub warning_deadends: Option<String>,
6023 #[serde(skip_serializing_if = "Option::is_none")]
6024 pub warning_mpp: Option<String>,
6025 #[serde(skip_serializing_if = "Option::is_none")]
6026 pub warning_offline: Option<String>,
6027 #[serde(skip_serializing_if = "Option::is_none")]
6028 pub warning_private_unused: Option<String>,
6029 pub bolt11: String,
6030 pub expires_at: u64,
6031 pub payment_hash: Sha256,
6032 pub payment_secret: Secret,
6033 }
6034
6035 impl TryFrom<Response> for InvoiceResponse {
6036 type Error = super::TryFromResponseError;
6037
6038 fn try_from(response: Response) -> Result<Self, Self::Error> {
6039 match response {
6040 Response::Invoice(response) => Ok(response),
6041 _ => Err(TryFromResponseError)
6042 }
6043 }
6044 }
6045
6046 #[derive(Clone, Debug, Deserialize, Serialize)]
6047 pub struct InvoicerequestResponse {
6048 #[serde(skip_serializing_if = "Option::is_none")]
6049 pub label: Option<String>,
6050 pub active: bool,
6051 pub bolt12: String,
6052 pub invreq_id: Sha256,
6053 pub single_use: bool,
6054 pub used: bool,
6055 }
6056
6057 impl TryFrom<Response> for InvoicerequestResponse {
6058 type Error = super::TryFromResponseError;
6059
6060 fn try_from(response: Response) -> Result<Self, Self::Error> {
6061 match response {
6062 Response::InvoiceRequest(response) => Ok(response),
6063 _ => Err(TryFromResponseError)
6064 }
6065 }
6066 }
6067
6068 #[derive(Clone, Debug, Deserialize, Serialize)]
6069 pub struct DisableinvoicerequestResponse {
6070 #[serde(skip_serializing_if = "Option::is_none")]
6071 pub label: Option<String>,
6072 pub active: bool,
6073 pub bolt12: String,
6074 pub invreq_id: Sha256,
6075 pub single_use: bool,
6076 pub used: bool,
6077 }
6078
6079 impl TryFrom<Response> for DisableinvoicerequestResponse {
6080 type Error = super::TryFromResponseError;
6081
6082 fn try_from(response: Response) -> Result<Self, Self::Error> {
6083 match response {
6084 Response::DisableInvoiceRequest(response) => Ok(response),
6085 _ => Err(TryFromResponseError)
6086 }
6087 }
6088 }
6089
6090 #[derive(Clone, Debug, Deserialize, Serialize)]
6091 pub struct ListinvoicerequestsInvoicerequests {
6092 #[serde(skip_serializing_if = "Option::is_none")]
6093 pub label: Option<String>,
6094 pub active: bool,
6095 pub bolt12: String,
6096 pub invreq_id: Sha256,
6097 pub single_use: bool,
6098 pub used: bool,
6099 }
6100
6101 #[derive(Clone, Debug, Deserialize, Serialize)]
6102 pub struct ListinvoicerequestsResponse {
6103 pub invoicerequests: Vec<ListinvoicerequestsInvoicerequests>,
6104 }
6105
6106 impl TryFrom<Response> for ListinvoicerequestsResponse {
6107 type Error = super::TryFromResponseError;
6108
6109 fn try_from(response: Response) -> Result<Self, Self::Error> {
6110 match response {
6111 Response::ListInvoiceRequests(response) => Ok(response),
6112 _ => Err(TryFromResponseError)
6113 }
6114 }
6115 }
6116
6117 #[derive(Clone, Debug, Deserialize, Serialize)]
6118 pub struct ListdatastoreDatastore {
6119 #[serde(skip_serializing_if = "Option::is_none")]
6120 pub generation: Option<u64>,
6121 #[serde(skip_serializing_if = "Option::is_none")]
6122 pub hex: Option<String>,
6123 #[serde(skip_serializing_if = "Option::is_none")]
6124 pub string: Option<String>,
6125 pub key: Vec<String>,
6126 }
6127
6128 #[derive(Clone, Debug, Deserialize, Serialize)]
6129 pub struct ListdatastoreResponse {
6130 pub datastore: Vec<ListdatastoreDatastore>,
6131 }
6132
6133 impl TryFrom<Response> for ListdatastoreResponse {
6134 type Error = super::TryFromResponseError;
6135
6136 fn try_from(response: Response) -> Result<Self, Self::Error> {
6137 match response {
6138 Response::ListDatastore(response) => Ok(response),
6139 _ => Err(TryFromResponseError)
6140 }
6141 }
6142 }
6143
6144 #[derive(Clone, Debug, Deserialize, Serialize)]
6145 pub struct ListinvoicesInvoicesPaidOutpoint {
6146 pub outnum: u32,
6147 pub txid: String,
6148 }
6149
6150 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6152 #[allow(non_camel_case_types)]
6153 pub enum ListinvoicesInvoicesStatus {
6154 #[serde(rename = "unpaid")]
6155 UNPAID = 0,
6156 #[serde(rename = "paid")]
6157 PAID = 1,
6158 #[serde(rename = "expired")]
6159 EXPIRED = 2,
6160 }
6161
6162 impl TryFrom<i32> for ListinvoicesInvoicesStatus {
6163 type Error = anyhow::Error;
6164 fn try_from(c: i32) -> Result<ListinvoicesInvoicesStatus, anyhow::Error> {
6165 match c {
6166 0 => Ok(ListinvoicesInvoicesStatus::UNPAID),
6167 1 => Ok(ListinvoicesInvoicesStatus::PAID),
6168 2 => Ok(ListinvoicesInvoicesStatus::EXPIRED),
6169 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListinvoicesInvoicesStatus", o)),
6170 }
6171 }
6172 }
6173
6174 impl ToString for ListinvoicesInvoicesStatus {
6175 fn to_string(&self) -> String {
6176 match self {
6177 ListinvoicesInvoicesStatus::UNPAID => "UNPAID",
6178 ListinvoicesInvoicesStatus::PAID => "PAID",
6179 ListinvoicesInvoicesStatus::EXPIRED => "EXPIRED",
6180 }.to_string()
6181 }
6182 }
6183
6184 #[derive(Clone, Debug, Deserialize, Serialize)]
6185 pub struct ListinvoicesInvoices {
6186 #[serde(skip_serializing_if = "Option::is_none")]
6187 pub amount_msat: Option<Amount>,
6188 #[serde(skip_serializing_if = "Option::is_none")]
6189 pub amount_received_msat: Option<Amount>,
6190 #[serde(skip_serializing_if = "Option::is_none")]
6191 pub bolt11: Option<String>,
6192 #[serde(skip_serializing_if = "Option::is_none")]
6193 pub bolt12: Option<String>,
6194 #[serde(skip_serializing_if = "Option::is_none")]
6195 pub created_index: Option<u64>,
6196 #[serde(skip_serializing_if = "Option::is_none")]
6197 pub description: Option<String>,
6198 #[serde(skip_serializing_if = "Option::is_none")]
6199 pub invreq_payer_note: Option<String>,
6200 #[serde(skip_serializing_if = "Option::is_none")]
6201 pub local_offer_id: Option<Sha256>,
6202 #[serde(skip_serializing_if = "Option::is_none")]
6203 pub paid_at: Option<u64>,
6204 #[serde(skip_serializing_if = "Option::is_none")]
6205 pub paid_outpoint: Option<ListinvoicesInvoicesPaidOutpoint>,
6206 #[serde(skip_serializing_if = "Option::is_none")]
6207 pub pay_index: Option<u64>,
6208 #[serde(skip_serializing_if = "Option::is_none")]
6209 pub payment_preimage: Option<Secret>,
6210 #[serde(skip_serializing_if = "Option::is_none")]
6211 pub updated_index: Option<u64>,
6212 pub status: ListinvoicesInvoicesStatus,
6214 pub expires_at: u64,
6215 pub label: String,
6216 pub payment_hash: Sha256,
6217 }
6218
6219 #[derive(Clone, Debug, Deserialize, Serialize)]
6220 pub struct ListinvoicesResponse {
6221 pub invoices: Vec<ListinvoicesInvoices>,
6222 }
6223
6224 impl TryFrom<Response> for ListinvoicesResponse {
6225 type Error = super::TryFromResponseError;
6226
6227 fn try_from(response: Response) -> Result<Self, Self::Error> {
6228 match response {
6229 Response::ListInvoices(response) => Ok(response),
6230 _ => Err(TryFromResponseError)
6231 }
6232 }
6233 }
6234
6235 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6237 #[allow(non_camel_case_types)]
6238 pub enum SendonionStatus {
6239 #[serde(rename = "pending")]
6240 PENDING = 0,
6241 #[serde(rename = "complete")]
6242 COMPLETE = 1,
6243 }
6244
6245 impl TryFrom<i32> for SendonionStatus {
6246 type Error = anyhow::Error;
6247 fn try_from(c: i32) -> Result<SendonionStatus, anyhow::Error> {
6248 match c {
6249 0 => Ok(SendonionStatus::PENDING),
6250 1 => Ok(SendonionStatus::COMPLETE),
6251 o => Err(anyhow::anyhow!("Unknown variant {} for enum SendonionStatus", o)),
6252 }
6253 }
6254 }
6255
6256 impl ToString for SendonionStatus {
6257 fn to_string(&self) -> String {
6258 match self {
6259 SendonionStatus::PENDING => "PENDING",
6260 SendonionStatus::COMPLETE => "COMPLETE",
6261 }.to_string()
6262 }
6263 }
6264
6265 #[derive(Clone, Debug, Deserialize, Serialize)]
6266 pub struct SendonionResponse {
6267 #[serde(skip_serializing_if = "Option::is_none")]
6268 pub amount_msat: Option<Amount>,
6269 #[serde(skip_serializing_if = "Option::is_none")]
6270 pub bolt11: Option<String>,
6271 #[serde(skip_serializing_if = "Option::is_none")]
6272 pub bolt12: Option<String>,
6273 #[serde(skip_serializing_if = "Option::is_none")]
6274 pub created_index: Option<u64>,
6275 #[serde(skip_serializing_if = "Option::is_none")]
6276 pub destination: Option<PublicKey>,
6277 #[serde(skip_serializing_if = "Option::is_none")]
6278 pub label: Option<String>,
6279 #[serde(skip_serializing_if = "Option::is_none")]
6280 pub message: Option<String>,
6281 #[serde(skip_serializing_if = "Option::is_none")]
6282 pub partid: Option<u64>,
6283 #[serde(skip_serializing_if = "Option::is_none")]
6284 pub payment_preimage: Option<Secret>,
6285 #[serde(skip_serializing_if = "Option::is_none")]
6286 pub updated_index: Option<u64>,
6287 pub status: SendonionStatus,
6289 pub amount_sent_msat: Amount,
6290 pub created_at: u64,
6291 pub id: u64,
6292 pub payment_hash: Sha256,
6293 }
6294
6295 impl TryFrom<Response> for SendonionResponse {
6296 type Error = super::TryFromResponseError;
6297
6298 fn try_from(response: Response) -> Result<Self, Self::Error> {
6299 match response {
6300 Response::SendOnion(response) => Ok(response),
6301 _ => Err(TryFromResponseError)
6302 }
6303 }
6304 }
6305
6306 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6308 #[allow(non_camel_case_types)]
6309 pub enum ListsendpaysPaymentsStatus {
6310 #[serde(rename = "pending")]
6311 PENDING = 0,
6312 #[serde(rename = "failed")]
6313 FAILED = 1,
6314 #[serde(rename = "complete")]
6315 COMPLETE = 2,
6316 }
6317
6318 impl TryFrom<i32> for ListsendpaysPaymentsStatus {
6319 type Error = anyhow::Error;
6320 fn try_from(c: i32) -> Result<ListsendpaysPaymentsStatus, anyhow::Error> {
6321 match c {
6322 0 => Ok(ListsendpaysPaymentsStatus::PENDING),
6323 1 => Ok(ListsendpaysPaymentsStatus::FAILED),
6324 2 => Ok(ListsendpaysPaymentsStatus::COMPLETE),
6325 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListsendpaysPaymentsStatus", o)),
6326 }
6327 }
6328 }
6329
6330 impl ToString for ListsendpaysPaymentsStatus {
6331 fn to_string(&self) -> String {
6332 match self {
6333 ListsendpaysPaymentsStatus::PENDING => "PENDING",
6334 ListsendpaysPaymentsStatus::FAILED => "FAILED",
6335 ListsendpaysPaymentsStatus::COMPLETE => "COMPLETE",
6336 }.to_string()
6337 }
6338 }
6339
6340 #[derive(Clone, Debug, Deserialize, Serialize)]
6341 pub struct ListsendpaysPayments {
6342 #[serde(skip_serializing_if = "Option::is_none")]
6343 pub amount_msat: Option<Amount>,
6344 #[serde(skip_serializing_if = "Option::is_none")]
6345 pub bolt11: Option<String>,
6346 #[serde(skip_serializing_if = "Option::is_none")]
6347 pub bolt12: Option<String>,
6348 #[serde(skip_serializing_if = "Option::is_none")]
6349 pub completed_at: Option<u64>,
6350 #[serde(skip_serializing_if = "Option::is_none")]
6351 pub created_index: Option<u64>,
6352 #[serde(skip_serializing_if = "Option::is_none")]
6353 pub description: Option<String>,
6354 #[serde(skip_serializing_if = "Option::is_none")]
6355 pub destination: Option<PublicKey>,
6356 #[serde(skip_serializing_if = "Option::is_none")]
6357 pub erroronion: Option<String>,
6358 #[serde(skip_serializing_if = "Option::is_none")]
6359 pub label: Option<String>,
6360 #[serde(skip_serializing_if = "Option::is_none")]
6361 pub partid: Option<u64>,
6362 #[serde(skip_serializing_if = "Option::is_none")]
6363 pub payment_preimage: Option<Secret>,
6364 #[serde(skip_serializing_if = "Option::is_none")]
6365 pub updated_index: Option<u64>,
6366 pub status: ListsendpaysPaymentsStatus,
6368 pub amount_sent_msat: Amount,
6369 pub created_at: u64,
6370 pub groupid: u64,
6371 pub id: u64,
6372 pub payment_hash: Sha256,
6373 }
6374
6375 #[derive(Clone, Debug, Deserialize, Serialize)]
6376 pub struct ListsendpaysResponse {
6377 pub payments: Vec<ListsendpaysPayments>,
6378 }
6379
6380 impl TryFrom<Response> for ListsendpaysResponse {
6381 type Error = super::TryFromResponseError;
6382
6383 fn try_from(response: Response) -> Result<Self, Self::Error> {
6384 match response {
6385 Response::ListSendPays(response) => Ok(response),
6386 _ => Err(TryFromResponseError)
6387 }
6388 }
6389 }
6390
6391 #[derive(Clone, Debug, Deserialize, Serialize)]
6392 pub struct ListtransactionsTransactionsInputs {
6393 pub index: u32,
6394 pub sequence: u32,
6395 pub txid: String,
6396 }
6397
6398 #[derive(Clone, Debug, Deserialize, Serialize)]
6399 pub struct ListtransactionsTransactionsOutputs {
6400 #[serde(rename = "scriptPubKey")]
6401 pub script_pub_key: String,
6402 pub amount_msat: Amount,
6403 pub index: u32,
6404 }
6405
6406 #[derive(Clone, Debug, Deserialize, Serialize)]
6407 pub struct ListtransactionsTransactions {
6408 pub blockheight: u32,
6409 pub hash: String,
6410 pub inputs: Vec<ListtransactionsTransactionsInputs>,
6411 pub locktime: u32,
6412 pub outputs: Vec<ListtransactionsTransactionsOutputs>,
6413 pub rawtx: String,
6414 pub txindex: u32,
6415 pub version: u32,
6416 }
6417
6418 #[derive(Clone, Debug, Deserialize, Serialize)]
6419 pub struct ListtransactionsResponse {
6420 pub transactions: Vec<ListtransactionsTransactions>,
6421 }
6422
6423 impl TryFrom<Response> for ListtransactionsResponse {
6424 type Error = super::TryFromResponseError;
6425
6426 fn try_from(response: Response) -> Result<Self, Self::Error> {
6427 match response {
6428 Response::ListTransactions(response) => Ok(response),
6429 _ => Err(TryFromResponseError)
6430 }
6431 }
6432 }
6433
6434 #[derive(Clone, Debug, Deserialize, Serialize)]
6435 pub struct MakesecretResponse {
6436 pub secret: Secret,
6437 }
6438
6439 impl TryFrom<Response> for MakesecretResponse {
6440 type Error = super::TryFromResponseError;
6441
6442 fn try_from(response: Response) -> Result<Self, Self::Error> {
6443 match response {
6444 Response::MakeSecret(response) => Ok(response),
6445 _ => Err(TryFromResponseError)
6446 }
6447 }
6448 }
6449
6450 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6452 #[allow(non_camel_case_types)]
6453 pub enum PayStatus {
6454 #[serde(rename = "complete")]
6455 COMPLETE = 0,
6456 #[serde(rename = "pending")]
6457 PENDING = 1,
6458 #[serde(rename = "failed")]
6459 FAILED = 2,
6460 }
6461
6462 impl TryFrom<i32> for PayStatus {
6463 type Error = anyhow::Error;
6464 fn try_from(c: i32) -> Result<PayStatus, anyhow::Error> {
6465 match c {
6466 0 => Ok(PayStatus::COMPLETE),
6467 1 => Ok(PayStatus::PENDING),
6468 2 => Ok(PayStatus::FAILED),
6469 o => Err(anyhow::anyhow!("Unknown variant {} for enum PayStatus", o)),
6470 }
6471 }
6472 }
6473
6474 impl ToString for PayStatus {
6475 fn to_string(&self) -> String {
6476 match self {
6477 PayStatus::COMPLETE => "COMPLETE",
6478 PayStatus::PENDING => "PENDING",
6479 PayStatus::FAILED => "FAILED",
6480 }.to_string()
6481 }
6482 }
6483
6484 #[derive(Clone, Debug, Deserialize, Serialize)]
6485 pub struct PayResponse {
6486 #[serde(skip_serializing_if = "Option::is_none")]
6487 pub destination: Option<PublicKey>,
6488 #[serde(skip_serializing_if = "Option::is_none")]
6489 pub warning_partial_completion: Option<String>,
6490 pub status: PayStatus,
6492 pub amount_msat: Amount,
6493 pub amount_sent_msat: Amount,
6494 pub created_at: f64,
6495 pub parts: u32,
6496 pub payment_hash: Sha256,
6497 pub payment_preimage: Secret,
6498 }
6499
6500 impl TryFrom<Response> for PayResponse {
6501 type Error = super::TryFromResponseError;
6502
6503 fn try_from(response: Response) -> Result<Self, Self::Error> {
6504 match response {
6505 Response::Pay(response) => Ok(response),
6506 _ => Err(TryFromResponseError)
6507 }
6508 }
6509 }
6510
6511 #[derive(Clone, Debug, Deserialize, Serialize)]
6512 pub struct ListnodesNodesOptionWillFund {
6513 pub channel_fee_max_base_msat: Amount,
6514 pub channel_fee_max_proportional_thousandths: u32,
6515 pub compact_lease: String,
6516 pub funding_weight: u32,
6517 pub lease_fee_base_msat: Amount,
6518 pub lease_fee_basis: u32,
6519 }
6520
6521 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6523 #[allow(non_camel_case_types)]
6524 pub enum ListnodesNodesAddressesType {
6525 #[serde(rename = "dns")]
6526 DNS = 0,
6527 #[serde(rename = "ipv4")]
6528 IPV4 = 1,
6529 #[serde(rename = "ipv6")]
6530 IPV6 = 2,
6531 #[serde(rename = "torv2")]
6532 TORV2 = 3,
6533 #[serde(rename = "torv3")]
6534 TORV3 = 4,
6535 }
6536
6537 impl TryFrom<i32> for ListnodesNodesAddressesType {
6538 type Error = anyhow::Error;
6539 fn try_from(c: i32) -> Result<ListnodesNodesAddressesType, anyhow::Error> {
6540 match c {
6541 0 => Ok(ListnodesNodesAddressesType::DNS),
6542 1 => Ok(ListnodesNodesAddressesType::IPV4),
6543 2 => Ok(ListnodesNodesAddressesType::IPV6),
6544 3 => Ok(ListnodesNodesAddressesType::TORV2),
6545 4 => Ok(ListnodesNodesAddressesType::TORV3),
6546 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListnodesNodesAddressesType", o)),
6547 }
6548 }
6549 }
6550
6551 impl ToString for ListnodesNodesAddressesType {
6552 fn to_string(&self) -> String {
6553 match self {
6554 ListnodesNodesAddressesType::DNS => "DNS",
6555 ListnodesNodesAddressesType::IPV4 => "IPV4",
6556 ListnodesNodesAddressesType::IPV6 => "IPV6",
6557 ListnodesNodesAddressesType::TORV2 => "TORV2",
6558 ListnodesNodesAddressesType::TORV3 => "TORV3",
6559 }.to_string()
6560 }
6561 }
6562
6563 #[derive(Clone, Debug, Deserialize, Serialize)]
6564 pub struct ListnodesNodesAddresses {
6565 #[serde(skip_serializing_if = "Option::is_none")]
6566 pub address: Option<String>,
6567 #[serde(rename = "type")]
6569 pub item_type: ListnodesNodesAddressesType,
6570 pub port: u16,
6571 }
6572
6573 #[derive(Clone, Debug, Deserialize, Serialize)]
6574 pub struct ListnodesNodes {
6575 #[serde(skip_serializing_if = "Option::is_none")]
6576 pub alias: Option<String>,
6577 #[serde(skip_serializing_if = "Option::is_none")]
6578 pub color: Option<String>,
6579 #[serde(skip_serializing_if = "Option::is_none")]
6580 pub features: Option<String>,
6581 #[serde(skip_serializing_if = "Option::is_none")]
6582 pub last_timestamp: Option<u32>,
6583 #[serde(skip_serializing_if = "Option::is_none")]
6584 pub option_will_fund: Option<ListnodesNodesOptionWillFund>,
6585 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
6586 pub addresses: Option<Vec<ListnodesNodesAddresses>>,
6587 pub nodeid: PublicKey,
6588 }
6589
6590 #[derive(Clone, Debug, Deserialize, Serialize)]
6591 pub struct ListnodesResponse {
6592 pub nodes: Vec<ListnodesNodes>,
6593 }
6594
6595 impl TryFrom<Response> for ListnodesResponse {
6596 type Error = super::TryFromResponseError;
6597
6598 fn try_from(response: Response) -> Result<Self, Self::Error> {
6599 match response {
6600 Response::ListNodes(response) => Ok(response),
6601 _ => Err(TryFromResponseError)
6602 }
6603 }
6604 }
6605
6606 #[derive(Clone, Debug, Deserialize, Serialize)]
6607 pub struct WaitanyinvoicePaidOutpoint {
6608 pub outnum: u32,
6609 pub txid: String,
6610 }
6611
6612 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6614 #[allow(non_camel_case_types)]
6615 pub enum WaitanyinvoiceStatus {
6616 #[serde(rename = "paid")]
6617 PAID = 0,
6618 #[serde(rename = "expired")]
6619 EXPIRED = 1,
6620 }
6621
6622 impl TryFrom<i32> for WaitanyinvoiceStatus {
6623 type Error = anyhow::Error;
6624 fn try_from(c: i32) -> Result<WaitanyinvoiceStatus, anyhow::Error> {
6625 match c {
6626 0 => Ok(WaitanyinvoiceStatus::PAID),
6627 1 => Ok(WaitanyinvoiceStatus::EXPIRED),
6628 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitanyinvoiceStatus", o)),
6629 }
6630 }
6631 }
6632
6633 impl ToString for WaitanyinvoiceStatus {
6634 fn to_string(&self) -> String {
6635 match self {
6636 WaitanyinvoiceStatus::PAID => "PAID",
6637 WaitanyinvoiceStatus::EXPIRED => "EXPIRED",
6638 }.to_string()
6639 }
6640 }
6641
6642 #[derive(Clone, Debug, Deserialize, Serialize)]
6643 pub struct WaitanyinvoiceResponse {
6644 #[serde(skip_serializing_if = "Option::is_none")]
6645 pub amount_msat: Option<Amount>,
6646 #[serde(skip_serializing_if = "Option::is_none")]
6647 pub amount_received_msat: Option<Amount>,
6648 #[serde(skip_serializing_if = "Option::is_none")]
6649 pub bolt11: Option<String>,
6650 #[serde(skip_serializing_if = "Option::is_none")]
6651 pub bolt12: Option<String>,
6652 #[serde(skip_serializing_if = "Option::is_none")]
6653 pub created_index: Option<u64>,
6654 #[serde(skip_serializing_if = "Option::is_none")]
6655 pub description: Option<String>,
6656 #[serde(skip_serializing_if = "Option::is_none")]
6657 pub paid_at: Option<u64>,
6658 #[serde(skip_serializing_if = "Option::is_none")]
6659 pub paid_outpoint: Option<WaitanyinvoicePaidOutpoint>,
6660 #[serde(skip_serializing_if = "Option::is_none")]
6661 pub pay_index: Option<u64>,
6662 #[serde(skip_serializing_if = "Option::is_none")]
6663 pub payment_preimage: Option<Secret>,
6664 #[serde(skip_serializing_if = "Option::is_none")]
6665 pub updated_index: Option<u64>,
6666 pub status: WaitanyinvoiceStatus,
6668 pub expires_at: u64,
6669 pub label: String,
6670 pub payment_hash: Sha256,
6671 }
6672
6673 impl TryFrom<Response> for WaitanyinvoiceResponse {
6674 type Error = super::TryFromResponseError;
6675
6676 fn try_from(response: Response) -> Result<Self, Self::Error> {
6677 match response {
6678 Response::WaitAnyInvoice(response) => Ok(response),
6679 _ => Err(TryFromResponseError)
6680 }
6681 }
6682 }
6683
6684 #[derive(Clone, Debug, Deserialize, Serialize)]
6685 pub struct WaitinvoicePaidOutpoint {
6686 pub outnum: u32,
6687 pub txid: String,
6688 }
6689
6690 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6692 #[allow(non_camel_case_types)]
6693 pub enum WaitinvoiceStatus {
6694 #[serde(rename = "paid")]
6695 PAID = 0,
6696 #[serde(rename = "expired")]
6697 EXPIRED = 1,
6698 }
6699
6700 impl TryFrom<i32> for WaitinvoiceStatus {
6701 type Error = anyhow::Error;
6702 fn try_from(c: i32) -> Result<WaitinvoiceStatus, anyhow::Error> {
6703 match c {
6704 0 => Ok(WaitinvoiceStatus::PAID),
6705 1 => Ok(WaitinvoiceStatus::EXPIRED),
6706 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitinvoiceStatus", o)),
6707 }
6708 }
6709 }
6710
6711 impl ToString for WaitinvoiceStatus {
6712 fn to_string(&self) -> String {
6713 match self {
6714 WaitinvoiceStatus::PAID => "PAID",
6715 WaitinvoiceStatus::EXPIRED => "EXPIRED",
6716 }.to_string()
6717 }
6718 }
6719
6720 #[derive(Clone, Debug, Deserialize, Serialize)]
6721 pub struct WaitinvoiceResponse {
6722 #[serde(skip_serializing_if = "Option::is_none")]
6723 pub amount_msat: Option<Amount>,
6724 #[serde(skip_serializing_if = "Option::is_none")]
6725 pub amount_received_msat: Option<Amount>,
6726 #[serde(skip_serializing_if = "Option::is_none")]
6727 pub bolt11: Option<String>,
6728 #[serde(skip_serializing_if = "Option::is_none")]
6729 pub bolt12: Option<String>,
6730 #[serde(skip_serializing_if = "Option::is_none")]
6731 pub created_index: Option<u64>,
6732 #[serde(skip_serializing_if = "Option::is_none")]
6733 pub description: Option<String>,
6734 #[serde(skip_serializing_if = "Option::is_none")]
6735 pub paid_at: Option<u64>,
6736 #[serde(skip_serializing_if = "Option::is_none")]
6737 pub paid_outpoint: Option<WaitinvoicePaidOutpoint>,
6738 #[serde(skip_serializing_if = "Option::is_none")]
6739 pub pay_index: Option<u64>,
6740 #[serde(skip_serializing_if = "Option::is_none")]
6741 pub payment_preimage: Option<Secret>,
6742 #[serde(skip_serializing_if = "Option::is_none")]
6743 pub updated_index: Option<u64>,
6744 pub status: WaitinvoiceStatus,
6746 pub expires_at: u64,
6747 pub label: String,
6748 pub payment_hash: Sha256,
6749 }
6750
6751 impl TryFrom<Response> for WaitinvoiceResponse {
6752 type Error = super::TryFromResponseError;
6753
6754 fn try_from(response: Response) -> Result<Self, Self::Error> {
6755 match response {
6756 Response::WaitInvoice(response) => Ok(response),
6757 _ => Err(TryFromResponseError)
6758 }
6759 }
6760 }
6761
6762 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6764 #[allow(non_camel_case_types)]
6765 pub enum WaitsendpayStatus {
6766 #[serde(rename = "complete")]
6767 COMPLETE = 0,
6768 }
6769
6770 impl TryFrom<i32> for WaitsendpayStatus {
6771 type Error = anyhow::Error;
6772 fn try_from(c: i32) -> Result<WaitsendpayStatus, anyhow::Error> {
6773 match c {
6774 0 => Ok(WaitsendpayStatus::COMPLETE),
6775 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitsendpayStatus", o)),
6776 }
6777 }
6778 }
6779
6780 impl ToString for WaitsendpayStatus {
6781 fn to_string(&self) -> String {
6782 match self {
6783 WaitsendpayStatus::COMPLETE => "COMPLETE",
6784 }.to_string()
6785 }
6786 }
6787
6788 #[derive(Clone, Debug, Deserialize, Serialize)]
6789 pub struct WaitsendpayResponse {
6790 #[serde(skip_serializing_if = "Option::is_none")]
6791 pub amount_msat: Option<Amount>,
6792 #[serde(skip_serializing_if = "Option::is_none")]
6793 pub bolt11: Option<String>,
6794 #[serde(skip_serializing_if = "Option::is_none")]
6795 pub bolt12: Option<String>,
6796 #[serde(skip_serializing_if = "Option::is_none")]
6797 pub completed_at: Option<f64>,
6798 #[serde(skip_serializing_if = "Option::is_none")]
6799 pub created_index: Option<u64>,
6800 #[serde(skip_serializing_if = "Option::is_none")]
6801 pub destination: Option<PublicKey>,
6802 #[serde(skip_serializing_if = "Option::is_none")]
6803 pub groupid: Option<u64>,
6804 #[serde(skip_serializing_if = "Option::is_none")]
6805 pub label: Option<String>,
6806 #[serde(skip_serializing_if = "Option::is_none")]
6807 pub partid: Option<u64>,
6808 #[serde(skip_serializing_if = "Option::is_none")]
6809 pub payment_preimage: Option<Secret>,
6810 #[serde(skip_serializing_if = "Option::is_none")]
6811 pub updated_index: Option<u64>,
6812 pub status: WaitsendpayStatus,
6814 pub amount_sent_msat: Amount,
6815 pub created_at: u64,
6816 pub id: u64,
6817 pub payment_hash: Sha256,
6818 }
6819
6820 impl TryFrom<Response> for WaitsendpayResponse {
6821 type Error = super::TryFromResponseError;
6822
6823 fn try_from(response: Response) -> Result<Self, Self::Error> {
6824 match response {
6825 Response::WaitSendPay(response) => Ok(response),
6826 _ => Err(TryFromResponseError)
6827 }
6828 }
6829 }
6830
6831 #[derive(Clone, Debug, Deserialize, Serialize)]
6832 pub struct NewaddrResponse {
6833 #[serde(skip_serializing_if = "Option::is_none")]
6834 pub bech32: Option<String>,
6835 #[serde(skip_serializing_if = "Option::is_none")]
6836 pub p2tr: Option<String>,
6837 }
6838
6839 impl TryFrom<Response> for NewaddrResponse {
6840 type Error = super::TryFromResponseError;
6841
6842 fn try_from(response: Response) -> Result<Self, Self::Error> {
6843 match response {
6844 Response::NewAddr(response) => Ok(response),
6845 _ => Err(TryFromResponseError)
6846 }
6847 }
6848 }
6849
6850 #[derive(Clone, Debug, Deserialize, Serialize)]
6851 pub struct WithdrawResponse {
6852 pub psbt: String,
6853 pub tx: String,
6854 pub txid: String,
6855 }
6856
6857 impl TryFrom<Response> for WithdrawResponse {
6858 type Error = super::TryFromResponseError;
6859
6860 fn try_from(response: Response) -> Result<Self, Self::Error> {
6861 match response {
6862 Response::Withdraw(response) => Ok(response),
6863 _ => Err(TryFromResponseError)
6864 }
6865 }
6866 }
6867
6868 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
6870 #[allow(non_camel_case_types)]
6871 pub enum KeysendStatus {
6872 #[serde(rename = "complete")]
6873 COMPLETE = 0,
6874 }
6875
6876 impl TryFrom<i32> for KeysendStatus {
6877 type Error = anyhow::Error;
6878 fn try_from(c: i32) -> Result<KeysendStatus, anyhow::Error> {
6879 match c {
6880 0 => Ok(KeysendStatus::COMPLETE),
6881 o => Err(anyhow::anyhow!("Unknown variant {} for enum KeysendStatus", o)),
6882 }
6883 }
6884 }
6885
6886 impl ToString for KeysendStatus {
6887 fn to_string(&self) -> String {
6888 match self {
6889 KeysendStatus::COMPLETE => "COMPLETE",
6890 }.to_string()
6891 }
6892 }
6893
6894 #[derive(Clone, Debug, Deserialize, Serialize)]
6895 pub struct KeysendResponse {
6896 #[serde(skip_serializing_if = "Option::is_none")]
6897 pub destination: Option<PublicKey>,
6898 #[serde(skip_serializing_if = "Option::is_none")]
6899 pub warning_partial_completion: Option<String>,
6900 pub status: KeysendStatus,
6902 pub amount_msat: Amount,
6903 pub amount_sent_msat: Amount,
6904 pub created_at: f64,
6905 pub parts: u32,
6906 pub payment_hash: Sha256,
6907 pub payment_preimage: Secret,
6908 }
6909
6910 impl TryFrom<Response> for KeysendResponse {
6911 type Error = super::TryFromResponseError;
6912
6913 fn try_from(response: Response) -> Result<Self, Self::Error> {
6914 match response {
6915 Response::KeySend(response) => Ok(response),
6916 _ => Err(TryFromResponseError)
6917 }
6918 }
6919 }
6920
6921 #[derive(Clone, Debug, Deserialize, Serialize)]
6922 pub struct FundpsbtReservations {
6923 pub reserved: bool,
6924 pub reserved_to_block: u32,
6925 pub txid: String,
6926 pub vout: u32,
6927 pub was_reserved: bool,
6928 }
6929
6930 #[derive(Clone, Debug, Deserialize, Serialize)]
6931 pub struct FundpsbtResponse {
6932 #[serde(skip_serializing_if = "Option::is_none")]
6933 pub change_outnum: Option<u32>,
6934 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
6935 pub reservations: Option<Vec<FundpsbtReservations>>,
6936 pub estimated_final_weight: u32,
6937 pub excess_msat: Amount,
6938 pub feerate_per_kw: u32,
6939 pub psbt: String,
6940 }
6941
6942 impl TryFrom<Response> for FundpsbtResponse {
6943 type Error = super::TryFromResponseError;
6944
6945 fn try_from(response: Response) -> Result<Self, Self::Error> {
6946 match response {
6947 Response::FundPsbt(response) => Ok(response),
6948 _ => Err(TryFromResponseError)
6949 }
6950 }
6951 }
6952
6953 #[derive(Clone, Debug, Deserialize, Serialize)]
6954 pub struct SendpsbtResponse {
6955 pub tx: String,
6956 pub txid: String,
6957 }
6958
6959 impl TryFrom<Response> for SendpsbtResponse {
6960 type Error = super::TryFromResponseError;
6961
6962 fn try_from(response: Response) -> Result<Self, Self::Error> {
6963 match response {
6964 Response::SendPsbt(response) => Ok(response),
6965 _ => Err(TryFromResponseError)
6966 }
6967 }
6968 }
6969
6970 #[derive(Clone, Debug, Deserialize, Serialize)]
6971 pub struct SignpsbtResponse {
6972 pub signed_psbt: String,
6973 }
6974
6975 impl TryFrom<Response> for SignpsbtResponse {
6976 type Error = super::TryFromResponseError;
6977
6978 fn try_from(response: Response) -> Result<Self, Self::Error> {
6979 match response {
6980 Response::SignPsbt(response) => Ok(response),
6981 _ => Err(TryFromResponseError)
6982 }
6983 }
6984 }
6985
6986 #[derive(Clone, Debug, Deserialize, Serialize)]
6987 pub struct UtxopsbtReservations {
6988 pub reserved: bool,
6989 pub reserved_to_block: u32,
6990 pub txid: String,
6991 pub vout: u32,
6992 pub was_reserved: bool,
6993 }
6994
6995 #[derive(Clone, Debug, Deserialize, Serialize)]
6996 pub struct UtxopsbtResponse {
6997 #[serde(skip_serializing_if = "Option::is_none")]
6998 pub change_outnum: Option<u32>,
6999 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7000 pub reservations: Option<Vec<UtxopsbtReservations>>,
7001 pub estimated_final_weight: u32,
7002 pub excess_msat: Amount,
7003 pub feerate_per_kw: u32,
7004 pub psbt: String,
7005 }
7006
7007 impl TryFrom<Response> for UtxopsbtResponse {
7008 type Error = super::TryFromResponseError;
7009
7010 fn try_from(response: Response) -> Result<Self, Self::Error> {
7011 match response {
7012 Response::UtxoPsbt(response) => Ok(response),
7013 _ => Err(TryFromResponseError)
7014 }
7015 }
7016 }
7017
7018 #[derive(Clone, Debug, Deserialize, Serialize)]
7019 pub struct TxdiscardResponse {
7020 pub txid: String,
7021 pub unsigned_tx: String,
7022 }
7023
7024 impl TryFrom<Response> for TxdiscardResponse {
7025 type Error = super::TryFromResponseError;
7026
7027 fn try_from(response: Response) -> Result<Self, Self::Error> {
7028 match response {
7029 Response::TxDiscard(response) => Ok(response),
7030 _ => Err(TryFromResponseError)
7031 }
7032 }
7033 }
7034
7035 #[derive(Clone, Debug, Deserialize, Serialize)]
7036 pub struct TxprepareResponse {
7037 pub psbt: String,
7038 pub txid: String,
7039 pub unsigned_tx: String,
7040 }
7041
7042 impl TryFrom<Response> for TxprepareResponse {
7043 type Error = super::TryFromResponseError;
7044
7045 fn try_from(response: Response) -> Result<Self, Self::Error> {
7046 match response {
7047 Response::TxPrepare(response) => Ok(response),
7048 _ => Err(TryFromResponseError)
7049 }
7050 }
7051 }
7052
7053 #[derive(Clone, Debug, Deserialize, Serialize)]
7054 pub struct TxsendResponse {
7055 pub psbt: String,
7056 pub tx: String,
7057 pub txid: String,
7058 }
7059
7060 impl TryFrom<Response> for TxsendResponse {
7061 type Error = super::TryFromResponseError;
7062
7063 fn try_from(response: Response) -> Result<Self, Self::Error> {
7064 match response {
7065 Response::TxSend(response) => Ok(response),
7066 _ => Err(TryFromResponseError)
7067 }
7068 }
7069 }
7070
7071 #[derive(Clone, Debug, Deserialize, Serialize)]
7072 pub struct ListpeerchannelsChannelsAlias {
7073 #[serde(skip_serializing_if = "Option::is_none")]
7074 pub local: Option<ShortChannelId>,
7075 #[serde(skip_serializing_if = "Option::is_none")]
7076 pub remote: Option<ShortChannelId>,
7077 }
7078
7079 #[derive(Clone, Debug, Deserialize, Serialize)]
7080 pub struct ListpeerchannelsChannelsFeerate {
7081 pub perkb: u32,
7082 pub perkw: u32,
7083 }
7084
7085 #[derive(Clone, Debug, Deserialize, Serialize)]
7086 pub struct ListpeerchannelsChannelsFunding {
7087 #[serde(skip_serializing_if = "Option::is_none")]
7088 pub fee_paid_msat: Option<Amount>,
7089 #[serde(skip_serializing_if = "Option::is_none")]
7090 pub fee_rcvd_msat: Option<Amount>,
7091 #[serde(skip_serializing_if = "Option::is_none")]
7092 pub pushed_msat: Option<Amount>,
7093 pub local_funds_msat: Amount,
7094 pub remote_funds_msat: Amount,
7095 }
7096
7097 #[derive(Clone, Debug, Deserialize, Serialize)]
7098 pub struct ListpeerchannelsChannelsUpdatesRemote {
7099 pub cltv_expiry_delta: u32,
7100 pub fee_base_msat: Amount,
7101 pub fee_proportional_millionths: u32,
7102 pub htlc_maximum_msat: Amount,
7103 pub htlc_minimum_msat: Amount,
7104 }
7105
7106 #[derive(Clone, Debug, Deserialize, Serialize)]
7107 pub struct ListpeerchannelsChannelsUpdatesLocal {
7108 pub cltv_expiry_delta: u32,
7109 pub fee_base_msat: Amount,
7110 pub fee_proportional_millionths: u32,
7111 pub htlc_maximum_msat: Amount,
7112 pub htlc_minimum_msat: Amount,
7113 }
7114
7115 #[derive(Clone, Debug, Deserialize, Serialize)]
7116 pub struct ListpeerchannelsChannelsUpdates {
7117 #[serde(skip_serializing_if = "Option::is_none")]
7118 pub remote: Option<ListpeerchannelsChannelsUpdatesRemote>,
7119 pub local: ListpeerchannelsChannelsUpdatesLocal,
7120 }
7121
7122 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7124 #[allow(non_camel_case_types)]
7125 pub enum ListpeerchannelsChannelsHtlcsDirection {
7126 #[serde(rename = "in")]
7127 IN = 0,
7128 #[serde(rename = "out")]
7129 OUT = 1,
7130 }
7131
7132 impl TryFrom<i32> for ListpeerchannelsChannelsHtlcsDirection {
7133 type Error = anyhow::Error;
7134 fn try_from(c: i32) -> Result<ListpeerchannelsChannelsHtlcsDirection, anyhow::Error> {
7135 match c {
7136 0 => Ok(ListpeerchannelsChannelsHtlcsDirection::IN),
7137 1 => Ok(ListpeerchannelsChannelsHtlcsDirection::OUT),
7138 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsHtlcsDirection", o)),
7139 }
7140 }
7141 }
7142
7143 impl ToString for ListpeerchannelsChannelsHtlcsDirection {
7144 fn to_string(&self) -> String {
7145 match self {
7146 ListpeerchannelsChannelsHtlcsDirection::IN => "IN",
7147 ListpeerchannelsChannelsHtlcsDirection::OUT => "OUT",
7148 }.to_string()
7149 }
7150 }
7151
7152 #[derive(Clone, Debug, Deserialize, Serialize)]
7153 pub struct ListpeerchannelsChannelsHtlcs {
7154 #[serde(skip_serializing_if = "Option::is_none")]
7155 pub local_trimmed: Option<bool>,
7156 #[serde(skip_serializing_if = "Option::is_none")]
7157 pub status: Option<String>,
7158 pub direction: ListpeerchannelsChannelsHtlcsDirection,
7160 pub state: HtlcState,
7162 pub amount_msat: Amount,
7163 pub expiry: u32,
7164 pub id: u64,
7165 pub payment_hash: Sha256,
7166 }
7167
7168 #[derive(Clone, Debug, Deserialize, Serialize)]
7169 pub struct ListpeerchannelsChannelsInflight {
7170 #[serde(skip_serializing_if = "Option::is_none")]
7171 pub scratch_txid: Option<String>,
7172 #[serde(skip_serializing_if = "Option::is_none")]
7173 pub splice_amount: Option<i64>,
7174 pub feerate: String,
7175 pub funding_outnum: u32,
7176 pub funding_txid: String,
7177 pub our_funding_msat: Amount,
7178 pub total_funding_msat: Amount,
7179 }
7180
7181 #[derive(Clone, Debug, Deserialize, Serialize)]
7182 pub struct ListpeerchannelsChannels {
7183 #[deprecated]
7184 #[serde(skip_serializing_if = "Option::is_none")]
7185 pub max_total_htlc_in_msat: Option<Amount>,
7186 #[serde(skip_serializing_if = "Option::is_none")]
7187 pub alias: Option<ListpeerchannelsChannelsAlias>,
7188 #[serde(skip_serializing_if = "Option::is_none")]
7189 pub channel_id: Option<Sha256>,
7190 #[serde(skip_serializing_if = "Option::is_none")]
7191 pub close_to: Option<String>,
7192 #[serde(skip_serializing_if = "Option::is_none")]
7193 pub close_to_addr: Option<String>,
7194 #[serde(skip_serializing_if = "Option::is_none")]
7195 pub closer: Option<ChannelSide>,
7196 #[serde(skip_serializing_if = "Option::is_none")]
7197 pub direction: Option<u32>,
7198 #[serde(skip_serializing_if = "Option::is_none")]
7199 pub dust_limit_msat: Option<Amount>,
7200 #[serde(skip_serializing_if = "Option::is_none")]
7201 pub fee_base_msat: Option<Amount>,
7202 #[serde(skip_serializing_if = "Option::is_none")]
7203 pub fee_proportional_millionths: Option<u32>,
7204 #[serde(skip_serializing_if = "Option::is_none")]
7205 pub feerate: Option<ListpeerchannelsChannelsFeerate>,
7206 #[serde(skip_serializing_if = "Option::is_none")]
7207 pub funding: Option<ListpeerchannelsChannelsFunding>,
7208 #[serde(skip_serializing_if = "Option::is_none")]
7209 pub funding_outnum: Option<u32>,
7210 #[serde(skip_serializing_if = "Option::is_none")]
7211 pub funding_txid: Option<String>,
7212 #[serde(skip_serializing_if = "Option::is_none")]
7213 pub ignore_fee_limits: Option<bool>,
7214 #[serde(skip_serializing_if = "Option::is_none")]
7215 pub in_fulfilled_msat: Option<Amount>,
7216 #[serde(skip_serializing_if = "Option::is_none")]
7217 pub in_offered_msat: Option<Amount>,
7218 #[serde(skip_serializing_if = "Option::is_none")]
7219 pub in_payments_fulfilled: Option<u64>,
7220 #[serde(skip_serializing_if = "Option::is_none")]
7221 pub in_payments_offered: Option<u64>,
7222 #[serde(skip_serializing_if = "Option::is_none")]
7223 pub initial_feerate: Option<String>,
7224 #[serde(skip_serializing_if = "Option::is_none")]
7225 pub last_feerate: Option<String>,
7226 #[serde(skip_serializing_if = "Option::is_none")]
7227 pub last_stable_connection: Option<u64>,
7228 #[serde(skip_serializing_if = "Option::is_none")]
7229 pub last_tx_fee_msat: Option<Amount>,
7230 #[serde(skip_serializing_if = "Option::is_none")]
7231 pub lost_state: Option<bool>,
7232 #[serde(skip_serializing_if = "Option::is_none")]
7233 pub max_accepted_htlcs: Option<u32>,
7234 #[serde(skip_serializing_if = "Option::is_none")]
7235 pub max_to_us_msat: Option<Amount>,
7236 #[serde(skip_serializing_if = "Option::is_none")]
7237 pub maximum_htlc_out_msat: Option<Amount>,
7238 #[serde(skip_serializing_if = "Option::is_none")]
7239 pub min_to_us_msat: Option<Amount>,
7240 #[serde(skip_serializing_if = "Option::is_none")]
7241 pub minimum_htlc_in_msat: Option<Amount>,
7242 #[serde(skip_serializing_if = "Option::is_none")]
7243 pub minimum_htlc_out_msat: Option<Amount>,
7244 #[serde(skip_serializing_if = "Option::is_none")]
7245 pub next_fee_step: Option<u32>,
7246 #[serde(skip_serializing_if = "Option::is_none")]
7247 pub next_feerate: Option<String>,
7248 #[serde(skip_serializing_if = "Option::is_none")]
7249 pub our_max_htlc_value_in_flight_msat: Option<Amount>,
7250 #[serde(skip_serializing_if = "Option::is_none")]
7251 pub our_reserve_msat: Option<Amount>,
7252 #[serde(skip_serializing_if = "Option::is_none")]
7253 pub our_to_self_delay: Option<u32>,
7254 #[serde(skip_serializing_if = "Option::is_none")]
7255 pub out_fulfilled_msat: Option<Amount>,
7256 #[serde(skip_serializing_if = "Option::is_none")]
7257 pub out_offered_msat: Option<Amount>,
7258 #[serde(skip_serializing_if = "Option::is_none")]
7259 pub out_payments_fulfilled: Option<u64>,
7260 #[serde(skip_serializing_if = "Option::is_none")]
7261 pub out_payments_offered: Option<u64>,
7262 #[serde(skip_serializing_if = "Option::is_none")]
7263 pub owner: Option<String>,
7264 #[serde(skip_serializing_if = "Option::is_none")]
7265 pub private: Option<bool>,
7266 #[serde(skip_serializing_if = "Option::is_none")]
7267 pub receivable_msat: Option<Amount>,
7268 #[serde(skip_serializing_if = "Option::is_none")]
7269 pub reestablished: Option<bool>,
7270 #[serde(skip_serializing_if = "Option::is_none")]
7271 pub scratch_txid: Option<String>,
7272 #[serde(skip_serializing_if = "Option::is_none")]
7273 pub short_channel_id: Option<ShortChannelId>,
7274 #[serde(skip_serializing_if = "Option::is_none")]
7275 pub spendable_msat: Option<Amount>,
7276 #[serde(skip_serializing_if = "Option::is_none")]
7277 pub their_max_htlc_value_in_flight_msat: Option<Amount>,
7278 #[serde(skip_serializing_if = "Option::is_none")]
7279 pub their_reserve_msat: Option<Amount>,
7280 #[serde(skip_serializing_if = "Option::is_none")]
7281 pub their_to_self_delay: Option<u32>,
7282 #[serde(skip_serializing_if = "Option::is_none")]
7283 pub to_us_msat: Option<Amount>,
7284 #[serde(skip_serializing_if = "Option::is_none")]
7285 pub total_msat: Option<Amount>,
7286 #[serde(skip_serializing_if = "Option::is_none")]
7287 pub updates: Option<ListpeerchannelsChannelsUpdates>,
7288 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7289 pub htlcs: Option<Vec<ListpeerchannelsChannelsHtlcs>>,
7290 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7291 pub inflight: Option<Vec<ListpeerchannelsChannelsInflight>>,
7292 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7293 pub status: Option<Vec<String>>,
7294 pub opener: ChannelSide,
7296 pub state: ChannelState,
7298 pub peer_connected: bool,
7299 pub peer_id: PublicKey,
7300 }
7301
7302 #[derive(Clone, Debug, Deserialize, Serialize)]
7303 pub struct ListpeerchannelsResponse {
7304 pub channels: Vec<ListpeerchannelsChannels>,
7305 }
7306
7307 impl TryFrom<Response> for ListpeerchannelsResponse {
7308 type Error = super::TryFromResponseError;
7309
7310 fn try_from(response: Response) -> Result<Self, Self::Error> {
7311 match response {
7312 Response::ListPeerChannels(response) => Ok(response),
7313 _ => Err(TryFromResponseError)
7314 }
7315 }
7316 }
7317
7318 #[derive(Clone, Debug, Deserialize, Serialize)]
7319 pub struct ListclosedchannelsClosedchannelsAlias {
7320 #[serde(skip_serializing_if = "Option::is_none")]
7321 pub local: Option<ShortChannelId>,
7322 #[serde(skip_serializing_if = "Option::is_none")]
7323 pub remote: Option<ShortChannelId>,
7324 }
7325
7326 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7328 #[allow(non_camel_case_types)]
7329 pub enum ListclosedchannelsClosedchannelsCloseCause {
7330 #[serde(rename = "unknown")]
7331 UNKNOWN = 0,
7332 #[serde(rename = "local")]
7333 LOCAL = 1,
7334 #[serde(rename = "user")]
7335 USER = 2,
7336 #[serde(rename = "remote")]
7337 REMOTE = 3,
7338 #[serde(rename = "protocol")]
7339 PROTOCOL = 4,
7340 #[serde(rename = "onchain")]
7341 ONCHAIN = 5,
7342 }
7343
7344 impl TryFrom<i32> for ListclosedchannelsClosedchannelsCloseCause {
7345 type Error = anyhow::Error;
7346 fn try_from(c: i32) -> Result<ListclosedchannelsClosedchannelsCloseCause, anyhow::Error> {
7347 match c {
7348 0 => Ok(ListclosedchannelsClosedchannelsCloseCause::UNKNOWN),
7349 1 => Ok(ListclosedchannelsClosedchannelsCloseCause::LOCAL),
7350 2 => Ok(ListclosedchannelsClosedchannelsCloseCause::USER),
7351 3 => Ok(ListclosedchannelsClosedchannelsCloseCause::REMOTE),
7352 4 => Ok(ListclosedchannelsClosedchannelsCloseCause::PROTOCOL),
7353 5 => Ok(ListclosedchannelsClosedchannelsCloseCause::ONCHAIN),
7354 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListclosedchannelsClosedchannelsCloseCause", o)),
7355 }
7356 }
7357 }
7358
7359 impl ToString for ListclosedchannelsClosedchannelsCloseCause {
7360 fn to_string(&self) -> String {
7361 match self {
7362 ListclosedchannelsClosedchannelsCloseCause::UNKNOWN => "UNKNOWN",
7363 ListclosedchannelsClosedchannelsCloseCause::LOCAL => "LOCAL",
7364 ListclosedchannelsClosedchannelsCloseCause::USER => "USER",
7365 ListclosedchannelsClosedchannelsCloseCause::REMOTE => "REMOTE",
7366 ListclosedchannelsClosedchannelsCloseCause::PROTOCOL => "PROTOCOL",
7367 ListclosedchannelsClosedchannelsCloseCause::ONCHAIN => "ONCHAIN",
7368 }.to_string()
7369 }
7370 }
7371
7372 #[derive(Clone, Debug, Deserialize, Serialize)]
7373 pub struct ListclosedchannelsClosedchannels {
7374 #[serde(skip_serializing_if = "Option::is_none")]
7375 pub alias: Option<ListclosedchannelsClosedchannelsAlias>,
7376 #[serde(skip_serializing_if = "Option::is_none")]
7377 pub closer: Option<ChannelSide>,
7378 #[serde(skip_serializing_if = "Option::is_none")]
7379 pub funding_fee_paid_msat: Option<Amount>,
7380 #[serde(skip_serializing_if = "Option::is_none")]
7381 pub funding_fee_rcvd_msat: Option<Amount>,
7382 #[serde(skip_serializing_if = "Option::is_none")]
7383 pub funding_pushed_msat: Option<Amount>,
7384 #[serde(skip_serializing_if = "Option::is_none")]
7385 pub last_commitment_fee_msat: Option<Amount>,
7386 #[serde(skip_serializing_if = "Option::is_none")]
7387 pub last_commitment_txid: Option<Sha256>,
7388 #[serde(skip_serializing_if = "Option::is_none")]
7389 pub last_stable_connection: Option<u64>,
7390 #[serde(skip_serializing_if = "Option::is_none")]
7391 pub peer_id: Option<PublicKey>,
7392 #[serde(skip_serializing_if = "Option::is_none")]
7393 pub short_channel_id: Option<ShortChannelId>,
7394 pub close_cause: ListclosedchannelsClosedchannelsCloseCause,
7396 pub opener: ChannelSide,
7398 pub channel_id: Sha256,
7399 pub final_to_us_msat: Amount,
7400 pub funding_outnum: u32,
7401 pub funding_txid: String,
7402 pub leased: bool,
7403 pub max_to_us_msat: Amount,
7404 pub min_to_us_msat: Amount,
7405 pub private: bool,
7406 pub total_htlcs_sent: u64,
7407 pub total_local_commitments: u64,
7408 pub total_msat: Amount,
7409 pub total_remote_commitments: u64,
7410 }
7411
7412 #[derive(Clone, Debug, Deserialize, Serialize)]
7413 pub struct ListclosedchannelsResponse {
7414 pub closedchannels: Vec<ListclosedchannelsClosedchannels>,
7415 }
7416
7417 impl TryFrom<Response> for ListclosedchannelsResponse {
7418 type Error = super::TryFromResponseError;
7419
7420 fn try_from(response: Response) -> Result<Self, Self::Error> {
7421 match response {
7422 Response::ListClosedChannels(response) => Ok(response),
7423 _ => Err(TryFromResponseError)
7424 }
7425 }
7426 }
7427
7428 #[derive(Clone, Debug, Deserialize, Serialize)]
7429 pub struct DecodepayExtra {
7430 pub data: String,
7431 pub tag: String,
7432 }
7433
7434 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7436 #[allow(non_camel_case_types)]
7437 pub enum DecodepayFallbacksType {
7438 #[serde(rename = "P2PKH")]
7439 P2PKH = 0,
7440 #[serde(rename = "P2SH")]
7441 P2SH = 1,
7442 #[serde(rename = "P2WPKH")]
7443 P2WPKH = 2,
7444 #[serde(rename = "P2WSH")]
7445 P2WSH = 3,
7446 #[serde(rename = "P2TR")]
7447 P2TR = 4,
7448 }
7449
7450 impl TryFrom<i32> for DecodepayFallbacksType {
7451 type Error = anyhow::Error;
7452 fn try_from(c: i32) -> Result<DecodepayFallbacksType, anyhow::Error> {
7453 match c {
7454 0 => Ok(DecodepayFallbacksType::P2PKH),
7455 1 => Ok(DecodepayFallbacksType::P2SH),
7456 2 => Ok(DecodepayFallbacksType::P2WPKH),
7457 3 => Ok(DecodepayFallbacksType::P2WSH),
7458 4 => Ok(DecodepayFallbacksType::P2TR),
7459 o => Err(anyhow::anyhow!("Unknown variant {} for enum DecodepayFallbacksType", o)),
7460 }
7461 }
7462 }
7463
7464 impl ToString for DecodepayFallbacksType {
7465 fn to_string(&self) -> String {
7466 match self {
7467 DecodepayFallbacksType::P2PKH => "P2PKH",
7468 DecodepayFallbacksType::P2SH => "P2SH",
7469 DecodepayFallbacksType::P2WPKH => "P2WPKH",
7470 DecodepayFallbacksType::P2WSH => "P2WSH",
7471 DecodepayFallbacksType::P2TR => "P2TR",
7472 }.to_string()
7473 }
7474 }
7475
7476 #[derive(Clone, Debug, Deserialize, Serialize)]
7477 pub struct DecodepayFallbacks {
7478 #[serde(skip_serializing_if = "Option::is_none")]
7479 pub addr: Option<String>,
7480 #[serde(rename = "type")]
7482 pub item_type: DecodepayFallbacksType,
7483 pub hex: String,
7484 }
7485
7486 #[derive(Clone, Debug, Deserialize, Serialize)]
7487 pub struct DecodepayResponse {
7488 #[serde(skip_serializing_if = "Option::is_none")]
7489 pub amount_msat: Option<Amount>,
7490 #[serde(skip_serializing_if = "Option::is_none")]
7491 pub description: Option<String>,
7492 #[serde(skip_serializing_if = "Option::is_none")]
7493 pub description_hash: Option<Sha256>,
7494 #[serde(skip_serializing_if = "Option::is_none")]
7495 pub features: Option<String>,
7496 #[serde(skip_serializing_if = "Option::is_none")]
7497 pub payment_metadata: Option<String>,
7498 #[serde(skip_serializing_if = "Option::is_none")]
7499 pub payment_secret: Option<Sha256>,
7500 #[serde(skip_serializing_if = "Option::is_none")]
7501 pub routes: Option<DecodeRoutehintList>,
7502 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7503 pub extra: Option<Vec<DecodepayExtra>>,
7504 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7505 pub fallbacks: Option<Vec<DecodepayFallbacks>>,
7506 pub created_at: u64,
7507 pub currency: String,
7508 pub expiry: u64,
7509 pub min_final_cltv_expiry: u32,
7510 pub payee: PublicKey,
7511 pub payment_hash: Sha256,
7512 pub signature: String,
7513 }
7514
7515 impl TryFrom<Response> for DecodepayResponse {
7516 type Error = super::TryFromResponseError;
7517
7518 fn try_from(response: Response) -> Result<Self, Self::Error> {
7519 match response {
7520 Response::DecodePay(response) => Ok(response),
7521 _ => Err(TryFromResponseError)
7522 }
7523 }
7524 }
7525
7526 #[derive(Clone, Debug, Deserialize, Serialize)]
7527 pub struct DecodeInvreqBip353Name {
7528 #[serde(skip_serializing_if = "Option::is_none")]
7529 pub domain: Option<String>,
7530 #[serde(skip_serializing_if = "Option::is_none")]
7531 pub name: Option<String>,
7532 }
7533
7534 #[derive(Clone, Debug, Deserialize, Serialize)]
7535 pub struct DecodeExtra {
7536 pub data: String,
7537 pub tag: String,
7538 }
7539
7540 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7542 #[allow(non_camel_case_types)]
7543 pub enum DecodeFallbacksType {
7544 #[serde(rename = "P2PKH")]
7545 P2PKH = 0,
7546 #[serde(rename = "P2SH")]
7547 P2SH = 1,
7548 #[serde(rename = "P2WPKH")]
7549 P2WPKH = 2,
7550 #[serde(rename = "P2WSH")]
7551 P2WSH = 3,
7552 #[serde(rename = "P2TR")]
7553 P2TR = 4,
7554 }
7555
7556 impl TryFrom<i32> for DecodeFallbacksType {
7557 type Error = anyhow::Error;
7558 fn try_from(c: i32) -> Result<DecodeFallbacksType, anyhow::Error> {
7559 match c {
7560 0 => Ok(DecodeFallbacksType::P2PKH),
7561 1 => Ok(DecodeFallbacksType::P2SH),
7562 2 => Ok(DecodeFallbacksType::P2WPKH),
7563 3 => Ok(DecodeFallbacksType::P2WSH),
7564 4 => Ok(DecodeFallbacksType::P2TR),
7565 o => Err(anyhow::anyhow!("Unknown variant {} for enum DecodeFallbacksType", o)),
7566 }
7567 }
7568 }
7569
7570 impl ToString for DecodeFallbacksType {
7571 fn to_string(&self) -> String {
7572 match self {
7573 DecodeFallbacksType::P2PKH => "P2PKH",
7574 DecodeFallbacksType::P2SH => "P2SH",
7575 DecodeFallbacksType::P2WPKH => "P2WPKH",
7576 DecodeFallbacksType::P2WSH => "P2WSH",
7577 DecodeFallbacksType::P2TR => "P2TR",
7578 }.to_string()
7579 }
7580 }
7581
7582 #[derive(Clone, Debug, Deserialize, Serialize)]
7583 pub struct DecodeFallbacks {
7584 #[serde(skip_serializing_if = "Option::is_none")]
7585 pub addr: Option<String>,
7586 #[serde(skip_serializing_if = "Option::is_none")]
7587 pub warning_invoice_fallbacks_version_invalid: Option<String>,
7588 #[serde(rename = "type")]
7590 pub item_type: DecodeFallbacksType,
7591 pub hex: String,
7592 }
7593
7594 #[derive(Clone, Debug, Deserialize, Serialize)]
7595 pub struct DecodeInvoiceFallbacks {
7596 #[serde(skip_serializing_if = "Option::is_none")]
7597 pub address: Option<String>,
7598 pub hex: String,
7599 pub version: u8,
7600 }
7601
7602 #[derive(Clone, Debug, Deserialize, Serialize)]
7603 pub struct DecodeInvreqPathsPath {
7604 pub blinded_node_id: PublicKey,
7605 pub encrypted_recipient_data: String,
7606 }
7607
7608 #[derive(Clone, Debug, Deserialize, Serialize)]
7609 pub struct DecodeInvreqPaths {
7610 #[deprecated]
7611 #[serde(skip_serializing_if = "Option::is_none")]
7612 pub blinding: Option<PublicKey>,
7613 #[serde(skip_serializing_if = "Option::is_none")]
7614 pub first_node_id: Option<PublicKey>,
7615 #[serde(skip_serializing_if = "Option::is_none")]
7616 pub first_path_key: Option<PublicKey>,
7617 #[serde(skip_serializing_if = "Option::is_none")]
7618 pub first_scid: Option<ShortChannelId>,
7619 #[serde(skip_serializing_if = "Option::is_none")]
7620 pub first_scid_dir: Option<u32>,
7621 pub path: Vec<DecodeInvreqPathsPath>,
7622 }
7623
7624 #[derive(Clone, Debug, Deserialize, Serialize)]
7625 pub struct DecodeOfferPaths {
7626 #[deprecated]
7627 #[serde(skip_serializing_if = "Option::is_none")]
7628 pub blinding: Option<PublicKey>,
7629 #[serde(skip_serializing_if = "Option::is_none")]
7630 pub first_node_id: Option<PublicKey>,
7631 #[serde(skip_serializing_if = "Option::is_none")]
7632 pub first_path_key: Option<PublicKey>,
7633 #[serde(skip_serializing_if = "Option::is_none")]
7634 pub first_scid: Option<ShortChannelId>,
7635 #[serde(skip_serializing_if = "Option::is_none")]
7636 pub first_scid_dir: Option<u32>,
7637 }
7638
7639 #[derive(Clone, Debug, Deserialize, Serialize)]
7640 pub struct DecodeRestrictions {
7641 pub alternatives: Vec<String>,
7642 pub summary: String,
7643 }
7644
7645 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7647 #[allow(non_camel_case_types)]
7648 pub enum DecodeType {
7649 #[serde(rename = "bolt12 offer")]
7650 BOLT12_OFFER = 0,
7651 #[serde(rename = "bolt12 invoice")]
7652 BOLT12_INVOICE = 1,
7653 #[serde(rename = "bolt12 invoice_request")]
7654 BOLT12_INVOICE_REQUEST = 2,
7655 #[serde(rename = "bolt11 invoice")]
7656 BOLT11_INVOICE = 3,
7657 #[serde(rename = "rune")]
7658 RUNE = 4,
7659 #[serde(rename = "emergency recover")]
7660 EMERGENCY_RECOVER = 5,
7661 }
7662
7663 impl TryFrom<i32> for DecodeType {
7664 type Error = anyhow::Error;
7665 fn try_from(c: i32) -> Result<DecodeType, anyhow::Error> {
7666 match c {
7667 0 => Ok(DecodeType::BOLT12_OFFER),
7668 1 => Ok(DecodeType::BOLT12_INVOICE),
7669 2 => Ok(DecodeType::BOLT12_INVOICE_REQUEST),
7670 3 => Ok(DecodeType::BOLT11_INVOICE),
7671 4 => Ok(DecodeType::RUNE),
7672 5 => Ok(DecodeType::EMERGENCY_RECOVER),
7673 o => Err(anyhow::anyhow!("Unknown variant {} for enum DecodeType", o)),
7674 }
7675 }
7676 }
7677
7678 impl ToString for DecodeType {
7679 fn to_string(&self) -> String {
7680 match self {
7681 DecodeType::BOLT12_OFFER => "BOLT12_OFFER",
7682 DecodeType::BOLT12_INVOICE => "BOLT12_INVOICE",
7683 DecodeType::BOLT12_INVOICE_REQUEST => "BOLT12_INVOICE_REQUEST",
7684 DecodeType::BOLT11_INVOICE => "BOLT11_INVOICE",
7685 DecodeType::RUNE => "RUNE",
7686 DecodeType::EMERGENCY_RECOVER => "EMERGENCY_RECOVER",
7687 }.to_string()
7688 }
7689 }
7690
7691 #[derive(Clone, Debug, Deserialize, Serialize)]
7692 pub struct DecodeResponse {
7693 #[deprecated]
7694 #[serde(skip_serializing_if = "Option::is_none")]
7695 pub offer_node_id: Option<PublicKey>,
7696 #[deprecated]
7697 #[serde(skip_serializing_if = "Option::is_none")]
7698 pub warning_missing_offer_node_id: Option<String>,
7699 #[serde(skip_serializing_if = "Option::is_none")]
7700 pub amount_msat: Option<Amount>,
7701 #[serde(skip_serializing_if = "Option::is_none")]
7702 pub created_at: Option<u64>,
7703 #[serde(skip_serializing_if = "Option::is_none")]
7704 pub currency: Option<String>,
7705 #[serde(skip_serializing_if = "Option::is_none")]
7706 pub currency_minor_unit: Option<u32>,
7707 #[serde(skip_serializing_if = "Option::is_none")]
7708 pub decrypted: Option<String>,
7709 #[serde(skip_serializing_if = "Option::is_none")]
7710 pub description: Option<String>,
7711 #[serde(skip_serializing_if = "Option::is_none")]
7712 pub description_hash: Option<Sha256>,
7713 #[serde(skip_serializing_if = "Option::is_none")]
7714 pub expiry: Option<u64>,
7715 #[serde(skip_serializing_if = "Option::is_none")]
7716 pub features: Option<String>,
7717 #[serde(skip_serializing_if = "Option::is_none")]
7718 pub hex: Option<String>,
7719 #[serde(skip_serializing_if = "Option::is_none")]
7720 pub invoice_amount_msat: Option<Amount>,
7721 #[serde(skip_serializing_if = "Option::is_none")]
7722 pub invoice_created_at: Option<u64>,
7723 #[serde(skip_serializing_if = "Option::is_none")]
7724 pub invoice_features: Option<String>,
7725 #[serde(skip_serializing_if = "Option::is_none")]
7726 pub invoice_node_id: Option<PublicKey>,
7727 #[serde(skip_serializing_if = "Option::is_none")]
7728 pub invoice_payment_hash: Option<String>,
7729 #[serde(skip_serializing_if = "Option::is_none")]
7730 pub invoice_recurrence_basetime: Option<u64>,
7731 #[serde(skip_serializing_if = "Option::is_none")]
7732 pub invoice_relative_expiry: Option<u32>,
7733 #[serde(skip_serializing_if = "Option::is_none")]
7734 pub invreq_amount_msat: Option<Amount>,
7735 #[serde(skip_serializing_if = "Option::is_none")]
7736 pub invreq_bip_353_name: Option<DecodeInvreqBip353Name>,
7737 #[serde(skip_serializing_if = "Option::is_none")]
7738 pub invreq_chain: Option<String>,
7739 #[serde(skip_serializing_if = "Option::is_none")]
7740 pub invreq_features: Option<String>,
7741 #[serde(skip_serializing_if = "Option::is_none")]
7742 pub invreq_metadata: Option<String>,
7743 #[serde(skip_serializing_if = "Option::is_none")]
7744 pub invreq_payer_id: Option<String>,
7745 #[serde(skip_serializing_if = "Option::is_none")]
7746 pub invreq_payer_note: Option<String>,
7747 #[serde(skip_serializing_if = "Option::is_none")]
7748 pub invreq_quantity: Option<u64>,
7749 #[serde(skip_serializing_if = "Option::is_none")]
7750 pub invreq_recurrence_counter: Option<u32>,
7751 #[serde(skip_serializing_if = "Option::is_none")]
7752 pub invreq_recurrence_start: Option<u32>,
7753 #[serde(skip_serializing_if = "Option::is_none")]
7754 pub min_final_cltv_expiry: Option<u32>,
7755 #[serde(skip_serializing_if = "Option::is_none")]
7756 pub offer_absolute_expiry: Option<u64>,
7757 #[serde(skip_serializing_if = "Option::is_none")]
7758 pub offer_amount: Option<u64>,
7759 #[serde(skip_serializing_if = "Option::is_none")]
7760 pub offer_amount_msat: Option<Amount>,
7761 #[serde(skip_serializing_if = "Option::is_none")]
7762 pub offer_currency: Option<String>,
7763 #[serde(skip_serializing_if = "Option::is_none")]
7764 pub offer_description: Option<String>,
7765 #[serde(skip_serializing_if = "Option::is_none")]
7766 pub offer_features: Option<String>,
7767 #[serde(skip_serializing_if = "Option::is_none")]
7768 pub offer_id: Option<String>,
7769 #[serde(skip_serializing_if = "Option::is_none")]
7770 pub offer_issuer: Option<String>,
7771 #[serde(skip_serializing_if = "Option::is_none")]
7772 pub offer_issuer_id: Option<PublicKey>,
7773 #[serde(skip_serializing_if = "Option::is_none")]
7774 pub offer_metadata: Option<String>,
7775 #[serde(skip_serializing_if = "Option::is_none")]
7776 pub offer_quantity_max: Option<u64>,
7777 #[serde(skip_serializing_if = "Option::is_none")]
7778 pub payee: Option<PublicKey>,
7779 #[serde(skip_serializing_if = "Option::is_none")]
7780 pub payment_hash: Option<Sha256>,
7781 #[serde(skip_serializing_if = "Option::is_none")]
7782 pub payment_metadata: Option<String>,
7783 #[serde(skip_serializing_if = "Option::is_none")]
7784 pub payment_secret: Option<Secret>,
7785 #[serde(skip_serializing_if = "Option::is_none")]
7786 pub routes: Option<DecodeRoutehintList>,
7787 #[serde(skip_serializing_if = "Option::is_none")]
7788 pub signature: Option<String>,
7789 #[serde(skip_serializing_if = "Option::is_none")]
7790 pub string: Option<String>,
7791 #[serde(skip_serializing_if = "Option::is_none")]
7792 pub unique_id: Option<String>,
7793 #[serde(skip_serializing_if = "Option::is_none")]
7794 pub version: Option<String>,
7795 #[serde(skip_serializing_if = "Option::is_none")]
7796 pub warning_empty_blinded_path: Option<String>,
7797 #[serde(skip_serializing_if = "Option::is_none")]
7798 pub warning_invalid_invoice_request_signature: Option<String>,
7799 #[serde(skip_serializing_if = "Option::is_none")]
7800 pub warning_invalid_invoice_signature: Option<String>,
7801 #[serde(skip_serializing_if = "Option::is_none")]
7802 pub warning_invalid_invreq_payer_note: Option<String>,
7803 #[serde(skip_serializing_if = "Option::is_none")]
7804 pub warning_invalid_offer_currency: Option<String>,
7805 #[serde(skip_serializing_if = "Option::is_none")]
7806 pub warning_invalid_offer_description: Option<String>,
7807 #[serde(skip_serializing_if = "Option::is_none")]
7808 pub warning_invalid_offer_issuer: Option<String>,
7809 #[serde(skip_serializing_if = "Option::is_none")]
7810 pub warning_invreq_bip_353_name_domain_invalid: Option<String>,
7811 #[serde(skip_serializing_if = "Option::is_none")]
7812 pub warning_invreq_bip_353_name_name_invalid: Option<String>,
7813 #[serde(skip_serializing_if = "Option::is_none")]
7814 pub warning_missing_invoice_amount: Option<String>,
7815 #[serde(skip_serializing_if = "Option::is_none")]
7816 pub warning_missing_invoice_blindedpay: Option<String>,
7817 #[serde(skip_serializing_if = "Option::is_none")]
7818 pub warning_missing_invoice_created_at: Option<String>,
7819 #[serde(skip_serializing_if = "Option::is_none")]
7820 pub warning_missing_invoice_node_id: Option<String>,
7821 #[serde(skip_serializing_if = "Option::is_none")]
7822 pub warning_missing_invoice_paths: Option<String>,
7823 #[serde(skip_serializing_if = "Option::is_none")]
7824 pub warning_missing_invoice_payment_hash: Option<String>,
7825 #[serde(skip_serializing_if = "Option::is_none")]
7826 pub warning_missing_invoice_recurrence_basetime: Option<String>,
7827 #[serde(skip_serializing_if = "Option::is_none")]
7828 pub warning_missing_invoice_request_signature: Option<String>,
7829 #[serde(skip_serializing_if = "Option::is_none")]
7830 pub warning_missing_invoice_signature: Option<String>,
7831 #[serde(skip_serializing_if = "Option::is_none")]
7832 pub warning_missing_invreq_metadata: Option<String>,
7833 #[serde(skip_serializing_if = "Option::is_none")]
7834 pub warning_missing_invreq_payer_id: Option<String>,
7835 #[serde(skip_serializing_if = "Option::is_none")]
7836 pub warning_missing_offer_description: Option<String>,
7837 #[serde(skip_serializing_if = "Option::is_none")]
7838 pub warning_missing_offer_issuer_id: Option<String>,
7839 #[serde(skip_serializing_if = "Option::is_none")]
7840 pub warning_rune_invalid_utf8: Option<String>,
7841 #[serde(skip_serializing_if = "Option::is_none")]
7842 pub warning_unknown_offer_currency: Option<String>,
7843 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7844 pub extra: Option<Vec<DecodeExtra>>,
7845 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7846 pub fallbacks: Option<Vec<DecodeFallbacks>>,
7847 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7848 pub invoice_fallbacks: Option<Vec<DecodeInvoiceFallbacks>>,
7849 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7850 pub invreq_paths: Option<Vec<DecodeInvreqPaths>>,
7851 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7852 pub offer_chains: Option<Vec<Sha256>>,
7853 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7854 pub offer_paths: Option<Vec<DecodeOfferPaths>>,
7855 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
7856 pub restrictions: Option<Vec<DecodeRestrictions>>,
7857 #[serde(rename = "type")]
7859 pub item_type: DecodeType,
7860 pub valid: bool,
7861 }
7862
7863 impl TryFrom<Response> for DecodeResponse {
7864 type Error = super::TryFromResponseError;
7865
7866 fn try_from(response: Response) -> Result<Self, Self::Error> {
7867 match response {
7868 Response::Decode(response) => Ok(response),
7869 _ => Err(TryFromResponseError)
7870 }
7871 }
7872 }
7873
7874 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
7876 #[allow(non_camel_case_types)]
7877 pub enum DelpayPaymentsStatus {
7878 #[serde(rename = "pending")]
7879 PENDING = 0,
7880 #[serde(rename = "failed")]
7881 FAILED = 1,
7882 #[serde(rename = "complete")]
7883 COMPLETE = 2,
7884 }
7885
7886 impl TryFrom<i32> for DelpayPaymentsStatus {
7887 type Error = anyhow::Error;
7888 fn try_from(c: i32) -> Result<DelpayPaymentsStatus, anyhow::Error> {
7889 match c {
7890 0 => Ok(DelpayPaymentsStatus::PENDING),
7891 1 => Ok(DelpayPaymentsStatus::FAILED),
7892 2 => Ok(DelpayPaymentsStatus::COMPLETE),
7893 o => Err(anyhow::anyhow!("Unknown variant {} for enum DelpayPaymentsStatus", o)),
7894 }
7895 }
7896 }
7897
7898 impl ToString for DelpayPaymentsStatus {
7899 fn to_string(&self) -> String {
7900 match self {
7901 DelpayPaymentsStatus::PENDING => "PENDING",
7902 DelpayPaymentsStatus::FAILED => "FAILED",
7903 DelpayPaymentsStatus::COMPLETE => "COMPLETE",
7904 }.to_string()
7905 }
7906 }
7907
7908 #[derive(Clone, Debug, Deserialize, Serialize)]
7909 pub struct DelpayPayments {
7910 #[serde(skip_serializing_if = "Option::is_none")]
7911 pub amount_msat: Option<Amount>,
7912 #[serde(skip_serializing_if = "Option::is_none")]
7913 pub bolt11: Option<String>,
7914 #[serde(skip_serializing_if = "Option::is_none")]
7915 pub bolt12: Option<String>,
7916 #[serde(skip_serializing_if = "Option::is_none")]
7917 pub completed_at: Option<u64>,
7918 #[serde(skip_serializing_if = "Option::is_none")]
7919 pub created_index: Option<u64>,
7920 #[serde(skip_serializing_if = "Option::is_none")]
7921 pub destination: Option<PublicKey>,
7922 #[serde(skip_serializing_if = "Option::is_none")]
7923 pub erroronion: Option<String>,
7924 #[serde(skip_serializing_if = "Option::is_none")]
7925 pub groupid: Option<u64>,
7926 #[serde(skip_serializing_if = "Option::is_none")]
7927 pub label: Option<String>,
7928 #[serde(skip_serializing_if = "Option::is_none")]
7929 pub partid: Option<u64>,
7930 #[serde(skip_serializing_if = "Option::is_none")]
7931 pub payment_preimage: Option<Secret>,
7932 #[serde(skip_serializing_if = "Option::is_none")]
7933 pub updated_index: Option<u64>,
7934 pub status: DelpayPaymentsStatus,
7936 pub amount_sent_msat: Amount,
7937 pub created_at: u64,
7938 pub id: u64,
7939 pub payment_hash: Sha256,
7940 }
7941
7942 #[derive(Clone, Debug, Deserialize, Serialize)]
7943 pub struct DelpayResponse {
7944 pub payments: Vec<DelpayPayments>,
7945 }
7946
7947 impl TryFrom<Response> for DelpayResponse {
7948 type Error = super::TryFromResponseError;
7949
7950 fn try_from(response: Response) -> Result<Self, Self::Error> {
7951 match response {
7952 Response::DelPay(response) => Ok(response),
7953 _ => Err(TryFromResponseError)
7954 }
7955 }
7956 }
7957
7958 #[derive(Clone, Debug, Deserialize, Serialize)]
7959 pub struct DelforwardResponse {
7960 }
7961
7962 impl TryFrom<Response> for DelforwardResponse {
7963 type Error = super::TryFromResponseError;
7964
7965 fn try_from(response: Response) -> Result<Self, Self::Error> {
7966 match response {
7967 Response::DelForward(response) => Ok(response),
7968 _ => Err(TryFromResponseError)
7969 }
7970 }
7971 }
7972
7973 #[derive(Clone, Debug, Deserialize, Serialize)]
7974 pub struct DisableofferResponse {
7975 #[serde(skip_serializing_if = "Option::is_none")]
7976 pub label: Option<String>,
7977 pub active: bool,
7978 pub bolt12: String,
7979 pub offer_id: Sha256,
7980 pub single_use: bool,
7981 pub used: bool,
7982 }
7983
7984 impl TryFrom<Response> for DisableofferResponse {
7985 type Error = super::TryFromResponseError;
7986
7987 fn try_from(response: Response) -> Result<Self, Self::Error> {
7988 match response {
7989 Response::DisableOffer(response) => Ok(response),
7990 _ => Err(TryFromResponseError)
7991 }
7992 }
7993 }
7994
7995 #[derive(Clone, Debug, Deserialize, Serialize)]
7996 pub struct EnableofferResponse {
7997 #[serde(skip_serializing_if = "Option::is_none")]
7998 pub label: Option<String>,
7999 pub active: bool,
8000 pub bolt12: String,
8001 pub offer_id: Sha256,
8002 pub single_use: bool,
8003 pub used: bool,
8004 }
8005
8006 impl TryFrom<Response> for EnableofferResponse {
8007 type Error = super::TryFromResponseError;
8008
8009 fn try_from(response: Response) -> Result<Self, Self::Error> {
8010 match response {
8011 Response::EnableOffer(response) => Ok(response),
8012 _ => Err(TryFromResponseError)
8013 }
8014 }
8015 }
8016
8017 #[derive(Clone, Debug, Deserialize, Serialize)]
8018 pub struct DisconnectResponse {
8019 }
8020
8021 impl TryFrom<Response> for DisconnectResponse {
8022 type Error = super::TryFromResponseError;
8023
8024 fn try_from(response: Response) -> Result<Self, Self::Error> {
8025 match response {
8026 Response::Disconnect(response) => Ok(response),
8027 _ => Err(TryFromResponseError)
8028 }
8029 }
8030 }
8031
8032 #[derive(Clone, Debug, Deserialize, Serialize)]
8033 pub struct FeeratesOnchainFeeEstimates {
8034 #[serde(skip_serializing_if = "Option::is_none")]
8035 pub unilateral_close_nonanchor_satoshis: Option<u64>,
8036 pub htlc_success_satoshis: u64,
8037 pub htlc_timeout_satoshis: u64,
8038 pub mutual_close_satoshis: u64,
8039 pub opening_channel_satoshis: u64,
8040 pub unilateral_close_satoshis: u64,
8041 }
8042
8043 #[derive(Clone, Debug, Deserialize, Serialize)]
8044 pub struct FeeratesPerkbEstimates {
8045 pub blockcount: u32,
8046 pub feerate: u32,
8047 pub smoothed_feerate: u32,
8048 }
8049
8050 #[derive(Clone, Debug, Deserialize, Serialize)]
8051 pub struct FeeratesPerkb {
8052 #[deprecated]
8053 #[serde(skip_serializing_if = "Option::is_none")]
8054 pub delayed_to_us: Option<u32>,
8055 #[deprecated]
8056 #[serde(skip_serializing_if = "Option::is_none")]
8057 pub htlc_resolution: Option<u32>,
8058 #[serde(skip_serializing_if = "Option::is_none")]
8059 pub floor: Option<u32>,
8060 #[serde(skip_serializing_if = "Option::is_none")]
8061 pub mutual_close: Option<u32>,
8062 #[serde(skip_serializing_if = "Option::is_none")]
8063 pub opening: Option<u32>,
8064 #[serde(skip_serializing_if = "Option::is_none")]
8065 pub penalty: Option<u32>,
8066 #[serde(skip_serializing_if = "Option::is_none")]
8067 pub unilateral_anchor_close: Option<u32>,
8068 #[serde(skip_serializing_if = "Option::is_none")]
8069 pub unilateral_close: Option<u32>,
8070 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
8071 pub estimates: Option<Vec<FeeratesPerkbEstimates>>,
8072 pub max_acceptable: u32,
8073 pub min_acceptable: u32,
8074 }
8075
8076 #[derive(Clone, Debug, Deserialize, Serialize)]
8077 pub struct FeeratesPerkwEstimates {
8078 pub blockcount: u32,
8079 pub feerate: u32,
8080 pub smoothed_feerate: u32,
8081 }
8082
8083 #[derive(Clone, Debug, Deserialize, Serialize)]
8084 pub struct FeeratesPerkw {
8085 #[deprecated]
8086 #[serde(skip_serializing_if = "Option::is_none")]
8087 pub delayed_to_us: Option<u32>,
8088 #[deprecated]
8089 #[serde(skip_serializing_if = "Option::is_none")]
8090 pub htlc_resolution: Option<u32>,
8091 #[serde(skip_serializing_if = "Option::is_none")]
8092 pub floor: Option<u32>,
8093 #[serde(skip_serializing_if = "Option::is_none")]
8094 pub mutual_close: Option<u32>,
8095 #[serde(skip_serializing_if = "Option::is_none")]
8096 pub opening: Option<u32>,
8097 #[serde(skip_serializing_if = "Option::is_none")]
8098 pub penalty: Option<u32>,
8099 #[serde(skip_serializing_if = "Option::is_none")]
8100 pub unilateral_anchor_close: Option<u32>,
8101 #[serde(skip_serializing_if = "Option::is_none")]
8102 pub unilateral_close: Option<u32>,
8103 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
8104 pub estimates: Option<Vec<FeeratesPerkwEstimates>>,
8105 pub max_acceptable: u32,
8106 pub min_acceptable: u32,
8107 }
8108
8109 #[derive(Clone, Debug, Deserialize, Serialize)]
8110 pub struct FeeratesResponse {
8111 #[serde(skip_serializing_if = "Option::is_none")]
8112 pub onchain_fee_estimates: Option<FeeratesOnchainFeeEstimates>,
8113 #[serde(skip_serializing_if = "Option::is_none")]
8114 pub perkb: Option<FeeratesPerkb>,
8115 #[serde(skip_serializing_if = "Option::is_none")]
8116 pub perkw: Option<FeeratesPerkw>,
8117 #[serde(skip_serializing_if = "Option::is_none")]
8118 pub warning_missing_feerates: Option<String>,
8119 }
8120
8121 impl TryFrom<Response> for FeeratesResponse {
8122 type Error = super::TryFromResponseError;
8123
8124 fn try_from(response: Response) -> Result<Self, Self::Error> {
8125 match response {
8126 Response::Feerates(response) => Ok(response),
8127 _ => Err(TryFromResponseError)
8128 }
8129 }
8130 }
8131
8132 #[derive(Clone, Debug, Deserialize, Serialize)]
8133 pub struct Fetchbip353Instructions {
8134 #[serde(skip_serializing_if = "Option::is_none")]
8135 pub description: Option<String>,
8136 #[serde(skip_serializing_if = "Option::is_none")]
8137 pub offchain_amount_msat: Option<u64>,
8138 #[serde(skip_serializing_if = "Option::is_none")]
8139 pub offer: Option<String>,
8140 #[serde(skip_serializing_if = "Option::is_none")]
8141 pub onchain: Option<String>,
8142 #[serde(skip_serializing_if = "Option::is_none")]
8143 pub onchain_amount_sat: Option<u64>,
8144 }
8145
8146 #[derive(Clone, Debug, Deserialize, Serialize)]
8147 pub struct Fetchbip353Response {
8148 pub instructions: Vec<Fetchbip353Instructions>,
8149 pub proof: String,
8150 }
8151
8152 impl TryFrom<Response> for Fetchbip353Response {
8153 type Error = super::TryFromResponseError;
8154
8155 fn try_from(response: Response) -> Result<Self, Self::Error> {
8156 match response {
8157 Response::FetchBip353(response) => Ok(response),
8158 _ => Err(TryFromResponseError)
8159 }
8160 }
8161 }
8162
8163 #[derive(Clone, Debug, Deserialize, Serialize)]
8164 pub struct FetchinvoiceNextPeriod {
8165 pub counter: u64,
8166 pub endtime: u64,
8167 pub paywindow_end: u64,
8168 pub paywindow_start: u64,
8169 pub starttime: u64,
8170 }
8171
8172 #[derive(Clone, Debug, Deserialize, Serialize)]
8173 pub struct FetchinvoiceChanges {
8174 #[serde(skip_serializing_if = "Option::is_none")]
8175 pub amount_msat: Option<Amount>,
8176 #[serde(skip_serializing_if = "Option::is_none")]
8177 pub description: Option<String>,
8178 #[serde(skip_serializing_if = "Option::is_none")]
8179 pub description_appended: Option<String>,
8180 #[serde(skip_serializing_if = "Option::is_none")]
8181 pub vendor: Option<String>,
8182 #[serde(skip_serializing_if = "Option::is_none")]
8183 pub vendor_removed: Option<String>,
8184 }
8185
8186 #[derive(Clone, Debug, Deserialize, Serialize)]
8187 pub struct FetchinvoiceResponse {
8188 #[serde(skip_serializing_if = "Option::is_none")]
8189 pub next_period: Option<FetchinvoiceNextPeriod>,
8190 pub changes: FetchinvoiceChanges,
8191 pub invoice: String,
8192 }
8193
8194 impl TryFrom<Response> for FetchinvoiceResponse {
8195 type Error = super::TryFromResponseError;
8196
8197 fn try_from(response: Response) -> Result<Self, Self::Error> {
8198 match response {
8199 Response::FetchInvoice(response) => Ok(response),
8200 _ => Err(TryFromResponseError)
8201 }
8202 }
8203 }
8204
8205 #[derive(Clone, Debug, Deserialize, Serialize)]
8206 pub struct FundchannelCancelResponse {
8207 pub cancelled: String,
8208 }
8209
8210 impl TryFrom<Response> for FundchannelCancelResponse {
8211 type Error = super::TryFromResponseError;
8212
8213 fn try_from(response: Response) -> Result<Self, Self::Error> {
8214 match response {
8215 Response::FundChannelCancel(response) => Ok(response),
8216 _ => Err(TryFromResponseError)
8217 }
8218 }
8219 }
8220
8221 #[derive(Clone, Debug, Deserialize, Serialize)]
8222 pub struct FundchannelCompleteResponse {
8223 pub channel_id: Sha256,
8224 pub commitments_secured: bool,
8225 }
8226
8227 impl TryFrom<Response> for FundchannelCompleteResponse {
8228 type Error = super::TryFromResponseError;
8229
8230 fn try_from(response: Response) -> Result<Self, Self::Error> {
8231 match response {
8232 Response::FundChannelComplete(response) => Ok(response),
8233 _ => Err(TryFromResponseError)
8234 }
8235 }
8236 }
8237
8238 #[derive(Clone, Debug, Deserialize, Serialize)]
8239 pub struct FundchannelChannelType {
8240 pub bits: Vec<u32>,
8241 pub names: Vec<ChannelTypeName>,
8242 }
8243
8244 #[derive(Clone, Debug, Deserialize, Serialize)]
8245 pub struct FundchannelResponse {
8246 #[serde(skip_serializing_if = "Option::is_none")]
8247 pub channel_type: Option<FundchannelChannelType>,
8248 #[serde(skip_serializing_if = "Option::is_none")]
8249 pub close_to: Option<String>,
8250 #[serde(skip_serializing_if = "Option::is_none")]
8251 pub mindepth: Option<u32>,
8252 pub channel_id: Sha256,
8253 pub outnum: u32,
8254 pub tx: String,
8255 pub txid: String,
8256 }
8257
8258 impl TryFrom<Response> for FundchannelResponse {
8259 type Error = super::TryFromResponseError;
8260
8261 fn try_from(response: Response) -> Result<Self, Self::Error> {
8262 match response {
8263 Response::FundChannel(response) => Ok(response),
8264 _ => Err(TryFromResponseError)
8265 }
8266 }
8267 }
8268
8269 #[derive(Clone, Debug, Deserialize, Serialize)]
8270 pub struct FundchannelStartChannelType {
8271 pub bits: Vec<u32>,
8272 pub names: Vec<ChannelTypeName>,
8273 }
8274
8275 #[derive(Clone, Debug, Deserialize, Serialize)]
8276 pub struct FundchannelStartResponse {
8277 #[serde(skip_serializing_if = "Option::is_none")]
8278 pub channel_type: Option<FundchannelStartChannelType>,
8279 #[serde(skip_serializing_if = "Option::is_none")]
8280 pub close_to: Option<String>,
8281 #[serde(skip_serializing_if = "Option::is_none")]
8282 pub mindepth: Option<u32>,
8283 pub funding_address: String,
8284 pub scriptpubkey: String,
8285 pub warning_usage: String,
8286 }
8287
8288 impl TryFrom<Response> for FundchannelStartResponse {
8289 type Error = super::TryFromResponseError;
8290
8291 fn try_from(response: Response) -> Result<Self, Self::Error> {
8292 match response {
8293 Response::FundChannelStart(response) => Ok(response),
8294 _ => Err(TryFromResponseError)
8295 }
8296 }
8297 }
8298
8299 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8300 #[allow(non_camel_case_types)]
8301 pub enum GetlogLogType {
8302 #[serde(rename = "SKIPPED")]
8303 SKIPPED = 0,
8304 #[serde(rename = "BROKEN")]
8305 BROKEN = 1,
8306 #[serde(rename = "UNUSUAL")]
8307 UNUSUAL = 2,
8308 #[serde(rename = "INFO")]
8309 INFO = 3,
8310 #[serde(rename = "DEBUG")]
8311 DEBUG = 4,
8312 #[serde(rename = "IO_IN")]
8313 IO_IN = 5,
8314 #[serde(rename = "IO_OUT")]
8315 IO_OUT = 6,
8316 #[serde(rename = "TRACE")]
8317 TRACE = 7,
8318 }
8319
8320 impl TryFrom<i32> for GetlogLogType {
8321 type Error = anyhow::Error;
8322 fn try_from(c: i32) -> Result<GetlogLogType, anyhow::Error> {
8323 match c {
8324 0 => Ok(GetlogLogType::SKIPPED),
8325 1 => Ok(GetlogLogType::BROKEN),
8326 2 => Ok(GetlogLogType::UNUSUAL),
8327 3 => Ok(GetlogLogType::INFO),
8328 4 => Ok(GetlogLogType::DEBUG),
8329 5 => Ok(GetlogLogType::IO_IN),
8330 6 => Ok(GetlogLogType::IO_OUT),
8331 7 => Ok(GetlogLogType::TRACE),
8332 o => Err(anyhow::anyhow!("Unknown variant {} for enum GetlogLogType", o)),
8333 }
8334 }
8335 }
8336
8337 impl ToString for GetlogLogType {
8338 fn to_string(&self) -> String {
8339 match self {
8340 GetlogLogType::SKIPPED => "SKIPPED",
8341 GetlogLogType::BROKEN => "BROKEN",
8342 GetlogLogType::UNUSUAL => "UNUSUAL",
8343 GetlogLogType::INFO => "INFO",
8344 GetlogLogType::DEBUG => "DEBUG",
8345 GetlogLogType::TRACE => "TRACE",
8346 GetlogLogType::IO_IN => "IO_IN",
8347 GetlogLogType::IO_OUT => "IO_OUT",
8348 }.to_string()
8349 }
8350 }
8351
8352 #[derive(Clone, Debug, Deserialize, Serialize)]
8353 pub struct GetlogLog {
8354 #[serde(skip_serializing_if = "Option::is_none")]
8355 pub data: Option<String>,
8356 #[serde(skip_serializing_if = "Option::is_none")]
8357 pub log: Option<String>,
8358 #[serde(skip_serializing_if = "Option::is_none")]
8359 pub node_id: Option<PublicKey>,
8360 #[serde(skip_serializing_if = "Option::is_none")]
8361 pub num_skipped: Option<u32>,
8362 #[serde(skip_serializing_if = "Option::is_none")]
8363 pub source: Option<String>,
8364 #[serde(skip_serializing_if = "Option::is_none")]
8365 pub time: Option<String>,
8366 #[serde(rename = "type")]
8368 pub item_type: GetlogLogType,
8369 }
8370
8371 #[derive(Clone, Debug, Deserialize, Serialize)]
8372 pub struct GetlogResponse {
8373 pub bytes_max: u32,
8374 pub bytes_used: u32,
8375 pub created_at: String,
8376 pub log: Vec<GetlogLog>,
8377 }
8378
8379 impl TryFrom<Response> for GetlogResponse {
8380 type Error = super::TryFromResponseError;
8381
8382 fn try_from(response: Response) -> Result<Self, Self::Error> {
8383 match response {
8384 Response::GetLog(response) => Ok(response),
8385 _ => Err(TryFromResponseError)
8386 }
8387 }
8388 }
8389
8390 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8392 #[allow(non_camel_case_types)]
8393 pub enum FunderupdatePolicy {
8394 #[serde(rename = "match")]
8395 MATCH = 0,
8396 #[serde(rename = "available")]
8397 AVAILABLE = 1,
8398 #[serde(rename = "fixed")]
8399 FIXED = 2,
8400 }
8401
8402 impl TryFrom<i32> for FunderupdatePolicy {
8403 type Error = anyhow::Error;
8404 fn try_from(c: i32) -> Result<FunderupdatePolicy, anyhow::Error> {
8405 match c {
8406 0 => Ok(FunderupdatePolicy::MATCH),
8407 1 => Ok(FunderupdatePolicy::AVAILABLE),
8408 2 => Ok(FunderupdatePolicy::FIXED),
8409 o => Err(anyhow::anyhow!("Unknown variant {} for enum FunderupdatePolicy", o)),
8410 }
8411 }
8412 }
8413
8414 impl ToString for FunderupdatePolicy {
8415 fn to_string(&self) -> String {
8416 match self {
8417 FunderupdatePolicy::MATCH => "MATCH",
8418 FunderupdatePolicy::AVAILABLE => "AVAILABLE",
8419 FunderupdatePolicy::FIXED => "FIXED",
8420 }.to_string()
8421 }
8422 }
8423
8424 #[derive(Clone, Debug, Deserialize, Serialize)]
8425 pub struct FunderupdateResponse {
8426 #[serde(skip_serializing_if = "Option::is_none")]
8427 pub channel_fee_max_base_msat: Option<Amount>,
8428 #[serde(skip_serializing_if = "Option::is_none")]
8429 pub channel_fee_max_proportional_thousandths: Option<u32>,
8430 #[serde(skip_serializing_if = "Option::is_none")]
8431 pub compact_lease: Option<String>,
8432 #[serde(skip_serializing_if = "Option::is_none")]
8433 pub funding_weight: Option<u32>,
8434 #[serde(skip_serializing_if = "Option::is_none")]
8435 pub lease_fee_base_msat: Option<Amount>,
8436 #[serde(skip_serializing_if = "Option::is_none")]
8437 pub lease_fee_basis: Option<u32>,
8438 pub policy: FunderupdatePolicy,
8440 pub fund_probability: u32,
8441 pub fuzz_percent: u32,
8442 pub leases_only: bool,
8443 pub max_their_funding_msat: Amount,
8444 pub min_their_funding_msat: Amount,
8445 pub per_channel_max_msat: Amount,
8446 pub per_channel_min_msat: Amount,
8447 pub policy_mod: u32,
8448 pub reserve_tank_msat: Amount,
8449 pub summary: String,
8450 }
8451
8452 impl TryFrom<Response> for FunderupdateResponse {
8453 type Error = super::TryFromResponseError;
8454
8455 fn try_from(response: Response) -> Result<Self, Self::Error> {
8456 match response {
8457 Response::FunderUpdate(response) => Ok(response),
8458 _ => Err(TryFromResponseError)
8459 }
8460 }
8461 }
8462
8463 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8465 #[allow(non_camel_case_types)]
8466 pub enum GetrouteRouteStyle {
8467 #[serde(rename = "tlv")]
8468 TLV = 0,
8469 }
8470
8471 impl TryFrom<i32> for GetrouteRouteStyle {
8472 type Error = anyhow::Error;
8473 fn try_from(c: i32) -> Result<GetrouteRouteStyle, anyhow::Error> {
8474 match c {
8475 0 => Ok(GetrouteRouteStyle::TLV),
8476 o => Err(anyhow::anyhow!("Unknown variant {} for enum GetrouteRouteStyle", o)),
8477 }
8478 }
8479 }
8480
8481 impl ToString for GetrouteRouteStyle {
8482 fn to_string(&self) -> String {
8483 match self {
8484 GetrouteRouteStyle::TLV => "TLV",
8485 }.to_string()
8486 }
8487 }
8488
8489 #[derive(Clone, Debug, Deserialize, Serialize)]
8490 pub struct GetrouteRoute {
8491 pub style: GetrouteRouteStyle,
8493 pub amount_msat: Amount,
8494 pub channel: ShortChannelId,
8495 pub delay: u32,
8496 pub direction: u32,
8497 pub id: PublicKey,
8498 }
8499
8500 #[derive(Clone, Debug, Deserialize, Serialize)]
8501 pub struct GetrouteResponse {
8502 pub route: Vec<GetrouteRoute>,
8503 }
8504
8505 impl TryFrom<Response> for GetrouteResponse {
8506 type Error = super::TryFromResponseError;
8507
8508 fn try_from(response: Response) -> Result<Self, Self::Error> {
8509 match response {
8510 Response::GetRoute(response) => Ok(response),
8511 _ => Err(TryFromResponseError)
8512 }
8513 }
8514 }
8515
8516 #[derive(Clone, Debug, Deserialize, Serialize)]
8517 pub struct ListaddressesAddresses {
8518 #[serde(skip_serializing_if = "Option::is_none")]
8519 pub bech32: Option<String>,
8520 #[serde(skip_serializing_if = "Option::is_none")]
8521 pub p2tr: Option<String>,
8522 pub keyidx: u64,
8523 }
8524
8525 #[derive(Clone, Debug, Deserialize, Serialize)]
8526 pub struct ListaddressesResponse {
8527 pub addresses: Vec<ListaddressesAddresses>,
8528 }
8529
8530 impl TryFrom<Response> for ListaddressesResponse {
8531 type Error = super::TryFromResponseError;
8532
8533 fn try_from(response: Response) -> Result<Self, Self::Error> {
8534 match response {
8535 Response::ListAddresses(response) => Ok(response),
8536 _ => Err(TryFromResponseError)
8537 }
8538 }
8539 }
8540
8541 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8543 #[allow(non_camel_case_types)]
8544 pub enum ListforwardsForwardsStyle {
8545 #[serde(rename = "legacy")]
8546 LEGACY = 0,
8547 #[serde(rename = "tlv")]
8548 TLV = 1,
8549 }
8550
8551 impl TryFrom<i32> for ListforwardsForwardsStyle {
8552 type Error = anyhow::Error;
8553 fn try_from(c: i32) -> Result<ListforwardsForwardsStyle, anyhow::Error> {
8554 match c {
8555 0 => Ok(ListforwardsForwardsStyle::LEGACY),
8556 1 => Ok(ListforwardsForwardsStyle::TLV),
8557 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListforwardsForwardsStyle", o)),
8558 }
8559 }
8560 }
8561
8562 impl ToString for ListforwardsForwardsStyle {
8563 fn to_string(&self) -> String {
8564 match self {
8565 ListforwardsForwardsStyle::LEGACY => "LEGACY",
8566 ListforwardsForwardsStyle::TLV => "TLV",
8567 }.to_string()
8568 }
8569 }
8570
8571 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8573 #[allow(non_camel_case_types)]
8574 pub enum ListforwardsForwardsStatus {
8575 #[serde(rename = "offered")]
8576 OFFERED = 0,
8577 #[serde(rename = "settled")]
8578 SETTLED = 1,
8579 #[serde(rename = "local_failed")]
8580 LOCAL_FAILED = 2,
8581 #[serde(rename = "failed")]
8582 FAILED = 3,
8583 }
8584
8585 impl TryFrom<i32> for ListforwardsForwardsStatus {
8586 type Error = anyhow::Error;
8587 fn try_from(c: i32) -> Result<ListforwardsForwardsStatus, anyhow::Error> {
8588 match c {
8589 0 => Ok(ListforwardsForwardsStatus::OFFERED),
8590 1 => Ok(ListforwardsForwardsStatus::SETTLED),
8591 2 => Ok(ListforwardsForwardsStatus::LOCAL_FAILED),
8592 3 => Ok(ListforwardsForwardsStatus::FAILED),
8593 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListforwardsForwardsStatus", o)),
8594 }
8595 }
8596 }
8597
8598 impl ToString for ListforwardsForwardsStatus {
8599 fn to_string(&self) -> String {
8600 match self {
8601 ListforwardsForwardsStatus::OFFERED => "OFFERED",
8602 ListforwardsForwardsStatus::SETTLED => "SETTLED",
8603 ListforwardsForwardsStatus::LOCAL_FAILED => "LOCAL_FAILED",
8604 ListforwardsForwardsStatus::FAILED => "FAILED",
8605 }.to_string()
8606 }
8607 }
8608
8609 #[derive(Clone, Debug, Deserialize, Serialize)]
8610 pub struct ListforwardsForwards {
8611 #[serde(skip_serializing_if = "Option::is_none")]
8612 pub created_index: Option<u64>,
8613 #[serde(skip_serializing_if = "Option::is_none")]
8614 pub failcode: Option<u32>,
8615 #[serde(skip_serializing_if = "Option::is_none")]
8616 pub failreason: Option<String>,
8617 #[serde(skip_serializing_if = "Option::is_none")]
8618 pub fee_msat: Option<Amount>,
8619 #[serde(skip_serializing_if = "Option::is_none")]
8620 pub in_htlc_id: Option<u64>,
8621 #[serde(skip_serializing_if = "Option::is_none")]
8622 pub out_channel: Option<ShortChannelId>,
8623 #[serde(skip_serializing_if = "Option::is_none")]
8624 pub out_htlc_id: Option<u64>,
8625 #[serde(skip_serializing_if = "Option::is_none")]
8626 pub out_msat: Option<Amount>,
8627 #[serde(skip_serializing_if = "Option::is_none")]
8628 pub resolved_time: Option<f64>,
8629 #[serde(skip_serializing_if = "Option::is_none")]
8630 pub style: Option<ListforwardsForwardsStyle>,
8631 #[serde(skip_serializing_if = "Option::is_none")]
8632 pub updated_index: Option<u64>,
8633 pub status: ListforwardsForwardsStatus,
8635 pub in_channel: ShortChannelId,
8636 pub in_msat: Amount,
8637 pub received_time: f64,
8638 }
8639
8640 #[derive(Clone, Debug, Deserialize, Serialize)]
8641 pub struct ListforwardsResponse {
8642 pub forwards: Vec<ListforwardsForwards>,
8643 }
8644
8645 impl TryFrom<Response> for ListforwardsResponse {
8646 type Error = super::TryFromResponseError;
8647
8648 fn try_from(response: Response) -> Result<Self, Self::Error> {
8649 match response {
8650 Response::ListForwards(response) => Ok(response),
8651 _ => Err(TryFromResponseError)
8652 }
8653 }
8654 }
8655
8656 #[derive(Clone, Debug, Deserialize, Serialize)]
8657 pub struct ListoffersOffers {
8658 #[serde(skip_serializing_if = "Option::is_none")]
8659 pub label: Option<String>,
8660 pub active: bool,
8661 pub bolt12: String,
8662 pub offer_id: Sha256,
8663 pub single_use: bool,
8664 pub used: bool,
8665 }
8666
8667 #[derive(Clone, Debug, Deserialize, Serialize)]
8668 pub struct ListoffersResponse {
8669 pub offers: Vec<ListoffersOffers>,
8670 }
8671
8672 impl TryFrom<Response> for ListoffersResponse {
8673 type Error = super::TryFromResponseError;
8674
8675 fn try_from(response: Response) -> Result<Self, Self::Error> {
8676 match response {
8677 Response::ListOffers(response) => Ok(response),
8678 _ => Err(TryFromResponseError)
8679 }
8680 }
8681 }
8682
8683 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8685 #[allow(non_camel_case_types)]
8686 pub enum ListpaysPaysStatus {
8687 #[serde(rename = "pending")]
8688 PENDING = 0,
8689 #[serde(rename = "failed")]
8690 FAILED = 1,
8691 #[serde(rename = "complete")]
8692 COMPLETE = 2,
8693 }
8694
8695 impl TryFrom<i32> for ListpaysPaysStatus {
8696 type Error = anyhow::Error;
8697 fn try_from(c: i32) -> Result<ListpaysPaysStatus, anyhow::Error> {
8698 match c {
8699 0 => Ok(ListpaysPaysStatus::PENDING),
8700 1 => Ok(ListpaysPaysStatus::FAILED),
8701 2 => Ok(ListpaysPaysStatus::COMPLETE),
8702 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpaysPaysStatus", o)),
8703 }
8704 }
8705 }
8706
8707 impl ToString for ListpaysPaysStatus {
8708 fn to_string(&self) -> String {
8709 match self {
8710 ListpaysPaysStatus::PENDING => "PENDING",
8711 ListpaysPaysStatus::FAILED => "FAILED",
8712 ListpaysPaysStatus::COMPLETE => "COMPLETE",
8713 }.to_string()
8714 }
8715 }
8716
8717 #[derive(Clone, Debug, Deserialize, Serialize)]
8718 pub struct ListpaysPays {
8719 #[serde(skip_serializing_if = "Option::is_none")]
8720 pub amount_msat: Option<Amount>,
8721 #[serde(skip_serializing_if = "Option::is_none")]
8722 pub amount_sent_msat: Option<Amount>,
8723 #[serde(skip_serializing_if = "Option::is_none")]
8724 pub bolt11: Option<String>,
8725 #[serde(skip_serializing_if = "Option::is_none")]
8726 pub bolt12: Option<String>,
8727 #[serde(skip_serializing_if = "Option::is_none")]
8728 pub completed_at: Option<u64>,
8729 #[serde(skip_serializing_if = "Option::is_none")]
8730 pub created_index: Option<u64>,
8731 #[serde(skip_serializing_if = "Option::is_none")]
8732 pub description: Option<String>,
8733 #[serde(skip_serializing_if = "Option::is_none")]
8734 pub destination: Option<PublicKey>,
8735 #[serde(skip_serializing_if = "Option::is_none")]
8736 pub erroronion: Option<String>,
8737 #[serde(skip_serializing_if = "Option::is_none")]
8738 pub label: Option<String>,
8739 #[serde(skip_serializing_if = "Option::is_none")]
8740 pub number_of_parts: Option<u64>,
8741 #[serde(skip_serializing_if = "Option::is_none")]
8742 pub preimage: Option<Secret>,
8743 #[serde(skip_serializing_if = "Option::is_none")]
8744 pub updated_index: Option<u64>,
8745 pub status: ListpaysPaysStatus,
8747 pub created_at: u64,
8748 pub payment_hash: Sha256,
8749 }
8750
8751 #[derive(Clone, Debug, Deserialize, Serialize)]
8752 pub struct ListpaysResponse {
8753 pub pays: Vec<ListpaysPays>,
8754 }
8755
8756 impl TryFrom<Response> for ListpaysResponse {
8757 type Error = super::TryFromResponseError;
8758
8759 fn try_from(response: Response) -> Result<Self, Self::Error> {
8760 match response {
8761 Response::ListPays(response) => Ok(response),
8762 _ => Err(TryFromResponseError)
8763 }
8764 }
8765 }
8766
8767 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8769 #[allow(non_camel_case_types)]
8770 pub enum ListhtlcsHtlcsDirection {
8771 #[serde(rename = "out")]
8772 OUT = 0,
8773 #[serde(rename = "in")]
8774 IN = 1,
8775 }
8776
8777 impl TryFrom<i32> for ListhtlcsHtlcsDirection {
8778 type Error = anyhow::Error;
8779 fn try_from(c: i32) -> Result<ListhtlcsHtlcsDirection, anyhow::Error> {
8780 match c {
8781 0 => Ok(ListhtlcsHtlcsDirection::OUT),
8782 1 => Ok(ListhtlcsHtlcsDirection::IN),
8783 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListhtlcsHtlcsDirection", o)),
8784 }
8785 }
8786 }
8787
8788 impl ToString for ListhtlcsHtlcsDirection {
8789 fn to_string(&self) -> String {
8790 match self {
8791 ListhtlcsHtlcsDirection::OUT => "OUT",
8792 ListhtlcsHtlcsDirection::IN => "IN",
8793 }.to_string()
8794 }
8795 }
8796
8797 #[derive(Clone, Debug, Deserialize, Serialize)]
8798 pub struct ListhtlcsHtlcs {
8799 #[serde(skip_serializing_if = "Option::is_none")]
8800 pub created_index: Option<u64>,
8801 #[serde(skip_serializing_if = "Option::is_none")]
8802 pub updated_index: Option<u64>,
8803 pub direction: ListhtlcsHtlcsDirection,
8805 pub state: HtlcState,
8807 pub amount_msat: Amount,
8808 pub expiry: u32,
8809 pub id: u64,
8810 pub payment_hash: Sha256,
8811 pub short_channel_id: ShortChannelId,
8812 }
8813
8814 #[derive(Clone, Debug, Deserialize, Serialize)]
8815 pub struct ListhtlcsResponse {
8816 pub htlcs: Vec<ListhtlcsHtlcs>,
8817 }
8818
8819 impl TryFrom<Response> for ListhtlcsResponse {
8820 type Error = super::TryFromResponseError;
8821
8822 fn try_from(response: Response) -> Result<Self, Self::Error> {
8823 match response {
8824 Response::ListHtlcs(response) => Ok(response),
8825 _ => Err(TryFromResponseError)
8826 }
8827 }
8828 }
8829
8830 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
8832 #[allow(non_camel_case_types)]
8833 pub enum MultifundchannelFailedMethod {
8834 #[serde(rename = "connect")]
8835 CONNECT = 0,
8836 #[serde(rename = "openchannel_init")]
8837 OPENCHANNEL_INIT = 1,
8838 #[serde(rename = "fundchannel_start")]
8839 FUNDCHANNEL_START = 2,
8840 #[serde(rename = "fundchannel_complete")]
8841 FUNDCHANNEL_COMPLETE = 3,
8842 }
8843
8844 impl TryFrom<i32> for MultifundchannelFailedMethod {
8845 type Error = anyhow::Error;
8846 fn try_from(c: i32) -> Result<MultifundchannelFailedMethod, anyhow::Error> {
8847 match c {
8848 0 => Ok(MultifundchannelFailedMethod::CONNECT),
8849 1 => Ok(MultifundchannelFailedMethod::OPENCHANNEL_INIT),
8850 2 => Ok(MultifundchannelFailedMethod::FUNDCHANNEL_START),
8851 3 => Ok(MultifundchannelFailedMethod::FUNDCHANNEL_COMPLETE),
8852 o => Err(anyhow::anyhow!("Unknown variant {} for enum MultifundchannelFailedMethod", o)),
8853 }
8854 }
8855 }
8856
8857 impl ToString for MultifundchannelFailedMethod {
8858 fn to_string(&self) -> String {
8859 match self {
8860 MultifundchannelFailedMethod::CONNECT => "CONNECT",
8861 MultifundchannelFailedMethod::OPENCHANNEL_INIT => "OPENCHANNEL_INIT",
8862 MultifundchannelFailedMethod::FUNDCHANNEL_START => "FUNDCHANNEL_START",
8863 MultifundchannelFailedMethod::FUNDCHANNEL_COMPLETE => "FUNDCHANNEL_COMPLETE",
8864 }.to_string()
8865 }
8866 }
8867
8868 #[derive(Clone, Debug, Deserialize, Serialize)]
8869 pub struct MultifundchannelFailedError {
8870 pub code: i64,
8871 pub message: String,
8872 }
8873
8874 #[derive(Clone, Debug, Deserialize, Serialize)]
8875 pub struct MultifundchannelFailed {
8876 pub method: MultifundchannelFailedMethod,
8878 pub error: MultifundchannelFailedError,
8879 pub id: PublicKey,
8880 }
8881
8882 #[derive(Clone, Debug, Deserialize, Serialize)]
8883 pub struct MultifundchannelChannelIdsChannelType {
8884 pub bits: Vec<u32>,
8885 pub names: Vec<ChannelTypeName>,
8886 }
8887
8888 #[derive(Clone, Debug, Deserialize, Serialize)]
8889 pub struct MultifundchannelChannelIds {
8890 #[serde(skip_serializing_if = "Option::is_none")]
8891 pub channel_type: Option<MultifundchannelChannelIdsChannelType>,
8892 #[serde(skip_serializing_if = "Option::is_none")]
8893 pub close_to: Option<String>,
8894 pub channel_id: Sha256,
8895 pub id: PublicKey,
8896 pub outnum: u32,
8897 }
8898
8899 #[derive(Clone, Debug, Deserialize, Serialize)]
8900 pub struct MultifundchannelResponse {
8901 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
8902 pub failed: Option<Vec<MultifundchannelFailed>>,
8903 pub channel_ids: Vec<MultifundchannelChannelIds>,
8904 pub tx: String,
8905 pub txid: String,
8906 }
8907
8908 impl TryFrom<Response> for MultifundchannelResponse {
8909 type Error = super::TryFromResponseError;
8910
8911 fn try_from(response: Response) -> Result<Self, Self::Error> {
8912 match response {
8913 Response::MultiFundChannel(response) => Ok(response),
8914 _ => Err(TryFromResponseError)
8915 }
8916 }
8917 }
8918
8919 #[derive(Clone, Debug, Deserialize, Serialize)]
8920 pub struct MultiwithdrawResponse {
8921 pub tx: String,
8922 pub txid: String,
8923 }
8924
8925 impl TryFrom<Response> for MultiwithdrawResponse {
8926 type Error = super::TryFromResponseError;
8927
8928 fn try_from(response: Response) -> Result<Self, Self::Error> {
8929 match response {
8930 Response::MultiWithdraw(response) => Ok(response),
8931 _ => Err(TryFromResponseError)
8932 }
8933 }
8934 }
8935
8936 #[derive(Clone, Debug, Deserialize, Serialize)]
8937 pub struct OfferResponse {
8938 #[serde(skip_serializing_if = "Option::is_none")]
8939 pub label: Option<String>,
8940 pub active: bool,
8941 pub bolt12: String,
8942 pub created: bool,
8943 pub offer_id: Sha256,
8944 pub single_use: bool,
8945 pub used: bool,
8946 }
8947
8948 impl TryFrom<Response> for OfferResponse {
8949 type Error = super::TryFromResponseError;
8950
8951 fn try_from(response: Response) -> Result<Self, Self::Error> {
8952 match response {
8953 Response::Offer(response) => Ok(response),
8954 _ => Err(TryFromResponseError)
8955 }
8956 }
8957 }
8958
8959 #[derive(Clone, Debug, Deserialize, Serialize)]
8960 pub struct OpenchannelAbortResponse {
8961 pub channel_canceled: bool,
8962 pub channel_id: Sha256,
8963 pub reason: String,
8964 }
8965
8966 impl TryFrom<Response> for OpenchannelAbortResponse {
8967 type Error = super::TryFromResponseError;
8968
8969 fn try_from(response: Response) -> Result<Self, Self::Error> {
8970 match response {
8971 Response::OpenChannelAbort(response) => Ok(response),
8972 _ => Err(TryFromResponseError)
8973 }
8974 }
8975 }
8976
8977 #[derive(Clone, Debug, Deserialize, Serialize)]
8978 pub struct OpenchannelBumpChannelType {
8979 pub bits: Vec<u32>,
8980 pub names: Vec<ChannelTypeName>,
8981 }
8982
8983 #[derive(Clone, Debug, Deserialize, Serialize)]
8984 pub struct OpenchannelBumpResponse {
8985 #[serde(skip_serializing_if = "Option::is_none")]
8986 pub channel_type: Option<OpenchannelBumpChannelType>,
8987 #[serde(skip_serializing_if = "Option::is_none")]
8988 pub requires_confirmed_inputs: Option<bool>,
8989 pub channel_id: Sha256,
8990 pub commitments_secured: bool,
8991 pub funding_serial: u64,
8992 pub psbt: String,
8993 }
8994
8995 impl TryFrom<Response> for OpenchannelBumpResponse {
8996 type Error = super::TryFromResponseError;
8997
8998 fn try_from(response: Response) -> Result<Self, Self::Error> {
8999 match response {
9000 Response::OpenChannelBump(response) => Ok(response),
9001 _ => Err(TryFromResponseError)
9002 }
9003 }
9004 }
9005
9006 #[derive(Clone, Debug, Deserialize, Serialize)]
9007 pub struct OpenchannelInitChannelType {
9008 pub bits: Vec<u32>,
9009 pub names: Vec<ChannelTypeName>,
9010 }
9011
9012 #[derive(Clone, Debug, Deserialize, Serialize)]
9013 pub struct OpenchannelInitResponse {
9014 #[serde(skip_serializing_if = "Option::is_none")]
9015 pub channel_type: Option<OpenchannelInitChannelType>,
9016 #[serde(skip_serializing_if = "Option::is_none")]
9017 pub requires_confirmed_inputs: Option<bool>,
9018 pub channel_id: Sha256,
9019 pub commitments_secured: bool,
9020 pub funding_serial: u64,
9021 pub psbt: String,
9022 }
9023
9024 impl TryFrom<Response> for OpenchannelInitResponse {
9025 type Error = super::TryFromResponseError;
9026
9027 fn try_from(response: Response) -> Result<Self, Self::Error> {
9028 match response {
9029 Response::OpenChannelInit(response) => Ok(response),
9030 _ => Err(TryFromResponseError)
9031 }
9032 }
9033 }
9034
9035 #[derive(Clone, Debug, Deserialize, Serialize)]
9036 pub struct OpenchannelSignedResponse {
9037 pub channel_id: Sha256,
9038 pub tx: String,
9039 pub txid: String,
9040 }
9041
9042 impl TryFrom<Response> for OpenchannelSignedResponse {
9043 type Error = super::TryFromResponseError;
9044
9045 fn try_from(response: Response) -> Result<Self, Self::Error> {
9046 match response {
9047 Response::OpenChannelSigned(response) => Ok(response),
9048 _ => Err(TryFromResponseError)
9049 }
9050 }
9051 }
9052
9053 #[derive(Clone, Debug, Deserialize, Serialize)]
9054 pub struct OpenchannelUpdateChannelType {
9055 pub bits: Vec<u32>,
9056 pub names: Vec<ChannelTypeName>,
9057 }
9058
9059 #[derive(Clone, Debug, Deserialize, Serialize)]
9060 pub struct OpenchannelUpdateResponse {
9061 #[serde(skip_serializing_if = "Option::is_none")]
9062 pub channel_type: Option<OpenchannelUpdateChannelType>,
9063 #[serde(skip_serializing_if = "Option::is_none")]
9064 pub close_to: Option<String>,
9065 #[serde(skip_serializing_if = "Option::is_none")]
9066 pub requires_confirmed_inputs: Option<bool>,
9067 pub channel_id: Sha256,
9068 pub commitments_secured: bool,
9069 pub funding_outnum: u32,
9070 pub psbt: String,
9071 }
9072
9073 impl TryFrom<Response> for OpenchannelUpdateResponse {
9074 type Error = super::TryFromResponseError;
9075
9076 fn try_from(response: Response) -> Result<Self, Self::Error> {
9077 match response {
9078 Response::OpenChannelUpdate(response) => Ok(response),
9079 _ => Err(TryFromResponseError)
9080 }
9081 }
9082 }
9083
9084 #[derive(Clone, Debug, Deserialize, Serialize)]
9085 pub struct PingResponse {
9086 pub totlen: u16,
9087 }
9088
9089 impl TryFrom<Response> for PingResponse {
9090 type Error = super::TryFromResponseError;
9091
9092 fn try_from(response: Response) -> Result<Self, Self::Error> {
9093 match response {
9094 Response::Ping(response) => Ok(response),
9095 _ => Err(TryFromResponseError)
9096 }
9097 }
9098 }
9099
9100 #[derive(Clone, Debug, Deserialize, Serialize)]
9101 pub struct PluginPlugins {
9102 pub active: bool,
9103 pub dynamic: bool,
9104 pub name: String,
9105 }
9106
9107 #[derive(Clone, Debug, Deserialize, Serialize)]
9108 pub struct PluginResponse {
9109 #[serde(skip_serializing_if = "Option::is_none")]
9110 pub result: Option<String>,
9111 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
9112 pub plugins: Option<Vec<PluginPlugins>>,
9113 pub command: PluginSubcommand,
9115 }
9116
9117 impl TryFrom<Response> for PluginResponse {
9118 type Error = super::TryFromResponseError;
9119
9120 fn try_from(response: Response) -> Result<Self, Self::Error> {
9121 match response {
9122 Response::Plugin(response) => Ok(response),
9123 _ => Err(TryFromResponseError)
9124 }
9125 }
9126 }
9127
9128 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9130 #[allow(non_camel_case_types)]
9131 pub enum RenepaystatusPaystatusStatus {
9132 #[serde(rename = "complete")]
9133 COMPLETE = 0,
9134 #[serde(rename = "pending")]
9135 PENDING = 1,
9136 #[serde(rename = "failed")]
9137 FAILED = 2,
9138 }
9139
9140 impl TryFrom<i32> for RenepaystatusPaystatusStatus {
9141 type Error = anyhow::Error;
9142 fn try_from(c: i32) -> Result<RenepaystatusPaystatusStatus, anyhow::Error> {
9143 match c {
9144 0 => Ok(RenepaystatusPaystatusStatus::COMPLETE),
9145 1 => Ok(RenepaystatusPaystatusStatus::PENDING),
9146 2 => Ok(RenepaystatusPaystatusStatus::FAILED),
9147 o => Err(anyhow::anyhow!("Unknown variant {} for enum RenepaystatusPaystatusStatus", o)),
9148 }
9149 }
9150 }
9151
9152 impl ToString for RenepaystatusPaystatusStatus {
9153 fn to_string(&self) -> String {
9154 match self {
9155 RenepaystatusPaystatusStatus::COMPLETE => "COMPLETE",
9156 RenepaystatusPaystatusStatus::PENDING => "PENDING",
9157 RenepaystatusPaystatusStatus::FAILED => "FAILED",
9158 }.to_string()
9159 }
9160 }
9161
9162 #[derive(Clone, Debug, Deserialize, Serialize)]
9163 pub struct RenepaystatusPaystatus {
9164 #[serde(skip_serializing_if = "Option::is_none")]
9165 pub amount_sent_msat: Option<Amount>,
9166 #[serde(skip_serializing_if = "Option::is_none")]
9167 pub destination: Option<PublicKey>,
9168 #[serde(skip_serializing_if = "Option::is_none")]
9169 pub parts: Option<u32>,
9170 #[serde(skip_serializing_if = "Option::is_none")]
9171 pub payment_preimage: Option<Secret>,
9172 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
9173 pub notes: Option<Vec<String>>,
9174 pub status: RenepaystatusPaystatusStatus,
9176 pub amount_msat: Amount,
9177 pub bolt11: String,
9178 pub created_at: f64,
9179 pub groupid: u32,
9180 pub payment_hash: Sha256,
9181 }
9182
9183 #[derive(Clone, Debug, Deserialize, Serialize)]
9184 pub struct RenepaystatusResponse {
9185 pub paystatus: Vec<RenepaystatusPaystatus>,
9186 }
9187
9188 impl TryFrom<Response> for RenepaystatusResponse {
9189 type Error = super::TryFromResponseError;
9190
9191 fn try_from(response: Response) -> Result<Self, Self::Error> {
9192 match response {
9193 Response::RenePayStatus(response) => Ok(response),
9194 _ => Err(TryFromResponseError)
9195 }
9196 }
9197 }
9198
9199 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9201 #[allow(non_camel_case_types)]
9202 pub enum RenepayStatus {
9203 #[serde(rename = "complete")]
9204 COMPLETE = 0,
9205 #[serde(rename = "pending")]
9206 PENDING = 1,
9207 #[serde(rename = "failed")]
9208 FAILED = 2,
9209 }
9210
9211 impl TryFrom<i32> for RenepayStatus {
9212 type Error = anyhow::Error;
9213 fn try_from(c: i32) -> Result<RenepayStatus, anyhow::Error> {
9214 match c {
9215 0 => Ok(RenepayStatus::COMPLETE),
9216 1 => Ok(RenepayStatus::PENDING),
9217 2 => Ok(RenepayStatus::FAILED),
9218 o => Err(anyhow::anyhow!("Unknown variant {} for enum RenepayStatus", o)),
9219 }
9220 }
9221 }
9222
9223 impl ToString for RenepayStatus {
9224 fn to_string(&self) -> String {
9225 match self {
9226 RenepayStatus::COMPLETE => "COMPLETE",
9227 RenepayStatus::PENDING => "PENDING",
9228 RenepayStatus::FAILED => "FAILED",
9229 }.to_string()
9230 }
9231 }
9232
9233 #[derive(Clone, Debug, Deserialize, Serialize)]
9234 pub struct RenepayResponse {
9235 #[serde(skip_serializing_if = "Option::is_none")]
9236 pub bolt11: Option<String>,
9237 #[serde(skip_serializing_if = "Option::is_none")]
9238 pub bolt12: Option<String>,
9239 #[serde(skip_serializing_if = "Option::is_none")]
9240 pub destination: Option<PublicKey>,
9241 #[serde(skip_serializing_if = "Option::is_none")]
9242 pub groupid: Option<u64>,
9243 pub status: RenepayStatus,
9245 pub amount_msat: Amount,
9246 pub amount_sent_msat: Amount,
9247 pub created_at: f64,
9248 pub parts: u32,
9249 pub payment_hash: Sha256,
9250 pub payment_preimage: Secret,
9251 }
9252
9253 impl TryFrom<Response> for RenepayResponse {
9254 type Error = super::TryFromResponseError;
9255
9256 fn try_from(response: Response) -> Result<Self, Self::Error> {
9257 match response {
9258 Response::RenePay(response) => Ok(response),
9259 _ => Err(TryFromResponseError)
9260 }
9261 }
9262 }
9263
9264 #[derive(Clone, Debug, Deserialize, Serialize)]
9265 pub struct ReserveinputsReservations {
9266 pub reserved: bool,
9267 pub reserved_to_block: u32,
9268 pub txid: String,
9269 pub vout: u32,
9270 pub was_reserved: bool,
9271 }
9272
9273 #[derive(Clone, Debug, Deserialize, Serialize)]
9274 pub struct ReserveinputsResponse {
9275 pub reservations: Vec<ReserveinputsReservations>,
9276 }
9277
9278 impl TryFrom<Response> for ReserveinputsResponse {
9279 type Error = super::TryFromResponseError;
9280
9281 fn try_from(response: Response) -> Result<Self, Self::Error> {
9282 match response {
9283 Response::ReserveInputs(response) => Ok(response),
9284 _ => Err(TryFromResponseError)
9285 }
9286 }
9287 }
9288
9289 #[derive(Clone, Debug, Deserialize, Serialize)]
9290 pub struct SendcustommsgResponse {
9291 pub status: String,
9292 }
9293
9294 impl TryFrom<Response> for SendcustommsgResponse {
9295 type Error = super::TryFromResponseError;
9296
9297 fn try_from(response: Response) -> Result<Self, Self::Error> {
9298 match response {
9299 Response::SendCustomMsg(response) => Ok(response),
9300 _ => Err(TryFromResponseError)
9301 }
9302 }
9303 }
9304
9305 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9307 #[allow(non_camel_case_types)]
9308 pub enum SendinvoiceStatus {
9309 #[serde(rename = "unpaid")]
9310 UNPAID = 0,
9311 #[serde(rename = "paid")]
9312 PAID = 1,
9313 #[serde(rename = "expired")]
9314 EXPIRED = 2,
9315 }
9316
9317 impl TryFrom<i32> for SendinvoiceStatus {
9318 type Error = anyhow::Error;
9319 fn try_from(c: i32) -> Result<SendinvoiceStatus, anyhow::Error> {
9320 match c {
9321 0 => Ok(SendinvoiceStatus::UNPAID),
9322 1 => Ok(SendinvoiceStatus::PAID),
9323 2 => Ok(SendinvoiceStatus::EXPIRED),
9324 o => Err(anyhow::anyhow!("Unknown variant {} for enum SendinvoiceStatus", o)),
9325 }
9326 }
9327 }
9328
9329 impl ToString for SendinvoiceStatus {
9330 fn to_string(&self) -> String {
9331 match self {
9332 SendinvoiceStatus::UNPAID => "UNPAID",
9333 SendinvoiceStatus::PAID => "PAID",
9334 SendinvoiceStatus::EXPIRED => "EXPIRED",
9335 }.to_string()
9336 }
9337 }
9338
9339 #[derive(Clone, Debug, Deserialize, Serialize)]
9340 pub struct SendinvoiceResponse {
9341 #[serde(skip_serializing_if = "Option::is_none")]
9342 pub amount_msat: Option<Amount>,
9343 #[serde(skip_serializing_if = "Option::is_none")]
9344 pub amount_received_msat: Option<Amount>,
9345 #[serde(skip_serializing_if = "Option::is_none")]
9346 pub bolt12: Option<String>,
9347 #[serde(skip_serializing_if = "Option::is_none")]
9348 pub created_index: Option<u64>,
9349 #[serde(skip_serializing_if = "Option::is_none")]
9350 pub paid_at: Option<u64>,
9351 #[serde(skip_serializing_if = "Option::is_none")]
9352 pub pay_index: Option<u64>,
9353 #[serde(skip_serializing_if = "Option::is_none")]
9354 pub payment_preimage: Option<Secret>,
9355 #[serde(skip_serializing_if = "Option::is_none")]
9356 pub updated_index: Option<u64>,
9357 pub status: SendinvoiceStatus,
9359 pub description: String,
9360 pub expires_at: u64,
9361 pub label: String,
9362 pub payment_hash: Sha256,
9363 }
9364
9365 impl TryFrom<Response> for SendinvoiceResponse {
9366 type Error = super::TryFromResponseError;
9367
9368 fn try_from(response: Response) -> Result<Self, Self::Error> {
9369 match response {
9370 Response::SendInvoice(response) => Ok(response),
9371 _ => Err(TryFromResponseError)
9372 }
9373 }
9374 }
9375
9376 #[derive(Clone, Debug, Deserialize, Serialize)]
9377 pub struct SetchannelChannels {
9378 #[serde(skip_serializing_if = "Option::is_none")]
9379 pub ignore_fee_limits: Option<bool>,
9380 #[serde(skip_serializing_if = "Option::is_none")]
9381 pub short_channel_id: Option<ShortChannelId>,
9382 #[serde(skip_serializing_if = "Option::is_none")]
9383 pub warning_htlcmax_too_high: Option<String>,
9384 #[serde(skip_serializing_if = "Option::is_none")]
9385 pub warning_htlcmin_too_low: Option<String>,
9386 pub channel_id: Sha256,
9387 pub fee_base_msat: Amount,
9388 pub fee_proportional_millionths: u32,
9389 pub maximum_htlc_out_msat: Amount,
9390 pub minimum_htlc_out_msat: Amount,
9391 pub peer_id: PublicKey,
9392 }
9393
9394 #[derive(Clone, Debug, Deserialize, Serialize)]
9395 pub struct SetchannelResponse {
9396 pub channels: Vec<SetchannelChannels>,
9397 }
9398
9399 impl TryFrom<Response> for SetchannelResponse {
9400 type Error = super::TryFromResponseError;
9401
9402 fn try_from(response: Response) -> Result<Self, Self::Error> {
9403 match response {
9404 Response::SetChannel(response) => Ok(response),
9405 _ => Err(TryFromResponseError)
9406 }
9407 }
9408 }
9409
9410 #[derive(Clone, Debug, Deserialize, Serialize)]
9411 pub struct SetconfigConfig {
9412 #[serde(skip_serializing_if = "Option::is_none")]
9413 pub plugin: Option<String>,
9414 #[serde(skip_serializing_if = "Option::is_none")]
9415 pub set: Option<bool>,
9416 #[serde(skip_serializing_if = "Option::is_none")]
9417 pub value_bool: Option<bool>,
9418 #[serde(skip_serializing_if = "Option::is_none")]
9419 pub value_int: Option<i64>,
9420 #[serde(skip_serializing_if = "Option::is_none")]
9421 pub value_msat: Option<Amount>,
9422 #[serde(skip_serializing_if = "Option::is_none")]
9423 pub value_str: Option<String>,
9424 pub config: String,
9425 pub dynamic: bool,
9426 pub source: String,
9427 }
9428
9429 #[derive(Clone, Debug, Deserialize, Serialize)]
9430 pub struct SetconfigResponse {
9431 pub config: SetconfigConfig,
9432 }
9433
9434 impl TryFrom<Response> for SetconfigResponse {
9435 type Error = super::TryFromResponseError;
9436
9437 fn try_from(response: Response) -> Result<Self, Self::Error> {
9438 match response {
9439 Response::SetConfig(response) => Ok(response),
9440 _ => Err(TryFromResponseError)
9441 }
9442 }
9443 }
9444
9445 #[derive(Clone, Debug, Deserialize, Serialize)]
9446 pub struct SetpsbtversionResponse {
9447 pub psbt: String,
9448 }
9449
9450 impl TryFrom<Response> for SetpsbtversionResponse {
9451 type Error = super::TryFromResponseError;
9452
9453 fn try_from(response: Response) -> Result<Self, Self::Error> {
9454 match response {
9455 Response::SetPsbtVersion(response) => Ok(response),
9456 _ => Err(TryFromResponseError)
9457 }
9458 }
9459 }
9460
9461 #[derive(Clone, Debug, Deserialize, Serialize)]
9462 pub struct SigninvoiceResponse {
9463 pub bolt11: String,
9464 }
9465
9466 impl TryFrom<Response> for SigninvoiceResponse {
9467 type Error = super::TryFromResponseError;
9468
9469 fn try_from(response: Response) -> Result<Self, Self::Error> {
9470 match response {
9471 Response::SignInvoice(response) => Ok(response),
9472 _ => Err(TryFromResponseError)
9473 }
9474 }
9475 }
9476
9477 #[derive(Clone, Debug, Deserialize, Serialize)]
9478 pub struct SignmessageResponse {
9479 pub recid: String,
9480 pub signature: String,
9481 pub zbase: String,
9482 }
9483
9484 impl TryFrom<Response> for SignmessageResponse {
9485 type Error = super::TryFromResponseError;
9486
9487 fn try_from(response: Response) -> Result<Self, Self::Error> {
9488 match response {
9489 Response::SignMessage(response) => Ok(response),
9490 _ => Err(TryFromResponseError)
9491 }
9492 }
9493 }
9494
9495 #[derive(Clone, Debug, Deserialize, Serialize)]
9496 pub struct SpliceInitResponse {
9497 pub psbt: String,
9498 }
9499
9500 impl TryFrom<Response> for SpliceInitResponse {
9501 type Error = super::TryFromResponseError;
9502
9503 fn try_from(response: Response) -> Result<Self, Self::Error> {
9504 match response {
9505 Response::SpliceInit(response) => Ok(response),
9506 _ => Err(TryFromResponseError)
9507 }
9508 }
9509 }
9510
9511 #[derive(Clone, Debug, Deserialize, Serialize)]
9512 pub struct SpliceSignedResponse {
9513 #[serde(skip_serializing_if = "Option::is_none")]
9514 pub outnum: Option<u32>,
9515 pub psbt: String,
9516 pub tx: String,
9517 pub txid: String,
9518 }
9519
9520 impl TryFrom<Response> for SpliceSignedResponse {
9521 type Error = super::TryFromResponseError;
9522
9523 fn try_from(response: Response) -> Result<Self, Self::Error> {
9524 match response {
9525 Response::SpliceSigned(response) => Ok(response),
9526 _ => Err(TryFromResponseError)
9527 }
9528 }
9529 }
9530
9531 #[derive(Clone, Debug, Deserialize, Serialize)]
9532 pub struct SpliceUpdateResponse {
9533 #[serde(skip_serializing_if = "Option::is_none")]
9534 pub signatures_secured: Option<bool>,
9535 pub commitments_secured: bool,
9536 pub psbt: String,
9537 }
9538
9539 impl TryFrom<Response> for SpliceUpdateResponse {
9540 type Error = super::TryFromResponseError;
9541
9542 fn try_from(response: Response) -> Result<Self, Self::Error> {
9543 match response {
9544 Response::SpliceUpdate(response) => Ok(response),
9545 _ => Err(TryFromResponseError)
9546 }
9547 }
9548 }
9549
9550 #[derive(Clone, Debug, Deserialize, Serialize)]
9551 pub struct DevspliceResponse {
9552 #[serde(skip_serializing_if = "Option::is_none")]
9553 pub psbt: Option<String>,
9554 #[serde(skip_serializing_if = "Option::is_none")]
9555 pub tx: Option<String>,
9556 #[serde(skip_serializing_if = "Option::is_none")]
9557 pub txid: Option<String>,
9558 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
9559 pub dryrun: Option<Vec<String>>,
9560 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
9561 pub log: Option<Vec<String>>,
9562 }
9563
9564 impl TryFrom<Response> for DevspliceResponse {
9565 type Error = super::TryFromResponseError;
9566
9567 fn try_from(response: Response) -> Result<Self, Self::Error> {
9568 match response {
9569 Response::DevSplice(response) => Ok(response),
9570 _ => Err(TryFromResponseError)
9571 }
9572 }
9573 }
9574
9575 #[derive(Clone, Debug, Deserialize, Serialize)]
9576 pub struct UnreserveinputsReservations {
9577 #[serde(skip_serializing_if = "Option::is_none")]
9578 pub reserved_to_block: Option<u32>,
9579 pub reserved: bool,
9580 pub txid: String,
9581 pub vout: u32,
9582 pub was_reserved: bool,
9583 }
9584
9585 #[derive(Clone, Debug, Deserialize, Serialize)]
9586 pub struct UnreserveinputsResponse {
9587 pub reservations: Vec<UnreserveinputsReservations>,
9588 }
9589
9590 impl TryFrom<Response> for UnreserveinputsResponse {
9591 type Error = super::TryFromResponseError;
9592
9593 fn try_from(response: Response) -> Result<Self, Self::Error> {
9594 match response {
9595 Response::UnreserveInputs(response) => Ok(response),
9596 _ => Err(TryFromResponseError)
9597 }
9598 }
9599 }
9600
9601 #[derive(Clone, Debug, Deserialize, Serialize)]
9602 pub struct UpgradewalletResponse {
9603 #[serde(skip_serializing_if = "Option::is_none")]
9604 pub psbt: Option<String>,
9605 #[serde(skip_serializing_if = "Option::is_none")]
9606 pub tx: Option<String>,
9607 #[serde(skip_serializing_if = "Option::is_none")]
9608 pub txid: Option<String>,
9609 #[serde(skip_serializing_if = "Option::is_none")]
9610 pub upgraded_outs: Option<u64>,
9611 }
9612
9613 impl TryFrom<Response> for UpgradewalletResponse {
9614 type Error = super::TryFromResponseError;
9615
9616 fn try_from(response: Response) -> Result<Self, Self::Error> {
9617 match response {
9618 Response::UpgradeWallet(response) => Ok(response),
9619 _ => Err(TryFromResponseError)
9620 }
9621 }
9622 }
9623
9624 #[derive(Clone, Debug, Deserialize, Serialize)]
9625 pub struct WaitblockheightResponse {
9626 pub blockheight: u32,
9627 }
9628
9629 impl TryFrom<Response> for WaitblockheightResponse {
9630 type Error = super::TryFromResponseError;
9631
9632 fn try_from(response: Response) -> Result<Self, Self::Error> {
9633 match response {
9634 Response::WaitBlockHeight(response) => Ok(response),
9635 _ => Err(TryFromResponseError)
9636 }
9637 }
9638 }
9639
9640 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9642 #[allow(non_camel_case_types)]
9643 pub enum WaitDetailsStatus {
9644 #[serde(rename = "unpaid")]
9645 UNPAID = 0,
9646 #[serde(rename = "paid")]
9647 PAID = 1,
9648 #[serde(rename = "expired")]
9649 EXPIRED = 2,
9650 #[serde(rename = "pending")]
9651 PENDING = 3,
9652 #[serde(rename = "failed")]
9653 FAILED = 4,
9654 #[serde(rename = "complete")]
9655 COMPLETE = 5,
9656 #[serde(rename = "offered")]
9657 OFFERED = 6,
9658 #[serde(rename = "settled")]
9659 SETTLED = 7,
9660 #[serde(rename = "local_failed")]
9661 LOCAL_FAILED = 8,
9662 }
9663
9664 impl TryFrom<i32> for WaitDetailsStatus {
9665 type Error = anyhow::Error;
9666 fn try_from(c: i32) -> Result<WaitDetailsStatus, anyhow::Error> {
9667 match c {
9668 0 => Ok(WaitDetailsStatus::UNPAID),
9669 1 => Ok(WaitDetailsStatus::PAID),
9670 2 => Ok(WaitDetailsStatus::EXPIRED),
9671 3 => Ok(WaitDetailsStatus::PENDING),
9672 4 => Ok(WaitDetailsStatus::FAILED),
9673 5 => Ok(WaitDetailsStatus::COMPLETE),
9674 6 => Ok(WaitDetailsStatus::OFFERED),
9675 7 => Ok(WaitDetailsStatus::SETTLED),
9676 8 => Ok(WaitDetailsStatus::LOCAL_FAILED),
9677 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitDetailsStatus", o)),
9678 }
9679 }
9680 }
9681
9682 impl ToString for WaitDetailsStatus {
9683 fn to_string(&self) -> String {
9684 match self {
9685 WaitDetailsStatus::COMPLETE => "COMPLETE",
9686 WaitDetailsStatus::EXPIRED => "EXPIRED",
9687 WaitDetailsStatus::FAILED => "FAILED",
9688 WaitDetailsStatus::LOCAL_FAILED => "LOCAL_FAILED",
9689 WaitDetailsStatus::OFFERED => "OFFERED",
9690 WaitDetailsStatus::PAID => "PAID",
9691 WaitDetailsStatus::PENDING => "PENDING",
9692 WaitDetailsStatus::SETTLED => "SETTLED",
9693 WaitDetailsStatus::UNPAID => "UNPAID",
9694 }.to_string()
9695 }
9696 }
9697
9698 #[derive(Clone, Debug, Deserialize, Serialize)]
9699 pub struct WaitDetails {
9700 #[serde(skip_serializing_if = "Option::is_none")]
9701 pub bolt11: Option<String>,
9702 #[serde(skip_serializing_if = "Option::is_none")]
9703 pub bolt12: Option<String>,
9704 #[serde(skip_serializing_if = "Option::is_none")]
9705 pub description: Option<String>,
9706 #[serde(skip_serializing_if = "Option::is_none")]
9707 pub groupid: Option<u64>,
9708 #[serde(skip_serializing_if = "Option::is_none")]
9709 pub in_channel: Option<ShortChannelId>,
9710 #[serde(skip_serializing_if = "Option::is_none")]
9711 pub in_htlc_id: Option<u64>,
9712 #[serde(skip_serializing_if = "Option::is_none")]
9713 pub in_msat: Option<Amount>,
9714 #[serde(skip_serializing_if = "Option::is_none")]
9715 pub label: Option<String>,
9716 #[serde(skip_serializing_if = "Option::is_none")]
9717 pub out_channel: Option<ShortChannelId>,
9718 #[serde(skip_serializing_if = "Option::is_none")]
9719 pub partid: Option<u64>,
9720 #[serde(skip_serializing_if = "Option::is_none")]
9721 pub payment_hash: Option<Sha256>,
9722 #[serde(skip_serializing_if = "Option::is_none")]
9723 pub status: Option<WaitDetailsStatus>,
9724 }
9725
9726 #[derive(Clone, Debug, Deserialize, Serialize)]
9727 pub struct WaitChainmoves {
9728 pub account: String,
9729 pub credit_msat: Amount,
9730 pub debit_msat: Amount,
9731 }
9732
9733 #[derive(Clone, Debug, Deserialize, Serialize)]
9734 pub struct WaitChannelmoves {
9735 pub account: String,
9736 pub credit_msat: Amount,
9737 pub debit_msat: Amount,
9738 }
9739
9740 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9742 #[allow(non_camel_case_types)]
9743 pub enum WaitForwardsStatus {
9744 #[serde(rename = "offered")]
9745 OFFERED = 0,
9746 #[serde(rename = "settled")]
9747 SETTLED = 1,
9748 #[serde(rename = "failed")]
9749 FAILED = 2,
9750 #[serde(rename = "local_failed")]
9751 LOCAL_FAILED = 3,
9752 }
9753
9754 impl TryFrom<i32> for WaitForwardsStatus {
9755 type Error = anyhow::Error;
9756 fn try_from(c: i32) -> Result<WaitForwardsStatus, anyhow::Error> {
9757 match c {
9758 0 => Ok(WaitForwardsStatus::OFFERED),
9759 1 => Ok(WaitForwardsStatus::SETTLED),
9760 2 => Ok(WaitForwardsStatus::FAILED),
9761 3 => Ok(WaitForwardsStatus::LOCAL_FAILED),
9762 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitForwardsStatus", o)),
9763 }
9764 }
9765 }
9766
9767 impl ToString for WaitForwardsStatus {
9768 fn to_string(&self) -> String {
9769 match self {
9770 WaitForwardsStatus::OFFERED => "OFFERED",
9771 WaitForwardsStatus::SETTLED => "SETTLED",
9772 WaitForwardsStatus::FAILED => "FAILED",
9773 WaitForwardsStatus::LOCAL_FAILED => "LOCAL_FAILED",
9774 }.to_string()
9775 }
9776 }
9777
9778 #[derive(Clone, Debug, Deserialize, Serialize)]
9779 pub struct WaitForwards {
9780 #[serde(skip_serializing_if = "Option::is_none")]
9781 pub in_channel: Option<ShortChannelId>,
9782 #[serde(skip_serializing_if = "Option::is_none")]
9783 pub in_htlc_id: Option<u64>,
9784 #[serde(skip_serializing_if = "Option::is_none")]
9785 pub in_msat: Option<Amount>,
9786 #[serde(skip_serializing_if = "Option::is_none")]
9787 pub out_channel: Option<ShortChannelId>,
9788 #[serde(skip_serializing_if = "Option::is_none")]
9789 pub status: Option<WaitForwardsStatus>,
9790 }
9791
9792 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9794 #[allow(non_camel_case_types)]
9795 pub enum WaitHtlcsDirection {
9796 #[serde(rename = "out")]
9797 OUT = 0,
9798 #[serde(rename = "in")]
9799 IN = 1,
9800 }
9801
9802 impl TryFrom<i32> for WaitHtlcsDirection {
9803 type Error = anyhow::Error;
9804 fn try_from(c: i32) -> Result<WaitHtlcsDirection, anyhow::Error> {
9805 match c {
9806 0 => Ok(WaitHtlcsDirection::OUT),
9807 1 => Ok(WaitHtlcsDirection::IN),
9808 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitHtlcsDirection", o)),
9809 }
9810 }
9811 }
9812
9813 impl ToString for WaitHtlcsDirection {
9814 fn to_string(&self) -> String {
9815 match self {
9816 WaitHtlcsDirection::OUT => "OUT",
9817 WaitHtlcsDirection::IN => "IN",
9818 }.to_string()
9819 }
9820 }
9821
9822 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9824 #[allow(non_camel_case_types)]
9825 pub enum WaitHtlcsState {
9826 #[serde(rename = "SENT_ADD_HTLC")]
9827 SENT_ADD_HTLC = 0,
9828 #[serde(rename = "SENT_ADD_COMMIT")]
9829 SENT_ADD_COMMIT = 1,
9830 #[serde(rename = "RCVD_ADD_REVOCATION")]
9831 RCVD_ADD_REVOCATION = 2,
9832 #[serde(rename = "RCVD_ADD_ACK_COMMIT")]
9833 RCVD_ADD_ACK_COMMIT = 3,
9834 #[serde(rename = "SENT_ADD_ACK_REVOCATION")]
9835 SENT_ADD_ACK_REVOCATION = 4,
9836 #[serde(rename = "RCVD_REMOVE_HTLC")]
9837 RCVD_REMOVE_HTLC = 5,
9838 #[serde(rename = "RCVD_REMOVE_COMMIT")]
9839 RCVD_REMOVE_COMMIT = 6,
9840 #[serde(rename = "SENT_REMOVE_REVOCATION")]
9841 SENT_REMOVE_REVOCATION = 7,
9842 #[serde(rename = "SENT_REMOVE_ACK_COMMIT")]
9843 SENT_REMOVE_ACK_COMMIT = 8,
9844 #[serde(rename = "RCVD_REMOVE_ACK_REVOCATION")]
9845 RCVD_REMOVE_ACK_REVOCATION = 9,
9846 #[serde(rename = "RCVD_ADD_HTLC")]
9847 RCVD_ADD_HTLC = 10,
9848 #[serde(rename = "RCVD_ADD_COMMIT")]
9849 RCVD_ADD_COMMIT = 11,
9850 #[serde(rename = "SENT_ADD_REVOCATION")]
9851 SENT_ADD_REVOCATION = 12,
9852 #[serde(rename = "SENT_ADD_ACK_COMMIT")]
9853 SENT_ADD_ACK_COMMIT = 13,
9854 #[serde(rename = "RCVD_ADD_ACK_REVOCATION")]
9855 RCVD_ADD_ACK_REVOCATION = 14,
9856 #[serde(rename = "SENT_REMOVE_HTLC")]
9857 SENT_REMOVE_HTLC = 15,
9858 #[serde(rename = "SENT_REMOVE_COMMIT")]
9859 SENT_REMOVE_COMMIT = 16,
9860 #[serde(rename = "RCVD_REMOVE_REVOCATION")]
9861 RCVD_REMOVE_REVOCATION = 17,
9862 #[serde(rename = "RCVD_REMOVE_ACK_COMMIT")]
9863 RCVD_REMOVE_ACK_COMMIT = 18,
9864 #[serde(rename = "SENT_REMOVE_ACK_REVOCATION")]
9865 SENT_REMOVE_ACK_REVOCATION = 19,
9866 }
9867
9868 impl TryFrom<i32> for WaitHtlcsState {
9869 type Error = anyhow::Error;
9870 fn try_from(c: i32) -> Result<WaitHtlcsState, anyhow::Error> {
9871 match c {
9872 0 => Ok(WaitHtlcsState::SENT_ADD_HTLC),
9873 1 => Ok(WaitHtlcsState::SENT_ADD_COMMIT),
9874 2 => Ok(WaitHtlcsState::RCVD_ADD_REVOCATION),
9875 3 => Ok(WaitHtlcsState::RCVD_ADD_ACK_COMMIT),
9876 4 => Ok(WaitHtlcsState::SENT_ADD_ACK_REVOCATION),
9877 5 => Ok(WaitHtlcsState::RCVD_REMOVE_HTLC),
9878 6 => Ok(WaitHtlcsState::RCVD_REMOVE_COMMIT),
9879 7 => Ok(WaitHtlcsState::SENT_REMOVE_REVOCATION),
9880 8 => Ok(WaitHtlcsState::SENT_REMOVE_ACK_COMMIT),
9881 9 => Ok(WaitHtlcsState::RCVD_REMOVE_ACK_REVOCATION),
9882 10 => Ok(WaitHtlcsState::RCVD_ADD_HTLC),
9883 11 => Ok(WaitHtlcsState::RCVD_ADD_COMMIT),
9884 12 => Ok(WaitHtlcsState::SENT_ADD_REVOCATION),
9885 13 => Ok(WaitHtlcsState::SENT_ADD_ACK_COMMIT),
9886 14 => Ok(WaitHtlcsState::RCVD_ADD_ACK_REVOCATION),
9887 15 => Ok(WaitHtlcsState::SENT_REMOVE_HTLC),
9888 16 => Ok(WaitHtlcsState::SENT_REMOVE_COMMIT),
9889 17 => Ok(WaitHtlcsState::RCVD_REMOVE_REVOCATION),
9890 18 => Ok(WaitHtlcsState::RCVD_REMOVE_ACK_COMMIT),
9891 19 => Ok(WaitHtlcsState::SENT_REMOVE_ACK_REVOCATION),
9892 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitHtlcsState", o)),
9893 }
9894 }
9895 }
9896
9897 impl ToString for WaitHtlcsState {
9898 fn to_string(&self) -> String {
9899 match self {
9900 WaitHtlcsState::SENT_ADD_HTLC => "SENT_ADD_HTLC",
9901 WaitHtlcsState::SENT_ADD_COMMIT => "SENT_ADD_COMMIT",
9902 WaitHtlcsState::RCVD_ADD_REVOCATION => "RCVD_ADD_REVOCATION",
9903 WaitHtlcsState::RCVD_ADD_ACK_COMMIT => "RCVD_ADD_ACK_COMMIT",
9904 WaitHtlcsState::SENT_ADD_ACK_REVOCATION => "SENT_ADD_ACK_REVOCATION",
9905 WaitHtlcsState::RCVD_REMOVE_HTLC => "RCVD_REMOVE_HTLC",
9906 WaitHtlcsState::RCVD_REMOVE_COMMIT => "RCVD_REMOVE_COMMIT",
9907 WaitHtlcsState::SENT_REMOVE_REVOCATION => "SENT_REMOVE_REVOCATION",
9908 WaitHtlcsState::SENT_REMOVE_ACK_COMMIT => "SENT_REMOVE_ACK_COMMIT",
9909 WaitHtlcsState::RCVD_REMOVE_ACK_REVOCATION => "RCVD_REMOVE_ACK_REVOCATION",
9910 WaitHtlcsState::RCVD_ADD_HTLC => "RCVD_ADD_HTLC",
9911 WaitHtlcsState::RCVD_ADD_COMMIT => "RCVD_ADD_COMMIT",
9912 WaitHtlcsState::SENT_ADD_REVOCATION => "SENT_ADD_REVOCATION",
9913 WaitHtlcsState::SENT_ADD_ACK_COMMIT => "SENT_ADD_ACK_COMMIT",
9914 WaitHtlcsState::RCVD_ADD_ACK_REVOCATION => "RCVD_ADD_ACK_REVOCATION",
9915 WaitHtlcsState::SENT_REMOVE_HTLC => "SENT_REMOVE_HTLC",
9916 WaitHtlcsState::SENT_REMOVE_COMMIT => "SENT_REMOVE_COMMIT",
9917 WaitHtlcsState::RCVD_REMOVE_REVOCATION => "RCVD_REMOVE_REVOCATION",
9918 WaitHtlcsState::RCVD_REMOVE_ACK_COMMIT => "RCVD_REMOVE_ACK_COMMIT",
9919 WaitHtlcsState::SENT_REMOVE_ACK_REVOCATION => "SENT_REMOVE_ACK_REVOCATION",
9920 }.to_string()
9921 }
9922 }
9923
9924 #[derive(Clone, Debug, Deserialize, Serialize)]
9925 pub struct WaitHtlcs {
9926 #[serde(skip_serializing_if = "Option::is_none")]
9927 pub amount_msat: Option<Amount>,
9928 #[serde(skip_serializing_if = "Option::is_none")]
9929 pub cltv_expiry: Option<u32>,
9930 #[serde(skip_serializing_if = "Option::is_none")]
9931 pub direction: Option<WaitHtlcsDirection>,
9932 #[serde(skip_serializing_if = "Option::is_none")]
9933 pub htlc_id: Option<u64>,
9934 #[serde(skip_serializing_if = "Option::is_none")]
9935 pub payment_hash: Option<Sha256>,
9936 #[serde(skip_serializing_if = "Option::is_none")]
9937 pub short_channel_id: Option<ShortChannelId>,
9938 #[serde(skip_serializing_if = "Option::is_none")]
9939 pub state: Option<WaitHtlcsState>,
9940 }
9941
9942 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9944 #[allow(non_camel_case_types)]
9945 pub enum WaitInvoicesStatus {
9946 #[serde(rename = "unpaid")]
9947 UNPAID = 0,
9948 #[serde(rename = "paid")]
9949 PAID = 1,
9950 #[serde(rename = "expired")]
9951 EXPIRED = 2,
9952 }
9953
9954 impl TryFrom<i32> for WaitInvoicesStatus {
9955 type Error = anyhow::Error;
9956 fn try_from(c: i32) -> Result<WaitInvoicesStatus, anyhow::Error> {
9957 match c {
9958 0 => Ok(WaitInvoicesStatus::UNPAID),
9959 1 => Ok(WaitInvoicesStatus::PAID),
9960 2 => Ok(WaitInvoicesStatus::EXPIRED),
9961 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitInvoicesStatus", o)),
9962 }
9963 }
9964 }
9965
9966 impl ToString for WaitInvoicesStatus {
9967 fn to_string(&self) -> String {
9968 match self {
9969 WaitInvoicesStatus::UNPAID => "UNPAID",
9970 WaitInvoicesStatus::PAID => "PAID",
9971 WaitInvoicesStatus::EXPIRED => "EXPIRED",
9972 }.to_string()
9973 }
9974 }
9975
9976 #[derive(Clone, Debug, Deserialize, Serialize)]
9977 pub struct WaitInvoices {
9978 #[serde(skip_serializing_if = "Option::is_none")]
9979 pub bolt11: Option<String>,
9980 #[serde(skip_serializing_if = "Option::is_none")]
9981 pub bolt12: Option<String>,
9982 #[serde(skip_serializing_if = "Option::is_none")]
9983 pub description: Option<String>,
9984 #[serde(skip_serializing_if = "Option::is_none")]
9985 pub label: Option<String>,
9986 #[serde(skip_serializing_if = "Option::is_none")]
9987 pub status: Option<WaitInvoicesStatus>,
9988 }
9989
9990 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
9992 #[allow(non_camel_case_types)]
9993 pub enum WaitSendpaysStatus {
9994 #[serde(rename = "pending")]
9995 PENDING = 0,
9996 #[serde(rename = "failed")]
9997 FAILED = 1,
9998 #[serde(rename = "complete")]
9999 COMPLETE = 2,
10000 }
10001
10002 impl TryFrom<i32> for WaitSendpaysStatus {
10003 type Error = anyhow::Error;
10004 fn try_from(c: i32) -> Result<WaitSendpaysStatus, anyhow::Error> {
10005 match c {
10006 0 => Ok(WaitSendpaysStatus::PENDING),
10007 1 => Ok(WaitSendpaysStatus::FAILED),
10008 2 => Ok(WaitSendpaysStatus::COMPLETE),
10009 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitSendpaysStatus", o)),
10010 }
10011 }
10012 }
10013
10014 impl ToString for WaitSendpaysStatus {
10015 fn to_string(&self) -> String {
10016 match self {
10017 WaitSendpaysStatus::PENDING => "PENDING",
10018 WaitSendpaysStatus::FAILED => "FAILED",
10019 WaitSendpaysStatus::COMPLETE => "COMPLETE",
10020 }.to_string()
10021 }
10022 }
10023
10024 #[derive(Clone, Debug, Deserialize, Serialize)]
10025 pub struct WaitSendpays {
10026 #[serde(skip_serializing_if = "Option::is_none")]
10027 pub groupid: Option<u64>,
10028 #[serde(skip_serializing_if = "Option::is_none")]
10029 pub partid: Option<u64>,
10030 #[serde(skip_serializing_if = "Option::is_none")]
10031 pub payment_hash: Option<Sha256>,
10032 #[serde(skip_serializing_if = "Option::is_none")]
10033 pub status: Option<WaitSendpaysStatus>,
10034 }
10035
10036 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
10037 #[allow(non_camel_case_types)]
10038 pub enum WaitSubsystem {
10039 #[serde(rename = "invoices")]
10040 INVOICES = 0,
10041 #[serde(rename = "forwards")]
10042 FORWARDS = 1,
10043 #[serde(rename = "sendpays")]
10044 SENDPAYS = 2,
10045 #[serde(rename = "htlcs")]
10046 HTLCS = 3,
10047 #[serde(rename = "chainmoves")]
10048 CHAINMOVES = 4,
10049 #[serde(rename = "channelmoves")]
10050 CHANNELMOVES = 5,
10051 }
10052
10053 impl TryFrom<i32> for WaitSubsystem {
10054 type Error = anyhow::Error;
10055 fn try_from(c: i32) -> Result<WaitSubsystem, anyhow::Error> {
10056 match c {
10057 0 => Ok(WaitSubsystem::INVOICES),
10058 1 => Ok(WaitSubsystem::FORWARDS),
10059 2 => Ok(WaitSubsystem::SENDPAYS),
10060 3 => Ok(WaitSubsystem::HTLCS),
10061 4 => Ok(WaitSubsystem::CHAINMOVES),
10062 5 => Ok(WaitSubsystem::CHANNELMOVES),
10063 o => Err(anyhow::anyhow!("Unknown variant {} for enum WaitSubsystem", o)),
10064 }
10065 }
10066 }
10067
10068 impl ToString for WaitSubsystem {
10069 fn to_string(&self) -> String {
10070 match self {
10071 WaitSubsystem::INVOICES => "INVOICES",
10072 WaitSubsystem::FORWARDS => "FORWARDS",
10073 WaitSubsystem::SENDPAYS => "SENDPAYS",
10074 WaitSubsystem::HTLCS => "HTLCS",
10075 WaitSubsystem::CHAINMOVES => "CHAINMOVES",
10076 WaitSubsystem::CHANNELMOVES => "CHANNELMOVES",
10077 }.to_string()
10078 }
10079 }
10080
10081 #[derive(Clone, Debug, Deserialize, Serialize)]
10082 pub struct WaitResponse {
10083 #[deprecated]
10084 #[serde(skip_serializing_if = "Option::is_none")]
10085 pub details: Option<WaitDetails>,
10086 #[serde(skip_serializing_if = "Option::is_none")]
10087 pub chainmoves: Option<WaitChainmoves>,
10088 #[serde(skip_serializing_if = "Option::is_none")]
10089 pub channelmoves: Option<WaitChannelmoves>,
10090 #[serde(skip_serializing_if = "Option::is_none")]
10091 pub created: Option<u64>,
10092 #[serde(skip_serializing_if = "Option::is_none")]
10093 pub deleted: Option<u64>,
10094 #[serde(skip_serializing_if = "Option::is_none")]
10095 pub forwards: Option<WaitForwards>,
10096 #[serde(skip_serializing_if = "Option::is_none")]
10097 pub htlcs: Option<WaitHtlcs>,
10098 #[serde(skip_serializing_if = "Option::is_none")]
10099 pub invoices: Option<WaitInvoices>,
10100 #[serde(skip_serializing_if = "Option::is_none")]
10101 pub sendpays: Option<WaitSendpays>,
10102 #[serde(skip_serializing_if = "Option::is_none")]
10103 pub updated: Option<u64>,
10104 pub subsystem: WaitSubsystem,
10106 }
10107
10108 impl TryFrom<Response> for WaitResponse {
10109 type Error = super::TryFromResponseError;
10110
10111 fn try_from(response: Response) -> Result<Self, Self::Error> {
10112 match response {
10113 Response::Wait(response) => Ok(response),
10114 _ => Err(TryFromResponseError)
10115 }
10116 }
10117 }
10118
10119 #[derive(Clone, Debug, Deserialize, Serialize)]
10120 pub struct ListconfigsConfigsExperimentaloffers {
10121 pub set: bool,
10122 pub source: String,
10123 }
10124
10125 #[derive(Clone, Debug, Deserialize, Serialize)]
10126 pub struct ListconfigsConfigsExperimentalonionmessages {
10127 pub set: bool,
10128 pub source: String,
10129 }
10130
10131 #[derive(Clone, Debug, Deserialize, Serialize)]
10132 pub struct ListconfigsConfigsMaxlocktimeblocks {
10133 pub source: String,
10134 pub value_int: u32,
10135 }
10136
10137 #[derive(Clone, Debug, Deserialize, Serialize)]
10138 pub struct ListconfigsConfigsAllowdeprecatedapis {
10139 pub source: String,
10140 pub value_bool: bool,
10141 }
10142
10143 #[derive(Clone, Debug, Deserialize, Serialize)]
10144 pub struct ListconfigsConfigsAlwaysuseproxy {
10145 pub source: String,
10146 pub value_bool: bool,
10147 }
10148
10149 #[derive(Clone, Debug, Deserialize, Serialize)]
10150 pub struct ListconfigsConfigsAnnounceaddr {
10151 pub sources: Vec<String>,
10152 pub values_str: Vec<String>,
10153 }
10154
10155 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
10157 #[allow(non_camel_case_types)]
10158 pub enum ListconfigsConfigsAnnounceaddrdiscoveredValueStr {
10159 #[serde(rename = "true")]
10160 TRUE = 0,
10161 #[serde(rename = "false")]
10162 FALSE = 1,
10163 #[serde(rename = "auto")]
10164 AUTO = 2,
10165 }
10166
10167 impl TryFrom<i32> for ListconfigsConfigsAnnounceaddrdiscoveredValueStr {
10168 type Error = anyhow::Error;
10169 fn try_from(c: i32) -> Result<ListconfigsConfigsAnnounceaddrdiscoveredValueStr, anyhow::Error> {
10170 match c {
10171 0 => Ok(ListconfigsConfigsAnnounceaddrdiscoveredValueStr::TRUE),
10172 1 => Ok(ListconfigsConfigsAnnounceaddrdiscoveredValueStr::FALSE),
10173 2 => Ok(ListconfigsConfigsAnnounceaddrdiscoveredValueStr::AUTO),
10174 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListconfigsConfigsAnnounceaddrdiscoveredValueStr", o)),
10175 }
10176 }
10177 }
10178
10179 impl ToString for ListconfigsConfigsAnnounceaddrdiscoveredValueStr {
10180 fn to_string(&self) -> String {
10181 match self {
10182 ListconfigsConfigsAnnounceaddrdiscoveredValueStr::TRUE => "TRUE",
10183 ListconfigsConfigsAnnounceaddrdiscoveredValueStr::FALSE => "FALSE",
10184 ListconfigsConfigsAnnounceaddrdiscoveredValueStr::AUTO => "AUTO",
10185 }.to_string()
10186 }
10187 }
10188
10189 #[derive(Clone, Debug, Deserialize, Serialize)]
10190 pub struct ListconfigsConfigsAnnounceaddrdiscovered {
10191 pub value_str: ListconfigsConfigsAnnounceaddrdiscoveredValueStr,
10193 pub source: String,
10194 }
10195
10196 #[derive(Clone, Debug, Deserialize, Serialize)]
10197 pub struct ListconfigsConfigsAnnounceaddrdiscoveredport {
10198 pub source: String,
10199 pub value_int: u32,
10200 }
10201
10202 #[derive(Clone, Debug, Deserialize, Serialize)]
10203 pub struct ListconfigsConfigsAnnounceaddrdns {
10204 pub source: String,
10205 pub value_bool: bool,
10206 }
10207
10208 #[derive(Clone, Debug, Deserialize, Serialize)]
10209 pub struct ListconfigsConfigsAutoconnectseekerpeers {
10210 pub source: String,
10211 pub value_int: u32,
10212 }
10213
10214 #[derive(Clone, Debug, Deserialize, Serialize)]
10215 pub struct ListconfigsConfigsBindaddr {
10216 pub sources: Vec<String>,
10217 pub values_str: Vec<String>,
10218 }
10219
10220 #[derive(Clone, Debug, Deserialize, Serialize)]
10221 pub struct ListconfigsConfigsClearplugins {
10222 pub set: bool,
10223 pub source: String,
10224 }
10225
10226 #[derive(Clone, Debug, Deserialize, Serialize)]
10227 pub struct ListconfigsConfigsCltvdelta {
10228 pub source: String,
10229 pub value_int: u32,
10230 }
10231
10232 #[derive(Clone, Debug, Deserialize, Serialize)]
10233 pub struct ListconfigsConfigsCltvfinal {
10234 pub source: String,
10235 pub value_int: u32,
10236 }
10237
10238 #[derive(Clone, Debug, Deserialize, Serialize)]
10239 pub struct ListconfigsConfigsCommitfee {
10240 pub source: String,
10241 pub value_int: u64,
10242 }
10243
10244 #[derive(Clone, Debug, Deserialize, Serialize)]
10245 pub struct ListconfigsConfigsCommitfeerateoffset {
10246 pub source: String,
10247 pub value_int: u32,
10248 }
10249
10250 #[derive(Clone, Debug, Deserialize, Serialize)]
10251 pub struct ListconfigsConfigsCommittime {
10252 pub source: String,
10253 pub value_int: u32,
10254 }
10255
10256 #[derive(Clone, Debug, Deserialize, Serialize)]
10257 pub struct ListconfigsConfigsDatabaseupgrade {
10258 pub source: String,
10259 pub value_bool: bool,
10260 }
10261
10262 #[derive(Clone, Debug, Deserialize, Serialize)]
10263 pub struct ListconfigsConfigsDisabledns {
10264 pub set: bool,
10265 pub source: String,
10266 }
10267
10268 #[derive(Clone, Debug, Deserialize, Serialize)]
10269 pub struct ListconfigsConfigsDisablempp {
10270 #[serde(skip_serializing_if = "Option::is_none")]
10271 pub plugin: Option<String>,
10272 pub set: bool,
10273 pub source: String,
10274 }
10275
10276 #[derive(Clone, Debug, Deserialize, Serialize)]
10277 pub struct ListconfigsConfigsDisableplugin {
10278 pub sources: Vec<String>,
10279 pub values_str: Vec<String>,
10280 }
10281
10282 #[derive(Clone, Debug, Deserialize, Serialize)]
10283 pub struct ListconfigsConfigsEncryptedhsm {
10284 pub set: bool,
10285 pub source: String,
10286 }
10287
10288 #[derive(Clone, Debug, Deserialize, Serialize)]
10289 pub struct ListconfigsConfigsExperimentalanchors {
10290 pub set: bool,
10291 pub source: String,
10292 }
10293
10294 #[derive(Clone, Debug, Deserialize, Serialize)]
10295 pub struct ListconfigsConfigsExperimentaldualfund {
10296 pub set: bool,
10297 pub source: String,
10298 }
10299
10300 #[derive(Clone, Debug, Deserialize, Serialize)]
10301 pub struct ListconfigsConfigsExperimentalpeerstorage {
10302 pub set: bool,
10303 pub source: String,
10304 }
10305
10306 #[derive(Clone, Debug, Deserialize, Serialize)]
10307 pub struct ListconfigsConfigsExperimentalshutdownwrongfunding {
10308 pub set: bool,
10309 pub source: String,
10310 }
10311
10312 #[derive(Clone, Debug, Deserialize, Serialize)]
10313 pub struct ListconfigsConfigsExperimentalsplicing {
10314 pub set: bool,
10315 pub source: String,
10316 }
10317
10318 #[derive(Clone, Debug, Deserialize, Serialize)]
10319 pub struct ListconfigsConfigsFeebase {
10320 pub source: String,
10321 pub value_int: u32,
10322 }
10323
10324 #[derive(Clone, Debug, Deserialize, Serialize)]
10325 pub struct ListconfigsConfigsFeepersatoshi {
10326 pub source: String,
10327 pub value_int: u32,
10328 }
10329
10330 #[derive(Clone, Debug, Deserialize, Serialize)]
10331 pub struct ListconfigsConfigsFetchinvoicenoconnect {
10332 #[serde(skip_serializing_if = "Option::is_none")]
10333 pub plugin: Option<String>,
10334 pub set: bool,
10335 pub source: String,
10336 }
10337
10338 #[derive(Clone, Debug, Deserialize, Serialize)]
10339 pub struct ListconfigsConfigsForcefeerates {
10340 pub source: String,
10341 pub value_str: String,
10342 }
10343
10344 #[derive(Clone, Debug, Deserialize, Serialize)]
10345 pub struct ListconfigsConfigsFundingconfirms {
10346 pub source: String,
10347 pub value_int: u32,
10348 }
10349
10350 #[derive(Clone, Debug, Deserialize, Serialize)]
10351 pub struct ListconfigsConfigsHtlcmaximummsat {
10352 pub source: String,
10353 pub value_msat: Amount,
10354 }
10355
10356 #[derive(Clone, Debug, Deserialize, Serialize)]
10357 pub struct ListconfigsConfigsHtlcminimummsat {
10358 pub source: String,
10359 pub value_msat: Amount,
10360 }
10361
10362 #[derive(Clone, Debug, Deserialize, Serialize)]
10363 pub struct ListconfigsConfigsIgnorefeelimits {
10364 pub source: String,
10365 pub value_bool: bool,
10366 }
10367
10368 #[derive(Clone, Debug, Deserialize, Serialize)]
10369 pub struct ListconfigsConfigsImportantplugin {
10370 pub sources: Vec<String>,
10371 pub values_str: Vec<String>,
10372 }
10373
10374 #[derive(Clone, Debug, Deserialize, Serialize)]
10375 pub struct ListconfigsConfigsLargechannels {
10376 pub set: bool,
10377 pub source: String,
10378 }
10379
10380 #[derive(Clone, Debug, Deserialize, Serialize)]
10381 pub struct ListconfigsConfigsLightningdir {
10382 pub source: String,
10383 pub value_str: String,
10384 }
10385
10386 #[derive(Clone, Debug, Deserialize, Serialize)]
10387 pub struct ListconfigsConfigsLogfile {
10388 pub sources: Vec<String>,
10389 pub values_str: Vec<String>,
10390 }
10391
10392 #[derive(Clone, Debug, Deserialize, Serialize)]
10393 pub struct ListconfigsConfigsLoglevel {
10394 pub source: String,
10395 pub value_str: String,
10396 }
10397
10398 #[derive(Clone, Debug, Deserialize, Serialize)]
10399 pub struct ListconfigsConfigsLogprefix {
10400 pub source: String,
10401 pub value_str: String,
10402 }
10403
10404 #[derive(Clone, Debug, Deserialize, Serialize)]
10405 pub struct ListconfigsConfigsLogtimestamps {
10406 pub source: String,
10407 pub value_bool: bool,
10408 }
10409
10410 #[derive(Clone, Debug, Deserialize, Serialize)]
10411 pub struct ListconfigsConfigsMaxconcurrenthtlcs {
10412 pub source: String,
10413 pub value_int: u32,
10414 }
10415
10416 #[derive(Clone, Debug, Deserialize, Serialize)]
10417 pub struct ListconfigsConfigsMaxdusthtlcexposuremsat {
10418 pub source: String,
10419 pub value_msat: Amount,
10420 }
10421
10422 #[derive(Clone, Debug, Deserialize, Serialize)]
10423 pub struct ListconfigsConfigsMincapacitysat {
10424 #[serde(skip_serializing_if = "Option::is_none")]
10425 pub dynamic: Option<bool>,
10426 pub source: String,
10427 pub value_int: u64,
10428 }
10429
10430 #[derive(Clone, Debug, Deserialize, Serialize)]
10431 pub struct ListconfigsConfigsPidfile {
10432 pub source: String,
10433 pub value_str: String,
10434 }
10435
10436 #[derive(Clone, Debug, Deserialize, Serialize)]
10437 pub struct ListconfigsConfigsPlugindir {
10438 pub sources: Vec<String>,
10439 pub values_str: Vec<String>,
10440 }
10441
10442 #[derive(Clone, Debug, Deserialize, Serialize)]
10443 pub struct ListconfigsConfigsRequireconfirmedinputs {
10444 pub source: String,
10445 pub value_bool: bool,
10446 }
10447
10448 #[derive(Clone, Debug, Deserialize, Serialize)]
10449 pub struct ListconfigsConfigsRpcfile {
10450 pub source: String,
10451 pub value_str: String,
10452 }
10453
10454 #[derive(Clone, Debug, Deserialize, Serialize)]
10455 pub struct ListconfigsConfigsRpcfilemode {
10456 pub source: String,
10457 pub value_str: String,
10458 }
10459
10460 #[derive(Clone, Debug, Deserialize, Serialize)]
10461 pub struct ListconfigsConfigsTorservicepassword {
10462 pub source: String,
10463 pub value_str: String,
10464 }
10465
10466 #[derive(Clone, Debug, Deserialize, Serialize)]
10467 pub struct ListconfigsConfigsWatchtimeblocks {
10468 pub source: String,
10469 pub value_int: u32,
10470 }
10471
10472 #[derive(Clone, Debug, Deserialize, Serialize)]
10473 pub struct ListconfigsConfigsAddr {
10474 pub sources: Vec<String>,
10475 pub values_str: Vec<String>,
10476 }
10477
10478 #[derive(Clone, Debug, Deserialize, Serialize)]
10479 pub struct ListconfigsConfigsAlias {
10480 pub source: String,
10481 pub value_str: String,
10482 }
10483
10484 #[derive(Clone, Debug, Deserialize, Serialize)]
10485 pub struct ListconfigsConfigsAutolisten {
10486 pub source: String,
10487 pub value_bool: bool,
10488 }
10489
10490 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
10492 #[allow(non_camel_case_types)]
10493 pub enum ListconfigsConfigsConfSource {
10494 #[serde(rename = "cmdline")]
10495 CMDLINE = 0,
10496 }
10497
10498 impl TryFrom<i32> for ListconfigsConfigsConfSource {
10499 type Error = anyhow::Error;
10500 fn try_from(c: i32) -> Result<ListconfigsConfigsConfSource, anyhow::Error> {
10501 match c {
10502 0 => Ok(ListconfigsConfigsConfSource::CMDLINE),
10503 o => Err(anyhow::anyhow!("Unknown variant {} for enum ListconfigsConfigsConfSource", o)),
10504 }
10505 }
10506 }
10507
10508 impl ToString for ListconfigsConfigsConfSource {
10509 fn to_string(&self) -> String {
10510 match self {
10511 ListconfigsConfigsConfSource::CMDLINE => "CMDLINE",
10512 }.to_string()
10513 }
10514 }
10515
10516 #[derive(Clone, Debug, Deserialize, Serialize)]
10517 pub struct ListconfigsConfigsConf {
10518 pub source: ListconfigsConfigsConfSource,
10520 pub value_str: String,
10521 }
10522
10523 #[derive(Clone, Debug, Deserialize, Serialize)]
10524 pub struct ListconfigsConfigsDaemon {
10525 pub set: bool,
10526 pub source: String,
10527 }
10528
10529 #[derive(Clone, Debug, Deserialize, Serialize)]
10530 pub struct ListconfigsConfigsDeveloper {
10531 pub set: bool,
10532 pub source: String,
10533 }
10534
10535 #[derive(Clone, Debug, Deserialize, Serialize)]
10536 pub struct ListconfigsConfigsMainnet {
10537 pub set: bool,
10538 pub source: String,
10539 }
10540
10541 #[derive(Clone, Debug, Deserialize, Serialize)]
10542 pub struct ListconfigsConfigsNetwork {
10543 pub source: String,
10544 pub value_str: String,
10545 }
10546
10547 #[derive(Clone, Debug, Deserialize, Serialize)]
10548 pub struct ListconfigsConfigsOffline {
10549 pub set: bool,
10550 pub source: String,
10551 }
10552
10553 #[derive(Clone, Debug, Deserialize, Serialize)]
10554 pub struct ListconfigsConfigsPlugin {
10555 pub sources: Vec<String>,
10556 pub values_str: Vec<String>,
10557 }
10558
10559 #[derive(Clone, Debug, Deserialize, Serialize)]
10560 pub struct ListconfigsConfigsProxy {
10561 pub source: String,
10562 pub value_str: String,
10563 }
10564
10565 #[derive(Clone, Debug, Deserialize, Serialize)]
10566 pub struct ListconfigsConfigsRegtest {
10567 pub set: bool,
10568 pub source: String,
10569 }
10570
10571 #[derive(Clone, Debug, Deserialize, Serialize)]
10572 pub struct ListconfigsConfigsRescan {
10573 pub source: String,
10574 pub value_int: i64,
10575 }
10576
10577 #[derive(Clone, Debug, Deserialize, Serialize)]
10578 pub struct ListconfigsConfigsRgb {
10579 pub source: String,
10580 pub value_str: String,
10581 }
10582
10583 #[derive(Clone, Debug, Deserialize, Serialize)]
10584 pub struct ListconfigsConfigsSignet {
10585 pub set: bool,
10586 pub source: String,
10587 }
10588
10589 #[derive(Clone, Debug, Deserialize, Serialize)]
10590 pub struct ListconfigsConfigsSubdaemon {
10591 pub sources: Vec<String>,
10592 pub values_str: Vec<String>,
10593 }
10594
10595 #[derive(Clone, Debug, Deserialize, Serialize)]
10596 pub struct ListconfigsConfigsTestnet {
10597 pub set: bool,
10598 pub source: String,
10599 }
10600
10601 #[derive(Clone, Debug, Deserialize, Serialize)]
10602 pub struct ListconfigsConfigsWallet {
10603 pub source: String,
10604 pub value_str: String,
10605 }
10606
10607 #[derive(Clone, Debug, Deserialize, Serialize)]
10608 pub struct ListconfigsConfigs {
10609 #[deprecated]
10610 #[serde(rename = "experimental-offers")]
10611 #[serde(skip_serializing_if = "Option::is_none")]
10612 pub experimental_offers: Option<ListconfigsConfigsExperimentaloffers>,
10613 #[deprecated]
10614 #[serde(rename = "experimental-onion-messages")]
10615 #[serde(skip_serializing_if = "Option::is_none")]
10616 pub experimental_onion_messages: Option<ListconfigsConfigsExperimentalonionmessages>,
10617 #[deprecated]
10618 #[serde(rename = "max-locktime-blocks")]
10619 #[serde(skip_serializing_if = "Option::is_none")]
10620 pub max_locktime_blocks: Option<ListconfigsConfigsMaxlocktimeblocks>,
10621 #[serde(rename = "allow-deprecated-apis")]
10622 #[serde(skip_serializing_if = "Option::is_none")]
10623 pub allow_deprecated_apis: Option<ListconfigsConfigsAllowdeprecatedapis>,
10624 #[serde(rename = "always-use-proxy")]
10625 #[serde(skip_serializing_if = "Option::is_none")]
10626 pub always_use_proxy: Option<ListconfigsConfigsAlwaysuseproxy>,
10627 #[serde(rename = "announce-addr")]
10628 #[serde(skip_serializing_if = "Option::is_none")]
10629 pub announce_addr: Option<ListconfigsConfigsAnnounceaddr>,
10630 #[serde(rename = "announce-addr-discovered")]
10631 #[serde(skip_serializing_if = "Option::is_none")]
10632 pub announce_addr_discovered: Option<ListconfigsConfigsAnnounceaddrdiscovered>,
10633 #[serde(rename = "announce-addr-discovered-port")]
10634 #[serde(skip_serializing_if = "Option::is_none")]
10635 pub announce_addr_discovered_port: Option<ListconfigsConfigsAnnounceaddrdiscoveredport>,
10636 #[serde(rename = "announce-addr-dns")]
10637 #[serde(skip_serializing_if = "Option::is_none")]
10638 pub announce_addr_dns: Option<ListconfigsConfigsAnnounceaddrdns>,
10639 #[serde(rename = "autoconnect-seeker-peers")]
10640 #[serde(skip_serializing_if = "Option::is_none")]
10641 pub autoconnect_seeker_peers: Option<ListconfigsConfigsAutoconnectseekerpeers>,
10642 #[serde(rename = "bind-addr")]
10643 #[serde(skip_serializing_if = "Option::is_none")]
10644 pub bind_addr: Option<ListconfigsConfigsBindaddr>,
10645 #[serde(rename = "clear-plugins")]
10646 #[serde(skip_serializing_if = "Option::is_none")]
10647 pub clear_plugins: Option<ListconfigsConfigsClearplugins>,
10648 #[serde(rename = "cltv-delta")]
10649 #[serde(skip_serializing_if = "Option::is_none")]
10650 pub cltv_delta: Option<ListconfigsConfigsCltvdelta>,
10651 #[serde(rename = "cltv-final")]
10652 #[serde(skip_serializing_if = "Option::is_none")]
10653 pub cltv_final: Option<ListconfigsConfigsCltvfinal>,
10654 #[serde(rename = "commit-fee")]
10655 #[serde(skip_serializing_if = "Option::is_none")]
10656 pub commit_fee: Option<ListconfigsConfigsCommitfee>,
10657 #[serde(rename = "commit-feerate-offset")]
10658 #[serde(skip_serializing_if = "Option::is_none")]
10659 pub commit_feerate_offset: Option<ListconfigsConfigsCommitfeerateoffset>,
10660 #[serde(rename = "commit-time")]
10661 #[serde(skip_serializing_if = "Option::is_none")]
10662 pub commit_time: Option<ListconfigsConfigsCommittime>,
10663 #[serde(rename = "database-upgrade")]
10664 #[serde(skip_serializing_if = "Option::is_none")]
10665 pub database_upgrade: Option<ListconfigsConfigsDatabaseupgrade>,
10666 #[serde(rename = "disable-dns")]
10667 #[serde(skip_serializing_if = "Option::is_none")]
10668 pub disable_dns: Option<ListconfigsConfigsDisabledns>,
10669 #[serde(rename = "disable-mpp")]
10670 #[serde(skip_serializing_if = "Option::is_none")]
10671 pub disable_mpp: Option<ListconfigsConfigsDisablempp>,
10672 #[serde(rename = "disable-plugin")]
10673 #[serde(skip_serializing_if = "Option::is_none")]
10674 pub disable_plugin: Option<ListconfigsConfigsDisableplugin>,
10675 #[serde(rename = "encrypted-hsm")]
10676 #[serde(skip_serializing_if = "Option::is_none")]
10677 pub encrypted_hsm: Option<ListconfigsConfigsEncryptedhsm>,
10678 #[serde(rename = "experimental-anchors")]
10679 #[serde(skip_serializing_if = "Option::is_none")]
10680 pub experimental_anchors: Option<ListconfigsConfigsExperimentalanchors>,
10681 #[serde(rename = "experimental-dual-fund")]
10682 #[serde(skip_serializing_if = "Option::is_none")]
10683 pub experimental_dual_fund: Option<ListconfigsConfigsExperimentaldualfund>,
10684 #[serde(rename = "experimental-peer-storage")]
10685 #[serde(skip_serializing_if = "Option::is_none")]
10686 pub experimental_peer_storage: Option<ListconfigsConfigsExperimentalpeerstorage>,
10687 #[serde(rename = "experimental-shutdown-wrong-funding")]
10688 #[serde(skip_serializing_if = "Option::is_none")]
10689 pub experimental_shutdown_wrong_funding: Option<ListconfigsConfigsExperimentalshutdownwrongfunding>,
10690 #[serde(rename = "experimental-splicing")]
10691 #[serde(skip_serializing_if = "Option::is_none")]
10692 pub experimental_splicing: Option<ListconfigsConfigsExperimentalsplicing>,
10693 #[serde(rename = "fee-base")]
10694 #[serde(skip_serializing_if = "Option::is_none")]
10695 pub fee_base: Option<ListconfigsConfigsFeebase>,
10696 #[serde(rename = "fee-per-satoshi")]
10697 #[serde(skip_serializing_if = "Option::is_none")]
10698 pub fee_per_satoshi: Option<ListconfigsConfigsFeepersatoshi>,
10699 #[serde(rename = "fetchinvoice-noconnect")]
10700 #[serde(skip_serializing_if = "Option::is_none")]
10701 pub fetchinvoice_noconnect: Option<ListconfigsConfigsFetchinvoicenoconnect>,
10702 #[serde(rename = "force-feerates")]
10703 #[serde(skip_serializing_if = "Option::is_none")]
10704 pub force_feerates: Option<ListconfigsConfigsForcefeerates>,
10705 #[serde(rename = "funding-confirms")]
10706 #[serde(skip_serializing_if = "Option::is_none")]
10707 pub funding_confirms: Option<ListconfigsConfigsFundingconfirms>,
10708 #[serde(rename = "htlc-maximum-msat")]
10709 #[serde(skip_serializing_if = "Option::is_none")]
10710 pub htlc_maximum_msat: Option<ListconfigsConfigsHtlcmaximummsat>,
10711 #[serde(rename = "htlc-minimum-msat")]
10712 #[serde(skip_serializing_if = "Option::is_none")]
10713 pub htlc_minimum_msat: Option<ListconfigsConfigsHtlcminimummsat>,
10714 #[serde(rename = "ignore-fee-limits")]
10715 #[serde(skip_serializing_if = "Option::is_none")]
10716 pub ignore_fee_limits: Option<ListconfigsConfigsIgnorefeelimits>,
10717 #[serde(rename = "important-plugin")]
10718 #[serde(skip_serializing_if = "Option::is_none")]
10719 pub important_plugin: Option<ListconfigsConfigsImportantplugin>,
10720 #[serde(rename = "large-channels")]
10721 #[serde(skip_serializing_if = "Option::is_none")]
10722 pub large_channels: Option<ListconfigsConfigsLargechannels>,
10723 #[serde(rename = "lightning-dir")]
10724 #[serde(skip_serializing_if = "Option::is_none")]
10725 pub lightning_dir: Option<ListconfigsConfigsLightningdir>,
10726 #[serde(rename = "log-file")]
10727 #[serde(skip_serializing_if = "Option::is_none")]
10728 pub log_file: Option<ListconfigsConfigsLogfile>,
10729 #[serde(rename = "log-level")]
10730 #[serde(skip_serializing_if = "Option::is_none")]
10731 pub log_level: Option<ListconfigsConfigsLoglevel>,
10732 #[serde(rename = "log-prefix")]
10733 #[serde(skip_serializing_if = "Option::is_none")]
10734 pub log_prefix: Option<ListconfigsConfigsLogprefix>,
10735 #[serde(rename = "log-timestamps")]
10736 #[serde(skip_serializing_if = "Option::is_none")]
10737 pub log_timestamps: Option<ListconfigsConfigsLogtimestamps>,
10738 #[serde(rename = "max-concurrent-htlcs")]
10739 #[serde(skip_serializing_if = "Option::is_none")]
10740 pub max_concurrent_htlcs: Option<ListconfigsConfigsMaxconcurrenthtlcs>,
10741 #[serde(rename = "max-dust-htlc-exposure-msat")]
10742 #[serde(skip_serializing_if = "Option::is_none")]
10743 pub max_dust_htlc_exposure_msat: Option<ListconfigsConfigsMaxdusthtlcexposuremsat>,
10744 #[serde(rename = "min-capacity-sat")]
10745 #[serde(skip_serializing_if = "Option::is_none")]
10746 pub min_capacity_sat: Option<ListconfigsConfigsMincapacitysat>,
10747 #[serde(rename = "pid-file")]
10748 #[serde(skip_serializing_if = "Option::is_none")]
10749 pub pid_file: Option<ListconfigsConfigsPidfile>,
10750 #[serde(rename = "plugin-dir")]
10751 #[serde(skip_serializing_if = "Option::is_none")]
10752 pub plugin_dir: Option<ListconfigsConfigsPlugindir>,
10753 #[serde(rename = "require-confirmed-inputs")]
10754 #[serde(skip_serializing_if = "Option::is_none")]
10755 pub require_confirmed_inputs: Option<ListconfigsConfigsRequireconfirmedinputs>,
10756 #[serde(rename = "rpc-file")]
10757 #[serde(skip_serializing_if = "Option::is_none")]
10758 pub rpc_file: Option<ListconfigsConfigsRpcfile>,
10759 #[serde(rename = "rpc-file-mode")]
10760 #[serde(skip_serializing_if = "Option::is_none")]
10761 pub rpc_file_mode: Option<ListconfigsConfigsRpcfilemode>,
10762 #[serde(rename = "tor-service-password")]
10763 #[serde(skip_serializing_if = "Option::is_none")]
10764 pub tor_service_password: Option<ListconfigsConfigsTorservicepassword>,
10765 #[serde(rename = "watchtime-blocks")]
10766 #[serde(skip_serializing_if = "Option::is_none")]
10767 pub watchtime_blocks: Option<ListconfigsConfigsWatchtimeblocks>,
10768 #[serde(skip_serializing_if = "Option::is_none")]
10769 pub addr: Option<ListconfigsConfigsAddr>,
10770 #[serde(skip_serializing_if = "Option::is_none")]
10771 pub alias: Option<ListconfigsConfigsAlias>,
10772 #[serde(skip_serializing_if = "Option::is_none")]
10773 pub autolisten: Option<ListconfigsConfigsAutolisten>,
10774 #[serde(skip_serializing_if = "Option::is_none")]
10775 pub conf: Option<ListconfigsConfigsConf>,
10776 #[serde(skip_serializing_if = "Option::is_none")]
10777 pub daemon: Option<ListconfigsConfigsDaemon>,
10778 #[serde(skip_serializing_if = "Option::is_none")]
10779 pub developer: Option<ListconfigsConfigsDeveloper>,
10780 #[serde(skip_serializing_if = "Option::is_none")]
10781 pub mainnet: Option<ListconfigsConfigsMainnet>,
10782 #[serde(skip_serializing_if = "Option::is_none")]
10783 pub network: Option<ListconfigsConfigsNetwork>,
10784 #[serde(skip_serializing_if = "Option::is_none")]
10785 pub offline: Option<ListconfigsConfigsOffline>,
10786 #[serde(skip_serializing_if = "Option::is_none")]
10787 pub plugin: Option<ListconfigsConfigsPlugin>,
10788 #[serde(skip_serializing_if = "Option::is_none")]
10789 pub proxy: Option<ListconfigsConfigsProxy>,
10790 #[serde(skip_serializing_if = "Option::is_none")]
10791 pub regtest: Option<ListconfigsConfigsRegtest>,
10792 #[serde(skip_serializing_if = "Option::is_none")]
10793 pub rescan: Option<ListconfigsConfigsRescan>,
10794 #[serde(skip_serializing_if = "Option::is_none")]
10795 pub rgb: Option<ListconfigsConfigsRgb>,
10796 #[serde(skip_serializing_if = "Option::is_none")]
10797 pub signet: Option<ListconfigsConfigsSignet>,
10798 #[serde(skip_serializing_if = "Option::is_none")]
10799 pub subdaemon: Option<ListconfigsConfigsSubdaemon>,
10800 #[serde(skip_serializing_if = "Option::is_none")]
10801 pub testnet: Option<ListconfigsConfigsTestnet>,
10802 #[serde(skip_serializing_if = "Option::is_none")]
10803 pub wallet: Option<ListconfigsConfigsWallet>,
10804 }
10805
10806 #[derive(Clone, Debug, Deserialize, Serialize)]
10807 pub struct ListconfigsResponse {
10808 #[serde(skip_serializing_if = "Option::is_none")]
10809 pub configs: Option<ListconfigsConfigs>,
10810 }
10811
10812 impl TryFrom<Response> for ListconfigsResponse {
10813 type Error = super::TryFromResponseError;
10814
10815 fn try_from(response: Response) -> Result<Self, Self::Error> {
10816 match response {
10817 Response::ListConfigs(response) => Ok(response),
10818 _ => Err(TryFromResponseError)
10819 }
10820 }
10821 }
10822
10823 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
10824 #[allow(non_camel_case_types)]
10825 pub enum StopResult {
10826 #[serde(rename = "Shutdown complete")]
10827 SHUTDOWN_COMPLETE = 0,
10828 }
10829
10830 impl TryFrom<i32> for StopResult {
10831 type Error = anyhow::Error;
10832 fn try_from(c: i32) -> Result<StopResult, anyhow::Error> {
10833 match c {
10834 0 => Ok(StopResult::SHUTDOWN_COMPLETE),
10835 o => Err(anyhow::anyhow!("Unknown variant {} for enum StopResult", o)),
10836 }
10837 }
10838 }
10839
10840 impl ToString for StopResult {
10841 fn to_string(&self) -> String {
10842 match self {
10843 StopResult::SHUTDOWN_COMPLETE => "SHUTDOWN_COMPLETE",
10844 }.to_string()
10845 }
10846 }
10847
10848 #[derive(Clone, Debug, Deserialize, Serialize)]
10849 pub struct StopResponse {
10850 #[serde(skip_serializing_if = "Option::is_none")]
10851 pub result: Option<StopResult>,
10852 }
10853
10854 impl TryFrom<Response> for StopResponse {
10855 type Error = super::TryFromResponseError;
10856
10857 fn try_from(response: Response) -> Result<Self, Self::Error> {
10858 match response {
10859 Response::Stop(response) => Ok(response),
10860 _ => Err(TryFromResponseError)
10861 }
10862 }
10863 }
10864
10865 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
10867 #[allow(non_camel_case_types)]
10868 pub enum HelpFormathint {
10869 #[serde(rename = "simple")]
10870 SIMPLE = 0,
10871 }
10872
10873 impl TryFrom<i32> for HelpFormathint {
10874 type Error = anyhow::Error;
10875 fn try_from(c: i32) -> Result<HelpFormathint, anyhow::Error> {
10876 match c {
10877 0 => Ok(HelpFormathint::SIMPLE),
10878 o => Err(anyhow::anyhow!("Unknown variant {} for enum HelpFormathint", o)),
10879 }
10880 }
10881 }
10882
10883 impl ToString for HelpFormathint {
10884 fn to_string(&self) -> String {
10885 match self {
10886 HelpFormathint::SIMPLE => "SIMPLE",
10887 }.to_string()
10888 }
10889 }
10890
10891 #[derive(Clone, Debug, Deserialize, Serialize)]
10892 pub struct HelpHelp {
10893 pub command: String,
10894 }
10895
10896 #[derive(Clone, Debug, Deserialize, Serialize)]
10897 pub struct HelpResponse {
10898 #[serde(skip_serializing_if = "Option::is_none")]
10899 pub format_hint: Option<HelpFormathint>,
10900 pub help: Vec<HelpHelp>,
10901 }
10902
10903 impl TryFrom<Response> for HelpResponse {
10904 type Error = super::TryFromResponseError;
10905
10906 fn try_from(response: Response) -> Result<Self, Self::Error> {
10907 match response {
10908 Response::Help(response) => Ok(response),
10909 _ => Err(TryFromResponseError)
10910 }
10911 }
10912 }
10913
10914 #[derive(Clone, Debug, Deserialize, Serialize)]
10915 pub struct PreapprovekeysendResponse {
10916 }
10917
10918 impl TryFrom<Response> for PreapprovekeysendResponse {
10919 type Error = super::TryFromResponseError;
10920
10921 fn try_from(response: Response) -> Result<Self, Self::Error> {
10922 match response {
10923 Response::PreApproveKeysend(response) => Ok(response),
10924 _ => Err(TryFromResponseError)
10925 }
10926 }
10927 }
10928
10929 #[derive(Clone, Debug, Deserialize, Serialize)]
10930 pub struct PreapproveinvoiceResponse {
10931 }
10932
10933 impl TryFrom<Response> for PreapproveinvoiceResponse {
10934 type Error = super::TryFromResponseError;
10935
10936 fn try_from(response: Response) -> Result<Self, Self::Error> {
10937 match response {
10938 Response::PreApproveInvoice(response) => Ok(response),
10939 _ => Err(TryFromResponseError)
10940 }
10941 }
10942 }
10943
10944 #[derive(Clone, Debug, Deserialize, Serialize)]
10945 pub struct StaticbackupResponse {
10946 pub scb: Vec<String>,
10947 }
10948
10949 impl TryFrom<Response> for StaticbackupResponse {
10950 type Error = super::TryFromResponseError;
10951
10952 fn try_from(response: Response) -> Result<Self, Self::Error> {
10953 match response {
10954 Response::StaticBackup(response) => Ok(response),
10955 _ => Err(TryFromResponseError)
10956 }
10957 }
10958 }
10959
10960 #[derive(Clone, Debug, Deserialize, Serialize)]
10961 pub struct BkprchannelsapyChannelsApy {
10962 #[serde(skip_serializing_if = "Option::is_none")]
10963 pub apy_in_initial: Option<String>,
10964 #[serde(skip_serializing_if = "Option::is_none")]
10965 pub apy_lease: Option<String>,
10966 #[serde(skip_serializing_if = "Option::is_none")]
10967 pub apy_out_initial: Option<String>,
10968 #[serde(skip_serializing_if = "Option::is_none")]
10969 pub apy_total_initial: Option<String>,
10970 #[serde(skip_serializing_if = "Option::is_none")]
10971 pub fees_in_msat: Option<Amount>,
10972 #[serde(skip_serializing_if = "Option::is_none")]
10973 pub utilization_in_initial: Option<String>,
10974 #[serde(skip_serializing_if = "Option::is_none")]
10975 pub utilization_out_initial: Option<String>,
10976 pub account: String,
10977 pub apy_in: String,
10978 pub apy_out: String,
10979 pub apy_total: String,
10980 pub channel_start_balance_msat: Amount,
10981 pub fees_out_msat: Amount,
10982 pub lease_fee_earned_msat: Amount,
10983 pub lease_fee_paid_msat: Amount,
10984 pub our_start_balance_msat: Amount,
10985 pub pushed_in_msat: Amount,
10986 pub pushed_out_msat: Amount,
10987 pub routed_in_msat: Amount,
10988 pub routed_out_msat: Amount,
10989 pub utilization_in: String,
10990 pub utilization_out: String,
10991 }
10992
10993 #[derive(Clone, Debug, Deserialize, Serialize)]
10994 pub struct BkprchannelsapyResponse {
10995 pub channels_apy: Vec<BkprchannelsapyChannelsApy>,
10996 }
10997
10998 impl TryFrom<Response> for BkprchannelsapyResponse {
10999 type Error = super::TryFromResponseError;
11000
11001 fn try_from(response: Response) -> Result<Self, Self::Error> {
11002 match response {
11003 Response::BkprChannelsApy(response) => Ok(response),
11004 _ => Err(TryFromResponseError)
11005 }
11006 }
11007 }
11008
11009 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
11011 #[allow(non_camel_case_types)]
11012 pub enum BkprdumpincomecsvCsvFormat {
11013 #[serde(rename = "cointracker")]
11014 COINTRACKER = 0,
11015 #[serde(rename = "koinly")]
11016 KOINLY = 1,
11017 #[serde(rename = "harmony")]
11018 HARMONY = 2,
11019 #[serde(rename = "quickbooks")]
11020 QUICKBOOKS = 3,
11021 }
11022
11023 impl TryFrom<i32> for BkprdumpincomecsvCsvFormat {
11024 type Error = anyhow::Error;
11025 fn try_from(c: i32) -> Result<BkprdumpincomecsvCsvFormat, anyhow::Error> {
11026 match c {
11027 0 => Ok(BkprdumpincomecsvCsvFormat::COINTRACKER),
11028 1 => Ok(BkprdumpincomecsvCsvFormat::KOINLY),
11029 2 => Ok(BkprdumpincomecsvCsvFormat::HARMONY),
11030 3 => Ok(BkprdumpincomecsvCsvFormat::QUICKBOOKS),
11031 o => Err(anyhow::anyhow!("Unknown variant {} for enum BkprdumpincomecsvCsvFormat", o)),
11032 }
11033 }
11034 }
11035
11036 impl ToString for BkprdumpincomecsvCsvFormat {
11037 fn to_string(&self) -> String {
11038 match self {
11039 BkprdumpincomecsvCsvFormat::COINTRACKER => "COINTRACKER",
11040 BkprdumpincomecsvCsvFormat::KOINLY => "KOINLY",
11041 BkprdumpincomecsvCsvFormat::HARMONY => "HARMONY",
11042 BkprdumpincomecsvCsvFormat::QUICKBOOKS => "QUICKBOOKS",
11043 }.to_string()
11044 }
11045 }
11046
11047 #[derive(Clone, Debug, Deserialize, Serialize)]
11048 pub struct BkprdumpincomecsvResponse {
11049 pub csv_format: BkprdumpincomecsvCsvFormat,
11051 pub csv_file: String,
11052 }
11053
11054 impl TryFrom<Response> for BkprdumpincomecsvResponse {
11055 type Error = super::TryFromResponseError;
11056
11057 fn try_from(response: Response) -> Result<Self, Self::Error> {
11058 match response {
11059 Response::BkprDumpIncomeCsv(response) => Ok(response),
11060 _ => Err(TryFromResponseError)
11061 }
11062 }
11063 }
11064
11065 #[derive(Clone, Debug, Deserialize, Serialize)]
11066 pub struct BkprinspectTxsOutputs {
11067 #[serde(skip_serializing_if = "Option::is_none")]
11068 pub credit_msat: Option<Amount>,
11069 #[serde(skip_serializing_if = "Option::is_none")]
11070 pub debit_msat: Option<Amount>,
11071 #[serde(skip_serializing_if = "Option::is_none")]
11072 pub originating_account: Option<String>,
11073 #[serde(skip_serializing_if = "Option::is_none")]
11074 pub output_tag: Option<String>,
11075 #[serde(skip_serializing_if = "Option::is_none")]
11076 pub payment_id: Option<String>,
11077 #[serde(skip_serializing_if = "Option::is_none")]
11078 pub spend_tag: Option<String>,
11079 #[serde(skip_serializing_if = "Option::is_none")]
11080 pub spending_txid: Option<String>,
11081 pub account: String,
11082 pub currency: String,
11083 pub outnum: u32,
11084 pub output_value_msat: Amount,
11085 }
11086
11087 #[derive(Clone, Debug, Deserialize, Serialize)]
11088 pub struct BkprinspectTxs {
11089 #[serde(skip_serializing_if = "Option::is_none")]
11090 pub blockheight: Option<u32>,
11091 pub fees_paid_msat: Amount,
11092 pub outputs: Vec<BkprinspectTxsOutputs>,
11093 pub txid: String,
11094 }
11095
11096 #[derive(Clone, Debug, Deserialize, Serialize)]
11097 pub struct BkprinspectResponse {
11098 pub txs: Vec<BkprinspectTxs>,
11099 }
11100
11101 impl TryFrom<Response> for BkprinspectResponse {
11102 type Error = super::TryFromResponseError;
11103
11104 fn try_from(response: Response) -> Result<Self, Self::Error> {
11105 match response {
11106 Response::BkprInspect(response) => Ok(response),
11107 _ => Err(TryFromResponseError)
11108 }
11109 }
11110 }
11111
11112 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
11114 #[allow(non_camel_case_types)]
11115 pub enum BkprlistaccounteventsEventsType {
11116 #[serde(rename = "onchain_fee")]
11117 ONCHAIN_FEE = 0,
11118 #[serde(rename = "chain")]
11119 CHAIN = 1,
11120 #[serde(rename = "channel")]
11121 CHANNEL = 2,
11122 }
11123
11124 impl TryFrom<i32> for BkprlistaccounteventsEventsType {
11125 type Error = anyhow::Error;
11126 fn try_from(c: i32) -> Result<BkprlistaccounteventsEventsType, anyhow::Error> {
11127 match c {
11128 0 => Ok(BkprlistaccounteventsEventsType::ONCHAIN_FEE),
11129 1 => Ok(BkprlistaccounteventsEventsType::CHAIN),
11130 2 => Ok(BkprlistaccounteventsEventsType::CHANNEL),
11131 o => Err(anyhow::anyhow!("Unknown variant {} for enum BkprlistaccounteventsEventsType", o)),
11132 }
11133 }
11134 }
11135
11136 impl ToString for BkprlistaccounteventsEventsType {
11137 fn to_string(&self) -> String {
11138 match self {
11139 BkprlistaccounteventsEventsType::ONCHAIN_FEE => "ONCHAIN_FEE",
11140 BkprlistaccounteventsEventsType::CHAIN => "CHAIN",
11141 BkprlistaccounteventsEventsType::CHANNEL => "CHANNEL",
11142 }.to_string()
11143 }
11144 }
11145
11146 #[derive(Clone, Debug, Deserialize, Serialize)]
11147 pub struct BkprlistaccounteventsEvents {
11148 #[serde(skip_serializing_if = "Option::is_none")]
11149 pub blockheight: Option<u32>,
11150 #[serde(skip_serializing_if = "Option::is_none")]
11151 pub description: Option<String>,
11152 #[serde(skip_serializing_if = "Option::is_none")]
11153 pub fees_msat: Option<Amount>,
11154 #[serde(skip_serializing_if = "Option::is_none")]
11155 pub is_rebalance: Option<bool>,
11156 #[serde(skip_serializing_if = "Option::is_none")]
11157 pub origin: Option<String>,
11158 #[serde(skip_serializing_if = "Option::is_none")]
11159 pub outpoint: Option<String>,
11160 #[serde(skip_serializing_if = "Option::is_none")]
11161 pub part_id: Option<u32>,
11162 #[serde(skip_serializing_if = "Option::is_none")]
11163 pub payment_id: Option<String>,
11164 #[serde(skip_serializing_if = "Option::is_none")]
11165 pub txid: Option<String>,
11166 #[serde(rename = "type")]
11168 pub item_type: BkprlistaccounteventsEventsType,
11169 pub account: String,
11170 pub credit_msat: Amount,
11171 pub currency: String,
11172 pub debit_msat: Amount,
11173 pub tag: String,
11174 pub timestamp: u32,
11175 }
11176
11177 #[derive(Clone, Debug, Deserialize, Serialize)]
11178 pub struct BkprlistaccounteventsResponse {
11179 pub events: Vec<BkprlistaccounteventsEvents>,
11180 }
11181
11182 impl TryFrom<Response> for BkprlistaccounteventsResponse {
11183 type Error = super::TryFromResponseError;
11184
11185 fn try_from(response: Response) -> Result<Self, Self::Error> {
11186 match response {
11187 Response::BkprListAccountEvents(response) => Ok(response),
11188 _ => Err(TryFromResponseError)
11189 }
11190 }
11191 }
11192
11193 #[derive(Clone, Debug, Deserialize, Serialize)]
11194 pub struct BkprlistbalancesAccountsBalances {
11195 pub balance_msat: Amount,
11196 pub coin_type: String,
11197 }
11198
11199 #[derive(Clone, Debug, Deserialize, Serialize)]
11200 pub struct BkprlistbalancesAccounts {
11201 #[serde(skip_serializing_if = "Option::is_none")]
11202 pub account_closed: Option<bool>,
11203 #[serde(skip_serializing_if = "Option::is_none")]
11204 pub account_resolved: Option<bool>,
11205 #[serde(skip_serializing_if = "Option::is_none")]
11206 pub peer_id: Option<PublicKey>,
11207 #[serde(skip_serializing_if = "Option::is_none")]
11208 pub resolved_at_block: Option<u32>,
11209 #[serde(skip_serializing_if = "Option::is_none")]
11210 pub we_opened: Option<bool>,
11211 pub account: String,
11212 pub balances: Vec<BkprlistbalancesAccountsBalances>,
11213 }
11214
11215 #[derive(Clone, Debug, Deserialize, Serialize)]
11216 pub struct BkprlistbalancesResponse {
11217 pub accounts: Vec<BkprlistbalancesAccounts>,
11218 }
11219
11220 impl TryFrom<Response> for BkprlistbalancesResponse {
11221 type Error = super::TryFromResponseError;
11222
11223 fn try_from(response: Response) -> Result<Self, Self::Error> {
11224 match response {
11225 Response::BkprListBalances(response) => Ok(response),
11226 _ => Err(TryFromResponseError)
11227 }
11228 }
11229 }
11230
11231 #[derive(Clone, Debug, Deserialize, Serialize)]
11232 pub struct BkprlistincomeIncomeEvents {
11233 #[serde(skip_serializing_if = "Option::is_none")]
11234 pub description: Option<String>,
11235 #[serde(skip_serializing_if = "Option::is_none")]
11236 pub outpoint: Option<String>,
11237 #[serde(skip_serializing_if = "Option::is_none")]
11238 pub payment_id: Option<String>,
11239 #[serde(skip_serializing_if = "Option::is_none")]
11240 pub txid: Option<String>,
11241 pub account: String,
11242 pub credit_msat: Amount,
11243 pub currency: String,
11244 pub debit_msat: Amount,
11245 pub tag: String,
11246 pub timestamp: u32,
11247 }
11248
11249 #[derive(Clone, Debug, Deserialize, Serialize)]
11250 pub struct BkprlistincomeResponse {
11251 pub income_events: Vec<BkprlistincomeIncomeEvents>,
11252 }
11253
11254 impl TryFrom<Response> for BkprlistincomeResponse {
11255 type Error = super::TryFromResponseError;
11256
11257 fn try_from(response: Response) -> Result<Self, Self::Error> {
11258 match response {
11259 Response::BkprListIncome(response) => Ok(response),
11260 _ => Err(TryFromResponseError)
11261 }
11262 }
11263 }
11264
11265 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
11267 #[allow(non_camel_case_types)]
11268 pub enum BkpreditdescriptionbypaymentidUpdatedType {
11269 #[serde(rename = "chain")]
11270 CHAIN = 0,
11271 #[serde(rename = "channel")]
11272 CHANNEL = 1,
11273 }
11274
11275 impl TryFrom<i32> for BkpreditdescriptionbypaymentidUpdatedType {
11276 type Error = anyhow::Error;
11277 fn try_from(c: i32) -> Result<BkpreditdescriptionbypaymentidUpdatedType, anyhow::Error> {
11278 match c {
11279 0 => Ok(BkpreditdescriptionbypaymentidUpdatedType::CHAIN),
11280 1 => Ok(BkpreditdescriptionbypaymentidUpdatedType::CHANNEL),
11281 o => Err(anyhow::anyhow!("Unknown variant {} for enum BkpreditdescriptionbypaymentidUpdatedType", o)),
11282 }
11283 }
11284 }
11285
11286 impl ToString for BkpreditdescriptionbypaymentidUpdatedType {
11287 fn to_string(&self) -> String {
11288 match self {
11289 BkpreditdescriptionbypaymentidUpdatedType::CHAIN => "CHAIN",
11290 BkpreditdescriptionbypaymentidUpdatedType::CHANNEL => "CHANNEL",
11291 }.to_string()
11292 }
11293 }
11294
11295 #[derive(Clone, Debug, Deserialize, Serialize)]
11296 pub struct BkpreditdescriptionbypaymentidUpdated {
11297 #[serde(skip_serializing_if = "Option::is_none")]
11298 pub blockheight: Option<u32>,
11299 #[serde(skip_serializing_if = "Option::is_none")]
11300 pub fees_msat: Option<Amount>,
11301 #[serde(skip_serializing_if = "Option::is_none")]
11302 pub is_rebalance: Option<bool>,
11303 #[serde(skip_serializing_if = "Option::is_none")]
11304 pub origin: Option<String>,
11305 #[serde(skip_serializing_if = "Option::is_none")]
11306 pub outpoint: Option<String>,
11307 #[serde(skip_serializing_if = "Option::is_none")]
11308 pub part_id: Option<u32>,
11309 #[serde(skip_serializing_if = "Option::is_none")]
11310 pub payment_id: Option<String>,
11311 #[serde(skip_serializing_if = "Option::is_none")]
11312 pub txid: Option<String>,
11313 #[serde(rename = "type")]
11315 pub item_type: BkpreditdescriptionbypaymentidUpdatedType,
11316 pub account: String,
11317 pub credit_msat: Amount,
11318 pub currency: String,
11319 pub debit_msat: Amount,
11320 pub description: String,
11321 pub tag: String,
11322 pub timestamp: u32,
11323 }
11324
11325 #[derive(Clone, Debug, Deserialize, Serialize)]
11326 pub struct BkpreditdescriptionbypaymentidResponse {
11327 pub updated: Vec<BkpreditdescriptionbypaymentidUpdated>,
11328 }
11329
11330 impl TryFrom<Response> for BkpreditdescriptionbypaymentidResponse {
11331 type Error = super::TryFromResponseError;
11332
11333 fn try_from(response: Response) -> Result<Self, Self::Error> {
11334 match response {
11335 Response::BkprEditDescriptionByPaymentId(response) => Ok(response),
11336 _ => Err(TryFromResponseError)
11337 }
11338 }
11339 }
11340
11341 #[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
11343 #[allow(non_camel_case_types)]
11344 pub enum BkpreditdescriptionbyoutpointUpdatedType {
11345 #[serde(rename = "chain")]
11346 CHAIN = 0,
11347 #[serde(rename = "channel")]
11348 CHANNEL = 1,
11349 }
11350
11351 impl TryFrom<i32> for BkpreditdescriptionbyoutpointUpdatedType {
11352 type Error = anyhow::Error;
11353 fn try_from(c: i32) -> Result<BkpreditdescriptionbyoutpointUpdatedType, anyhow::Error> {
11354 match c {
11355 0 => Ok(BkpreditdescriptionbyoutpointUpdatedType::CHAIN),
11356 1 => Ok(BkpreditdescriptionbyoutpointUpdatedType::CHANNEL),
11357 o => Err(anyhow::anyhow!("Unknown variant {} for enum BkpreditdescriptionbyoutpointUpdatedType", o)),
11358 }
11359 }
11360 }
11361
11362 impl ToString for BkpreditdescriptionbyoutpointUpdatedType {
11363 fn to_string(&self) -> String {
11364 match self {
11365 BkpreditdescriptionbyoutpointUpdatedType::CHAIN => "CHAIN",
11366 BkpreditdescriptionbyoutpointUpdatedType::CHANNEL => "CHANNEL",
11367 }.to_string()
11368 }
11369 }
11370
11371 #[derive(Clone, Debug, Deserialize, Serialize)]
11372 pub struct BkpreditdescriptionbyoutpointUpdated {
11373 #[serde(skip_serializing_if = "Option::is_none")]
11374 pub blockheight: Option<u32>,
11375 #[serde(skip_serializing_if = "Option::is_none")]
11376 pub fees_msat: Option<Amount>,
11377 #[serde(skip_serializing_if = "Option::is_none")]
11378 pub is_rebalance: Option<bool>,
11379 #[serde(skip_serializing_if = "Option::is_none")]
11380 pub origin: Option<String>,
11381 #[serde(skip_serializing_if = "Option::is_none")]
11382 pub outpoint: Option<String>,
11383 #[serde(skip_serializing_if = "Option::is_none")]
11384 pub part_id: Option<u32>,
11385 #[serde(skip_serializing_if = "Option::is_none")]
11386 pub payment_id: Option<String>,
11387 #[serde(skip_serializing_if = "Option::is_none")]
11388 pub txid: Option<String>,
11389 #[serde(rename = "type")]
11391 pub item_type: BkpreditdescriptionbyoutpointUpdatedType,
11392 pub account: String,
11393 pub credit_msat: Amount,
11394 pub currency: String,
11395 pub debit_msat: Amount,
11396 pub description: String,
11397 pub tag: String,
11398 pub timestamp: u32,
11399 }
11400
11401 #[derive(Clone, Debug, Deserialize, Serialize)]
11402 pub struct BkpreditdescriptionbyoutpointResponse {
11403 pub updated: Vec<BkpreditdescriptionbyoutpointUpdated>,
11404 }
11405
11406 impl TryFrom<Response> for BkpreditdescriptionbyoutpointResponse {
11407 type Error = super::TryFromResponseError;
11408
11409 fn try_from(response: Response) -> Result<Self, Self::Error> {
11410 match response {
11411 Response::BkprEditDescriptionByOutpoint(response) => Ok(response),
11412 _ => Err(TryFromResponseError)
11413 }
11414 }
11415 }
11416
11417 #[derive(Clone, Debug, Deserialize, Serialize)]
11418 pub struct BlacklistruneBlacklist {
11419 pub end: u64,
11420 pub start: u64,
11421 }
11422
11423 #[derive(Clone, Debug, Deserialize, Serialize)]
11424 pub struct BlacklistruneResponse {
11425 pub blacklist: Vec<BlacklistruneBlacklist>,
11426 }
11427
11428 impl TryFrom<Response> for BlacklistruneResponse {
11429 type Error = super::TryFromResponseError;
11430
11431 fn try_from(response: Response) -> Result<Self, Self::Error> {
11432 match response {
11433 Response::BlacklistRune(response) => Ok(response),
11434 _ => Err(TryFromResponseError)
11435 }
11436 }
11437 }
11438
11439 #[derive(Clone, Debug, Deserialize, Serialize)]
11440 pub struct CheckruneResponse {
11441 pub valid: bool,
11442 }
11443
11444 impl TryFrom<Response> for CheckruneResponse {
11445 type Error = super::TryFromResponseError;
11446
11447 fn try_from(response: Response) -> Result<Self, Self::Error> {
11448 match response {
11449 Response::CheckRune(response) => Ok(response),
11450 _ => Err(TryFromResponseError)
11451 }
11452 }
11453 }
11454
11455 #[derive(Clone, Debug, Deserialize, Serialize)]
11456 pub struct CreateruneResponse {
11457 #[serde(skip_serializing_if = "Option::is_none")]
11458 pub warning_unrestricted_rune: Option<String>,
11459 pub rune: String,
11460 pub unique_id: String,
11461 }
11462
11463 impl TryFrom<Response> for CreateruneResponse {
11464 type Error = super::TryFromResponseError;
11465
11466 fn try_from(response: Response) -> Result<Self, Self::Error> {
11467 match response {
11468 Response::CreateRune(response) => Ok(response),
11469 _ => Err(TryFromResponseError)
11470 }
11471 }
11472 }
11473
11474 #[derive(Clone, Debug, Deserialize, Serialize)]
11475 pub struct ShowrunesRunesRestrictionsAlternatives {
11476 pub condition: String,
11477 pub english: String,
11478 pub fieldname: String,
11479 pub value: String,
11480 }
11481
11482 #[derive(Clone, Debug, Deserialize, Serialize)]
11483 pub struct ShowrunesRunesRestrictions {
11484 pub alternatives: Vec<ShowrunesRunesRestrictionsAlternatives>,
11485 pub english: String,
11486 }
11487
11488 #[derive(Clone, Debug, Deserialize, Serialize)]
11489 pub struct ShowrunesRunes {
11490 #[serde(skip_serializing_if = "Option::is_none")]
11491 pub blacklisted: Option<bool>,
11492 #[serde(skip_serializing_if = "Option::is_none")]
11493 pub last_used: Option<f64>,
11494 #[serde(skip_serializing_if = "Option::is_none")]
11495 pub our_rune: Option<bool>,
11496 #[serde(skip_serializing_if = "Option::is_none")]
11497 pub stored: Option<bool>,
11498 pub restrictions: Vec<ShowrunesRunesRestrictions>,
11499 pub restrictions_as_english: String,
11500 pub rune: String,
11501 pub unique_id: String,
11502 }
11503
11504 #[derive(Clone, Debug, Deserialize, Serialize)]
11505 pub struct ShowrunesResponse {
11506 pub runes: Vec<ShowrunesRunes>,
11507 }
11508
11509 impl TryFrom<Response> for ShowrunesResponse {
11510 type Error = super::TryFromResponseError;
11511
11512 fn try_from(response: Response) -> Result<Self, Self::Error> {
11513 match response {
11514 Response::ShowRunes(response) => Ok(response),
11515 _ => Err(TryFromResponseError)
11516 }
11517 }
11518 }
11519
11520 #[derive(Clone, Debug, Deserialize, Serialize)]
11521 pub struct AskreneunreserveResponse {
11522 }
11523
11524 impl TryFrom<Response> for AskreneunreserveResponse {
11525 type Error = super::TryFromResponseError;
11526
11527 fn try_from(response: Response) -> Result<Self, Self::Error> {
11528 match response {
11529 Response::AskReneUnreserve(response) => Ok(response),
11530 _ => Err(TryFromResponseError)
11531 }
11532 }
11533 }
11534
11535 #[derive(Clone, Debug, Deserialize, Serialize)]
11536 pub struct AskrenelistlayersLayersBiases {
11537 #[serde(skip_serializing_if = "Option::is_none")]
11538 pub description: Option<String>,
11539 pub bias: i64,
11540 pub short_channel_id_dir: ShortChannelIdDir,
11541 }
11542
11543 #[derive(Clone, Debug, Deserialize, Serialize)]
11544 pub struct AskrenelistlayersLayersChannelUpdates {
11545 #[serde(skip_serializing_if = "Option::is_none")]
11546 pub cltv_expiry_delta: Option<u16>,
11547 #[serde(skip_serializing_if = "Option::is_none")]
11548 pub enabled: Option<bool>,
11549 #[serde(skip_serializing_if = "Option::is_none")]
11550 pub fee_base_msat: Option<Amount>,
11551 #[serde(skip_serializing_if = "Option::is_none")]
11552 pub fee_proportional_millionths: Option<u32>,
11553 #[serde(skip_serializing_if = "Option::is_none")]
11554 pub htlc_maximum_msat: Option<Amount>,
11555 #[serde(skip_serializing_if = "Option::is_none")]
11556 pub htlc_minimum_msat: Option<Amount>,
11557 pub short_channel_id_dir: ShortChannelIdDir,
11558 }
11559
11560 #[derive(Clone, Debug, Deserialize, Serialize)]
11561 pub struct AskrenelistlayersLayersConstraints {
11562 #[serde(skip_serializing_if = "Option::is_none")]
11563 pub maximum_msat: Option<Amount>,
11564 #[serde(skip_serializing_if = "Option::is_none")]
11565 pub minimum_msat: Option<Amount>,
11566 #[serde(skip_serializing_if = "Option::is_none")]
11567 pub short_channel_id_dir: Option<ShortChannelIdDir>,
11568 #[serde(skip_serializing_if = "Option::is_none")]
11569 pub timestamp: Option<u64>,
11570 }
11571
11572 #[derive(Clone, Debug, Deserialize, Serialize)]
11573 pub struct AskrenelistlayersLayersCreatedChannels {
11574 pub capacity_msat: Amount,
11575 pub destination: PublicKey,
11576 pub short_channel_id: ShortChannelId,
11577 pub source: PublicKey,
11578 }
11579
11580 #[derive(Clone, Debug, Deserialize, Serialize)]
11581 pub struct AskrenelistlayersLayers {
11582 #[serde(skip_serializing_if = "Option::is_none")]
11583 pub persistent: Option<bool>,
11584 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11585 pub biases: Option<Vec<AskrenelistlayersLayersBiases>>,
11586 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11587 pub channel_updates: Option<Vec<AskrenelistlayersLayersChannelUpdates>>,
11588 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11589 pub disabled_channels: Option<Vec<ShortChannelIdDir>>,
11590 pub constraints: Vec<AskrenelistlayersLayersConstraints>,
11591 pub created_channels: Vec<AskrenelistlayersLayersCreatedChannels>,
11592 pub disabled_nodes: Vec<PublicKey>,
11593 pub layer: String,
11594 }
11595
11596 #[derive(Clone, Debug, Deserialize, Serialize)]
11597 pub struct AskrenelistlayersResponse {
11598 pub layers: Vec<AskrenelistlayersLayers>,
11599 }
11600
11601 impl TryFrom<Response> for AskrenelistlayersResponse {
11602 type Error = super::TryFromResponseError;
11603
11604 fn try_from(response: Response) -> Result<Self, Self::Error> {
11605 match response {
11606 Response::AskReneListLayers(response) => Ok(response),
11607 _ => Err(TryFromResponseError)
11608 }
11609 }
11610 }
11611
11612 #[derive(Clone, Debug, Deserialize, Serialize)]
11613 pub struct AskrenecreatelayerLayersBiases {
11614 #[serde(skip_serializing_if = "Option::is_none")]
11615 pub description: Option<String>,
11616 pub bias: i64,
11617 pub short_channel_id_dir: ShortChannelIdDir,
11618 }
11619
11620 #[derive(Clone, Debug, Deserialize, Serialize)]
11621 pub struct AskrenecreatelayerLayersChannelUpdates {
11622 #[serde(skip_serializing_if = "Option::is_none")]
11623 pub delay: Option<u16>,
11624 #[serde(skip_serializing_if = "Option::is_none")]
11625 pub fee_base_msat: Option<Amount>,
11626 #[serde(skip_serializing_if = "Option::is_none")]
11627 pub fee_proportional_millionths: Option<u32>,
11628 #[serde(skip_serializing_if = "Option::is_none")]
11629 pub htlc_maximum_msat: Option<Amount>,
11630 #[serde(skip_serializing_if = "Option::is_none")]
11631 pub htlc_minimum_msat: Option<Amount>,
11632 }
11633
11634 #[derive(Clone, Debug, Deserialize, Serialize)]
11635 pub struct AskrenecreatelayerLayersConstraints {
11636 #[serde(skip_serializing_if = "Option::is_none")]
11637 pub maximum_msat: Option<Amount>,
11638 #[serde(skip_serializing_if = "Option::is_none")]
11639 pub minimum_msat: Option<Amount>,
11640 pub direction: u32,
11641 pub short_channel_id: ShortChannelId,
11642 }
11643
11644 #[derive(Clone, Debug, Deserialize, Serialize)]
11645 pub struct AskrenecreatelayerLayersCreatedChannels {
11646 pub capacity_msat: Amount,
11647 pub destination: PublicKey,
11648 pub short_channel_id: ShortChannelId,
11649 pub source: PublicKey,
11650 }
11651
11652 #[derive(Clone, Debug, Deserialize, Serialize)]
11653 pub struct AskrenecreatelayerLayers {
11654 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11655 pub biases: Option<Vec<AskrenecreatelayerLayersBiases>>,
11656 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11657 pub disabled_channels: Option<Vec<ShortChannelIdDir>>,
11658 pub channel_updates: Vec<AskrenecreatelayerLayersChannelUpdates>,
11659 pub constraints: Vec<AskrenecreatelayerLayersConstraints>,
11660 pub created_channels: Vec<AskrenecreatelayerLayersCreatedChannels>,
11661 pub disabled_nodes: Vec<PublicKey>,
11662 pub layer: String,
11663 pub persistent: bool,
11664 }
11665
11666 #[derive(Clone, Debug, Deserialize, Serialize)]
11667 pub struct AskrenecreatelayerResponse {
11668 pub layers: Vec<AskrenecreatelayerLayers>,
11669 }
11670
11671 impl TryFrom<Response> for AskrenecreatelayerResponse {
11672 type Error = super::TryFromResponseError;
11673
11674 fn try_from(response: Response) -> Result<Self, Self::Error> {
11675 match response {
11676 Response::AskReneCreateLayer(response) => Ok(response),
11677 _ => Err(TryFromResponseError)
11678 }
11679 }
11680 }
11681
11682 #[derive(Clone, Debug, Deserialize, Serialize)]
11683 pub struct AskreneremovelayerResponse {
11684 }
11685
11686 impl TryFrom<Response> for AskreneremovelayerResponse {
11687 type Error = super::TryFromResponseError;
11688
11689 fn try_from(response: Response) -> Result<Self, Self::Error> {
11690 match response {
11691 Response::AskReneRemoveLayer(response) => Ok(response),
11692 _ => Err(TryFromResponseError)
11693 }
11694 }
11695 }
11696
11697 #[derive(Clone, Debug, Deserialize, Serialize)]
11698 pub struct AskrenereserveResponse {
11699 }
11700
11701 impl TryFrom<Response> for AskrenereserveResponse {
11702 type Error = super::TryFromResponseError;
11703
11704 fn try_from(response: Response) -> Result<Self, Self::Error> {
11705 match response {
11706 Response::AskReneReserve(response) => Ok(response),
11707 _ => Err(TryFromResponseError)
11708 }
11709 }
11710 }
11711
11712 #[derive(Clone, Debug, Deserialize, Serialize)]
11713 pub struct AskreneageResponse {
11714 pub layer: String,
11715 pub num_removed: u64,
11716 }
11717
11718 impl TryFrom<Response> for AskreneageResponse {
11719 type Error = super::TryFromResponseError;
11720
11721 fn try_from(response: Response) -> Result<Self, Self::Error> {
11722 match response {
11723 Response::AskReneAge(response) => Ok(response),
11724 _ => Err(TryFromResponseError)
11725 }
11726 }
11727 }
11728
11729 #[derive(Clone, Debug, Deserialize, Serialize)]
11730 pub struct GetroutesRoutesPath {
11731 #[serde(skip_serializing_if = "Option::is_none")]
11732 pub short_channel_id_dir: Option<ShortChannelIdDir>,
11733 pub amount_msat: Amount,
11734 pub delay: u32,
11735 pub next_node_id: PublicKey,
11736 }
11737
11738 #[derive(Clone, Debug, Deserialize, Serialize)]
11739 pub struct GetroutesRoutes {
11740 #[serde(skip_serializing_if = "Option::is_none")]
11741 pub final_cltv: Option<u32>,
11742 pub amount_msat: Amount,
11743 pub path: Vec<GetroutesRoutesPath>,
11744 pub probability_ppm: u64,
11745 }
11746
11747 #[derive(Clone, Debug, Deserialize, Serialize)]
11748 pub struct GetroutesResponse {
11749 pub probability_ppm: u64,
11750 pub routes: Vec<GetroutesRoutes>,
11751 }
11752
11753 impl TryFrom<Response> for GetroutesResponse {
11754 type Error = super::TryFromResponseError;
11755
11756 fn try_from(response: Response) -> Result<Self, Self::Error> {
11757 match response {
11758 Response::GetRoutes(response) => Ok(response),
11759 _ => Err(TryFromResponseError)
11760 }
11761 }
11762 }
11763
11764 #[derive(Clone, Debug, Deserialize, Serialize)]
11765 pub struct AskrenedisablenodeResponse {
11766 }
11767
11768 impl TryFrom<Response> for AskrenedisablenodeResponse {
11769 type Error = super::TryFromResponseError;
11770
11771 fn try_from(response: Response) -> Result<Self, Self::Error> {
11772 match response {
11773 Response::AskReneDisableNode(response) => Ok(response),
11774 _ => Err(TryFromResponseError)
11775 }
11776 }
11777 }
11778
11779 #[derive(Clone, Debug, Deserialize, Serialize)]
11780 pub struct AskreneinformchannelConstraints {
11781 #[serde(skip_serializing_if = "Option::is_none")]
11782 pub maximum_msat: Option<Amount>,
11783 #[serde(skip_serializing_if = "Option::is_none")]
11784 pub minimum_msat: Option<Amount>,
11785 pub layer: String,
11786 pub short_channel_id_dir: ShortChannelIdDir,
11787 pub timestamp: u64,
11788 }
11789
11790 #[derive(Clone, Debug, Deserialize, Serialize)]
11791 pub struct AskreneinformchannelResponse {
11792 #[serde(skip_serializing_if = "crate::is_none_or_empty")]
11793 pub constraints: Option<Vec<AskreneinformchannelConstraints>>,
11794 }
11795
11796 impl TryFrom<Response> for AskreneinformchannelResponse {
11797 type Error = super::TryFromResponseError;
11798
11799 fn try_from(response: Response) -> Result<Self, Self::Error> {
11800 match response {
11801 Response::AskReneInformChannel(response) => Ok(response),
11802 _ => Err(TryFromResponseError)
11803 }
11804 }
11805 }
11806
11807 #[derive(Clone, Debug, Deserialize, Serialize)]
11808 pub struct AskrenecreatechannelResponse {
11809 }
11810
11811 impl TryFrom<Response> for AskrenecreatechannelResponse {
11812 type Error = super::TryFromResponseError;
11813
11814 fn try_from(response: Response) -> Result<Self, Self::Error> {
11815 match response {
11816 Response::AskReneCreateChannel(response) => Ok(response),
11817 _ => Err(TryFromResponseError)
11818 }
11819 }
11820 }
11821
11822 #[derive(Clone, Debug, Deserialize, Serialize)]
11823 pub struct AskreneupdatechannelResponse {
11824 }
11825
11826 impl TryFrom<Response> for AskreneupdatechannelResponse {
11827 type Error = super::TryFromResponseError;
11828
11829 fn try_from(response: Response) -> Result<Self, Self::Error> {
11830 match response {
11831 Response::AskReneUpdateChannel(response) => Ok(response),
11832 _ => Err(TryFromResponseError)
11833 }
11834 }
11835 }
11836
11837 #[derive(Clone, Debug, Deserialize, Serialize)]
11838 pub struct AskrenebiaschannelBiases {
11839 #[serde(skip_serializing_if = "Option::is_none")]
11840 pub description: Option<String>,
11841 pub bias: i64,
11842 pub layer: String,
11843 pub short_channel_id_dir: ShortChannelIdDir,
11844 }
11845
11846 #[derive(Clone, Debug, Deserialize, Serialize)]
11847 pub struct AskrenebiaschannelResponse {
11848 pub biases: Vec<AskrenebiaschannelBiases>,
11849 }
11850
11851 impl TryFrom<Response> for AskrenebiaschannelResponse {
11852 type Error = super::TryFromResponseError;
11853
11854 fn try_from(response: Response) -> Result<Self, Self::Error> {
11855 match response {
11856 Response::AskReneBiasChannel(response) => Ok(response),
11857 _ => Err(TryFromResponseError)
11858 }
11859 }
11860 }
11861
11862 #[derive(Clone, Debug, Deserialize, Serialize)]
11863 pub struct AskrenelistreservationsReservations {
11864 pub age_in_seconds: u64,
11865 pub amount_msat: Amount,
11866 pub command_id: String,
11867 pub short_channel_id_dir: ShortChannelIdDir,
11868 }
11869
11870 #[derive(Clone, Debug, Deserialize, Serialize)]
11871 pub struct AskrenelistreservationsResponse {
11872 pub reservations: Vec<AskrenelistreservationsReservations>,
11873 }
11874
11875 impl TryFrom<Response> for AskrenelistreservationsResponse {
11876 type Error = super::TryFromResponseError;
11877
11878 fn try_from(response: Response) -> Result<Self, Self::Error> {
11879 match response {
11880 Response::AskReneListReservations(response) => Ok(response),
11881 _ => Err(TryFromResponseError)
11882 }
11883 }
11884 }
11885
11886 #[derive(Clone, Debug, Deserialize, Serialize)]
11887 pub struct InjectpaymentonionResponse {
11888 pub completed_at: u64,
11889 pub created_at: u64,
11890 pub created_index: u64,
11891 pub payment_preimage: Secret,
11892 }
11893
11894 impl TryFrom<Response> for InjectpaymentonionResponse {
11895 type Error = super::TryFromResponseError;
11896
11897 fn try_from(response: Response) -> Result<Self, Self::Error> {
11898 match response {
11899 Response::InjectPaymentOnion(response) => Ok(response),
11900 _ => Err(TryFromResponseError)
11901 }
11902 }
11903 }
11904
11905 #[derive(Clone, Debug, Deserialize, Serialize)]
11906 pub struct InjectonionmessageResponse {
11907 }
11908
11909 impl TryFrom<Response> for InjectonionmessageResponse {
11910 type Error = super::TryFromResponseError;
11911
11912 fn try_from(response: Response) -> Result<Self, Self::Error> {
11913 match response {
11914 Response::InjectOnionMessage(response) => Ok(response),
11915 _ => Err(TryFromResponseError)
11916 }
11917 }
11918 }
11919
11920 #[derive(Clone, Debug, Deserialize, Serialize)]
11921 pub struct XpayResponse {
11922 pub amount_msat: Amount,
11923 pub amount_sent_msat: Amount,
11924 pub failed_parts: u64,
11925 pub payment_preimage: Secret,
11926 pub successful_parts: u64,
11927 }
11928
11929 impl TryFrom<Response> for XpayResponse {
11930 type Error = super::TryFromResponseError;
11931
11932 fn try_from(response: Response) -> Result<Self, Self::Error> {
11933 match response {
11934 Response::Xpay(response) => Ok(response),
11935 _ => Err(TryFromResponseError)
11936 }
11937 }
11938 }
11939
11940 #[derive(Clone, Debug, Deserialize, Serialize)]
11941 pub struct SignmessagewithkeyResponse {
11942 pub address: String,
11943 pub base64: String,
11944 pub pubkey: PublicKey,
11945 pub signature: String,
11946 }
11947
11948 impl TryFrom<Response> for SignmessagewithkeyResponse {
11949 type Error = super::TryFromResponseError;
11950
11951 fn try_from(response: Response) -> Result<Self, Self::Error> {
11952 match response {
11953 Response::SignMessageWithKey(response) => Ok(response),
11954 _ => Err(TryFromResponseError)
11955 }
11956 }
11957 }
11958
11959}
11960