Skip to content

Commit 1dfc105

Browse files
committed
Add proto for ListChannels
1 parent 64e06fa commit 1dfc105

File tree

1 file changed

+147
-0
lines changed

1 file changed

+147
-0
lines changed

protos/src/proto/ldk_node_server.proto

+147
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,150 @@ message CloseChannelRequest {
238238
message CloseChannelResponse {
239239

240240
}
241+
242+
// Returns a list of known channels.
243+
// See more: https://docs.rs/ldk-node/latest/ldk_node/struct.Node.html#method.list_channels
244+
message ListChannelsRequest {}
245+
246+
message ListChannelsResponse {
247+
248+
// List of channels.
249+
repeated Channel channels = 1;
250+
}
251+
252+
message Channel {
253+
// The channel ID (prior to funding transaction generation, this is a random 32-byte
254+
// identifier, afterwards this is the transaction ID of the funding transaction XOR the
255+
// funding transaction output).
256+
//
257+
// Note that this means this value is *not* persistent - it can change once during the
258+
// lifetime of the channel.
259+
string channel_id = 1;
260+
261+
// The node ID of our the channel's remote counterparty.
262+
string counterparty_node_id = 2;
263+
264+
// The channel's funding transaction output, if we've negotiated the funding transaction with
265+
// our counterparty already.
266+
optional OutPoint funding_txo = 3;
267+
268+
// The local `user_channel_id` of this channel.
269+
bytes user_channel_id = 4;
270+
271+
// The value, in satoshis, that must always be held as a reserve in the channel for us. This
272+
// value ensures that if we broadcast a revoked state, our counterparty can punish us by
273+
// claiming at least this value on chain.
274+
//
275+
// This value is not included in [`outbound_capacity_msat`] as it can never be spent.
276+
//
277+
// This value will be `None` for outbound channels until the counterparty accepts the channel.
278+
optional uint64 unspendable_punishment_reserve = 5;
279+
280+
// The value, in satoshis, of this channel as it appears in the funding output.
281+
uint64 channel_value_sats = 6;
282+
283+
// The currently negotiated fee rate denominated in satoshi per 1000 weight units,
284+
// which is applied to commitment and HTLC transactions.
285+
uint32 feerate_sat_per_1000_weight = 7;
286+
287+
// The available outbound capacity for sending HTLCs to the remote peer.
288+
//
289+
// The amount does not include any pending HTLCs which are not yet resolved (and, thus, whose
290+
// balance is not available for inclusion in new outbound HTLCs). This further does not include
291+
// any pending outgoing HTLCs which are awaiting some other resolution to be sent.
292+
uint64 outbound_capacity_msat = 8;
293+
294+
// The available outbound capacity for sending HTLCs to the remote peer.
295+
//
296+
// The amount does not include any pending HTLCs which are not yet resolved
297+
// (and, thus, whose balance is not available for inclusion in new inbound HTLCs). This further
298+
// does not include any pending outgoing HTLCs which are awaiting some other resolution to be
299+
// sent.
300+
uint64 inbound_capacity_msat = 9;
301+
302+
// The number of required confirmations on the funding transactions before the funding is
303+
// considered "locked". The amount is selected by the channel fundee.
304+
//
305+
// The value will be `None` for outbound channels until the counterparty accepts the channel.
306+
optional uint32 confirmations_required = 10;
307+
308+
// The current number of confirmations on the funding transaction.
309+
optional uint32 confirmations = 11;
310+
311+
// Is `true` if the channel was initiated (and therefore funded) by us.
312+
bool is_outbound = 12;
313+
314+
// Is `true` if both parties have exchanged `channel_ready` messages, and the channel is
315+
// not currently being shut down. Both parties exchange `channel_ready` messages upon
316+
// independently verifying that the required confirmations count provided by
317+
// `confirmations_required` has been reached.
318+
bool is_channel_ready = 13;
319+
320+
// Is `true` if the channel (a) `channel_ready` messages have been exchanged, (b) the
321+
// peer is connected, and (c) the channel is not currently negotiating shutdown.
322+
//
323+
// This is a strict superset of `is_channel_ready`.
324+
bool is_usable = 14;
325+
326+
// Is `true` if this channel is (or will be) publicly-announced
327+
bool is_public = 15;
328+
329+
// Set of configurable parameters set by self that affect channel operation.
330+
ChannelConfig channel_config = 16;
331+
332+
// The available outbound capacity for sending a single HTLC to the remote peer. This is
333+
// similar to `outbound_capacity_msat` but it may be further restricted by
334+
// the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
335+
// to use a limit as close as possible to the HTLC limit we can currently send.
336+
uint64 next_outbound_htlc_limit_msat = 17;
337+
338+
// The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
339+
// `next_outbound_htlc_limit_msat` but represents a lower-bound, rather than
340+
// an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
341+
// route which is valid.
342+
uint64 next_outbound_htlc_minimum_msat = 18;
343+
344+
// The number of blocks (after our commitment transaction confirms) that we will need to wait
345+
// until we can claim our funds after we force-close the channel. During this time our
346+
// counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
347+
// force-closes the channel and broadcasts a commitment transaction we do not have to wait any
348+
// time to claim our non-HTLC-encumbered funds.
349+
//
350+
// This value will be `None` for outbound channels until the counterparty accepts the channel.
351+
optional uint32 force_close_spend_delay = 19;
352+
353+
// The smallest value HTLC (in msat) the remote peer will accept, for this channel.
354+
//
355+
// This field is only `None` before we have received either the `OpenChannel` or
356+
// `AcceptChannel` message from the remote peer.
357+
optional uint64 counterparty_outbound_htlc_minimum_msat = 20;
358+
359+
// The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
360+
optional uint64 counterparty_outbound_htlc_maximum_msat = 21;
361+
362+
// The value, in satoshis, that must always be held in the channel for our counterparty. This
363+
// value ensures that if our counterparty broadcasts a revoked state, we can punish them by
364+
// claiming at least this value on chain.
365+
//
366+
// This value is not included in `inbound_capacity_msat` as it can never be spent.
367+
optional uint64 counterparty_unspendable_punishment_reserve = 22;
368+
369+
// Base routing fee in millisatoshis.
370+
optional uint32 counterparty_forwarding_info_fee_base_msat = 23;
371+
372+
// Proportional fee, in millionths of a satoshi the channel will charge per transferred satoshi.
373+
optional uint32 counterparty_forwarding_info_fee_proportional_millionths = 24;
374+
375+
// The minimum difference in CLTV expiry between an ingoing HTLC and its outgoing counterpart,
376+
// such that the outgoing HTLC is forwardable to this counterparty.
377+
optional uint32 counterparty_forwarding_info_cltv_expiry_delta = 25;
378+
}
379+
380+
// Represent a transaction outpoint.
381+
message OutPoint {
382+
// The referenced transaction's txid.
383+
string txid = 1;
384+
385+
// The index of the referenced output in its transaction's vout.
386+
uint32 vout = 2;
387+
}

0 commit comments

Comments
 (0)