#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenSeedRequest {
#[prost(bytes, tag = "1")]
pub aezeed_passphrase: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub seed_entropy: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenSeedResponse {
#[prost(string, repeated, tag = "1")]
pub cipher_seed_mnemonic: ::std::vec::Vec<std::string::String>,
#[prost(bytes, tag = "2")]
pub enciphered_seed: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitWalletRequest {
#[prost(bytes, tag = "1")]
pub wallet_password: std::vec::Vec<u8>,
#[prost(string, repeated, tag = "2")]
pub cipher_seed_mnemonic: ::std::vec::Vec<std::string::String>,
#[prost(bytes, tag = "3")]
pub aezeed_passphrase: std::vec::Vec<u8>,
#[prost(int32, tag = "4")]
pub recovery_window: i32,
#[prost(message, optional, tag = "5")]
pub channel_backups: ::std::option::Option<ChanBackupSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitWalletResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnlockWalletRequest {
#[prost(bytes, tag = "1")]
pub wallet_password: std::vec::Vec<u8>,
#[prost(int32, tag = "2")]
pub recovery_window: i32,
#[prost(message, optional, tag = "3")]
pub channel_backups: ::std::option::Option<ChanBackupSnapshot>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UnlockWalletResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangePasswordRequest {
#[prost(bytes, tag = "1")]
pub current_password: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub new_password: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChangePasswordResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Utxo {
#[prost(enumeration = "AddressType", tag = "1")]
pub address_type: i32,
#[prost(string, tag = "2")]
pub address: std::string::String,
#[prost(int64, tag = "3")]
pub amount_sat: i64,
#[prost(string, tag = "4")]
pub pk_script: std::string::String,
#[prost(message, optional, tag = "5")]
pub outpoint: ::std::option::Option<OutPoint>,
#[prost(int64, tag = "6")]
pub confirmations: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Transaction {
#[prost(string, tag = "1")]
pub tx_hash: std::string::String,
#[prost(int64, tag = "2")]
pub amount: i64,
#[prost(int32, tag = "3")]
pub num_confirmations: i32,
#[prost(string, tag = "4")]
pub block_hash: std::string::String,
#[prost(int32, tag = "5")]
pub block_height: i32,
#[prost(int64, tag = "6")]
pub time_stamp: i64,
#[prost(int64, tag = "7")]
pub total_fees: i64,
#[prost(string, repeated, tag = "8")]
pub dest_addresses: ::std::vec::Vec<std::string::String>,
#[prost(string, tag = "9")]
pub raw_tx_hex: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TransactionDetails {
#[prost(message, repeated, tag = "1")]
pub transactions: ::std::vec::Vec<Transaction>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeeLimit {
#[prost(oneof = "fee_limit::Limit", tags = "1, 3, 2")]
pub limit: ::std::option::Option<fee_limit::Limit>,
}
pub mod fee_limit {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Limit {
#[prost(int64, tag = "1")]
Fixed(i64),
#[prost(int64, tag = "3")]
FixedMsat(i64),
#[prost(int64, tag = "2")]
Percent(i64),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendRequest {
#[prost(bytes, tag = "1")]
pub dest: std::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub dest_string: std::string::String,
#[prost(int64, tag = "3")]
pub amt: i64,
#[prost(int64, tag = "12")]
pub amt_msat: i64,
#[prost(bytes, tag = "4")]
pub payment_hash: std::vec::Vec<u8>,
#[prost(string, tag = "5")]
pub payment_hash_string: std::string::String,
#[prost(string, tag = "6")]
pub payment_request: std::string::String,
#[prost(int32, tag = "7")]
pub final_cltv_delta: i32,
#[prost(message, optional, tag = "8")]
pub fee_limit: ::std::option::Option<FeeLimit>,
#[prost(uint64, tag = "9")]
pub outgoing_chan_id: u64,
#[prost(bytes, tag = "13")]
pub last_hop_pubkey: std::vec::Vec<u8>,
#[prost(uint32, tag = "10")]
pub cltv_limit: u32,
#[prost(map = "uint64, bytes", tag = "11")]
pub dest_custom_records: ::std::collections::HashMap<u64, std::vec::Vec<u8>>,
#[prost(bool, tag = "14")]
pub allow_self_payment: bool,
#[prost(enumeration = "FeatureBit", repeated, tag = "15")]
pub dest_features: ::std::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendResponse {
#[prost(string, tag = "1")]
pub payment_error: std::string::String,
#[prost(bytes, tag = "2")]
pub payment_preimage: std::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub payment_route: ::std::option::Option<Route>,
#[prost(bytes, tag = "4")]
pub payment_hash: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendToRouteRequest {
#[prost(bytes, tag = "1")]
pub payment_hash: std::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub payment_hash_string: std::string::String,
#[prost(message, optional, tag = "4")]
pub route: ::std::option::Option<Route>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelAcceptRequest {
#[prost(bytes, tag = "1")]
pub node_pubkey: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub chain_hash: std::vec::Vec<u8>,
#[prost(bytes, tag = "3")]
pub pending_chan_id: std::vec::Vec<u8>,
#[prost(uint64, tag = "4")]
pub funding_amt: u64,
#[prost(uint64, tag = "5")]
pub push_amt: u64,
#[prost(uint64, tag = "6")]
pub dust_limit: u64,
#[prost(uint64, tag = "7")]
pub max_value_in_flight: u64,
#[prost(uint64, tag = "8")]
pub channel_reserve: u64,
#[prost(uint64, tag = "9")]
pub min_htlc: u64,
#[prost(uint64, tag = "10")]
pub fee_per_kw: u64,
#[prost(uint32, tag = "11")]
pub csv_delay: u32,
#[prost(uint32, tag = "12")]
pub max_accepted_htlcs: u32,
#[prost(uint32, tag = "13")]
pub channel_flags: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelAcceptResponse {
#[prost(bool, tag = "1")]
pub accept: bool,
#[prost(bytes, tag = "2")]
pub pending_chan_id: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelPoint {
#[prost(uint32, tag = "3")]
pub output_index: u32,
#[prost(oneof = "channel_point::FundingTxid", tags = "1, 2")]
pub funding_txid: ::std::option::Option<channel_point::FundingTxid>,
}
pub mod channel_point {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum FundingTxid {
#[prost(bytes, tag = "1")]
FundingTxidBytes(std::vec::Vec<u8>),
#[prost(string, tag = "2")]
FundingTxidStr(std::string::String),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutPoint {
#[prost(bytes, tag = "1")]
pub txid_bytes: std::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub txid_str: std::string::String,
#[prost(uint32, tag = "3")]
pub output_index: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LightningAddress {
#[prost(string, tag = "1")]
pub pubkey: std::string::String,
#[prost(string, tag = "2")]
pub host: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EstimateFeeRequest {
#[prost(map = "string, int64", tag = "1")]
pub addr_to_amount: ::std::collections::HashMap<std::string::String, i64>,
#[prost(int32, tag = "2")]
pub target_conf: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EstimateFeeResponse {
#[prost(int64, tag = "1")]
pub fee_sat: i64,
#[prost(int64, tag = "2")]
pub feerate_sat_per_byte: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendManyRequest {
#[prost(map = "string, int64", tag = "1")]
pub addr_to_amount: ::std::collections::HashMap<std::string::String, i64>,
#[prost(int32, tag = "3")]
pub target_conf: i32,
#[prost(int64, tag = "5")]
pub sat_per_byte: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendManyResponse {
#[prost(string, tag = "1")]
pub txid: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendCoinsRequest {
#[prost(string, tag = "1")]
pub addr: std::string::String,
#[prost(int64, tag = "2")]
pub amount: i64,
#[prost(int32, tag = "3")]
pub target_conf: i32,
#[prost(int64, tag = "5")]
pub sat_per_byte: i64,
#[prost(bool, tag = "6")]
pub send_all: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendCoinsResponse {
#[prost(string, tag = "1")]
pub txid: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListUnspentRequest {
#[prost(int32, tag = "1")]
pub min_confs: i32,
#[prost(int32, tag = "2")]
pub max_confs: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListUnspentResponse {
#[prost(message, repeated, tag = "1")]
pub utxos: ::std::vec::Vec<Utxo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NewAddressRequest {
#[prost(enumeration = "AddressType", tag = "1")]
pub r#type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NewAddressResponse {
#[prost(string, tag = "1")]
pub address: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignMessageRequest {
#[prost(bytes, tag = "1")]
pub msg: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SignMessageResponse {
#[prost(string, tag = "1")]
pub signature: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyMessageRequest {
#[prost(bytes, tag = "1")]
pub msg: std::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub signature: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyMessageResponse {
#[prost(bool, tag = "1")]
pub valid: bool,
#[prost(string, tag = "2")]
pub pubkey: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConnectPeerRequest {
#[prost(message, optional, tag = "1")]
pub addr: ::std::option::Option<LightningAddress>,
#[prost(bool, tag = "2")]
pub perm: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConnectPeerResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisconnectPeerRequest {
#[prost(string, tag = "1")]
pub pub_key: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DisconnectPeerResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Htlc {
#[prost(bool, tag = "1")]
pub incoming: bool,
#[prost(int64, tag = "2")]
pub amount: i64,
#[prost(bytes, tag = "3")]
pub hash_lock: std::vec::Vec<u8>,
#[prost(uint32, tag = "4")]
pub expiration_height: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Channel {
#[prost(bool, tag = "1")]
pub active: bool,
#[prost(string, tag = "2")]
pub remote_pubkey: std::string::String,
#[prost(string, tag = "3")]
pub channel_point: std::string::String,
#[prost(uint64, tag = "4")]
pub chan_id: u64,
#[prost(int64, tag = "5")]
pub capacity: i64,
#[prost(int64, tag = "6")]
pub local_balance: i64,
#[prost(int64, tag = "7")]
pub remote_balance: i64,
#[prost(int64, tag = "8")]
pub commit_fee: i64,
#[prost(int64, tag = "9")]
pub commit_weight: i64,
#[prost(int64, tag = "10")]
pub fee_per_kw: i64,
#[prost(int64, tag = "11")]
pub unsettled_balance: i64,
#[prost(int64, tag = "12")]
pub total_satoshis_sent: i64,
#[prost(int64, tag = "13")]
pub total_satoshis_received: i64,
#[prost(uint64, tag = "14")]
pub num_updates: u64,
#[prost(message, repeated, tag = "15")]
pub pending_htlcs: ::std::vec::Vec<Htlc>,
#[prost(uint32, tag = "16")]
pub csv_delay: u32,
#[prost(bool, tag = "17")]
pub private: bool,
#[prost(bool, tag = "18")]
pub initiator: bool,
#[prost(string, tag = "19")]
pub chan_status_flags: std::string::String,
#[prost(int64, tag = "20")]
pub local_chan_reserve_sat: i64,
#[prost(int64, tag = "21")]
pub remote_chan_reserve_sat: i64,
#[prost(bool, tag = "22")]
pub static_remote_key: bool,
#[prost(enumeration = "CommitmentType", tag = "26")]
pub commitment_type: i32,
#[prost(int64, tag = "23")]
pub lifetime: i64,
#[prost(int64, tag = "24")]
pub uptime: i64,
#[prost(string, tag = "25")]
pub close_address: std::string::String,
#[prost(uint64, tag = "27")]
pub push_amount_sat: u64,
#[prost(uint32, tag = "28")]
pub thaw_height: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelsRequest {
#[prost(bool, tag = "1")]
pub active_only: bool,
#[prost(bool, tag = "2")]
pub inactive_only: bool,
#[prost(bool, tag = "3")]
pub public_only: bool,
#[prost(bool, tag = "4")]
pub private_only: bool,
#[prost(bytes, tag = "5")]
pub peer: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelsResponse {
#[prost(message, repeated, tag = "11")]
pub channels: ::std::vec::Vec<Channel>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelCloseSummary {
#[prost(string, tag = "1")]
pub channel_point: std::string::String,
#[prost(uint64, tag = "2")]
pub chan_id: u64,
#[prost(string, tag = "3")]
pub chain_hash: std::string::String,
#[prost(string, tag = "4")]
pub closing_tx_hash: std::string::String,
#[prost(string, tag = "5")]
pub remote_pubkey: std::string::String,
#[prost(int64, tag = "6")]
pub capacity: i64,
#[prost(uint32, tag = "7")]
pub close_height: u32,
#[prost(int64, tag = "8")]
pub settled_balance: i64,
#[prost(int64, tag = "9")]
pub time_locked_balance: i64,
#[prost(enumeration = "channel_close_summary::ClosureType", tag = "10")]
pub close_type: i32,
#[prost(enumeration = "Initiator", tag = "11")]
pub open_initiator: i32,
#[prost(enumeration = "Initiator", tag = "12")]
pub close_initiator: i32,
}
pub mod channel_close_summary {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ClosureType {
CooperativeClose = 0,
LocalForceClose = 1,
RemoteForceClose = 2,
BreachClose = 3,
FundingCanceled = 4,
Abandoned = 5,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClosedChannelsRequest {
#[prost(bool, tag = "1")]
pub cooperative: bool,
#[prost(bool, tag = "2")]
pub local_force: bool,
#[prost(bool, tag = "3")]
pub remote_force: bool,
#[prost(bool, tag = "4")]
pub breach: bool,
#[prost(bool, tag = "5")]
pub funding_canceled: bool,
#[prost(bool, tag = "6")]
pub abandoned: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClosedChannelsResponse {
#[prost(message, repeated, tag = "1")]
pub channels: ::std::vec::Vec<ChannelCloseSummary>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Peer {
#[prost(string, tag = "1")]
pub pub_key: std::string::String,
#[prost(string, tag = "3")]
pub address: std::string::String,
#[prost(uint64, tag = "4")]
pub bytes_sent: u64,
#[prost(uint64, tag = "5")]
pub bytes_recv: u64,
#[prost(int64, tag = "6")]
pub sat_sent: i64,
#[prost(int64, tag = "7")]
pub sat_recv: i64,
#[prost(bool, tag = "8")]
pub inbound: bool,
#[prost(int64, tag = "9")]
pub ping_time: i64,
#[prost(enumeration = "peer::SyncType", tag = "10")]
pub sync_type: i32,
#[prost(map = "uint32, message", tag = "11")]
pub features: ::std::collections::HashMap<u32, Feature>,
#[prost(message, repeated, tag = "12")]
pub errors: ::std::vec::Vec<TimestampedError>,
}
pub mod peer {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SyncType {
UnknownSync = 0,
ActiveSync = 1,
PassiveSync = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimestampedError {
#[prost(uint64, tag = "1")]
pub timestamp: u64,
#[prost(string, tag = "2")]
pub error: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPeersRequest {
#[prost(bool, tag = "1")]
pub latest_error: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPeersResponse {
#[prost(message, repeated, tag = "1")]
pub peers: ::std::vec::Vec<Peer>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerEventSubscription {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PeerEvent {
#[prost(string, tag = "1")]
pub pub_key: std::string::String,
#[prost(enumeration = "peer_event::EventType", tag = "2")]
pub r#type: i32,
}
pub mod peer_event {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EventType {
PeerOnline = 0,
PeerOffline = 1,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInfoRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetInfoResponse {
#[prost(string, tag = "14")]
pub version: std::string::String,
#[prost(string, tag = "20")]
pub commit_hash: std::string::String,
#[prost(string, tag = "1")]
pub identity_pubkey: std::string::String,
#[prost(string, tag = "2")]
pub alias: std::string::String,
#[prost(string, tag = "17")]
pub color: std::string::String,
#[prost(uint32, tag = "3")]
pub num_pending_channels: u32,
#[prost(uint32, tag = "4")]
pub num_active_channels: u32,
#[prost(uint32, tag = "15")]
pub num_inactive_channels: u32,
#[prost(uint32, tag = "5")]
pub num_peers: u32,
#[prost(uint32, tag = "6")]
pub block_height: u32,
#[prost(string, tag = "8")]
pub block_hash: std::string::String,
#[prost(int64, tag = "13")]
pub best_header_timestamp: i64,
#[prost(bool, tag = "9")]
pub synced_to_chain: bool,
#[prost(bool, tag = "18")]
pub synced_to_graph: bool,
#[prost(bool, tag = "10")]
pub testnet: bool,
#[prost(message, repeated, tag = "16")]
pub chains: ::std::vec::Vec<Chain>,
#[prost(string, repeated, tag = "12")]
pub uris: ::std::vec::Vec<std::string::String>,
#[prost(map = "uint32, message", tag = "19")]
pub features: ::std::collections::HashMap<u32, Feature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Chain {
#[prost(string, tag = "1")]
pub chain: std::string::String,
#[prost(string, tag = "2")]
pub network: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConfirmationUpdate {
#[prost(bytes, tag = "1")]
pub block_sha: std::vec::Vec<u8>,
#[prost(int32, tag = "2")]
pub block_height: i32,
#[prost(uint32, tag = "3")]
pub num_confs_left: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelOpenUpdate {
#[prost(message, optional, tag = "1")]
pub channel_point: ::std::option::Option<ChannelPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelCloseUpdate {
#[prost(bytes, tag = "1")]
pub closing_txid: std::vec::Vec<u8>,
#[prost(bool, tag = "2")]
pub success: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseChannelRequest {
#[prost(message, optional, tag = "1")]
pub channel_point: ::std::option::Option<ChannelPoint>,
#[prost(bool, tag = "2")]
pub force: bool,
#[prost(int32, tag = "3")]
pub target_conf: i32,
#[prost(int64, tag = "4")]
pub sat_per_byte: i64,
#[prost(string, tag = "5")]
pub delivery_address: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseStatusUpdate {
#[prost(oneof = "close_status_update::Update", tags = "1, 3")]
pub update: ::std::option::Option<close_status_update::Update>,
}
pub mod close_status_update {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Update {
#[prost(message, tag = "1")]
ClosePending(super::PendingUpdate),
#[prost(message, tag = "3")]
ChanClose(super::ChannelCloseUpdate),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingUpdate {
#[prost(bytes, tag = "1")]
pub txid: std::vec::Vec<u8>,
#[prost(uint32, tag = "2")]
pub output_index: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReadyForPsbtFunding {
#[prost(string, tag = "1")]
pub funding_address: std::string::String,
#[prost(int64, tag = "2")]
pub funding_amount: i64,
#[prost(bytes, tag = "3")]
pub psbt: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenChannelRequest {
#[prost(bytes, tag = "2")]
pub node_pubkey: std::vec::Vec<u8>,
#[prost(string, tag = "3")]
pub node_pubkey_string: std::string::String,
#[prost(int64, tag = "4")]
pub local_funding_amount: i64,
#[prost(int64, tag = "5")]
pub push_sat: i64,
#[prost(int32, tag = "6")]
pub target_conf: i32,
#[prost(int64, tag = "7")]
pub sat_per_byte: i64,
#[prost(bool, tag = "8")]
pub private: bool,
#[prost(int64, tag = "9")]
pub min_htlc_msat: i64,
#[prost(uint32, tag = "10")]
pub remote_csv_delay: u32,
#[prost(int32, tag = "11")]
pub min_confs: i32,
#[prost(bool, tag = "12")]
pub spend_unconfirmed: bool,
#[prost(string, tag = "13")]
pub close_address: std::string::String,
#[prost(message, optional, tag = "14")]
pub funding_shim: ::std::option::Option<FundingShim>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OpenStatusUpdate {
#[prost(bytes, tag = "4")]
pub pending_chan_id: std::vec::Vec<u8>,
#[prost(oneof = "open_status_update::Update", tags = "1, 3, 5")]
pub update: ::std::option::Option<open_status_update::Update>,
}
pub mod open_status_update {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Update {
#[prost(message, tag = "1")]
ChanPending(super::PendingUpdate),
#[prost(message, tag = "3")]
ChanOpen(super::ChannelOpenUpdate),
#[prost(message, tag = "5")]
PsbtFund(super::ReadyForPsbtFunding),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyLocator {
#[prost(int32, tag = "1")]
pub key_family: i32,
#[prost(int32, tag = "2")]
pub key_index: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct KeyDescriptor {
#[prost(bytes, tag = "1")]
pub raw_key_bytes: std::vec::Vec<u8>,
#[prost(message, optional, tag = "2")]
pub key_loc: ::std::option::Option<KeyLocator>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChanPointShim {
#[prost(int64, tag = "1")]
pub amt: i64,
#[prost(message, optional, tag = "2")]
pub chan_point: ::std::option::Option<ChannelPoint>,
#[prost(message, optional, tag = "3")]
pub local_key: ::std::option::Option<KeyDescriptor>,
#[prost(bytes, tag = "4")]
pub remote_key: std::vec::Vec<u8>,
#[prost(bytes, tag = "5")]
pub pending_chan_id: std::vec::Vec<u8>,
#[prost(uint32, tag = "6")]
pub thaw_height: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PsbtShim {
#[prost(bytes, tag = "1")]
pub pending_chan_id: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub base_psbt: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingShim {
#[prost(oneof = "funding_shim::Shim", tags = "1, 2")]
pub shim: ::std::option::Option<funding_shim::Shim>,
}
pub mod funding_shim {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Shim {
#[prost(message, tag = "1")]
ChanPointShim(super::ChanPointShim),
#[prost(message, tag = "2")]
PsbtShim(super::PsbtShim),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingShimCancel {
#[prost(bytes, tag = "1")]
pub pending_chan_id: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingPsbtVerify {
#[prost(bytes, tag = "1")]
pub funded_psbt: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub pending_chan_id: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingPsbtFinalize {
#[prost(bytes, tag = "1")]
pub signed_psbt: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub pending_chan_id: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingTransitionMsg {
#[prost(oneof = "funding_transition_msg::Trigger", tags = "1, 2, 3, 4")]
pub trigger: ::std::option::Option<funding_transition_msg::Trigger>,
}
pub mod funding_transition_msg {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Trigger {
#[prost(message, tag = "1")]
ShimRegister(super::FundingShim),
#[prost(message, tag = "2")]
ShimCancel(super::FundingShimCancel),
#[prost(message, tag = "3")]
PsbtVerify(super::FundingPsbtVerify),
#[prost(message, tag = "4")]
PsbtFinalize(super::FundingPsbtFinalize),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FundingStateStepResp {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingHtlc {
#[prost(bool, tag = "1")]
pub incoming: bool,
#[prost(int64, tag = "2")]
pub amount: i64,
#[prost(string, tag = "3")]
pub outpoint: std::string::String,
#[prost(uint32, tag = "4")]
pub maturity_height: u32,
#[prost(int32, tag = "5")]
pub blocks_til_maturity: i32,
#[prost(uint32, tag = "6")]
pub stage: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingChannelsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingChannelsResponse {
#[prost(int64, tag = "1")]
pub total_limbo_balance: i64,
#[prost(message, repeated, tag = "2")]
pub pending_open_channels: ::std::vec::Vec<pending_channels_response::PendingOpenChannel>,
#[prost(message, repeated, tag = "3")]
pub pending_closing_channels: ::std::vec::Vec<pending_channels_response::ClosedChannel>,
#[prost(message, repeated, tag = "4")]
pub pending_force_closing_channels:
::std::vec::Vec<pending_channels_response::ForceClosedChannel>,
#[prost(message, repeated, tag = "5")]
pub waiting_close_channels: ::std::vec::Vec<pending_channels_response::WaitingCloseChannel>,
}
pub mod pending_channels_response {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingChannel {
#[prost(string, tag = "1")]
pub remote_node_pub: std::string::String,
#[prost(string, tag = "2")]
pub channel_point: std::string::String,
#[prost(int64, tag = "3")]
pub capacity: i64,
#[prost(int64, tag = "4")]
pub local_balance: i64,
#[prost(int64, tag = "5")]
pub remote_balance: i64,
#[prost(int64, tag = "6")]
pub local_chan_reserve_sat: i64,
#[prost(int64, tag = "7")]
pub remote_chan_reserve_sat: i64,
#[prost(enumeration = "super::Initiator", tag = "8")]
pub initiator: i32,
#[prost(enumeration = "super::CommitmentType", tag = "9")]
pub commitment_type: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PendingOpenChannel {
#[prost(message, optional, tag = "1")]
pub channel: ::std::option::Option<PendingChannel>,
#[prost(uint32, tag = "2")]
pub confirmation_height: u32,
#[prost(int64, tag = "4")]
pub commit_fee: i64,
#[prost(int64, tag = "5")]
pub commit_weight: i64,
#[prost(int64, tag = "6")]
pub fee_per_kw: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WaitingCloseChannel {
#[prost(message, optional, tag = "1")]
pub channel: ::std::option::Option<PendingChannel>,
#[prost(int64, tag = "2")]
pub limbo_balance: i64,
#[prost(message, optional, tag = "3")]
pub commitments: ::std::option::Option<Commitments>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Commitments {
#[prost(string, tag = "1")]
pub local_txid: std::string::String,
#[prost(string, tag = "2")]
pub remote_txid: std::string::String,
#[prost(string, tag = "3")]
pub remote_pending_txid: std::string::String,
#[prost(uint64, tag = "4")]
pub local_commit_fee_sat: u64,
#[prost(uint64, tag = "5")]
pub remote_commit_fee_sat: u64,
#[prost(uint64, tag = "6")]
pub remote_pending_commit_fee_sat: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClosedChannel {
#[prost(message, optional, tag = "1")]
pub channel: ::std::option::Option<PendingChannel>,
#[prost(string, tag = "2")]
pub closing_txid: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForceClosedChannel {
#[prost(message, optional, tag = "1")]
pub channel: ::std::option::Option<PendingChannel>,
#[prost(string, tag = "2")]
pub closing_txid: std::string::String,
#[prost(int64, tag = "3")]
pub limbo_balance: i64,
#[prost(uint32, tag = "4")]
pub maturity_height: u32,
#[prost(int32, tag = "5")]
pub blocks_til_maturity: i32,
#[prost(int64, tag = "6")]
pub recovered_balance: i64,
#[prost(message, repeated, tag = "8")]
pub pending_htlcs: ::std::vec::Vec<super::PendingHtlc>,
#[prost(enumeration = "force_closed_channel::AnchorState", tag = "9")]
pub anchor: i32,
}
pub mod force_closed_channel {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AnchorState {
Limbo = 0,
Recovered = 1,
Lost = 2,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelEventSubscription {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelEventUpdate {
#[prost(enumeration = "channel_event_update::UpdateType", tag = "5")]
pub r#type: i32,
#[prost(oneof = "channel_event_update::Channel", tags = "1, 2, 3, 4, 6")]
pub channel: ::std::option::Option<channel_event_update::Channel>,
}
pub mod channel_event_update {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum UpdateType {
OpenChannel = 0,
ClosedChannel = 1,
ActiveChannel = 2,
InactiveChannel = 3,
PendingOpenChannel = 4,
}
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Channel {
#[prost(message, tag = "1")]
OpenChannel(super::Channel),
#[prost(message, tag = "2")]
ClosedChannel(super::ChannelCloseSummary),
#[prost(message, tag = "3")]
ActiveChannel(super::ChannelPoint),
#[prost(message, tag = "4")]
InactiveChannel(super::ChannelPoint),
#[prost(message, tag = "6")]
PendingOpenChannel(super::PendingUpdate),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WalletBalanceRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WalletBalanceResponse {
#[prost(int64, tag = "1")]
pub total_balance: i64,
#[prost(int64, tag = "2")]
pub confirmed_balance: i64,
#[prost(int64, tag = "3")]
pub unconfirmed_balance: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelBalanceRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelBalanceResponse {
#[prost(int64, tag = "1")]
pub balance: i64,
#[prost(int64, tag = "2")]
pub pending_open_balance: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRoutesRequest {
#[prost(string, tag = "1")]
pub pub_key: std::string::String,
#[prost(int64, tag = "2")]
pub amt: i64,
#[prost(int64, tag = "12")]
pub amt_msat: i64,
#[prost(int32, tag = "4")]
pub final_cltv_delta: i32,
#[prost(message, optional, tag = "5")]
pub fee_limit: ::std::option::Option<FeeLimit>,
#[prost(bytes, repeated, tag = "6")]
pub ignored_nodes: ::std::vec::Vec<std::vec::Vec<u8>>,
#[prost(message, repeated, tag = "7")]
pub ignored_edges: ::std::vec::Vec<EdgeLocator>,
#[prost(string, tag = "8")]
pub source_pub_key: std::string::String,
#[prost(bool, tag = "9")]
pub use_mission_control: bool,
#[prost(message, repeated, tag = "10")]
pub ignored_pairs: ::std::vec::Vec<NodePair>,
#[prost(uint32, tag = "11")]
pub cltv_limit: u32,
#[prost(map = "uint64, bytes", tag = "13")]
pub dest_custom_records: ::std::collections::HashMap<u64, std::vec::Vec<u8>>,
#[prost(uint64, tag = "14")]
pub outgoing_chan_id: u64,
#[prost(bytes, tag = "15")]
pub last_hop_pubkey: std::vec::Vec<u8>,
#[prost(message, repeated, tag = "16")]
pub route_hints: ::std::vec::Vec<RouteHint>,
#[prost(enumeration = "FeatureBit", repeated, tag = "17")]
pub dest_features: ::std::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodePair {
#[prost(bytes, tag = "1")]
pub from: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub to: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EdgeLocator {
#[prost(uint64, tag = "1")]
pub channel_id: u64,
#[prost(bool, tag = "2")]
pub direction_reverse: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryRoutesResponse {
#[prost(message, repeated, tag = "1")]
pub routes: ::std::vec::Vec<Route>,
#[prost(double, tag = "2")]
pub success_prob: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Hop {
#[prost(uint64, tag = "1")]
pub chan_id: u64,
#[prost(int64, tag = "2")]
pub chan_capacity: i64,
#[prost(int64, tag = "3")]
pub amt_to_forward: i64,
#[prost(int64, tag = "4")]
pub fee: i64,
#[prost(uint32, tag = "5")]
pub expiry: u32,
#[prost(int64, tag = "6")]
pub amt_to_forward_msat: i64,
#[prost(int64, tag = "7")]
pub fee_msat: i64,
#[prost(string, tag = "8")]
pub pub_key: std::string::String,
#[prost(bool, tag = "9")]
pub tlv_payload: bool,
#[prost(message, optional, tag = "10")]
pub mpp_record: ::std::option::Option<MppRecord>,
#[prost(map = "uint64, bytes", tag = "11")]
pub custom_records: ::std::collections::HashMap<u64, std::vec::Vec<u8>>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MppRecord {
#[prost(bytes, tag = "11")]
pub payment_addr: std::vec::Vec<u8>,
#[prost(int64, tag = "10")]
pub total_amt_msat: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Route {
#[prost(uint32, tag = "1")]
pub total_time_lock: u32,
#[prost(int64, tag = "2")]
pub total_fees: i64,
#[prost(int64, tag = "3")]
pub total_amt: i64,
#[prost(message, repeated, tag = "4")]
pub hops: ::std::vec::Vec<Hop>,
#[prost(int64, tag = "5")]
pub total_fees_msat: i64,
#[prost(int64, tag = "6")]
pub total_amt_msat: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfoRequest {
#[prost(string, tag = "1")]
pub pub_key: std::string::String,
#[prost(bool, tag = "2")]
pub include_channels: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfo {
#[prost(message, optional, tag = "1")]
pub node: ::std::option::Option<LightningNode>,
#[prost(uint32, tag = "2")]
pub num_channels: u32,
#[prost(int64, tag = "3")]
pub total_capacity: i64,
#[prost(message, repeated, tag = "4")]
pub channels: ::std::vec::Vec<ChannelEdge>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LightningNode {
#[prost(uint32, tag = "1")]
pub last_update: u32,
#[prost(string, tag = "2")]
pub pub_key: std::string::String,
#[prost(string, tag = "3")]
pub alias: std::string::String,
#[prost(message, repeated, tag = "4")]
pub addresses: ::std::vec::Vec<NodeAddress>,
#[prost(string, tag = "5")]
pub color: std::string::String,
#[prost(map = "uint32, message", tag = "6")]
pub features: ::std::collections::HashMap<u32, Feature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeAddress {
#[prost(string, tag = "1")]
pub network: std::string::String,
#[prost(string, tag = "2")]
pub addr: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RoutingPolicy {
#[prost(uint32, tag = "1")]
pub time_lock_delta: u32,
#[prost(int64, tag = "2")]
pub min_htlc: i64,
#[prost(int64, tag = "3")]
pub fee_base_msat: i64,
#[prost(int64, tag = "4")]
pub fee_rate_milli_msat: i64,
#[prost(bool, tag = "5")]
pub disabled: bool,
#[prost(uint64, tag = "6")]
pub max_htlc_msat: u64,
#[prost(uint32, tag = "7")]
pub last_update: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelEdge {
#[prost(uint64, tag = "1")]
pub channel_id: u64,
#[prost(string, tag = "2")]
pub chan_point: std::string::String,
#[prost(uint32, tag = "3")]
pub last_update: u32,
#[prost(string, tag = "4")]
pub node1_pub: std::string::String,
#[prost(string, tag = "5")]
pub node2_pub: std::string::String,
#[prost(int64, tag = "6")]
pub capacity: i64,
#[prost(message, optional, tag = "7")]
pub node1_policy: ::std::option::Option<RoutingPolicy>,
#[prost(message, optional, tag = "8")]
pub node2_policy: ::std::option::Option<RoutingPolicy>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelGraphRequest {
#[prost(bool, tag = "1")]
pub include_unannounced: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelGraph {
#[prost(message, repeated, tag = "1")]
pub nodes: ::std::vec::Vec<LightningNode>,
#[prost(message, repeated, tag = "2")]
pub edges: ::std::vec::Vec<ChannelEdge>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeMetricsRequest {
#[prost(enumeration = "NodeMetricType", repeated, tag = "1")]
pub types: ::std::vec::Vec<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeMetricsResponse {
#[prost(map = "string, message", tag = "1")]
pub betweenness_centrality: ::std::collections::HashMap<std::string::String, FloatMetric>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FloatMetric {
#[prost(double, tag = "1")]
pub value: f64,
#[prost(double, tag = "2")]
pub normalized_value: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChanInfoRequest {
#[prost(uint64, tag = "1")]
pub chan_id: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetworkInfoRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NetworkInfo {
#[prost(uint32, tag = "1")]
pub graph_diameter: u32,
#[prost(double, tag = "2")]
pub avg_out_degree: f64,
#[prost(uint32, tag = "3")]
pub max_out_degree: u32,
#[prost(uint32, tag = "4")]
pub num_nodes: u32,
#[prost(uint32, tag = "5")]
pub num_channels: u32,
#[prost(int64, tag = "6")]
pub total_network_capacity: i64,
#[prost(double, tag = "7")]
pub avg_channel_size: f64,
#[prost(int64, tag = "8")]
pub min_channel_size: i64,
#[prost(int64, tag = "9")]
pub max_channel_size: i64,
#[prost(int64, tag = "10")]
pub median_channel_size_sat: i64,
#[prost(uint64, tag = "11")]
pub num_zombie_chans: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StopResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphTopologySubscription {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GraphTopologyUpdate {
#[prost(message, repeated, tag = "1")]
pub node_updates: ::std::vec::Vec<NodeUpdate>,
#[prost(message, repeated, tag = "2")]
pub channel_updates: ::std::vec::Vec<ChannelEdgeUpdate>,
#[prost(message, repeated, tag = "3")]
pub closed_chans: ::std::vec::Vec<ClosedChannelUpdate>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeUpdate {
#[prost(string, repeated, tag = "1")]
pub addresses: ::std::vec::Vec<std::string::String>,
#[prost(string, tag = "2")]
pub identity_key: std::string::String,
#[prost(bytes, tag = "3")]
pub global_features: std::vec::Vec<u8>,
#[prost(string, tag = "4")]
pub alias: std::string::String,
#[prost(string, tag = "5")]
pub color: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelEdgeUpdate {
#[prost(uint64, tag = "1")]
pub chan_id: u64,
#[prost(message, optional, tag = "2")]
pub chan_point: ::std::option::Option<ChannelPoint>,
#[prost(int64, tag = "3")]
pub capacity: i64,
#[prost(message, optional, tag = "4")]
pub routing_policy: ::std::option::Option<RoutingPolicy>,
#[prost(string, tag = "5")]
pub advertising_node: std::string::String,
#[prost(string, tag = "6")]
pub connecting_node: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClosedChannelUpdate {
#[prost(uint64, tag = "1")]
pub chan_id: u64,
#[prost(int64, tag = "2")]
pub capacity: i64,
#[prost(uint32, tag = "3")]
pub closed_height: u32,
#[prost(message, optional, tag = "4")]
pub chan_point: ::std::option::Option<ChannelPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HopHint {
#[prost(string, tag = "1")]
pub node_id: std::string::String,
#[prost(uint64, tag = "2")]
pub chan_id: u64,
#[prost(uint32, tag = "3")]
pub fee_base_msat: u32,
#[prost(uint32, tag = "4")]
pub fee_proportional_millionths: u32,
#[prost(uint32, tag = "5")]
pub cltv_expiry_delta: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RouteHint {
#[prost(message, repeated, tag = "1")]
pub hop_hints: ::std::vec::Vec<HopHint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Invoice {
#[prost(string, tag = "1")]
pub memo: std::string::String,
#[prost(bytes, tag = "3")]
pub r_preimage: std::vec::Vec<u8>,
#[prost(bytes, tag = "4")]
pub r_hash: std::vec::Vec<u8>,
#[prost(int64, tag = "5")]
pub value: i64,
#[prost(int64, tag = "23")]
pub value_msat: i64,
#[prost(bool, tag = "6")]
pub settled: bool,
#[prost(int64, tag = "7")]
pub creation_date: i64,
#[prost(int64, tag = "8")]
pub settle_date: i64,
#[prost(string, tag = "9")]
pub payment_request: std::string::String,
#[prost(bytes, tag = "10")]
pub description_hash: std::vec::Vec<u8>,
#[prost(int64, tag = "11")]
pub expiry: i64,
#[prost(string, tag = "12")]
pub fallback_addr: std::string::String,
#[prost(uint64, tag = "13")]
pub cltv_expiry: u64,
#[prost(message, repeated, tag = "14")]
pub route_hints: ::std::vec::Vec<RouteHint>,
#[prost(bool, tag = "15")]
pub private: bool,
#[prost(uint64, tag = "16")]
pub add_index: u64,
#[prost(uint64, tag = "17")]
pub settle_index: u64,
#[prost(int64, tag = "18")]
pub amt_paid: i64,
#[prost(int64, tag = "19")]
pub amt_paid_sat: i64,
#[prost(int64, tag = "20")]
pub amt_paid_msat: i64,
#[prost(enumeration = "invoice::InvoiceState", tag = "21")]
pub state: i32,
#[prost(message, repeated, tag = "22")]
pub htlcs: ::std::vec::Vec<InvoiceHtlc>,
#[prost(map = "uint32, message", tag = "24")]
pub features: ::std::collections::HashMap<u32, Feature>,
#[prost(bool, tag = "25")]
pub is_keysend: bool,
}
pub mod invoice {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InvoiceState {
Open = 0,
Settled = 1,
Canceled = 2,
Accepted = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvoiceHtlc {
#[prost(uint64, tag = "1")]
pub chan_id: u64,
#[prost(uint64, tag = "2")]
pub htlc_index: u64,
#[prost(uint64, tag = "3")]
pub amt_msat: u64,
#[prost(int32, tag = "4")]
pub accept_height: i32,
#[prost(int64, tag = "5")]
pub accept_time: i64,
#[prost(int64, tag = "6")]
pub resolve_time: i64,
#[prost(int32, tag = "7")]
pub expiry_height: i32,
#[prost(enumeration = "InvoiceHtlcState", tag = "8")]
pub state: i32,
#[prost(map = "uint64, bytes", tag = "9")]
pub custom_records: ::std::collections::HashMap<u64, std::vec::Vec<u8>>,
#[prost(uint64, tag = "10")]
pub mpp_total_amt_msat: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddInvoiceResponse {
#[prost(bytes, tag = "1")]
pub r_hash: std::vec::Vec<u8>,
#[prost(string, tag = "2")]
pub payment_request: std::string::String,
#[prost(uint64, tag = "16")]
pub add_index: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PaymentHash {
#[prost(string, tag = "1")]
pub r_hash_str: std::string::String,
#[prost(bytes, tag = "2")]
pub r_hash: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInvoiceRequest {
#[prost(bool, tag = "1")]
pub pending_only: bool,
#[prost(uint64, tag = "4")]
pub index_offset: u64,
#[prost(uint64, tag = "5")]
pub num_max_invoices: u64,
#[prost(bool, tag = "6")]
pub reversed: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListInvoiceResponse {
#[prost(message, repeated, tag = "1")]
pub invoices: ::std::vec::Vec<Invoice>,
#[prost(uint64, tag = "2")]
pub last_index_offset: u64,
#[prost(uint64, tag = "3")]
pub first_index_offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InvoiceSubscription {
#[prost(uint64, tag = "1")]
pub add_index: u64,
#[prost(uint64, tag = "2")]
pub settle_index: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Payment {
#[prost(string, tag = "1")]
pub payment_hash: std::string::String,
#[prost(int64, tag = "2")]
pub value: i64,
#[prost(int64, tag = "3")]
pub creation_date: i64,
#[prost(int64, tag = "5")]
pub fee: i64,
#[prost(string, tag = "6")]
pub payment_preimage: std::string::String,
#[prost(int64, tag = "7")]
pub value_sat: i64,
#[prost(int64, tag = "8")]
pub value_msat: i64,
#[prost(string, tag = "9")]
pub payment_request: std::string::String,
#[prost(enumeration = "payment::PaymentStatus", tag = "10")]
pub status: i32,
#[prost(int64, tag = "11")]
pub fee_sat: i64,
#[prost(int64, tag = "12")]
pub fee_msat: i64,
#[prost(int64, tag = "13")]
pub creation_time_ns: i64,
#[prost(message, repeated, tag = "14")]
pub htlcs: ::std::vec::Vec<HtlcAttempt>,
#[prost(uint64, tag = "15")]
pub payment_index: u64,
#[prost(enumeration = "PaymentFailureReason", tag = "16")]
pub failure_reason: i32,
}
pub mod payment {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PaymentStatus {
Unknown = 0,
InFlight = 1,
Succeeded = 2,
Failed = 3,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HtlcAttempt {
#[prost(enumeration = "htlc_attempt::HtlcStatus", tag = "1")]
pub status: i32,
#[prost(message, optional, tag = "2")]
pub route: ::std::option::Option<Route>,
#[prost(int64, tag = "3")]
pub attempt_time_ns: i64,
#[prost(int64, tag = "4")]
pub resolve_time_ns: i64,
#[prost(message, optional, tag = "5")]
pub failure: ::std::option::Option<Failure>,
}
pub mod htlc_attempt {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HtlcStatus {
InFlight = 0,
Succeeded = 1,
Failed = 2,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPaymentsRequest {
#[prost(bool, tag = "1")]
pub include_incomplete: bool,
#[prost(uint64, tag = "2")]
pub index_offset: u64,
#[prost(uint64, tag = "3")]
pub max_payments: u64,
#[prost(bool, tag = "4")]
pub reversed: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPaymentsResponse {
#[prost(message, repeated, tag = "1")]
pub payments: ::std::vec::Vec<Payment>,
#[prost(uint64, tag = "2")]
pub first_index_offset: u64,
#[prost(uint64, tag = "3")]
pub last_index_offset: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAllPaymentsRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteAllPaymentsResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbandonChannelRequest {
#[prost(message, optional, tag = "1")]
pub channel_point: ::std::option::Option<ChannelPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbandonChannelResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugLevelRequest {
#[prost(bool, tag = "1")]
pub show: bool,
#[prost(string, tag = "2")]
pub level_spec: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DebugLevelResponse {
#[prost(string, tag = "1")]
pub sub_systems: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayReqString {
#[prost(string, tag = "1")]
pub pay_req: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayReq {
#[prost(string, tag = "1")]
pub destination: std::string::String,
#[prost(string, tag = "2")]
pub payment_hash: std::string::String,
#[prost(int64, tag = "3")]
pub num_satoshis: i64,
#[prost(int64, tag = "4")]
pub timestamp: i64,
#[prost(int64, tag = "5")]
pub expiry: i64,
#[prost(string, tag = "6")]
pub description: std::string::String,
#[prost(string, tag = "7")]
pub description_hash: std::string::String,
#[prost(string, tag = "8")]
pub fallback_addr: std::string::String,
#[prost(int64, tag = "9")]
pub cltv_expiry: i64,
#[prost(message, repeated, tag = "10")]
pub route_hints: ::std::vec::Vec<RouteHint>,
#[prost(bytes, tag = "11")]
pub payment_addr: std::vec::Vec<u8>,
#[prost(int64, tag = "12")]
pub num_msat: i64,
#[prost(map = "uint32, message", tag = "13")]
pub features: ::std::collections::HashMap<u32, Feature>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Feature {
#[prost(string, tag = "2")]
pub name: std::string::String,
#[prost(bool, tag = "3")]
pub is_required: bool,
#[prost(bool, tag = "4")]
pub is_known: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeeReportRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelFeeReport {
#[prost(uint64, tag = "5")]
pub chan_id: u64,
#[prost(string, tag = "1")]
pub channel_point: std::string::String,
#[prost(int64, tag = "2")]
pub base_fee_msat: i64,
#[prost(int64, tag = "3")]
pub fee_per_mil: i64,
#[prost(double, tag = "4")]
pub fee_rate: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeeReportResponse {
#[prost(message, repeated, tag = "1")]
pub channel_fees: ::std::vec::Vec<ChannelFeeReport>,
#[prost(uint64, tag = "2")]
pub day_fee_sum: u64,
#[prost(uint64, tag = "3")]
pub week_fee_sum: u64,
#[prost(uint64, tag = "4")]
pub month_fee_sum: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PolicyUpdateRequest {
#[prost(int64, tag = "3")]
pub base_fee_msat: i64,
#[prost(double, tag = "4")]
pub fee_rate: f64,
#[prost(uint32, tag = "5")]
pub time_lock_delta: u32,
#[prost(uint64, tag = "6")]
pub max_htlc_msat: u64,
#[prost(uint64, tag = "7")]
pub min_htlc_msat: u64,
#[prost(bool, tag = "8")]
pub min_htlc_msat_specified: bool,
#[prost(oneof = "policy_update_request::Scope", tags = "1, 2")]
pub scope: ::std::option::Option<policy_update_request::Scope>,
}
pub mod policy_update_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Scope {
#[prost(bool, tag = "1")]
Global(bool),
#[prost(message, tag = "2")]
ChanPoint(super::ChannelPoint),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PolicyUpdateResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForwardingHistoryRequest {
#[prost(uint64, tag = "1")]
pub start_time: u64,
#[prost(uint64, tag = "2")]
pub end_time: u64,
#[prost(uint32, tag = "3")]
pub index_offset: u32,
#[prost(uint32, tag = "4")]
pub num_max_events: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForwardingEvent {
#[prost(uint64, tag = "1")]
pub timestamp: u64,
#[prost(uint64, tag = "2")]
pub chan_id_in: u64,
#[prost(uint64, tag = "4")]
pub chan_id_out: u64,
#[prost(uint64, tag = "5")]
pub amt_in: u64,
#[prost(uint64, tag = "6")]
pub amt_out: u64,
#[prost(uint64, tag = "7")]
pub fee: u64,
#[prost(uint64, tag = "8")]
pub fee_msat: u64,
#[prost(uint64, tag = "9")]
pub amt_in_msat: u64,
#[prost(uint64, tag = "10")]
pub amt_out_msat: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ForwardingHistoryResponse {
#[prost(message, repeated, tag = "1")]
pub forwarding_events: ::std::vec::Vec<ForwardingEvent>,
#[prost(uint32, tag = "2")]
pub last_offset_index: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportChannelBackupRequest {
#[prost(message, optional, tag = "1")]
pub chan_point: ::std::option::Option<ChannelPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelBackup {
#[prost(message, optional, tag = "1")]
pub chan_point: ::std::option::Option<ChannelPoint>,
#[prost(bytes, tag = "2")]
pub chan_backup: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MultiChanBackup {
#[prost(message, repeated, tag = "1")]
pub chan_points: ::std::vec::Vec<ChannelPoint>,
#[prost(bytes, tag = "2")]
pub multi_chan_backup: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChanBackupExportRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChanBackupSnapshot {
#[prost(message, optional, tag = "1")]
pub single_chan_backups: ::std::option::Option<ChannelBackups>,
#[prost(message, optional, tag = "2")]
pub multi_chan_backup: ::std::option::Option<MultiChanBackup>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelBackups {
#[prost(message, repeated, tag = "1")]
pub chan_backups: ::std::vec::Vec<ChannelBackup>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreChanBackupRequest {
#[prost(oneof = "restore_chan_backup_request::Backup", tags = "1, 2")]
pub backup: ::std::option::Option<restore_chan_backup_request::Backup>,
}
pub mod restore_chan_backup_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Backup {
#[prost(message, tag = "1")]
ChanBackups(super::ChannelBackups),
#[prost(bytes, tag = "2")]
MultiChanBackup(std::vec::Vec<u8>),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RestoreBackupResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelBackupSubscription {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VerifyChanBackupResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MacaroonPermission {
#[prost(string, tag = "1")]
pub entity: std::string::String,
#[prost(string, tag = "2")]
pub action: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BakeMacaroonRequest {
#[prost(message, repeated, tag = "1")]
pub permissions: ::std::vec::Vec<MacaroonPermission>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BakeMacaroonResponse {
#[prost(string, tag = "1")]
pub macaroon: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Failure {
#[prost(enumeration = "failure::FailureCode", tag = "1")]
pub code: i32,
#[prost(message, optional, tag = "3")]
pub channel_update: ::std::option::Option<ChannelUpdate>,
#[prost(uint64, tag = "4")]
pub htlc_msat: u64,
#[prost(bytes, tag = "5")]
pub onion_sha_256: std::vec::Vec<u8>,
#[prost(uint32, tag = "6")]
pub cltv_expiry: u32,
#[prost(uint32, tag = "7")]
pub flags: u32,
#[prost(uint32, tag = "8")]
pub failure_source_index: u32,
#[prost(uint32, tag = "9")]
pub height: u32,
}
pub mod failure {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FailureCode {
Reserved = 0,
IncorrectOrUnknownPaymentDetails = 1,
IncorrectPaymentAmount = 2,
FinalIncorrectCltvExpiry = 3,
FinalIncorrectHtlcAmount = 4,
FinalExpiryTooSoon = 5,
InvalidRealm = 6,
ExpiryTooSoon = 7,
InvalidOnionVersion = 8,
InvalidOnionHmac = 9,
InvalidOnionKey = 10,
AmountBelowMinimum = 11,
FeeInsufficient = 12,
IncorrectCltvExpiry = 13,
ChannelDisabled = 14,
TemporaryChannelFailure = 15,
RequiredNodeFeatureMissing = 16,
RequiredChannelFeatureMissing = 17,
UnknownNextPeer = 18,
TemporaryNodeFailure = 19,
PermanentNodeFailure = 20,
PermanentChannelFailure = 21,
ExpiryTooFar = 22,
MppTimeout = 23,
InternalFailure = 997,
UnknownFailure = 998,
UnreadableFailure = 999,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelUpdate {
#[prost(bytes, tag = "1")]
pub signature: std::vec::Vec<u8>,
#[prost(bytes, tag = "2")]
pub chain_hash: std::vec::Vec<u8>,
#[prost(uint64, tag = "3")]
pub chan_id: u64,
#[prost(uint32, tag = "4")]
pub timestamp: u32,
#[prost(uint32, tag = "10")]
pub message_flags: u32,
#[prost(uint32, tag = "5")]
pub channel_flags: u32,
#[prost(uint32, tag = "6")]
pub time_lock_delta: u32,
#[prost(uint64, tag = "7")]
pub htlc_minimum_msat: u64,
#[prost(uint32, tag = "8")]
pub base_fee: u32,
#[prost(uint32, tag = "9")]
pub fee_rate: u32,
#[prost(uint64, tag = "11")]
pub htlc_maximum_msat: u64,
#[prost(bytes, tag = "12")]
pub extra_opaque_data: std::vec::Vec<u8>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AddressType {
WitnessPubkeyHash = 0,
NestedPubkeyHash = 1,
UnusedWitnessPubkeyHash = 2,
UnusedNestedPubkeyHash = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CommitmentType {
Legacy = 0,
StaticRemoteKey = 1,
Anchors = 2,
UnknownCommitmentType = 999,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Initiator {
Unknown = 0,
Local = 1,
Remote = 2,
Both = 3,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NodeMetricType {
Unknown = 0,
BetweennessCentrality = 1,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum InvoiceHtlcState {
Accepted = 0,
Settled = 1,
Canceled = 2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PaymentFailureReason {
FailureReasonNone = 0,
FailureReasonTimeout = 1,
FailureReasonNoRoute = 2,
FailureReasonError = 3,
FailureReasonIncorrectPaymentDetails = 4,
FailureReasonInsufficientBalance = 5,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FeatureBit {
DatalossProtectReq = 0,
DatalossProtectOpt = 1,
InitialRouingSync = 3,
UpfrontShutdownScriptReq = 4,
UpfrontShutdownScriptOpt = 5,
GossipQueriesReq = 6,
GossipQueriesOpt = 7,
TlvOnionReq = 8,
TlvOnionOpt = 9,
ExtGossipQueriesReq = 10,
ExtGossipQueriesOpt = 11,
StaticRemoteKeyReq = 12,
StaticRemoteKeyOpt = 13,
PaymentAddrReq = 14,
PaymentAddrOpt = 15,
MppReq = 16,
MppOpt = 17,
}
#[doc = r" Generated client implementations."]
pub mod wallet_unlocker_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = " The WalletUnlocker service is used to set up a wallet password for"]
#[doc = " lnd at first startup, and unlock a previously set up wallet."]
pub struct WalletUnlockerClient<T> {
inner: tonic::client::Grpc<T>,
}
impl WalletUnlockerClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> WalletUnlockerClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor(inner: T, interceptor: impl Into<tonic::Interceptor>) -> Self {
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
Self { inner }
}
#[doc = "*"]
#[doc = "GenSeed is the first method that should be used to instantiate a new lnd"]
#[doc = "instance. This method allows a caller to generate a new aezeed cipher seed"]
#[doc = "given an optional passphrase. If provided, the passphrase will be necessary"]
#[doc = "to decrypt the cipherseed to expose the internal wallet seed."]
#[doc = ""]
#[doc = "Once the cipherseed is obtained and verified by the user, the InitWallet"]
#[doc = "method should be used to commit the newly generated seed, and create the"]
#[doc = "wallet."]
pub async fn gen_seed(
&mut self,
request: impl tonic::IntoRequest<super::GenSeedRequest>,
) -> Result<tonic::Response<super::GenSeedResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.WalletUnlocker/GenSeed");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "InitWallet is used when lnd is starting up for the first time to fully"]
#[doc = "initialize the daemon and its internal wallet. At the very least a wallet"]
#[doc = "password must be provided. This will be used to encrypt sensitive material"]
#[doc = "on disk."]
#[doc = ""]
#[doc = "In the case of a recovery scenario, the user can also specify their aezeed"]
#[doc = "mnemonic and passphrase. If set, then the daemon will use this prior state"]
#[doc = "to initialize its internal wallet."]
#[doc = ""]
#[doc = "Alternatively, this can be used along with the GenSeed RPC to obtain a"]
#[doc = "seed, then present it to the user. Once it has been verified by the user,"]
#[doc = "the seed can be fed into this RPC in order to commit the new wallet."]
pub async fn init_wallet(
&mut self,
request: impl tonic::IntoRequest<super::InitWalletRequest>,
) -> Result<tonic::Response<super::InitWalletResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.WalletUnlocker/InitWallet");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `unlock`"]
#[doc = "UnlockWallet is used at startup of lnd to provide a password to unlock"]
#[doc = "the wallet database."]
pub async fn unlock_wallet(
&mut self,
request: impl tonic::IntoRequest<super::UnlockWalletRequest>,
) -> Result<tonic::Response<super::UnlockWalletResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.WalletUnlocker/UnlockWallet");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `changepassword`"]
#[doc = "ChangePassword changes the password of the encrypted wallet. This will"]
#[doc = "automatically unlock the wallet database if successful."]
pub async fn change_password(
&mut self,
request: impl tonic::IntoRequest<super::ChangePasswordRequest>,
) -> Result<tonic::Response<super::ChangePasswordResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.WalletUnlocker/ChangePassword");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for WalletUnlockerClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
impl<T> std::fmt::Debug for WalletUnlockerClient<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "WalletUnlockerClient {{ ... }}")
}
}
}
#[doc = r" Generated client implementations."]
pub mod lightning_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
pub struct LightningClient<T> {
inner: tonic::client::Grpc<T>,
}
impl LightningClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> LightningClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor(inner: T, interceptor: impl Into<tonic::Interceptor>) -> Self {
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
Self { inner }
}
#[doc = "* lncli: `walletbalance`"]
#[doc = "WalletBalance returns total unspent outputs(confirmed and unconfirmed), all"]
#[doc = "confirmed unspent outputs and all unconfirmed unspent outputs under control"]
#[doc = "of the wallet."]
pub async fn wallet_balance(
&mut self,
request: impl tonic::IntoRequest<super::WalletBalanceRequest>,
) -> Result<tonic::Response<super::WalletBalanceResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/WalletBalance");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `channelbalance`"]
#[doc = "ChannelBalance returns the total funds available across all open channels"]
#[doc = "in satoshis."]
pub async fn channel_balance(
&mut self,
request: impl tonic::IntoRequest<super::ChannelBalanceRequest>,
) -> Result<tonic::Response<super::ChannelBalanceResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ChannelBalance");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listchaintxns`"]
#[doc = "GetTransactions returns a list describing all the known transactions"]
#[doc = "relevant to the wallet."]
pub async fn get_transactions(
&mut self,
request: impl tonic::IntoRequest<super::GetTransactionsRequest>,
) -> Result<tonic::Response<super::TransactionDetails>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetTransactions");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `estimatefee`"]
#[doc = "EstimateFee asks the chain backend to estimate the fee rate and total fees"]
#[doc = "for a transaction that pays to multiple specified outputs."]
pub async fn estimate_fee(
&mut self,
request: impl tonic::IntoRequest<super::EstimateFeeRequest>,
) -> Result<tonic::Response<super::EstimateFeeResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/EstimateFee");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `sendcoins`"]
#[doc = "SendCoins executes a request to send coins to a particular address. Unlike"]
#[doc = "SendMany, this RPC call only allows creating a single output at a time. If"]
#[doc = "neither target_conf, or sat_per_byte are set, then the internal wallet will"]
#[doc = "consult its fee model to determine a fee for the default confirmation"]
#[doc = "target."]
pub async fn send_coins(
&mut self,
request: impl tonic::IntoRequest<super::SendCoinsRequest>,
) -> Result<tonic::Response<super::SendCoinsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendCoins");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listunspent`"]
#[doc = "ListUnspent returns a list of all utxos spendable by the wallet with a"]
#[doc = "number of confirmations between the specified minimum and maximum."]
pub async fn list_unspent(
&mut self,
request: impl tonic::IntoRequest<super::ListUnspentRequest>,
) -> Result<tonic::Response<super::ListUnspentResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ListUnspent");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribeTransactions creates a uni-directional stream from the server to"]
#[doc = "the client in which any newly discovered transactions relevant to the"]
#[doc = "wallet are sent over."]
pub async fn subscribe_transactions(
&mut self,
request: impl tonic::IntoRequest<super::GetTransactionsRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::Transaction>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribeTransactions");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `sendmany`"]
#[doc = "SendMany handles a request for a transaction that creates multiple specified"]
#[doc = "outputs in parallel. If neither target_conf, or sat_per_byte are set, then"]
#[doc = "the internal wallet will consult its fee model to determine a fee for the"]
#[doc = "default confirmation target."]
pub async fn send_many(
&mut self,
request: impl tonic::IntoRequest<super::SendManyRequest>,
) -> Result<tonic::Response<super::SendManyResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendMany");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `newaddress`"]
#[doc = "NewAddress creates a new address under control of the local wallet."]
pub async fn new_address(
&mut self,
request: impl tonic::IntoRequest<super::NewAddressRequest>,
) -> Result<tonic::Response<super::NewAddressResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/NewAddress");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `signmessage`"]
#[doc = "SignMessage signs a message with this node's private key. The returned"]
#[doc = "signature string is `zbase32` encoded and pubkey recoverable, meaning that"]
#[doc = "only the message digest and signature are needed for verification."]
pub async fn sign_message(
&mut self,
request: impl tonic::IntoRequest<super::SignMessageRequest>,
) -> Result<tonic::Response<super::SignMessageResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SignMessage");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `verifymessage`"]
#[doc = "VerifyMessage verifies a signature over a msg. The signature must be"]
#[doc = "zbase32 encoded and signed by an active node in the resident node's"]
#[doc = "channel database. In addition to returning the validity of the signature,"]
#[doc = "VerifyMessage also returns the recovered pubkey from the signature."]
pub async fn verify_message(
&mut self,
request: impl tonic::IntoRequest<super::VerifyMessageRequest>,
) -> Result<tonic::Response<super::VerifyMessageResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/VerifyMessage");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `connect`"]
#[doc = "ConnectPeer attempts to establish a connection to a remote peer. This is at"]
#[doc = "the networking level, and is used for communication between nodes. This is"]
#[doc = "distinct from establishing a channel with a peer."]
pub async fn connect_peer(
&mut self,
request: impl tonic::IntoRequest<super::ConnectPeerRequest>,
) -> Result<tonic::Response<super::ConnectPeerResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ConnectPeer");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `disconnect`"]
#[doc = "DisconnectPeer attempts to disconnect one peer from another identified by a"]
#[doc = "given pubKey. In the case that we currently have a pending or active channel"]
#[doc = "with the target peer, then this action will be not be allowed."]
pub async fn disconnect_peer(
&mut self,
request: impl tonic::IntoRequest<super::DisconnectPeerRequest>,
) -> Result<tonic::Response<super::DisconnectPeerResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/DisconnectPeer");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listpeers`"]
#[doc = "ListPeers returns a verbose listing of all currently active peers."]
pub async fn list_peers(
&mut self,
request: impl tonic::IntoRequest<super::ListPeersRequest>,
) -> Result<tonic::Response<super::ListPeersResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ListPeers");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribePeerEvents creates a uni-directional stream from the server to"]
#[doc = "the client in which any events relevant to the state of peers are sent"]
#[doc = "over. Events include peers going online and offline."]
pub async fn subscribe_peer_events(
&mut self,
request: impl tonic::IntoRequest<super::PeerEventSubscription>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::PeerEvent>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribePeerEvents");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `getinfo`"]
#[doc = "GetInfo returns general information concerning the lightning node including"]
#[doc = "it's identity pubkey, alias, the chains it is connected to, and information"]
#[doc = "concerning the number of open+pending channels."]
pub async fn get_info(
&mut self,
request: impl tonic::IntoRequest<super::GetInfoRequest>,
) -> Result<tonic::Response<super::GetInfoResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetInfo");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `pendingchannels`"]
#[doc = "PendingChannels returns a list of all the channels that are currently"]
#[doc = "considered \"pending\". A channel is pending if it has finished the funding"]
#[doc = "workflow and is waiting for confirmations for the funding txn, or is in the"]
#[doc = "process of closure, either initiated cooperatively or non-cooperatively."]
pub async fn pending_channels(
&mut self,
request: impl tonic::IntoRequest<super::PendingChannelsRequest>,
) -> Result<tonic::Response<super::PendingChannelsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/PendingChannels");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listchannels`"]
#[doc = "ListChannels returns a description of all the open channels that this node"]
#[doc = "is a participant in."]
pub async fn list_channels(
&mut self,
request: impl tonic::IntoRequest<super::ListChannelsRequest>,
) -> Result<tonic::Response<super::ListChannelsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ListChannels");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribeChannelEvents creates a uni-directional stream from the server to"]
#[doc = "the client in which any updates relevant to the state of the channels are"]
#[doc = "sent over. Events include new active channels, inactive channels, and closed"]
#[doc = "channels."]
pub async fn subscribe_channel_events(
&mut self,
request: impl tonic::IntoRequest<super::ChannelEventSubscription>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::ChannelEventUpdate>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribeChannelEvents");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `closedchannels`"]
#[doc = "ClosedChannels returns a description of all the closed channels that"]
#[doc = "this node was a participant in."]
pub async fn closed_channels(
&mut self,
request: impl tonic::IntoRequest<super::ClosedChannelsRequest>,
) -> Result<tonic::Response<super::ClosedChannelsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ClosedChannels");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "OpenChannelSync is a synchronous version of the OpenChannel RPC call. This"]
#[doc = "call is meant to be consumed by clients to the REST proxy. As with all"]
#[doc = "other sync calls, all byte slices are intended to be populated as hex"]
#[doc = "encoded strings."]
pub async fn open_channel_sync(
&mut self,
request: impl tonic::IntoRequest<super::OpenChannelRequest>,
) -> Result<tonic::Response<super::ChannelPoint>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/OpenChannelSync");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `openchannel`"]
#[doc = "OpenChannel attempts to open a singly funded channel specified in the"]
#[doc = "request to a remote peer. Users are able to specify a target number of"]
#[doc = "blocks that the funding transaction should be confirmed in, or a manual fee"]
#[doc = "rate to us for the funding transaction. If neither are specified, then a"]
#[doc = "lax block confirmation target is used. Each OpenStatusUpdate will return"]
#[doc = "the pending channel ID of the in-progress channel. Depending on the"]
#[doc = "arguments specified in the OpenChannelRequest, this pending channel ID can"]
#[doc = "then be used to manually progress the channel funding flow."]
pub async fn open_channel(
&mut self,
request: impl tonic::IntoRequest<super::OpenChannelRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::OpenStatusUpdate>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/OpenChannel");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "*"]
#[doc = "FundingStateStep is an advanced funding related call that allows the caller"]
#[doc = "to either execute some preparatory steps for a funding workflow, or"]
#[doc = "manually progress a funding workflow. The primary way a funding flow is"]
#[doc = "identified is via its pending channel ID. As an example, this method can be"]
#[doc = "used to specify that we're expecting a funding flow for a particular"]
#[doc = "pending channel ID, for which we need to use specific parameters."]
#[doc = "Alternatively, this can be used to interactively drive PSBT signing for"]
#[doc = "funding for partially complete funding transactions."]
pub async fn funding_state_step(
&mut self,
request: impl tonic::IntoRequest<super::FundingTransitionMsg>,
) -> Result<tonic::Response<super::FundingStateStepResp>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/FundingStateStep");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "ChannelAcceptor dispatches a bi-directional streaming RPC in which"]
#[doc = "OpenChannel requests are sent to the client and the client responds with"]
#[doc = "a boolean that tells LND whether or not to accept the channel. This allows"]
#[doc = "node operators to specify their own criteria for accepting inbound channels"]
#[doc = "through a single persistent connection."]
pub async fn channel_acceptor(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::ChannelAcceptResponse>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::ChannelAcceptRequest>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ChannelAcceptor");
self.inner
.streaming(request.into_streaming_request(), path, codec)
.await
}
#[doc = "* lncli: `closechannel`"]
#[doc = "CloseChannel attempts to close an active channel identified by its channel"]
#[doc = "outpoint (ChannelPoint). The actions of this method can additionally be"]
#[doc = "augmented to attempt a force close after a timeout period in the case of an"]
#[doc = "inactive peer. If a non-force close (cooperative closure) is requested,"]
#[doc = "then the user can specify either a target number of blocks until the"]
#[doc = "closure transaction is confirmed, or a manual fee rate. If neither are"]
#[doc = "specified, then a default lax, block confirmation target is used."]
pub async fn close_channel(
&mut self,
request: impl tonic::IntoRequest<super::CloseChannelRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::CloseStatusUpdate>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/CloseChannel");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `abandonchannel`"]
#[doc = "AbandonChannel removes all channel state from the database except for a"]
#[doc = "close summary. This method can be used to get rid of permanently unusable"]
#[doc = "channels due to bugs fixed in newer versions of lnd. Only available"]
#[doc = "when in debug builds of lnd."]
pub async fn abandon_channel(
&mut self,
request: impl tonic::IntoRequest<super::AbandonChannelRequest>,
) -> Result<tonic::Response<super::AbandonChannelResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/AbandonChannel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `sendpayment`"]
#[doc = "Deprecated, use routerrpc.SendPayment. SendPayment dispatches a"]
#[doc = "bi-directional streaming RPC for sending payments through the Lightning"]
#[doc = "Network. A single RPC invocation creates a persistent bi-directional"]
#[doc = "stream allowing clients to rapidly send payments through the Lightning"]
#[doc = "Network with a single persistent connection."]
pub async fn send_payment(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::SendRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::SendResponse>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendPayment");
self.inner
.streaming(request.into_streaming_request(), path, codec)
.await
}
#[doc = "*"]
#[doc = "SendPaymentSync is the synchronous non-streaming version of SendPayment."]
#[doc = "This RPC is intended to be consumed by clients of the REST proxy."]
#[doc = "Additionally, this RPC expects the destination's public key and the payment"]
#[doc = "hash (if any) to be encoded as hex strings."]
pub async fn send_payment_sync(
&mut self,
request: impl tonic::IntoRequest<super::SendRequest>,
) -> Result<tonic::Response<super::SendResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendPaymentSync");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `sendtoroute`"]
#[doc = "SendToRoute is a bi-directional streaming RPC for sending payment through"]
#[doc = "the Lightning Network. This method differs from SendPayment in that it"]
#[doc = "allows users to specify a full route manually. This can be used for things"]
#[doc = "like rebalancing, and atomic swaps."]
pub async fn send_to_route(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::SendToRouteRequest>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::SendResponse>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendToRoute");
self.inner
.streaming(request.into_streaming_request(), path, codec)
.await
}
#[doc = "*"]
#[doc = "SendToRouteSync is a synchronous version of SendToRoute. It Will block"]
#[doc = "until the payment either fails or succeeds."]
pub async fn send_to_route_sync(
&mut self,
request: impl tonic::IntoRequest<super::SendToRouteRequest>,
) -> Result<tonic::Response<super::SendResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SendToRouteSync");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `addinvoice`"]
#[doc = "AddInvoice attempts to add a new invoice to the invoice database. Any"]
#[doc = "duplicated invoices are rejected, therefore all invoices *must* have a"]
#[doc = "unique payment preimage."]
pub async fn add_invoice(
&mut self,
request: impl tonic::IntoRequest<super::Invoice>,
) -> Result<tonic::Response<super::AddInvoiceResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/AddInvoice");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listinvoices`"]
#[doc = "ListInvoices returns a list of all the invoices currently stored within the"]
#[doc = "database. Any active debug invoices are ignored. It has full support for"]
#[doc = "paginated responses, allowing users to query for specific invoices through"]
#[doc = "their add_index. This can be done by using either the first_index_offset or"]
#[doc = "last_index_offset fields included in the response as the index_offset of the"]
#[doc = "next request. By default, the first 100 invoices created will be returned."]
#[doc = "Backwards pagination is also supported through the Reversed flag."]
pub async fn list_invoices(
&mut self,
request: impl tonic::IntoRequest<super::ListInvoiceRequest>,
) -> Result<tonic::Response<super::ListInvoiceResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ListInvoices");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `lookupinvoice`"]
#[doc = "LookupInvoice attempts to look up an invoice according to its payment hash."]
#[doc = "The passed payment hash *must* be exactly 32 bytes, if not, an error is"]
#[doc = "returned."]
pub async fn lookup_invoice(
&mut self,
request: impl tonic::IntoRequest<super::PaymentHash>,
) -> Result<tonic::Response<super::Invoice>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/LookupInvoice");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribeInvoices returns a uni-directional stream (server -> client) for"]
#[doc = "notifying the client of newly added/settled invoices. The caller can"]
#[doc = "optionally specify the add_index and/or the settle_index. If the add_index"]
#[doc = "is specified, then we'll first start by sending add invoice events for all"]
#[doc = "invoices with an add_index greater than the specified value. If the"]
#[doc = "settle_index is specified, the next, we'll send out all settle events for"]
#[doc = "invoices with a settle_index greater than the specified value. One or both"]
#[doc = "of these fields can be set. If no fields are set, then we'll only send out"]
#[doc = "the latest add/settle events."]
pub async fn subscribe_invoices(
&mut self,
request: impl tonic::IntoRequest<super::InvoiceSubscription>,
) -> Result<tonic::Response<tonic::codec::Streaming<super::Invoice>>, tonic::Status>
{
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribeInvoices");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `decodepayreq`"]
#[doc = "DecodePayReq takes an encoded payment request string and attempts to decode"]
#[doc = "it, returning a full description of the conditions encoded within the"]
#[doc = "payment request."]
pub async fn decode_pay_req(
&mut self,
request: impl tonic::IntoRequest<super::PayReqString>,
) -> Result<tonic::Response<super::PayReq>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/DecodePayReq");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `listpayments`"]
#[doc = "ListPayments returns a list of all outgoing payments."]
pub async fn list_payments(
&mut self,
request: impl tonic::IntoRequest<super::ListPaymentsRequest>,
) -> Result<tonic::Response<super::ListPaymentsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ListPayments");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "DeleteAllPayments deletes all outgoing payments from DB."]
pub async fn delete_all_payments(
&mut self,
request: impl tonic::IntoRequest<super::DeleteAllPaymentsRequest>,
) -> Result<tonic::Response<super::DeleteAllPaymentsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/DeleteAllPayments");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `describegraph`"]
#[doc = "DescribeGraph returns a description of the latest graph state from the"]
#[doc = "point of view of the node. The graph information is partitioned into two"]
#[doc = "components: all the nodes/vertexes, and all the edges that connect the"]
#[doc = "vertexes themselves. As this is a directed graph, the edges also contain"]
#[doc = "the node directional specific routing policy which includes: the time lock"]
#[doc = "delta, fee information, etc."]
pub async fn describe_graph(
&mut self,
request: impl tonic::IntoRequest<super::ChannelGraphRequest>,
) -> Result<tonic::Response<super::ChannelGraph>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/DescribeGraph");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `getnodemetrics`"]
#[doc = "GetNodeMetrics returns node metrics calculated from the graph. Currently"]
#[doc = "the only supported metric is betweenness centrality of individual nodes."]
pub async fn get_node_metrics(
&mut self,
request: impl tonic::IntoRequest<super::NodeMetricsRequest>,
) -> Result<tonic::Response<super::NodeMetricsResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetNodeMetrics");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `getchaninfo`"]
#[doc = "GetChanInfo returns the latest authenticated network announcement for the"]
#[doc = "given channel identified by its channel ID: an 8-byte integer which"]
#[doc = "uniquely identifies the location of transaction's funding output within the"]
#[doc = "blockchain."]
pub async fn get_chan_info(
&mut self,
request: impl tonic::IntoRequest<super::ChanInfoRequest>,
) -> Result<tonic::Response<super::ChannelEdge>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetChanInfo");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `getnodeinfo`"]
#[doc = "GetNodeInfo returns the latest advertised, aggregated, and authenticated"]
#[doc = "channel information for the specified node identified by its public key."]
pub async fn get_node_info(
&mut self,
request: impl tonic::IntoRequest<super::NodeInfoRequest>,
) -> Result<tonic::Response<super::NodeInfo>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetNodeInfo");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `queryroutes`"]
#[doc = "QueryRoutes attempts to query the daemon's Channel Router for a possible"]
#[doc = "route to a target destination capable of carrying a specific amount of"]
#[doc = "satoshis. The returned route contains the full details required to craft and"]
#[doc = "send an HTLC, also including the necessary information that should be"]
#[doc = "present within the Sphinx packet encapsulated within the HTLC."]
pub async fn query_routes(
&mut self,
request: impl tonic::IntoRequest<super::QueryRoutesRequest>,
) -> Result<tonic::Response<super::QueryRoutesResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/QueryRoutes");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `getnetworkinfo`"]
#[doc = "GetNetworkInfo returns some basic stats about the known channel graph from"]
#[doc = "the point of view of the node."]
pub async fn get_network_info(
&mut self,
request: impl tonic::IntoRequest<super::NetworkInfoRequest>,
) -> Result<tonic::Response<super::NetworkInfo>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/GetNetworkInfo");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `stop`"]
#[doc = "StopDaemon will send a shutdown request to the interrupt handler, triggering"]
#[doc = "a graceful shutdown of the daemon."]
pub async fn stop_daemon(
&mut self,
request: impl tonic::IntoRequest<super::StopRequest>,
) -> Result<tonic::Response<super::StopResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/StopDaemon");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribeChannelGraph launches a streaming RPC that allows the caller to"]
#[doc = "receive notifications upon any changes to the channel graph topology from"]
#[doc = "the point of view of the responding node. Events notified include: new"]
#[doc = "nodes coming online, nodes updating their authenticated attributes, new"]
#[doc = "channels being advertised, updates in the routing policy for a directional"]
#[doc = "channel edge, and when channels are closed on-chain."]
pub async fn subscribe_channel_graph(
&mut self,
request: impl tonic::IntoRequest<super::GraphTopologySubscription>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::GraphTopologyUpdate>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribeChannelGraph");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `debuglevel`"]
#[doc = "DebugLevel allows a caller to programmatically set the logging verbosity of"]
#[doc = "lnd. The logging can be targeted according to a coarse daemon-wide logging"]
#[doc = "level, or in a granular fashion to specify the logging for a target"]
#[doc = "sub-system."]
pub async fn debug_level(
&mut self,
request: impl tonic::IntoRequest<super::DebugLevelRequest>,
) -> Result<tonic::Response<super::DebugLevelResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/DebugLevel");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `feereport`"]
#[doc = "FeeReport allows the caller to obtain a report detailing the current fee"]
#[doc = "schedule enforced by the node globally for each channel."]
pub async fn fee_report(
&mut self,
request: impl tonic::IntoRequest<super::FeeReportRequest>,
) -> Result<tonic::Response<super::FeeReportResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/FeeReport");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `updatechanpolicy`"]
#[doc = "UpdateChannelPolicy allows the caller to update the fee schedule and"]
#[doc = "channel policies for all channels globally, or a particular channel."]
pub async fn update_channel_policy(
&mut self,
request: impl tonic::IntoRequest<super::PolicyUpdateRequest>,
) -> Result<tonic::Response<super::PolicyUpdateResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/UpdateChannelPolicy");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `fwdinghistory`"]
#[doc = "ForwardingHistory allows the caller to query the htlcswitch for a record of"]
#[doc = "all HTLCs forwarded within the target time range, and integer offset"]
#[doc = "within that time range. If no time-range is specified, then the first chunk"]
#[doc = "of the past 24 hrs of forwarding history are returned."]
#[doc = ""]
#[doc = "A list of forwarding events are returned. The size of each forwarding event"]
#[doc = "is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB."]
#[doc = "As a result each message can only contain 50k entries. Each response has"]
#[doc = "the index offset of the last entry. The index offset can be provided to the"]
#[doc = "request to allow the caller to skip a series of records."]
pub async fn forwarding_history(
&mut self,
request: impl tonic::IntoRequest<super::ForwardingHistoryRequest>,
) -> Result<tonic::Response<super::ForwardingHistoryResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ForwardingHistory");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `exportchanbackup`"]
#[doc = "ExportChannelBackup attempts to return an encrypted static channel backup"]
#[doc = "for the target channel identified by it channel point. The backup is"]
#[doc = "encrypted with a key generated from the aezeed seed of the user. The"]
#[doc = "returned backup can either be restored using the RestoreChannelBackup"]
#[doc = "method once lnd is running, or via the InitWallet and UnlockWallet methods"]
#[doc = "from the WalletUnlocker service."]
pub async fn export_channel_backup(
&mut self,
request: impl tonic::IntoRequest<super::ExportChannelBackupRequest>,
) -> Result<tonic::Response<super::ChannelBackup>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ExportChannelBackup");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "ExportAllChannelBackups returns static channel backups for all existing"]
#[doc = "channels known to lnd. A set of regular singular static channel backups for"]
#[doc = "each channel are returned. Additionally, a multi-channel backup is returned"]
#[doc = "as well, which contains a single encrypted blob containing the backups of"]
#[doc = "each channel."]
pub async fn export_all_channel_backups(
&mut self,
request: impl tonic::IntoRequest<super::ChanBackupExportRequest>,
) -> Result<tonic::Response<super::ChanBackupSnapshot>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/ExportAllChannelBackups");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "VerifyChanBackup allows a caller to verify the integrity of a channel backup"]
#[doc = "snapshot. This method will accept either a packed Single or a packed Multi."]
#[doc = "Specifying both will result in an error."]
pub async fn verify_chan_backup(
&mut self,
request: impl tonic::IntoRequest<super::ChanBackupSnapshot>,
) -> Result<tonic::Response<super::VerifyChanBackupResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/VerifyChanBackup");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "* lncli: `restorechanbackup`"]
#[doc = "RestoreChannelBackups accepts a set of singular channel backups, or a"]
#[doc = "single encrypted multi-chan backup and attempts to recover any funds"]
#[doc = "remaining within the channel. If we are able to unpack the backup, then the"]
#[doc = "new channel will be shown under listchannels, as well as pending channels."]
pub async fn restore_channel_backups(
&mut self,
request: impl tonic::IntoRequest<super::RestoreChanBackupRequest>,
) -> Result<tonic::Response<super::RestoreBackupResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/RestoreChannelBackups");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = "*"]
#[doc = "SubscribeChannelBackups allows a client to sub-subscribe to the most up to"]
#[doc = "date information concerning the state of all channel backups. Each time a"]
#[doc = "new channel is added, we return the new set of channels, along with a"]
#[doc = "multi-chan backup containing the backup info for all channels. Each time a"]
#[doc = "channel is closed, we send a new update, which contains new new chan back"]
#[doc = "ups, but the updated set of encrypted multi-chan backups with the closed"]
#[doc = "channel(s) removed."]
pub async fn subscribe_channel_backups(
&mut self,
request: impl tonic::IntoRequest<super::ChannelBackupSubscription>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::ChanBackupSnapshot>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/lnrpc.Lightning/SubscribeChannelBackups");
self.inner
.server_streaming(request.into_request(), path, codec)
.await
}
#[doc = "* lncli: `bakemacaroon`"]
#[doc = "BakeMacaroon allows the creation of a new macaroon with custom read and"]
#[doc = "write permissions. No first-party caveats are added since this can be done"]
#[doc = "offline."]
pub async fn bake_macaroon(
&mut self,
request: impl tonic::IntoRequest<super::BakeMacaroonRequest>,
) -> Result<tonic::Response<super::BakeMacaroonResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/lnrpc.Lightning/BakeMacaroon");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for LightningClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
impl<T> std::fmt::Debug for LightningClient<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "LightningClient {{ ... }}")
}
}
}