From ab2650a711cdc359dce21cfbc046567325b1388a Mon Sep 17 00:00:00 2001 From: G8XSU <3442979+G8XSU@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:41:02 -0800 Subject: [PATCH] fixup! Add proto definition for ListForwardedPayments API. --- ldk-server-protos/src/api.rs | 502 +++++----- ldk-server-protos/src/error.rs | 108 +-- ldk-server-protos/src/proto/types.proto | 6 +- ldk-server-protos/src/types.rs | 1173 ++++++++++++----------- 4 files changed, 898 insertions(+), 891 deletions(-) diff --git a/ldk-server-protos/src/api.rs b/ldk-server-protos/src/api.rs index 43172d9..adcb5cd 100644 --- a/ldk-server-protos/src/api.rs +++ b/ldk-server-protos/src/api.rs @@ -4,94 +4,96 @@ /// - #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetNodeInfoRequest {} +pub struct GetNodeInfoRequest { +} /// The response `content` for the `GetNodeInfo` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { - /// The hex-encoded `node-id` or public key for our own lightning node. - #[prost(string, tag = "1")] - pub node_id: ::prost::alloc::string::String, - /// The best block to which our Lightning wallet is currently synced. - /// - /// Should be always set, will never be `None`. - #[prost(message, optional, tag = "3")] - pub current_best_block: ::core::option::Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our Lightning wallet to - /// the chain tip. - /// - /// Will be `None` if the wallet hasn't been synced yet. - #[prost(uint64, optional, tag = "4")] - pub latest_lightning_wallet_sync_timestamp: ::core::option::Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our on-chain - /// wallet to the chain tip. - /// - /// Will be `None` if the wallet hasn’t been synced since the node was initialized. - #[prost(uint64, optional, tag = "5")] - pub latest_onchain_wallet_sync_timestamp: ::core::option::Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully update our fee rate cache. - /// - /// Will be `None` if the cache hasn’t been updated since the node was initialized. - #[prost(uint64, optional, tag = "6")] - pub latest_fee_rate_cache_update_timestamp: ::core::option::Option, - /// The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync (RGS) snapshot we - /// successfully applied was generated. - /// - /// Will be `None` if RGS isn’t configured or the snapshot hasn’t been updated since the node was initialized. - #[prost(uint64, optional, tag = "7")] - pub latest_rgs_snapshot_timestamp: ::core::option::Option, - /// The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node announcement. - /// - /// Will be `None` if we have no public channels or we haven’t broadcasted since the node was initialized. - #[prost(uint64, optional, tag = "8")] - pub latest_node_announcement_broadcast_timestamp: ::core::option::Option, + /// The hex-encoded `node-id` or public key for our own lightning node. + #[prost(string, tag="1")] + pub node_id: ::prost::alloc::string::String, + /// The best block to which our Lightning wallet is currently synced. + /// + /// Should be always set, will never be `None`. + #[prost(message, optional, tag="3")] + pub current_best_block: ::core::option::Option, + /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our Lightning wallet to + /// the chain tip. + /// + /// Will be `None` if the wallet hasn't been synced yet. + #[prost(uint64, optional, tag="4")] + pub latest_lightning_wallet_sync_timestamp: ::core::option::Option, + /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully synced our on-chain + /// wallet to the chain tip. + /// + /// Will be `None` if the wallet hasn’t been synced since the node was initialized. + #[prost(uint64, optional, tag="5")] + pub latest_onchain_wallet_sync_timestamp: ::core::option::Option, + /// The timestamp, in seconds since start of the UNIX epoch, when we last successfully update our fee rate cache. + /// + /// Will be `None` if the cache hasn’t been updated since the node was initialized. + #[prost(uint64, optional, tag="6")] + pub latest_fee_rate_cache_update_timestamp: ::core::option::Option, + /// The timestamp, in seconds since start of the UNIX epoch, when the last rapid gossip sync (RGS) snapshot we + /// successfully applied was generated. + /// + /// Will be `None` if RGS isn’t configured or the snapshot hasn’t been updated since the node was initialized. + #[prost(uint64, optional, tag="7")] + pub latest_rgs_snapshot_timestamp: ::core::option::Option, + /// The timestamp, in seconds since start of the UNIX epoch, when we last broadcasted a node announcement. + /// + /// Will be `None` if we have no public channels or we haven’t broadcasted since the node was initialized. + #[prost(uint64, optional, tag="8")] + pub latest_node_announcement_broadcast_timestamp: ::core::option::Option, } /// Retrieve a new on-chain funding address. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct OnchainReceiveRequest {} +pub struct OnchainReceiveRequest { +} /// The response `content` for the `OnchainReceive` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`.. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OnchainReceiveResponse { - /// A Bitcoin on-chain address. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, + /// A Bitcoin on-chain address. + #[prost(string, tag="1")] + pub address: ::prost::alloc::string::String, } /// Send an on-chain payment to the given address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OnchainSendRequest { - /// The address to send coins to. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// The amount in satoshis to send. - /// While sending the specified amount, we will respect any on-chain reserve we need to keep, - /// i.e., won't allow to cut into `total_anchor_channels_reserve_sats`. - /// See more: - #[prost(uint64, optional, tag = "2")] - pub amount_sats: ::core::option::Option, - /// If set, the amount_sats field should be unset. - /// It indicates that node will send full balance to the specified address. - /// - /// Please note that when send_all is used this operation will **not** retain any on-chain reserves, - /// which might be potentially dangerous if you have open Anchor channels for which you can't trust - /// the counterparty to spend the Anchor output after channel closure. - /// See more: - #[prost(bool, optional, tag = "3")] - pub send_all: ::core::option::Option, + /// The address to send coins to. + #[prost(string, tag="1")] + pub address: ::prost::alloc::string::String, + /// The amount in satoshis to send. + /// While sending the specified amount, we will respect any on-chain reserve we need to keep, + /// i.e., won't allow to cut into `total_anchor_channels_reserve_sats`. + /// See more: + #[prost(uint64, optional, tag="2")] + pub amount_sats: ::core::option::Option, + /// If set, the amount_sats field should be unset. + /// It indicates that node will send full balance to the specified address. + /// + /// Please note that when send_all is used this operation will **not** retain any on-chain reserves, + /// which might be potentially dangerous if you have open Anchor channels for which you can't trust + /// the counterparty to spend the Anchor output after channel closure. + /// See more: + #[prost(bool, optional, tag="3")] + pub send_all: ::core::option::Option, } /// The response `content` for the `OnchainSend` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OnchainSendResponse { - /// The transaction ID of the broadcasted transaction. - #[prost(string, tag = "1")] - pub txid: ::prost::alloc::string::String, + /// The transaction ID of the broadcasted transaction. + #[prost(string, tag="1")] + pub txid: ::prost::alloc::string::String, } /// Return a BOLT11 payable invoice that can be used to request and receive a payment /// for the given amount, if specified. @@ -102,50 +104,50 @@ pub struct OnchainSendResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11ReceiveRequest { - /// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount invoice is returned. - #[prost(uint64, optional, tag = "1")] - pub amount_msat: ::core::option::Option, - /// An optional description to attach along with the invoice. - /// Will be set in the description field of the encoded payment request. - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// Invoice expiry time in seconds. - #[prost(uint32, tag = "3")] - pub expiry_secs: u32, + /// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount invoice is returned. + #[prost(uint64, optional, tag="1")] + pub amount_msat: ::core::option::Option, + /// An optional description to attach along with the invoice. + /// Will be set in the description field of the encoded payment request. + #[prost(string, tag="2")] + pub description: ::prost::alloc::string::String, + /// Invoice expiry time in seconds. + #[prost(uint32, tag="3")] + pub expiry_secs: u32, } /// The response `content` for the `Bolt11Receive` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11ReceiveResponse { - /// An invoice for a payment within the Lightning Network. - /// With the details of the invoice, the sender has all the data necessary to send a payment - /// to the recipient. - #[prost(string, tag = "1")] - pub invoice: ::prost::alloc::string::String, + /// An invoice for a payment within the Lightning Network. + /// With the details of the invoice, the sender has all the data necessary to send a payment + /// to the recipient. + #[prost(string, tag="1")] + pub invoice: ::prost::alloc::string::String, } /// Send a payment for a BOLT11 invoice. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11SendRequest { - /// An invoice for a payment within the Lightning Network. - #[prost(string, tag = "1")] - pub invoice: ::prost::alloc::string::String, - /// Set this field when paying a so-called "zero-amount" invoice, i.e., an invoice that leaves the - /// amount paid to be determined by the user. - /// This operation will fail if the amount specified is less than the value required by the given invoice. - #[prost(uint64, optional, tag = "2")] - pub amount_msat: ::core::option::Option, + /// An invoice for a payment within the Lightning Network. + #[prost(string, tag="1")] + pub invoice: ::prost::alloc::string::String, + /// Set this field when paying a so-called "zero-amount" invoice, i.e., an invoice that leaves the + /// amount paid to be determined by the user. + /// This operation will fail if the amount specified is less than the value required by the given invoice. + #[prost(uint64, optional, tag="2")] + pub amount_msat: ::core::option::Option, } /// The response `content` for the `Bolt11Send` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11SendResponse { - /// An identifier used to uniquely identify a payment. - #[prost(bytes = "bytes", tag = "1")] - pub payment_id: ::prost::bytes::Bytes, + /// An identifier used to uniquely identify a payment. + #[prost(bytes="bytes", tag="1")] + pub payment_id: ::prost::bytes::Bytes, } /// Returns a BOLT12 offer for the given amount, if specified. /// @@ -155,30 +157,30 @@ pub struct Bolt11SendResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12ReceiveRequest { - /// An optional description to attach along with the offer. - /// Will be set in the description field of the encoded offer. - #[prost(string, tag = "1")] - pub description: ::prost::alloc::string::String, - /// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount offer is returned. - #[prost(uint64, optional, tag = "2")] - pub amount_msat: ::core::option::Option, - /// Offer expiry time in seconds. - #[prost(uint32, optional, tag = "3")] - pub expiry_secs: ::core::option::Option, - /// If set, it represents the number of items requested, can only be set for fixed-amount offers. - #[prost(uint64, optional, tag = "4")] - pub quantity: ::core::option::Option, + /// An optional description to attach along with the offer. + /// Will be set in the description field of the encoded offer. + #[prost(string, tag="1")] + pub description: ::prost::alloc::string::String, + /// The amount in millisatoshi to send. If unset, a "zero-amount" or variable-amount offer is returned. + #[prost(uint64, optional, tag="2")] + pub amount_msat: ::core::option::Option, + /// Offer expiry time in seconds. + #[prost(uint32, optional, tag="3")] + pub expiry_secs: ::core::option::Option, + /// If set, it represents the number of items requested, can only be set for fixed-amount offers. + #[prost(uint64, optional, tag="4")] + pub quantity: ::core::option::Option, } /// The response `content` for the `Bolt12Receive` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12ReceiveResponse { - /// An offer for a payment within the Lightning Network. - /// With the details of the offer, the sender has all the data necessary to send a payment - /// to the recipient. - #[prost(string, tag = "1")] - pub offer: ::prost::alloc::string::String, + /// An offer for a payment within the Lightning Network. + /// With the details of the offer, the sender has all the data necessary to send a payment + /// to the recipient. + #[prost(string, tag="1")] + pub offer: ::prost::alloc::string::String, } /// Send a payment for a BOLT12 offer. /// See more: @@ -187,84 +189,85 @@ pub struct Bolt12ReceiveResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12SendRequest { - /// An offer for a payment within the Lightning Network. - #[prost(string, tag = "1")] - pub offer: ::prost::alloc::string::String, - /// Set this field when paying a so-called "zero-amount" offer, i.e., an offer that leaves the - /// amount paid to be determined by the user. - /// This operation will fail if the amount specified is less than the value required by the given offer. - #[prost(uint64, optional, tag = "2")] - pub amount_msat: ::core::option::Option, - /// If set, it represents the number of items requested. - #[prost(uint64, optional, tag = "3")] - pub quantity: ::core::option::Option, - /// If set, it will be seen by the recipient and reflected back in the invoice. - #[prost(string, optional, tag = "4")] - pub payer_note: ::core::option::Option<::prost::alloc::string::String>, + /// An offer for a payment within the Lightning Network. + #[prost(string, tag="1")] + pub offer: ::prost::alloc::string::String, + /// Set this field when paying a so-called "zero-amount" offer, i.e., an offer that leaves the + /// amount paid to be determined by the user. + /// This operation will fail if the amount specified is less than the value required by the given offer. + #[prost(uint64, optional, tag="2")] + pub amount_msat: ::core::option::Option, + /// If set, it represents the number of items requested. + #[prost(uint64, optional, tag="3")] + pub quantity: ::core::option::Option, + /// If set, it will be seen by the recipient and reflected back in the invoice. + #[prost(string, optional, tag="4")] + pub payer_note: ::core::option::Option<::prost::alloc::string::String>, } /// The response `content` for the `Bolt12Send` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12SendResponse { - /// An identifier used to uniquely identify a payment. - #[prost(bytes = "bytes", tag = "1")] - pub payment_id: ::prost::bytes::Bytes, + /// An identifier used to uniquely identify a payment. + #[prost(bytes="bytes", tag="1")] + pub payment_id: ::prost::bytes::Bytes, } /// Creates a new outbound channel to the given remote node. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpenChannelRequest { - /// The hex-encoded public key of the node to open a channel with. - #[prost(string, tag = "1")] - pub node_pubkey: ::prost::alloc::string::String, - /// An address which can be used to connect to a remote peer. - /// It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port - #[prost(string, tag = "2")] - pub address: ::prost::alloc::string::String, - /// The amount of satoshis the caller is willing to commit to the channel. - #[prost(uint64, tag = "3")] - pub channel_amount_sats: u64, - /// The amount of satoshis to push to the remote side as part of the initial commitment state. - #[prost(uint64, optional, tag = "4")] - pub push_to_counterparty_msat: ::core::option::Option, - /// The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used. - #[prost(message, optional, tag = "5")] - pub channel_config: ::core::option::Option, - /// Whether the channel should be public. - #[prost(bool, tag = "6")] - pub announce_channel: bool, + /// The hex-encoded public key of the node to open a channel with. + #[prost(string, tag="1")] + pub node_pubkey: ::prost::alloc::string::String, + /// An address which can be used to connect to a remote peer. + /// It can be of type IPv4:port, IPv6:port, OnionV3:port or hostname:port + #[prost(string, tag="2")] + pub address: ::prost::alloc::string::String, + /// The amount of satoshis the caller is willing to commit to the channel. + #[prost(uint64, tag="3")] + pub channel_amount_sats: u64, + /// The amount of satoshis to push to the remote side as part of the initial commitment state. + #[prost(uint64, optional, tag="4")] + pub push_to_counterparty_msat: ::core::option::Option, + /// The channel configuration to be used for opening this channel. If unset, default ChannelConfig is used. + #[prost(message, optional, tag="5")] + pub channel_config: ::core::option::Option, + /// Whether the channel should be public. + #[prost(bool, tag="6")] + pub announce_channel: bool, } /// The response `content` for the `OpenChannel` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OpenChannelResponse { - /// The channel id of the created channel that user can use to refer to channel. - #[prost(bytes = "bytes", tag = "1")] - pub user_channel_id: ::prost::bytes::Bytes, + /// The channel id of the created channel that user can use to refer to channel. + #[prost(bytes="bytes", tag="1")] + pub user_channel_id: ::prost::bytes::Bytes, } /// Update the config for a previously opened channel. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateChannelConfigRequest { - /// The hex-encoded local `user_channel_id` of this channel. - #[prost(string, tag = "1")] - pub user_channel_id: ::prost::alloc::string::String, - /// The hex-encoded public key of the counterparty node to update channel config with. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The updated channel configuration settings for a channel. - #[prost(message, optional, tag = "3")] - pub channel_config: ::core::option::Option, + /// The hex-encoded local `user_channel_id` of this channel. + #[prost(string, tag="1")] + pub user_channel_id: ::prost::alloc::string::String, + /// The hex-encoded public key of the counterparty node to update channel config with. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The updated channel configuration settings for a channel. + #[prost(message, optional, tag="3")] + pub channel_config: ::core::option::Option, } /// The response `content` for the `UpdateChannelConfig` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UpdateChannelConfigResponse {} +pub struct UpdateChannelConfigResponse { +} /// Closes the channel specified by given request. /// See more: /// - @@ -272,155 +275,158 @@ pub struct UpdateChannelConfigResponse {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CloseChannelRequest { - /// The channel id of the created channel that user can use to refer to channel. - #[prost(bytes = "bytes", tag = "1")] - pub user_channel_id: ::prost::bytes::Bytes, - /// The hex-encoded public key of the node to close a channel with. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// Whether to force close the specified channel. - #[prost(bool, optional, tag = "3")] - pub force_close: ::core::option::Option, - /// The reason for force-closing, can only be set while force closing a channel. - #[prost(string, optional, tag = "4")] - pub force_close_reason: ::core::option::Option<::prost::alloc::string::String>, + /// The channel id of the created channel that user can use to refer to channel. + #[prost(bytes="bytes", tag="1")] + pub user_channel_id: ::prost::bytes::Bytes, + /// The hex-encoded public key of the node to close a channel with. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// Whether to force close the specified channel. + #[prost(bool, optional, tag="3")] + pub force_close: ::core::option::Option, + /// The reason for force-closing, can only be set while force closing a channel. + #[prost(string, optional, tag="4")] + pub force_close_reason: ::core::option::Option<::prost::alloc::string::String>, } /// The response `content` for the `CloseChannel` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CloseChannelResponse {} +pub struct CloseChannelResponse { +} /// Returns a list of known channels. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListChannelsRequest {} +pub struct ListChannelsRequest { +} /// The response `content` for the `ListChannels` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListChannelsResponse { - /// List of channels. - #[prost(message, repeated, tag = "1")] - pub channels: ::prost::alloc::vec::Vec, + /// List of channels. + #[prost(message, repeated, tag="1")] + pub channels: ::prost::alloc::vec::Vec, } /// Returns payment details for a given payment_id. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPaymentDetailsRequest { - /// An identifier used to uniquely identify a payment in hex-encoded form. - #[prost(string, tag = "1")] - pub payment_id: ::prost::alloc::string::String, + /// An identifier used to uniquely identify a payment in hex-encoded form. + #[prost(string, tag="1")] + pub payment_id: ::prost::alloc::string::String, } /// The response `content` for the `GetPaymentDetails` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetPaymentDetailsResponse { - /// Represents a payment. - /// Will be `None` if payment doesn't exist. - #[prost(message, optional, tag = "1")] - pub payment: ::core::option::Option, + /// Represents a payment. + /// Will be `None` if payment doesn't exist. + #[prost(message, optional, tag="1")] + pub payment: ::core::option::Option, } /// Retrieves list of all payments. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListPaymentsRequest {} +pub struct ListPaymentsRequest { +} /// The response `content` for the `ListPayments` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListPaymentsResponse { - /// List of payments. - #[prost(message, repeated, tag = "1")] - pub payments: ::prost::alloc::vec::Vec, + /// List of payments. + #[prost(message, repeated, tag="1")] + pub payments: ::prost::alloc::vec::Vec, } /// Retrieves list of all forwarded payments. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListForwardedPaymentsRequest { - /// `page_token` is a pagination token. - /// - /// To query for the first page, `page_token` must not be specified. - /// - /// For subsequent pages, use the value that was returned as `next_page_token` in the previous - /// page's response. - #[prost(message, optional, tag = "1")] - pub page_token: ::core::option::Option, + /// `page_token` is a pagination token. + /// + /// To query for the first page, `page_token` must not be specified. + /// + /// For subsequent pages, use the value that was returned as `next_page_token` in the previous + /// page's response. + #[prost(message, optional, tag="1")] + pub page_token: ::core::option::Option, } /// The response `content` for the `ListForwardedPayments` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ListForwardedPaymentsResponse { - /// List of forwarded payments. - #[prost(message, repeated, tag = "1")] - pub forwarded_payments: ::prost::alloc::vec::Vec, - /// `next_page_token` is a pagination token, used to retrieve the next page of results. - /// Use this value to query for next-page of paginated operation, by specifying - /// this value as the `page_token` in the next request. - /// - /// If `next_page_token` is `None`, then the "last page" of results has been processed and - /// there is no more data to be retrieved. - /// - /// If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the - /// result set. The only way to know when you have reached the end of the result set is when - /// `next_page_token` is `None`. - /// - /// **Caution**: Clients must not assume a specific number of records to be present in a page for - /// paginated response. - #[prost(message, optional, tag = "2")] - pub next_page_token: ::core::option::Option, + /// List of forwarded payments. + #[prost(message, repeated, tag="1")] + pub forwarded_payments: ::prost::alloc::vec::Vec, + /// `next_page_token` is a pagination token, used to retrieve the next page of results. + /// Use this value to query for next-page of paginated operation, by specifying + /// this value as the `page_token` in the next request. + /// + /// If `next_page_token` is `None`, then the "last page" of results has been processed and + /// there is no more data to be retrieved. + /// + /// If `next_page_token` is not `None`, it does not necessarily mean that there is more data in the + /// result set. The only way to know when you have reached the end of the result set is when + /// `next_page_token` is `None`. + /// + /// **Caution**: Clients must not assume a specific number of records to be present in a page for + /// paginated response. + #[prost(message, optional, tag="2")] + pub next_page_token: ::core::option::Option, } /// Retrieves an overview of all known balances. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetBalancesRequest {} +pub struct GetBalancesRequest { +} /// The response `content` for the `GetBalances` API, when HttpStatusCode is OK (200). /// When HttpStatusCode is not OK (non-200), the response `content` contains a serialized `ErrorResponse`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBalancesResponse { - /// The total balance of our on-chain wallet. - #[prost(uint64, tag = "1")] - pub total_onchain_balance_sats: u64, - /// The currently spendable balance of our on-chain wallet. - /// - /// This includes any sufficiently confirmed funds, minus `total_anchor_channels_reserve_sats`. - #[prost(uint64, tag = "2")] - pub spendable_onchain_balance_sats: u64, - /// The share of our total balance that we retain as an emergency reserve to (hopefully) be - /// able to spend the Anchor outputs when one of our channels is closed. - #[prost(uint64, tag = "3")] - pub total_anchor_channels_reserve_sats: u64, - /// The total balance that we would be able to claim across all our Lightning channels. - /// - /// Note this excludes balances that we are unsure if we are able to claim (e.g., as we are - /// waiting for a preimage or for a timeout to expire). These balances will however be included - /// as `MaybePreimageClaimableHTLC` and `MaybeTimeoutClaimableHTLC` in `lightning_balances`. - #[prost(uint64, tag = "4")] - pub total_lightning_balance_sats: u64, - /// A detailed list of all known Lightning balances that would be claimable on channel closure. - /// - /// Note that less than the listed amounts are spendable over lightning as further reserve - /// restrictions apply. Please refer to `Channel::outbound_capacity_msat` and - /// Channel::next_outbound_htlc_limit_msat as returned by `ListChannels` - /// for a better approximation of the spendable amounts. - #[prost(message, repeated, tag = "5")] - pub lightning_balances: ::prost::alloc::vec::Vec, - /// A detailed list of balances currently being swept from the Lightning to the on-chain - /// wallet. - /// - /// These are balances resulting from channel closures that may have been encumbered by a - /// delay, but are now being claimed and useable once sufficiently confirmed on-chain. - /// - /// Note that, depending on the sync status of the wallets, swept balances listed here might or - /// might not already be accounted for in `total_onchain_balance_sats`. - #[prost(message, repeated, tag = "6")] - pub pending_balances_from_channel_closures: - ::prost::alloc::vec::Vec, + /// The total balance of our on-chain wallet. + #[prost(uint64, tag="1")] + pub total_onchain_balance_sats: u64, + /// The currently spendable balance of our on-chain wallet. + /// + /// This includes any sufficiently confirmed funds, minus `total_anchor_channels_reserve_sats`. + #[prost(uint64, tag="2")] + pub spendable_onchain_balance_sats: u64, + /// The share of our total balance that we retain as an emergency reserve to (hopefully) be + /// able to spend the Anchor outputs when one of our channels is closed. + #[prost(uint64, tag="3")] + pub total_anchor_channels_reserve_sats: u64, + /// The total balance that we would be able to claim across all our Lightning channels. + /// + /// Note this excludes balances that we are unsure if we are able to claim (e.g., as we are + /// waiting for a preimage or for a timeout to expire). These balances will however be included + /// as `MaybePreimageClaimableHTLC` and `MaybeTimeoutClaimableHTLC` in `lightning_balances`. + #[prost(uint64, tag="4")] + pub total_lightning_balance_sats: u64, + /// A detailed list of all known Lightning balances that would be claimable on channel closure. + /// + /// Note that less than the listed amounts are spendable over lightning as further reserve + /// restrictions apply. Please refer to `Channel::outbound_capacity_msat` and + /// Channel::next_outbound_htlc_limit_msat as returned by `ListChannels` + /// for a better approximation of the spendable amounts. + #[prost(message, repeated, tag="5")] + pub lightning_balances: ::prost::alloc::vec::Vec, + /// A detailed list of balances currently being swept from the Lightning to the on-chain + /// wallet. + /// + /// These are balances resulting from channel closures that may have been encumbered by a + /// delay, but are now being claimed and useable once sufficiently confirmed on-chain. + /// + /// Note that, depending on the sync status of the wallets, swept balances listed here might or + /// might not already be accounted for in `total_onchain_balance_sats`. + #[prost(message, repeated, tag="6")] + pub pending_balances_from_channel_closures: ::prost::alloc::vec::Vec, } diff --git a/ldk-server-protos/src/error.rs b/ldk-server-protos/src/error.rs index bd76d36..51f1ddd 100644 --- a/ldk-server-protos/src/error.rs +++ b/ldk-server-protos/src/error.rs @@ -3,64 +3,64 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ErrorResponse { - /// The error message containing a generic description of the error condition in English. - /// It is intended for a human audience only and should not be parsed to extract any information - /// programmatically. Client-side code may use it for logging only. - #[prost(string, tag = "1")] - pub message: ::prost::alloc::string::String, - /// The error code uniquely identifying an error condition. - /// It is meant to be read and understood programmatically by code that detects/handles errors by - /// type. - /// - /// **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to - /// `UnknownError`. - #[prost(enumeration = "ErrorCode", tag = "2")] - pub error_code: i32, + /// The error message containing a generic description of the error condition in English. + /// It is intended for a human audience only and should not be parsed to extract any information + /// programmatically. Client-side code may use it for logging only. + #[prost(string, tag="1")] + pub message: ::prost::alloc::string::String, + /// The error code uniquely identifying an error condition. + /// It is meant to be read and understood programmatically by code that detects/handles errors by + /// type. + /// + /// **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to + /// `UnknownError`. + #[prost(enumeration="ErrorCode", tag="2")] + pub error_code: i32, } #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ErrorCode { - /// Will never be used as `error_code` by server. - /// - /// **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to - /// `UnknownError`. - UnknownError = 0, - /// Used in the following cases: - /// - The request was missing a required argument. - /// - The specified argument was invalid, incomplete or in the wrong format. - /// - The request body of api cannot be deserialized into corresponding protobuf object. - /// - The request does not follow api contract. - InvalidRequestError = 1, - /// Used when authentication fails or in case of an unauthorized request. - AuthError = 2, - /// Used to represent an error while doing a Lightning operation. - LightningError = 3, - /// Used when an internal server error occurred. The client is probably at no fault. - InternalServerError = 4, + /// Will never be used as `error_code` by server. + /// + /// **Caution**: If a new type of `error_code` is introduced in the `ErrorCode` enum, `error_code` field will be set to + /// `UnknownError`. + UnknownError = 0, + /// Used in the following cases: + /// - The request was missing a required argument. + /// - The specified argument was invalid, incomplete or in the wrong format. + /// - The request body of api cannot be deserialized into corresponding protobuf object. + /// - The request does not follow api contract. + InvalidRequestError = 1, + /// Used when authentication fails or in case of an unauthorized request. + AuthError = 2, + /// Used to represent an error while doing a Lightning operation. + LightningError = 3, + /// Used when an internal server error occurred. The client is probably at no fault. + InternalServerError = 4, } impl ErrorCode { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - ErrorCode::UnknownError => "UNKNOWN_ERROR", - ErrorCode::InvalidRequestError => "INVALID_REQUEST_ERROR", - ErrorCode::AuthError => "AUTH_ERROR", - ErrorCode::LightningError => "LIGHTNING_ERROR", - ErrorCode::InternalServerError => "INTERNAL_SERVER_ERROR", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "UNKNOWN_ERROR" => Some(Self::UnknownError), - "INVALID_REQUEST_ERROR" => Some(Self::InvalidRequestError), - "AUTH_ERROR" => Some(Self::AuthError), - "LIGHTNING_ERROR" => Some(Self::LightningError), - "INTERNAL_SERVER_ERROR" => Some(Self::InternalServerError), - _ => None, - } - } + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ErrorCode::UnknownError => "UNKNOWN_ERROR", + ErrorCode::InvalidRequestError => "INVALID_REQUEST_ERROR", + ErrorCode::AuthError => "AUTH_ERROR", + ErrorCode::LightningError => "LIGHTNING_ERROR", + ErrorCode::InternalServerError => "INTERNAL_SERVER_ERROR", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UNKNOWN_ERROR" => Some(Self::UnknownError), + "INVALID_REQUEST_ERROR" => Some(Self::InvalidRequestError), + "AUTH_ERROR" => Some(Self::AuthError), + "LIGHTNING_ERROR" => Some(Self::LightningError), + "INTERNAL_SERVER_ERROR" => Some(Self::InternalServerError), + _ => None, + } + } } diff --git a/ldk-server-protos/src/proto/types.proto b/ldk-server-protos/src/proto/types.proto index b0f0f3c..b2ccd57 100644 --- a/ldk-server-protos/src/proto/types.proto +++ b/ldk-server-protos/src/proto/types.proto @@ -170,10 +170,10 @@ message ForwardedPayment{ // The channel id of the outgoing channel between the next node and us. string next_channel_id = 2; - // The user_channel_id of the incoming channel between the previous node and us. + // The `user_channel_id` of the incoming channel between the previous node and us. string prev_user_channel_id = 3; - // The user_channel_id of the outgoing channel between the next node and us. + // The `user_channel_id` of the outgoing channel between the next node and us. // This will be `None` if the payment was settled via an on-chain transaction. // See the caveat described for the `total_fee_earned_msat` field. optional string next_user_channel_id = 4; @@ -201,7 +201,7 @@ message ForwardedPayment{ // The final amount forwarded, in milli-satoshis, after the fee is deducted. // - // The caveat described above the total_fee_earned_msat field applies here as well. + // The caveat described above the `total_fee_earned_msat` field applies here as well. optional uint64 outbound_amount_forwarded_msat = 8; } diff --git a/ldk-server-protos/src/types.rs b/ldk-server-protos/src/types.rs index 5956694..f83f258 100644 --- a/ldk-server-protos/src/types.rs +++ b/ldk-server-protos/src/types.rs @@ -3,151 +3,152 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Payment { - /// An identifier used to uniquely identify a payment in hex-encoded form. - #[prost(string, tag = "1")] - pub id: ::prost::alloc::string::String, - /// The kind of the payment. - #[prost(message, optional, tag = "2")] - pub kind: ::core::option::Option, - /// The amount transferred. - #[prost(uint64, optional, tag = "3")] - pub amount_msat: ::core::option::Option, - /// The direction of the payment. - #[prost(enumeration = "PaymentDirection", tag = "4")] - pub direction: i32, - /// The status of the payment. - #[prost(enumeration = "PaymentStatus", tag = "5")] - pub status: i32, - /// The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. - #[prost(uint64, tag = "6")] - pub latest_update_timestamp: u64, + /// An identifier used to uniquely identify a payment in hex-encoded form. + #[prost(string, tag="1")] + pub id: ::prost::alloc::string::String, + /// The kind of the payment. + #[prost(message, optional, tag="2")] + pub kind: ::core::option::Option, + /// The amount transferred. + #[prost(uint64, optional, tag="3")] + pub amount_msat: ::core::option::Option, + /// The direction of the payment. + #[prost(enumeration="PaymentDirection", tag="4")] + pub direction: i32, + /// The status of the payment. + #[prost(enumeration="PaymentStatus", tag="5")] + pub status: i32, + /// The timestamp, in seconds since start of the UNIX epoch, when this entry was last updated. + #[prost(uint64, tag="6")] + pub latest_update_timestamp: u64, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PaymentKind { - #[prost(oneof = "payment_kind::Kind", tags = "1, 2, 3, 4, 5, 6")] - pub kind: ::core::option::Option, + #[prost(oneof="payment_kind::Kind", tags="1, 2, 3, 4, 5, 6")] + pub kind: ::core::option::Option, } /// Nested message and enum types in `PaymentKind`. pub mod payment_kind { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Kind { - #[prost(message, tag = "1")] - Onchain(super::Onchain), - #[prost(message, tag = "2")] - Bolt11(super::Bolt11), - #[prost(message, tag = "3")] - Bolt11Jit(super::Bolt11Jit), - #[prost(message, tag = "4")] - Bolt12Offer(super::Bolt12Offer), - #[prost(message, tag = "5")] - Bolt12Refund(super::Bolt12Refund), - #[prost(message, tag = "6")] - Spontaneous(super::Spontaneous), - } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Kind { + #[prost(message, tag="1")] + Onchain(super::Onchain), + #[prost(message, tag="2")] + Bolt11(super::Bolt11), + #[prost(message, tag="3")] + Bolt11Jit(super::Bolt11Jit), + #[prost(message, tag="4")] + Bolt12Offer(super::Bolt12Offer), + #[prost(message, tag="5")] + Bolt12Refund(super::Bolt12Refund), + #[prost(message, tag="6")] + Spontaneous(super::Spontaneous), + } } /// Represents an on-chain payment. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Onchain {} +pub struct Onchain { +} /// Represents a BOLT 11 payment. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11 { - /// The payment hash, i.e., the hash of the preimage. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - /// The pre-image used by the payment. - #[prost(string, optional, tag = "2")] - pub preimage: ::core::option::Option<::prost::alloc::string::String>, - /// The secret used by the payment. - #[prost(bytes = "bytes", optional, tag = "3")] - pub secret: ::core::option::Option<::prost::bytes::Bytes>, + /// The payment hash, i.e., the hash of the preimage. + #[prost(string, tag="1")] + pub hash: ::prost::alloc::string::String, + /// The pre-image used by the payment. + #[prost(string, optional, tag="2")] + pub preimage: ::core::option::Option<::prost::alloc::string::String>, + /// The secret used by the payment. + #[prost(bytes="bytes", optional, tag="3")] + pub secret: ::core::option::Option<::prost::bytes::Bytes>, } /// Represents a BOLT 11 payment intended to open an LSPS 2 just-in-time channel. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt11Jit { - /// The payment hash, i.e., the hash of the preimage. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - /// The pre-image used by the payment. - #[prost(string, optional, tag = "2")] - pub preimage: ::core::option::Option<::prost::alloc::string::String>, - /// The secret used by the payment. - #[prost(bytes = "bytes", optional, tag = "3")] - pub secret: ::core::option::Option<::prost::bytes::Bytes>, - /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. - /// - /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP’s channel opening fees. - /// - /// See \[`LdkChannelConfig::accept_underpaying_htlcs`\]() - /// for more information. - #[prost(message, optional, tag = "4")] - pub lsp_fee_limits: ::core::option::Option, + /// The payment hash, i.e., the hash of the preimage. + #[prost(string, tag="1")] + pub hash: ::prost::alloc::string::String, + /// The pre-image used by the payment. + #[prost(string, optional, tag="2")] + pub preimage: ::core::option::Option<::prost::alloc::string::String>, + /// The secret used by the payment. + #[prost(bytes="bytes", optional, tag="3")] + pub secret: ::core::option::Option<::prost::bytes::Bytes>, + /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. + /// + /// Allowing them to deduct this fee from the first inbound payment will pay for the LSP’s channel opening fees. + /// + /// See \[`LdkChannelConfig::accept_underpaying_htlcs`\]() + /// for more information. + #[prost(message, optional, tag="4")] + pub lsp_fee_limits: ::core::option::Option, } /// Represents a BOLT 12 ‘offer’ payment, i.e., a payment for an Offer. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12Offer { - /// The payment hash, i.e., the hash of the preimage. - #[prost(string, optional, tag = "1")] - pub hash: ::core::option::Option<::prost::alloc::string::String>, - /// The pre-image used by the payment. - #[prost(string, optional, tag = "2")] - pub preimage: ::core::option::Option<::prost::alloc::string::String>, - /// The secret used by the payment. - #[prost(bytes = "bytes", optional, tag = "3")] - pub secret: ::core::option::Option<::prost::bytes::Bytes>, - /// The hex-encoded ID of the offer this payment is for. - #[prost(string, tag = "4")] - pub offer_id: ::prost::alloc::string::String, - /// The payer's note for the payment. - /// Truncated to \[PAYER_NOTE_LIMIT\](). - /// - /// **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, - /// all non-printable characters will be sanitized and replaced with safe characters. - #[prost(string, optional, tag = "5")] - pub payer_note: ::core::option::Option<::prost::alloc::string::String>, - /// The quantity of an item requested in the offer. - #[prost(uint64, optional, tag = "6")] - pub quantity: ::core::option::Option, + /// The payment hash, i.e., the hash of the preimage. + #[prost(string, optional, tag="1")] + pub hash: ::core::option::Option<::prost::alloc::string::String>, + /// The pre-image used by the payment. + #[prost(string, optional, tag="2")] + pub preimage: ::core::option::Option<::prost::alloc::string::String>, + /// The secret used by the payment. + #[prost(bytes="bytes", optional, tag="3")] + pub secret: ::core::option::Option<::prost::bytes::Bytes>, + /// The hex-encoded ID of the offer this payment is for. + #[prost(string, tag="4")] + pub offer_id: ::prost::alloc::string::String, + /// The payer's note for the payment. + /// Truncated to \[PAYER_NOTE_LIMIT\](). + /// + /// **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, + /// all non-printable characters will be sanitized and replaced with safe characters. + #[prost(string, optional, tag="5")] + pub payer_note: ::core::option::Option<::prost::alloc::string::String>, + /// The quantity of an item requested in the offer. + #[prost(uint64, optional, tag="6")] + pub quantity: ::core::option::Option, } /// Represents a BOLT 12 ‘refund’ payment, i.e., a payment for a Refund. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bolt12Refund { - /// The payment hash, i.e., the hash of the preimage. - #[prost(string, optional, tag = "1")] - pub hash: ::core::option::Option<::prost::alloc::string::String>, - /// The pre-image used by the payment. - #[prost(string, optional, tag = "2")] - pub preimage: ::core::option::Option<::prost::alloc::string::String>, - /// The secret used by the payment. - #[prost(bytes = "bytes", optional, tag = "3")] - pub secret: ::core::option::Option<::prost::bytes::Bytes>, - /// The payer's note for the payment. - /// Truncated to \[PAYER_NOTE_LIMIT\](). - /// - /// **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, - /// all non-printable characters will be sanitized and replaced with safe characters. - #[prost(string, optional, tag = "5")] - pub payer_note: ::core::option::Option<::prost::alloc::string::String>, - /// The quantity of an item requested in the offer. - #[prost(uint64, optional, tag = "6")] - pub quantity: ::core::option::Option, + /// The payment hash, i.e., the hash of the preimage. + #[prost(string, optional, tag="1")] + pub hash: ::core::option::Option<::prost::alloc::string::String>, + /// The pre-image used by the payment. + #[prost(string, optional, tag="2")] + pub preimage: ::core::option::Option<::prost::alloc::string::String>, + /// The secret used by the payment. + #[prost(bytes="bytes", optional, tag="3")] + pub secret: ::core::option::Option<::prost::bytes::Bytes>, + /// The payer's note for the payment. + /// Truncated to \[PAYER_NOTE_LIMIT\](). + /// + /// **Caution**: The `payer_note` field may come from an untrusted source. To prevent potential misuse, + /// all non-printable characters will be sanitized and replaced with safe characters. + #[prost(string, optional, tag="5")] + pub payer_note: ::core::option::Option<::prost::alloc::string::String>, + /// The quantity of an item requested in the offer. + #[prost(uint64, optional, tag="6")] + pub quantity: ::core::option::Option, } /// Represents a spontaneous (“keysend”) payment. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Spontaneous { - /// The payment hash, i.e., the hash of the preimage. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, - /// The pre-image used by the payment. - #[prost(string, optional, tag = "2")] - pub preimage: ::core::option::Option<::prost::alloc::string::String>, + /// The payment hash, i.e., the hash of the preimage. + #[prost(string, tag="1")] + pub hash: ::prost::alloc::string::String, + /// The pre-image used by the payment. + #[prost(string, optional, tag="2")] + pub preimage: ::core::option::Option<::prost::alloc::string::String>, } /// Limits applying to how much fee we allow an LSP to deduct from the payment amount. /// See \[`LdkChannelConfig::accept_underpaying_htlcs`\] for more information. @@ -156,295 +157,295 @@ pub struct Spontaneous { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LspFeeLimits { - /// The maximal total amount we allow any configured LSP withhold from us when forwarding the - /// payment. - #[prost(uint64, optional, tag = "1")] - pub max_total_opening_fee_msat: ::core::option::Option, - /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured - /// LSP withhold from us when forwarding the payment. - #[prost(uint64, optional, tag = "2")] - pub max_proportional_opening_fee_ppm_msat: ::core::option::Option, + /// The maximal total amount we allow any configured LSP withhold from us when forwarding the + /// payment. + #[prost(uint64, optional, tag="1")] + pub max_total_opening_fee_msat: ::core::option::Option, + /// The maximal proportional fee, in parts-per-million millisatoshi, we allow any configured + /// LSP withhold from us when forwarding the payment. + #[prost(uint64, optional, tag="2")] + pub max_proportional_opening_fee_ppm_msat: ::core::option::Option, } /// A forwarded payment through our node. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ForwardedPayment { - /// The channel id of the incoming channel between the previous node and us. - #[prost(string, tag = "1")] - pub prev_channel_id: ::prost::alloc::string::String, - /// The channel id of the outgoing channel between the next node and us. - #[prost(string, tag = "2")] - pub next_channel_id: ::prost::alloc::string::String, - /// The user_channel_id of the incoming channel between the previous node and us. - #[prost(string, tag = "3")] - pub prev_user_channel_id: ::prost::alloc::string::String, - /// The user_channel_id of the outgoing channel between the next node and us. - /// This will be `None` if the payment was settled via an on-chain transaction. - /// See the caveat described for the `total_fee_earned_msat` field. - #[prost(string, optional, tag = "4")] - pub next_user_channel_id: ::core::option::Option<::prost::alloc::string::String>, - /// The total fee, in milli-satoshis, which was earned as a result of the payment. - /// - /// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC was pending, the amount the - /// next hop claimed will have been rounded down to the nearest whole satoshi. Thus, the fee calculated here may be - /// higher than expected as we still claimed the full value in millisatoshis from the source. - /// In this case, `claim_from_onchain_tx` will be set. - /// - /// If the channel which sent us the payment has been force-closed, we will claim the funds via an on-chain transaction. - /// In that case we do not yet know the on-chain transaction fees which we will spend and will instead set this to `None`. - #[prost(uint64, optional, tag = "5")] - pub total_fee_earned_msat: ::core::option::Option, - /// The share of the total fee, in milli-satoshis, which was withheld in addition to the forwarding fee. - /// This will only be set if we forwarded an intercepted HTLC with less than the expected amount. This means our - /// counterparty accepted to receive less than the invoice amount. - /// - /// The caveat described above the `total_fee_earned_msat` field applies here as well. - #[prost(uint64, optional, tag = "6")] - pub skimmed_fee_msat: ::core::option::Option, - /// If this is true, the forwarded HTLC was claimed by our counterparty via an on-chain transaction. - #[prost(bool, tag = "7")] - pub claim_from_onchain_tx: bool, - /// The final amount forwarded, in milli-satoshis, after the fee is deducted. - /// - /// The caveat described above the total_fee_earned_msat field applies here as well. - #[prost(uint64, optional, tag = "8")] - pub outbound_amount_forwarded_msat: ::core::option::Option, + /// The channel id of the incoming channel between the previous node and us. + #[prost(string, tag="1")] + pub prev_channel_id: ::prost::alloc::string::String, + /// The channel id of the outgoing channel between the next node and us. + #[prost(string, tag="2")] + pub next_channel_id: ::prost::alloc::string::String, + /// The `user_channel_id` of the incoming channel between the previous node and us. + #[prost(string, tag="3")] + pub prev_user_channel_id: ::prost::alloc::string::String, + /// The `user_channel_id` of the outgoing channel between the next node and us. + /// This will be `None` if the payment was settled via an on-chain transaction. + /// See the caveat described for the `total_fee_earned_msat` field. + #[prost(string, optional, tag="4")] + pub next_user_channel_id: ::core::option::Option<::prost::alloc::string::String>, + /// The total fee, in milli-satoshis, which was earned as a result of the payment. + /// + /// Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC was pending, the amount the + /// next hop claimed will have been rounded down to the nearest whole satoshi. Thus, the fee calculated here may be + /// higher than expected as we still claimed the full value in millisatoshis from the source. + /// In this case, `claim_from_onchain_tx` will be set. + /// + /// If the channel which sent us the payment has been force-closed, we will claim the funds via an on-chain transaction. + /// In that case we do not yet know the on-chain transaction fees which we will spend and will instead set this to `None`. + #[prost(uint64, optional, tag="5")] + pub total_fee_earned_msat: ::core::option::Option, + /// The share of the total fee, in milli-satoshis, which was withheld in addition to the forwarding fee. + /// This will only be set if we forwarded an intercepted HTLC with less than the expected amount. This means our + /// counterparty accepted to receive less than the invoice amount. + /// + /// The caveat described above the `total_fee_earned_msat` field applies here as well. + #[prost(uint64, optional, tag="6")] + pub skimmed_fee_msat: ::core::option::Option, + /// If this is true, the forwarded HTLC was claimed by our counterparty via an on-chain transaction. + #[prost(bool, tag="7")] + pub claim_from_onchain_tx: bool, + /// The final amount forwarded, in milli-satoshis, after the fee is deducted. + /// + /// The caveat described above the `total_fee_earned_msat` field applies here as well. + #[prost(uint64, optional, tag="8")] + pub outbound_amount_forwarded_msat: ::core::option::Option, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Channel { - /// The channel ID (prior to funding transaction generation, this is a random 32-byte - /// identifier, afterwards this is the transaction ID of the funding transaction XOR the - /// funding transaction output). - /// - /// Note that this means this value is *not* persistent - it can change once during the - /// lifetime of the channel. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The node ID of our the channel's remote counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The channel's funding transaction output, if we've negotiated the funding transaction with - /// our counterparty already. - #[prost(message, optional, tag = "3")] - pub funding_txo: ::core::option::Option, - /// The hex-encoded local `user_channel_id` of this channel. - #[prost(string, tag = "4")] - pub user_channel_id: ::prost::alloc::string::String, - /// The value, in satoshis, that must always be held as a reserve in the channel for us. This - /// value ensures that if we broadcast a revoked state, our counterparty can punish us by - /// claiming at least this value on chain. - /// - /// This value is not included in \[`outbound_capacity_msat`\] as it can never be spent. - /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. - #[prost(uint64, optional, tag = "5")] - pub unspendable_punishment_reserve: ::core::option::Option, - /// The value, in satoshis, of this channel as it appears in the funding output. - #[prost(uint64, tag = "6")] - pub channel_value_sats: u64, - /// The currently negotiated fee rate denominated in satoshi per 1000 weight units, - /// which is applied to commitment and HTLC transactions. - #[prost(uint32, tag = "7")] - pub feerate_sat_per_1000_weight: u32, - /// The available outbound capacity for sending HTLCs to the remote peer. - /// - /// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose - /// balance is not available for inclusion in new outbound HTLCs). This further does not include - /// any pending outgoing HTLCs which are awaiting some other resolution to be sent. - #[prost(uint64, tag = "8")] - pub outbound_capacity_msat: u64, - /// The available outbound capacity for sending HTLCs to the remote peer. - /// - /// The amount does not include any pending HTLCs which are not yet resolved - /// (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further - /// does not include any pending outgoing HTLCs which are awaiting some other resolution to be - /// sent. - #[prost(uint64, tag = "9")] - pub inbound_capacity_msat: u64, - /// The number of required confirmations on the funding transactions before the funding is - /// considered "locked". The amount is selected by the channel fundee. - /// - /// The value will be `None` for outbound channels until the counterparty accepts the channel. - #[prost(uint32, optional, tag = "10")] - pub confirmations_required: ::core::option::Option, - /// The current number of confirmations on the funding transaction. - #[prost(uint32, optional, tag = "11")] - pub confirmations: ::core::option::Option, - /// Is `true` if the channel was initiated (and therefore funded) by us. - #[prost(bool, tag = "12")] - pub is_outbound: bool, - /// Is `true` if both parties have exchanged `channel_ready` messages, and the channel is - /// not currently being shut down. Both parties exchange `channel_ready` messages upon - /// independently verifying that the required confirmations count provided by - /// `confirmations_required` has been reached. - #[prost(bool, tag = "13")] - pub is_channel_ready: bool, - /// Is `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the - /// peer is connected, and (c) the channel is not currently negotiating shutdown. - /// - /// This is a strict superset of `is_channel_ready`. - #[prost(bool, tag = "14")] - pub is_usable: bool, - /// Is `true` if this channel is (or will be) publicly-announced - #[prost(bool, tag = "15")] - pub is_announced: bool, - /// Set of configurable parameters set by self that affect channel operation. - #[prost(message, optional, tag = "16")] - pub channel_config: ::core::option::Option, - /// The available outbound capacity for sending a single HTLC to the remote peer. This is - /// similar to `outbound_capacity_msat` but it may be further restricted by - /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us - /// to use a limit as close as possible to the HTLC limit we can currently send. - #[prost(uint64, tag = "17")] - pub next_outbound_htlc_limit_msat: u64, - /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of - /// `next_outbound_htlc_limit_msat` but represents a lower-bound, rather than - /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a - /// route which is valid. - #[prost(uint64, tag = "18")] - pub next_outbound_htlc_minimum_msat: u64, - /// The number of blocks (after our commitment transaction confirms) that we will need to wait - /// until we can claim our funds after we force-close the channel. During this time our - /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty - /// force-closes the channel and broadcasts a commitment transaction we do not have to wait any - /// time to claim our non-HTLC-encumbered funds. - /// - /// This value will be `None` for outbound channels until the counterparty accepts the channel. - #[prost(uint32, optional, tag = "19")] - pub force_close_spend_delay: ::core::option::Option, - /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. - /// - /// This field is only `None` before we have received either the `OpenChannel` or - /// `AcceptChannel` message from the remote peer. - #[prost(uint64, optional, tag = "20")] - pub counterparty_outbound_htlc_minimum_msat: ::core::option::Option, - /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. - #[prost(uint64, optional, tag = "21")] - pub counterparty_outbound_htlc_maximum_msat: ::core::option::Option, - /// The value, in satoshis, that must always be held in the channel for our counterparty. This - /// value ensures that if our counterparty broadcasts a revoked state, we can punish them by - /// claiming at least this value on chain. - /// - /// This value is not included in `inbound_capacity_msat` as it can never be spent. - #[prost(uint64, tag = "22")] - pub counterparty_unspendable_punishment_reserve: u64, - /// Base routing fee in millisatoshis. - #[prost(uint32, optional, tag = "23")] - pub counterparty_forwarding_info_fee_base_msat: ::core::option::Option, - /// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi. - #[prost(uint32, optional, tag = "24")] - pub counterparty_forwarding_info_fee_proportional_millionths: ::core::option::Option, - /// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart, - /// such that the outgoing HTLC is forwardable to this counterparty. - #[prost(uint32, optional, tag = "25")] - pub counterparty_forwarding_info_cltv_expiry_delta: ::core::option::Option, + /// The channel ID (prior to funding transaction generation, this is a random 32-byte + /// identifier, afterwards this is the transaction ID of the funding transaction XOR the + /// funding transaction output). + /// + /// Note that this means this value is *not* persistent - it can change once during the + /// lifetime of the channel. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The node ID of our the channel's remote counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The channel's funding transaction output, if we've negotiated the funding transaction with + /// our counterparty already. + #[prost(message, optional, tag="3")] + pub funding_txo: ::core::option::Option, + /// The hex-encoded local `user_channel_id` of this channel. + #[prost(string, tag="4")] + pub user_channel_id: ::prost::alloc::string::String, + /// The value, in satoshis, that must always be held as a reserve in the channel for us. This + /// value ensures that if we broadcast a revoked state, our counterparty can punish us by + /// claiming at least this value on chain. + /// + /// This value is not included in \[`outbound_capacity_msat`\] as it can never be spent. + /// + /// This value will be `None` for outbound channels until the counterparty accepts the channel. + #[prost(uint64, optional, tag="5")] + pub unspendable_punishment_reserve: ::core::option::Option, + /// The value, in satoshis, of this channel as it appears in the funding output. + #[prost(uint64, tag="6")] + pub channel_value_sats: u64, + /// The currently negotiated fee rate denominated in satoshi per 1000 weight units, + /// which is applied to commitment and HTLC transactions. + #[prost(uint32, tag="7")] + pub feerate_sat_per_1000_weight: u32, + /// The available outbound capacity for sending HTLCs to the remote peer. + /// + /// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose + /// balance is not available for inclusion in new outbound HTLCs). This further does not include + /// any pending outgoing HTLCs which are awaiting some other resolution to be sent. + #[prost(uint64, tag="8")] + pub outbound_capacity_msat: u64, + /// The available outbound capacity for sending HTLCs to the remote peer. + /// + /// The amount does not include any pending HTLCs which are not yet resolved + /// (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further + /// does not include any pending outgoing HTLCs which are awaiting some other resolution to be + /// sent. + #[prost(uint64, tag="9")] + pub inbound_capacity_msat: u64, + /// The number of required confirmations on the funding transactions before the funding is + /// considered "locked". The amount is selected by the channel fundee. + /// + /// The value will be `None` for outbound channels until the counterparty accepts the channel. + #[prost(uint32, optional, tag="10")] + pub confirmations_required: ::core::option::Option, + /// The current number of confirmations on the funding transaction. + #[prost(uint32, optional, tag="11")] + pub confirmations: ::core::option::Option, + /// Is `true` if the channel was initiated (and therefore funded) by us. + #[prost(bool, tag="12")] + pub is_outbound: bool, + /// Is `true` if both parties have exchanged `channel_ready` messages, and the channel is + /// not currently being shut down. Both parties exchange `channel_ready` messages upon + /// independently verifying that the required confirmations count provided by + /// `confirmations_required` has been reached. + #[prost(bool, tag="13")] + pub is_channel_ready: bool, + /// Is `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the + /// peer is connected, and (c) the channel is not currently negotiating shutdown. + /// + /// This is a strict superset of `is_channel_ready`. + #[prost(bool, tag="14")] + pub is_usable: bool, + /// Is `true` if this channel is (or will be) publicly-announced + #[prost(bool, tag="15")] + pub is_announced: bool, + /// Set of configurable parameters set by self that affect channel operation. + #[prost(message, optional, tag="16")] + pub channel_config: ::core::option::Option, + /// The available outbound capacity for sending a single HTLC to the remote peer. This is + /// similar to `outbound_capacity_msat` but it may be further restricted by + /// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us + /// to use a limit as close as possible to the HTLC limit we can currently send. + #[prost(uint64, tag="17")] + pub next_outbound_htlc_limit_msat: u64, + /// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of + /// `next_outbound_htlc_limit_msat` but represents a lower-bound, rather than + /// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a + /// route which is valid. + #[prost(uint64, tag="18")] + pub next_outbound_htlc_minimum_msat: u64, + /// The number of blocks (after our commitment transaction confirms) that we will need to wait + /// until we can claim our funds after we force-close the channel. During this time our + /// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty + /// force-closes the channel and broadcasts a commitment transaction we do not have to wait any + /// time to claim our non-HTLC-encumbered funds. + /// + /// This value will be `None` for outbound channels until the counterparty accepts the channel. + #[prost(uint32, optional, tag="19")] + pub force_close_spend_delay: ::core::option::Option, + /// The smallest value HTLC (in msat) the remote peer will accept, for this channel. + /// + /// This field is only `None` before we have received either the `OpenChannel` or + /// `AcceptChannel` message from the remote peer. + #[prost(uint64, optional, tag="20")] + pub counterparty_outbound_htlc_minimum_msat: ::core::option::Option, + /// The largest value HTLC (in msat) the remote peer currently will accept, for this channel. + #[prost(uint64, optional, tag="21")] + pub counterparty_outbound_htlc_maximum_msat: ::core::option::Option, + /// The value, in satoshis, that must always be held in the channel for our counterparty. This + /// value ensures that if our counterparty broadcasts a revoked state, we can punish them by + /// claiming at least this value on chain. + /// + /// This value is not included in `inbound_capacity_msat` as it can never be spent. + #[prost(uint64, tag="22")] + pub counterparty_unspendable_punishment_reserve: u64, + /// Base routing fee in millisatoshis. + #[prost(uint32, optional, tag="23")] + pub counterparty_forwarding_info_fee_base_msat: ::core::option::Option, + /// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi. + #[prost(uint32, optional, tag="24")] + pub counterparty_forwarding_info_fee_proportional_millionths: ::core::option::Option, + /// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart, + /// such that the outgoing HTLC is forwardable to this counterparty. + #[prost(uint32, optional, tag="25")] + pub counterparty_forwarding_info_cltv_expiry_delta: ::core::option::Option, } /// ChannelConfig represents the configuration settings for a channel in a Lightning Network node. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChannelConfig { - /// Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound - /// over the channel. - /// See more: - #[prost(uint32, optional, tag = "1")] - pub forwarding_fee_proportional_millionths: ::core::option::Option, - /// Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, - /// in excess of forwarding_fee_proportional_millionths. - /// See more: - #[prost(uint32, optional, tag = "2")] - pub forwarding_fee_base_msat: ::core::option::Option, - /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded - /// over the channel this config applies to. - /// See more: - #[prost(uint32, optional, tag = "3")] - pub cltv_expiry_delta: ::core::option::Option, - /// The maximum additional fee we’re willing to pay to avoid waiting for the counterparty’s - /// to_self_delay to reclaim funds. - /// See more: - #[prost(uint64, optional, tag = "4")] - pub force_close_avoidance_max_fee_satoshis: ::core::option::Option, - /// If set, allows this channel’s counterparty to skim an additional fee off this node’s - /// inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. - /// See more: - #[prost(bool, optional, tag = "5")] - pub accept_underpaying_htlcs: ::core::option::Option, - /// Limit our total exposure to potential loss to on-chain fees on close, including - /// in-flight HTLCs which are burned to fees as they are too small to claim on-chain - /// and fees on commitment transaction(s) broadcasted by our counterparty in excess of - /// our own fee estimate. - /// See more: - #[prost(oneof = "channel_config::MaxDustHtlcExposure", tags = "6, 7")] - pub max_dust_htlc_exposure: ::core::option::Option, + /// Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound + /// over the channel. + /// See more: + #[prost(uint32, optional, tag="1")] + pub forwarding_fee_proportional_millionths: ::core::option::Option, + /// Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, + /// in excess of forwarding_fee_proportional_millionths. + /// See more: + #[prost(uint32, optional, tag="2")] + pub forwarding_fee_base_msat: ::core::option::Option, + /// The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded + /// over the channel this config applies to. + /// See more: + #[prost(uint32, optional, tag="3")] + pub cltv_expiry_delta: ::core::option::Option, + /// The maximum additional fee we’re willing to pay to avoid waiting for the counterparty’s + /// to_self_delay to reclaim funds. + /// See more: + #[prost(uint64, optional, tag="4")] + pub force_close_avoidance_max_fee_satoshis: ::core::option::Option, + /// If set, allows this channel’s counterparty to skim an additional fee off this node’s + /// inbound HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users. + /// See more: + #[prost(bool, optional, tag="5")] + pub accept_underpaying_htlcs: ::core::option::Option, + /// Limit our total exposure to potential loss to on-chain fees on close, including + /// in-flight HTLCs which are burned to fees as they are too small to claim on-chain + /// and fees on commitment transaction(s) broadcasted by our counterparty in excess of + /// our own fee estimate. + /// See more: + #[prost(oneof="channel_config::MaxDustHtlcExposure", tags="6, 7")] + pub max_dust_htlc_exposure: ::core::option::Option, } /// Nested message and enum types in `ChannelConfig`. pub mod channel_config { - /// Limit our total exposure to potential loss to on-chain fees on close, including - /// in-flight HTLCs which are burned to fees as they are too small to claim on-chain - /// and fees on commitment transaction(s) broadcasted by our counterparty in excess of - /// our own fee estimate. - /// See more: - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum MaxDustHtlcExposure { - /// This sets a fixed limit on the total dust exposure in millisatoshis. - /// See more: - #[prost(uint64, tag = "6")] - FixedLimitMsat(u64), - /// This sets a multiplier on the ConfirmationTarget::OnChainSweep feerate (in sats/KW) to determine the maximum allowed dust exposure. - /// See more: - #[prost(uint64, tag = "7")] - FeeRateMultiplier(u64), - } + /// Limit our total exposure to potential loss to on-chain fees on close, including + /// in-flight HTLCs which are burned to fees as they are too small to claim on-chain + /// and fees on commitment transaction(s) broadcasted by our counterparty in excess of + /// our own fee estimate. + /// See more: + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum MaxDustHtlcExposure { + /// This sets a fixed limit on the total dust exposure in millisatoshis. + /// See more: + #[prost(uint64, tag="6")] + FixedLimitMsat(u64), + /// This sets a multiplier on the ConfirmationTarget::OnChainSweep feerate (in sats/KW) to determine the maximum allowed dust exposure. + /// See more: + #[prost(uint64, tag="7")] + FeeRateMultiplier(u64), + } } /// Represent a transaction outpoint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OutPoint { - /// The referenced transaction's txid. - #[prost(string, tag = "1")] - pub txid: ::prost::alloc::string::String, - /// The index of the referenced output in its transaction's vout. - #[prost(uint32, tag = "2")] - pub vout: u32, + /// The referenced transaction's txid. + #[prost(string, tag="1")] + pub txid: ::prost::alloc::string::String, + /// The index of the referenced output in its transaction's vout. + #[prost(uint32, tag="2")] + pub vout: u32, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BestBlock { - /// The block’s hash - #[prost(string, tag = "1")] - pub block_hash: ::prost::alloc::string::String, - /// The height at which the block was confirmed. - #[prost(uint32, tag = "2")] - pub height: u32, + /// The block’s hash + #[prost(string, tag="1")] + pub block_hash: ::prost::alloc::string::String, + /// The height at which the block was confirmed. + #[prost(uint32, tag="2")] + pub height: u32, } /// Details about the status of a known Lightning balance. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LightningBalance { - #[prost(oneof = "lightning_balance::BalanceType", tags = "1, 2, 3, 4, 5, 6")] - pub balance_type: ::core::option::Option, + #[prost(oneof="lightning_balance::BalanceType", tags="1, 2, 3, 4, 5, 6")] + pub balance_type: ::core::option::Option, } /// Nested message and enum types in `LightningBalance`. pub mod lightning_balance { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum BalanceType { - #[prost(message, tag = "1")] - ClaimableOnChannelClose(super::ClaimableOnChannelClose), - #[prost(message, tag = "2")] - ClaimableAwaitingConfirmations(super::ClaimableAwaitingConfirmations), - #[prost(message, tag = "3")] - ContentiousClaimable(super::ContentiousClaimable), - #[prost(message, tag = "4")] - MaybeTimeoutClaimableHtlc(super::MaybeTimeoutClaimableHtlc), - #[prost(message, tag = "5")] - MaybePreimageClaimableHtlc(super::MaybePreimageClaimableHtlc), - #[prost(message, tag = "6")] - CounterpartyRevokedOutputClaimable(super::CounterpartyRevokedOutputClaimable), - } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum BalanceType { + #[prost(message, tag="1")] + ClaimableOnChannelClose(super::ClaimableOnChannelClose), + #[prost(message, tag="2")] + ClaimableAwaitingConfirmations(super::ClaimableAwaitingConfirmations), + #[prost(message, tag="3")] + ContentiousClaimable(super::ContentiousClaimable), + #[prost(message, tag="4")] + MaybeTimeoutClaimableHtlc(super::MaybeTimeoutClaimableHtlc), + #[prost(message, tag="5")] + MaybePreimageClaimableHtlc(super::MaybePreimageClaimableHtlc), + #[prost(message, tag="6")] + CounterpartyRevokedOutputClaimable(super::CounterpartyRevokedOutputClaimable), + } } /// The channel is not yet closed (or the commitment or closing transaction has not yet appeared in a block). /// The given balance is claimable (less on-chain fees) if the channel is force-closed now. @@ -452,74 +453,74 @@ pub mod lightning_balance { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClaimableOnChannelClose { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount available to claim, in satoshis, excluding the on-chain fees which will be required to do so. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, - /// The transaction fee we pay for the closing commitment transaction. - /// This amount is not included in the `amount_satoshis` value. - /// - /// Note that if this channel is inbound (and thus our counterparty pays the commitment transaction fee) this value - /// will be zero. - #[prost(uint64, tag = "4")] - pub transaction_fee_satoshis: u64, - /// The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to - /// a payment which was sent by us. This is the sum of the millisatoshis part of all HTLCs which are otherwise - /// represented by `LightningBalance::MaybeTimeoutClaimableHTLC` with their - /// `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` flag set, as well as any dust HTLCs which would - /// otherwise be represented the same. - /// - /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. - #[prost(uint64, tag = "5")] - pub outbound_payment_htlc_rounded_msat: u64, - /// The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to - /// a forwarded HTLC. This is the sum of the millisatoshis part of all HTLCs which are otherwise represented by - /// `LightningBalance::MaybeTimeoutClaimableHTLC` with their `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` - /// flag not set, as well as any dust HTLCs which would otherwise be represented the same. - /// - /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. - #[prost(uint64, tag = "6")] - pub outbound_forwarded_htlc_rounded_msat: u64, - /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we know - /// the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by - /// `LightningBalance::ContentiousClaimable` on channel close, but whose current value is included in `amount_satoshis`, - /// as well as any dust HTLCs which would otherwise be represented the same. - /// - /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. - #[prost(uint64, tag = "7")] - pub inbound_claiming_htlc_rounded_msat: u64, - /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we do - /// not know the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by - /// `LightningBalance::MaybePreimageClaimableHTLC` on channel close, as well as any dust HTLCs which would otherwise be - /// represented the same. - /// - /// This amount (rounded up to a whole satoshi value) will not be included in the counterparty’s `amount_satoshis`. - #[prost(uint64, tag = "8")] - pub inbound_htlc_rounded_msat: u64, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount available to claim, in satoshis, excluding the on-chain fees which will be required to do so. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, + /// The transaction fee we pay for the closing commitment transaction. + /// This amount is not included in the `amount_satoshis` value. + /// + /// Note that if this channel is inbound (and thus our counterparty pays the commitment transaction fee) this value + /// will be zero. + #[prost(uint64, tag="4")] + pub transaction_fee_satoshis: u64, + /// The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to + /// a payment which was sent by us. This is the sum of the millisatoshis part of all HTLCs which are otherwise + /// represented by `LightningBalance::MaybeTimeoutClaimableHTLC` with their + /// `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` flag set, as well as any dust HTLCs which would + /// otherwise be represented the same. + /// + /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + #[prost(uint64, tag="5")] + pub outbound_payment_htlc_rounded_msat: u64, + /// The amount of millisatoshis which has been burned to fees from HTLCs which are outbound from us and are related to + /// a forwarded HTLC. This is the sum of the millisatoshis part of all HTLCs which are otherwise represented by + /// `LightningBalance::MaybeTimeoutClaimableHTLC` with their `LightningBalance::MaybeTimeoutClaimableHTLC::outbound_payment` + /// flag not set, as well as any dust HTLCs which would otherwise be represented the same. + /// + /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + #[prost(uint64, tag="6")] + pub outbound_forwarded_htlc_rounded_msat: u64, + /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we know + /// the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by + /// `LightningBalance::ContentiousClaimable` on channel close, but whose current value is included in `amount_satoshis`, + /// as well as any dust HTLCs which would otherwise be represented the same. + /// + /// This amount (rounded up to a whole satoshi value) will not be included in `amount_satoshis`. + #[prost(uint64, tag="7")] + pub inbound_claiming_htlc_rounded_msat: u64, + /// The amount of millisatoshis which has been burned to fees from HTLCs which are inbound to us and for which we do + /// not know the preimage. This is the sum of the millisatoshis part of all HTLCs which would be represented by + /// `LightningBalance::MaybePreimageClaimableHTLC` on channel close, as well as any dust HTLCs which would otherwise be + /// represented the same. + /// + /// This amount (rounded up to a whole satoshi value) will not be included in the counterparty’s `amount_satoshis`. + #[prost(uint64, tag="8")] + pub inbound_htlc_rounded_msat: u64, } /// The channel has been closed, and the given balance is ours but awaiting confirmations until we consider it spendable. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClaimableAwaitingConfirmations { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which were spent in broadcasting - /// the transaction. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, - /// The height at which we start tracking it as `SpendableOutput`. - #[prost(uint32, tag = "4")] - pub confirmation_height: u32, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount available to claim, in satoshis, possibly excluding the on-chain fees which were spent in broadcasting + /// the transaction. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, + /// The height at which we start tracking it as `SpendableOutput`. + #[prost(uint32, tag="4")] + pub confirmation_height: u32, } /// The channel has been closed, and the given balance should be ours but awaiting spending transaction confirmation. /// If the spending transaction does not confirm in time, it is possible our counterparty can take the funds by @@ -531,25 +532,25 @@ pub struct ClaimableAwaitingConfirmations { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContentiousClaimable { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting - /// the transaction. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, - /// The height at which the counterparty may be able to claim the balance if we have not done so. - #[prost(uint32, tag = "4")] - pub timeout_height: u32, - /// The payment hash that locks this HTLC. - #[prost(string, tag = "5")] - pub payment_hash: ::prost::alloc::string::String, - /// The preimage that can be used to claim this HTLC. - #[prost(string, tag = "6")] - pub payment_preimage: ::prost::alloc::string::String, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + /// the transaction. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, + /// The height at which the counterparty may be able to claim the balance if we have not done so. + #[prost(uint32, tag="4")] + pub timeout_height: u32, + /// The payment hash that locks this HTLC. + #[prost(string, tag="5")] + pub payment_hash: ::prost::alloc::string::String, + /// The preimage that can be used to claim this HTLC. + #[prost(string, tag="6")] + pub payment_preimage: ::prost::alloc::string::String, } /// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain fees) if the counterparty /// does not know the preimage for the HTLCs. These are somewhat likely to be claimed by our counterparty before we do. @@ -557,25 +558,25 @@ pub struct ContentiousClaimable { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MaybeTimeoutClaimableHtlc { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting - /// the transaction. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, - /// The height at which we will be able to claim the balance if our counterparty has not done so. - #[prost(uint32, tag = "4")] - pub claimable_height: u32, - /// The payment hash whose preimage our counterparty needs to claim this HTLC. - #[prost(string, tag = "5")] - pub payment_hash: ::prost::alloc::string::String, - /// Indicates whether this HTLC represents a payment which was sent outbound from us. - #[prost(bool, tag = "6")] - pub outbound_payment: bool, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + /// the transaction. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, + /// The height at which we will be able to claim the balance if our counterparty has not done so. + #[prost(uint32, tag="4")] + pub claimable_height: u32, + /// The payment hash whose preimage our counterparty needs to claim this HTLC. + #[prost(string, tag="5")] + pub payment_hash: ::prost::alloc::string::String, + /// Indicates whether this HTLC represents a payment which was sent outbound from us. + #[prost(bool, tag="6")] + pub outbound_payment: bool, } /// HTLCs which we received from our counterparty which are claimable with a preimage which we do not currently have. /// This will only be claimable if we receive the preimage from the node to which we forwarded this HTLC before the @@ -584,23 +585,23 @@ pub struct MaybeTimeoutClaimableHtlc { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MaybePreimageClaimableHtlc { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting - /// the transaction. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, - /// The height at which our counterparty will be able to claim the balance if we have not yet received the preimage and - /// claimed it ourselves. - #[prost(uint32, tag = "4")] - pub expiry_height: u32, - /// The payment hash whose preimage we need to claim this HTLC. - #[prost(string, tag = "5")] - pub payment_hash: ::prost::alloc::string::String, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount available to claim, in satoshis, excluding the on-chain fees which were spent in broadcasting + /// the transaction. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, + /// The height at which our counterparty will be able to claim the balance if we have not yet received the preimage and + /// claimed it ourselves. + #[prost(uint32, tag="4")] + pub expiry_height: u32, + /// The payment hash whose preimage we need to claim this HTLC. + #[prost(string, tag="5")] + pub payment_hash: ::prost::alloc::string::String, } /// The channel has been closed, and our counterparty broadcasted a revoked commitment transaction. /// @@ -610,65 +611,65 @@ pub struct MaybePreimageClaimableHtlc { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CounterpartyRevokedOutputClaimable { - /// The identifier of the channel this balance belongs to. - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// The identifier of our channel counterparty. - #[prost(string, tag = "2")] - pub counterparty_node_id: ::prost::alloc::string::String, - /// The amount, in satoshis, of the output which we can claim. - #[prost(uint64, tag = "3")] - pub amount_satoshis: u64, + /// The identifier of the channel this balance belongs to. + #[prost(string, tag="1")] + pub channel_id: ::prost::alloc::string::String, + /// The identifier of our channel counterparty. + #[prost(string, tag="2")] + pub counterparty_node_id: ::prost::alloc::string::String, + /// The amount, in satoshis, of the output which we can claim. + #[prost(uint64, tag="3")] + pub amount_satoshis: u64, } /// Details about the status of a known balance currently being swept to our on-chain wallet. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PendingSweepBalance { - #[prost(oneof = "pending_sweep_balance::BalanceType", tags = "1, 2, 3")] - pub balance_type: ::core::option::Option, + #[prost(oneof="pending_sweep_balance::BalanceType", tags="1, 2, 3")] + pub balance_type: ::core::option::Option, } /// Nested message and enum types in `PendingSweepBalance`. pub mod pending_sweep_balance { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum BalanceType { - #[prost(message, tag = "1")] - PendingBroadcast(super::PendingBroadcast), - #[prost(message, tag = "2")] - BroadcastAwaitingConfirmation(super::BroadcastAwaitingConfirmation), - #[prost(message, tag = "3")] - AwaitingThresholdConfirmations(super::AwaitingThresholdConfirmations), - } + #[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum BalanceType { + #[prost(message, tag="1")] + PendingBroadcast(super::PendingBroadcast), + #[prost(message, tag="2")] + BroadcastAwaitingConfirmation(super::BroadcastAwaitingConfirmation), + #[prost(message, tag="3")] + AwaitingThresholdConfirmations(super::AwaitingThresholdConfirmations), + } } /// The spendable output is about to be swept, but a spending transaction has yet to be generated and broadcast. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PendingBroadcast { - /// The identifier of the channel this balance belongs to. - #[prost(string, optional, tag = "1")] - pub channel_id: ::core::option::Option<::prost::alloc::string::String>, - /// The amount, in satoshis, of the output being swept. - #[prost(uint64, tag = "2")] - pub amount_satoshis: u64, + /// The identifier of the channel this balance belongs to. + #[prost(string, optional, tag="1")] + pub channel_id: ::core::option::Option<::prost::alloc::string::String>, + /// The amount, in satoshis, of the output being swept. + #[prost(uint64, tag="2")] + pub amount_satoshis: u64, } /// A spending transaction has been generated and broadcast and is awaiting confirmation on-chain. /// See more: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BroadcastAwaitingConfirmation { - /// The identifier of the channel this balance belongs to. - #[prost(string, optional, tag = "1")] - pub channel_id: ::core::option::Option<::prost::alloc::string::String>, - /// The best height when we last broadcast a transaction spending the output being swept. - #[prost(uint32, tag = "2")] - pub latest_broadcast_height: u32, - /// The identifier of the transaction spending the swept output we last broadcast. - #[prost(string, tag = "3")] - pub latest_spending_txid: ::prost::alloc::string::String, - /// The amount, in satoshis, of the output being swept. - #[prost(uint64, tag = "4")] - pub amount_satoshis: u64, + /// The identifier of the channel this balance belongs to. + #[prost(string, optional, tag="1")] + pub channel_id: ::core::option::Option<::prost::alloc::string::String>, + /// The best height when we last broadcast a transaction spending the output being swept. + #[prost(uint32, tag="2")] + pub latest_broadcast_height: u32, + /// The identifier of the transaction spending the swept output we last broadcast. + #[prost(string, tag="3")] + pub latest_spending_txid: ::prost::alloc::string::String, + /// The amount, in satoshis, of the output being swept. + #[prost(uint64, tag="4")] + pub amount_satoshis: u64, } /// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations. /// @@ -677,90 +678,90 @@ pub struct BroadcastAwaitingConfirmation { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AwaitingThresholdConfirmations { - /// The identifier of the channel this balance belongs to. - #[prost(string, optional, tag = "1")] - pub channel_id: ::core::option::Option<::prost::alloc::string::String>, - /// The identifier of the confirmed transaction spending the swept output. - #[prost(string, tag = "2")] - pub latest_spending_txid: ::prost::alloc::string::String, - /// The hash of the block in which the spending transaction was confirmed. - #[prost(string, tag = "3")] - pub confirmation_hash: ::prost::alloc::string::String, - /// The height at which the spending transaction was confirmed. - #[prost(uint32, tag = "4")] - pub confirmation_height: u32, - /// The amount, in satoshis, of the output being swept. - #[prost(uint64, tag = "5")] - pub amount_satoshis: u64, + /// The identifier of the channel this balance belongs to. + #[prost(string, optional, tag="1")] + pub channel_id: ::core::option::Option<::prost::alloc::string::String>, + /// The identifier of the confirmed transaction spending the swept output. + #[prost(string, tag="2")] + pub latest_spending_txid: ::prost::alloc::string::String, + /// The hash of the block in which the spending transaction was confirmed. + #[prost(string, tag="3")] + pub confirmation_hash: ::prost::alloc::string::String, + /// The height at which the spending transaction was confirmed. + #[prost(uint32, tag="4")] + pub confirmation_height: u32, + /// The amount, in satoshis, of the output being swept. + #[prost(uint64, tag="5")] + pub amount_satoshis: u64, } /// Token used to determine start of next page in paginated APIs. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageToken { - #[prost(string, tag = "1")] - pub token: ::prost::alloc::string::String, - #[prost(int64, tag = "2")] - pub index: i64, + #[prost(string, tag="1")] + pub token: ::prost::alloc::string::String, + #[prost(int64, tag="2")] + pub index: i64, } /// Represents the direction of a payment. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PaymentDirection { - /// The payment is inbound. - Inbound = 0, - /// The payment is outbound. - Outbound = 1, + /// The payment is inbound. + Inbound = 0, + /// The payment is outbound. + Outbound = 1, } impl PaymentDirection { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - PaymentDirection::Inbound => "INBOUND", - PaymentDirection::Outbound => "OUTBOUND", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "INBOUND" => Some(Self::Inbound), - "OUTBOUND" => Some(Self::Outbound), - _ => None, - } - } + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PaymentDirection::Inbound => "INBOUND", + PaymentDirection::Outbound => "OUTBOUND", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "INBOUND" => Some(Self::Inbound), + "OUTBOUND" => Some(Self::Outbound), + _ => None, + } + } } /// Represents the current status of a payment. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum PaymentStatus { - /// The payment is still pending. - Pending = 0, - /// The payment succeeded. - Succeeded = 1, - /// The payment failed. - Failed = 2, + /// The payment is still pending. + Pending = 0, + /// The payment succeeded. + Succeeded = 1, + /// The payment failed. + Failed = 2, } impl PaymentStatus { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - PaymentStatus::Pending => "PENDING", - PaymentStatus::Succeeded => "SUCCEEDED", - PaymentStatus::Failed => "FAILED", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "PENDING" => Some(Self::Pending), - "SUCCEEDED" => Some(Self::Succeeded), - "FAILED" => Some(Self::Failed), - _ => None, - } - } + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + PaymentStatus::Pending => "PENDING", + PaymentStatus::Succeeded => "SUCCEEDED", + PaymentStatus::Failed => "FAILED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "PENDING" => Some(Self::Pending), + "SUCCEEDED" => Some(Self::Succeeded), + "FAILED" => Some(Self::Failed), + _ => None, + } + } }