msggen: Add ListPeerChannels to generated interfaces

This commit is contained in:
Christian Decker 2023-05-02 12:13:36 +02:00 committed by Rusty Russell
parent 2a52e52015
commit 65f5134643
11 changed files with 719 additions and 6 deletions

View File

@ -103,6 +103,77 @@
"failed": 2,
"pending": 0
},
"ListpeerchannelsChannelsCloser": {
"local": 0,
"remote": 1
},
"ListpeerchannelsChannelsHtlcsDirection": {
"in": 0,
"out": 1
},
"ListpeerchannelsChannelsHtlcsState": {
"RCVD_ADD_ACK_COMMIT": 3,
"RCVD_ADD_REVOCATION": 2,
"RCVD_REMOVE_ACK_REVOCATION": 9,
"RCVD_REMOVE_COMMIT": 6,
"RCVD_REMOVE_HTLC": 5,
"SENT_ADD_ACK_REVOCATION": 4,
"SENT_ADD_COMMIT": 1,
"SENT_ADD_HTLC": 0,
"SENT_REMOVE_ACK_COMMIT": 8,
"SENT_REMOVE_REVOCATION": 7
},
"ListpeerchannelsChannelsOpener": {
"local": 0,
"remote": 1
},
"ListpeerchannelsChannelsState": {
"AWAITING_UNILATERAL": 6,
"CHANNELD_AWAITING_LOCKIN": 1,
"CHANNELD_NORMAL": 2,
"CHANNELD_SHUTTING_DOWN": 3,
"CLOSINGD_COMPLETE": 5,
"CLOSINGD_SIGEXCHANGE": 4,
"DUALOPEND_AWAITING_LOCKIN": 10,
"DUALOPEND_OPEN_INIT": 9,
"FUNDING_SPEND_SEEN": 7,
"ONCHAIN": 8,
"OPENINGD": 0
},
"ListpeerchannelsChannelsState_changesCause": {
"local": 1,
"onchain": 5,
"protocol": 4,
"remote": 3,
"unknown": 0,
"user": 2
},
"ListpeerchannelsChannelsState_changesNew_state": {
"AWAITING_UNILATERAL": 6,
"CHANNELD_AWAITING_LOCKIN": 1,
"CHANNELD_NORMAL": 2,
"CHANNELD_SHUTTING_DOWN": 3,
"CLOSINGD_COMPLETE": 5,
"CLOSINGD_SIGEXCHANGE": 4,
"DUALOPEND_AWAITING_LOCKIN": 10,
"DUALOPEND_OPEN_INIT": 9,
"FUNDING_SPEND_SEEN": 7,
"ONCHAIN": 8,
"OPENINGD": 0
},
"ListpeerchannelsChannelsState_changesOld_state": {
"AWAITING_UNILATERAL": 6,
"CHANNELD_AWAITING_LOCKIN": 1,
"CHANNELD_NORMAL": 2,
"CHANNELD_SHUTTING_DOWN": 3,
"CLOSINGD_COMPLETE": 5,
"CLOSINGD_SIGEXCHANGE": 4,
"DUALOPEND_AWAITING_LOCKIN": 10,
"DUALOPEND_OPEN_INIT": 9,
"FUNDING_SPEND_SEEN": 7,
"ONCHAIN": 8,
"OPENINGD": 0
},
"ListpeersPeersChannelsHtlcsDirection": {
"in": 0,
"out": 1
@ -710,6 +781,111 @@
"ListpaysResponse": {
"ListPays.pays[]": 1
},
"ListpeerchannelsChannels": {
"ListPeerChannels.channels[].alias": 41,
"ListPeerChannels.channels[].channel_id": 9,
"ListPeerChannels.channels[].channel_type": 5,
"ListPeerChannels.channels[].close_to": 17,
"ListPeerChannels.channels[].close_to_addr": 53,
"ListPeerChannels.channels[].closer": 20,
"ListPeerChannels.channels[].dust_limit_msat": 29,
"ListPeerChannels.channels[].features[]": 21,
"ListPeerChannels.channels[].fee_base_msat": 27,
"ListPeerChannels.channels[].fee_proportional_millionths": 28,
"ListPeerChannels.channels[].feerate": 6,
"ListPeerChannels.channels[].funding": 22,
"ListPeerChannels.channels[].funding_outnum": 11,
"ListPeerChannels.channels[].funding_txid": 10,
"ListPeerChannels.channels[].htlcs[]": 52,
"ListPeerChannels.channels[].in_fulfilled_msat": 47,
"ListPeerChannels.channels[].in_offered_msat": 45,
"ListPeerChannels.channels[].in_payments_fulfilled": 46,
"ListPeerChannels.channels[].in_payments_offered": 44,
"ListPeerChannels.channels[].inflight[]": 16,
"ListPeerChannels.channels[].initial_feerate": 12,
"ListPeerChannels.channels[].last_feerate": 13,
"ListPeerChannels.channels[].max_accepted_htlcs": 40,
"ListPeerChannels.channels[].max_to_us_msat": 25,
"ListPeerChannels.channels[].max_total_htlc_in_msat": 30,
"ListPeerChannels.channels[].maximum_htlc_out_msat": 37,
"ListPeerChannels.channels[].min_to_us_msat": 24,
"ListPeerChannels.channels[].minimum_htlc_in_msat": 35,
"ListPeerChannels.channels[].minimum_htlc_out_msat": 36,
"ListPeerChannels.channels[].next_fee_step": 15,
"ListPeerChannels.channels[].next_feerate": 14,
"ListPeerChannels.channels[].opener": 19,
"ListPeerChannels.channels[].our_reserve_msat": 32,
"ListPeerChannels.channels[].our_to_self_delay": 39,
"ListPeerChannels.channels[].out_fulfilled_msat": 51,
"ListPeerChannels.channels[].out_offered_msat": 49,
"ListPeerChannels.channels[].out_payments_fulfilled": 50,
"ListPeerChannels.channels[].out_payments_offered": 48,
"ListPeerChannels.channels[].owner": 7,
"ListPeerChannels.channels[].peer_connected": 2,
"ListPeerChannels.channels[].peer_id": 1,
"ListPeerChannels.channels[].private": 18,
"ListPeerChannels.channels[].receivable_msat": 34,
"ListPeerChannels.channels[].scratch_txid": 4,
"ListPeerChannels.channels[].short_channel_id": 8,
"ListPeerChannels.channels[].spendable_msat": 33,
"ListPeerChannels.channels[].state": 3,
"ListPeerChannels.channels[].state_changes[]": 42,
"ListPeerChannels.channels[].status[]": 43,
"ListPeerChannels.channels[].their_reserve_msat": 31,
"ListPeerChannels.channels[].their_to_self_delay": 38,
"ListPeerChannels.channels[].to_us_msat": 23,
"ListPeerChannels.channels[].total_msat": 26
},
"ListpeerchannelsChannelsAlias": {
"ListPeerChannels.channels[].alias.local": 1,
"ListPeerChannels.channels[].alias.remote": 2
},
"ListpeerchannelsChannelsChannel_type": {
"ListPeerChannels.channels[].channel_type.bits[]": 1,
"ListPeerChannels.channels[].channel_type.names[]": 2
},
"ListpeerchannelsChannelsFeerate": {
"ListPeerChannels.channels[].feerate.perkb": 2,
"ListPeerChannels.channels[].feerate.perkw": 1
},
"ListpeerchannelsChannelsFunding": {
"ListPeerChannels.channels[].funding.fee_paid_msat": 4,
"ListPeerChannels.channels[].funding.fee_rcvd_msat": 5,
"ListPeerChannels.channels[].funding.local_funds_msat": 2,
"ListPeerChannels.channels[].funding.pushed_msat": 1,
"ListPeerChannels.channels[].funding.remote_funds_msat": 3
},
"ListpeerchannelsChannelsHtlcs": {
"ListPeerChannels.channels[].htlcs[].amount_msat": 3,
"ListPeerChannels.channels[].htlcs[].direction": 1,
"ListPeerChannels.channels[].htlcs[].expiry": 4,
"ListPeerChannels.channels[].htlcs[].id": 2,
"ListPeerChannels.channels[].htlcs[].local_trimmed": 6,
"ListPeerChannels.channels[].htlcs[].payment_hash": 5,
"ListPeerChannels.channels[].htlcs[].state": 8,
"ListPeerChannels.channels[].htlcs[].status": 7
},
"ListpeerchannelsChannelsInflight": {
"ListPeerChannels.channels[].inflight[].feerate": 3,
"ListPeerChannels.channels[].inflight[].funding_outnum": 2,
"ListPeerChannels.channels[].inflight[].funding_txid": 1,
"ListPeerChannels.channels[].inflight[].our_funding_msat": 5,
"ListPeerChannels.channels[].inflight[].scratch_txid": 6,
"ListPeerChannels.channels[].inflight[].total_funding_msat": 4
},
"ListpeerchannelsChannelsState_changes": {
"ListPeerChannels.channels[].state_changes[].cause": 4,
"ListPeerChannels.channels[].state_changes[].message": 5,
"ListPeerChannels.channels[].state_changes[].new_state": 3,
"ListPeerChannels.channels[].state_changes[].old_state": 2,
"ListPeerChannels.channels[].state_changes[].timestamp": 1
},
"ListpeerchannelsRequest": {
"ListPeerChannels.id": 1
},
"ListpeerchannelsResponse": {
"ListPeerChannels.channels[]": 1
},
"ListpeersPeers": {
"ListPeers.peers[].channels[]": 4,
"ListPeers.peers[].connected": 2,
@ -2598,6 +2774,350 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPeerChannels": {
"added": "v23.02",
"deprecated": null
},
"ListPeerChannels.channels[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].alias": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].alias.local": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].alias.remote": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].channel_id": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].channel_type": {
"added": "v23.05",
"deprecated": false
},
"ListPeerChannels.channels[].channel_type.bits[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].channel_type.names[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].close_to": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].close_to_addr": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].closer": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].dust_limit_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].features[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].fee_base_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].fee_proportional_millionths": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].feerate": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].feerate.perkb": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].feerate.perkw": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding.fee_paid_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding.fee_rcvd_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding.local_funds_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding.pushed_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding.remote_funds_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding_outnum": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].funding_txid": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].amount_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].direction": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].expiry": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].id": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].local_trimmed": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].payment_hash": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].state": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].htlcs[].status": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].in_fulfilled_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].in_offered_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].in_payments_fulfilled": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].in_payments_offered": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].feerate": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].funding_outnum": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].funding_txid": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].our_funding_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].scratch_txid": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].inflight[].total_funding_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].initial_feerate": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].last_feerate": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].max_accepted_htlcs": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].max_to_us_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].max_total_htlc_in_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].maximum_htlc_out_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].min_to_us_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].minimum_htlc_in_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].minimum_htlc_out_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].next_fee_step": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].next_feerate": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].opener": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].our_reserve_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].our_to_self_delay": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].out_fulfilled_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].out_offered_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].out_payments_fulfilled": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].out_payments_offered": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].owner": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].peer_connected": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].peer_id": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].private": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].receivable_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].scratch_txid": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].short_channel_id": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].spendable_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[].cause": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[].message": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[].new_state": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[].old_state": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].state_changes[].timestamp": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].status[]": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].their_reserve_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].their_to_self_delay": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].to_us_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].total_msat": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.id": {
"added": "v23.02",
"deprecated": false
},
"ListPeers": {
"added": "pre-v0.10.1",
"deprecated": null

Binary file not shown.

BIN
cln-grpc/src/convert.rs generated

Binary file not shown.

View File

@ -1210,6 +1210,38 @@ async fn tx_send(
}
async fn list_peer_channels(
&self,
request: tonic::Request<pb::ListpeerchannelsRequest>,
) -> Result<tonic::Response<pb::ListpeerchannelsResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::ListpeerchannelsRequest = req.into();
debug!("Client asked for list_peer_channels");
trace!("list_peer_channels request: {:?}", req);
let mut rpc = ClnRpc::new(&self.rpc_path)
.await
.map_err(|e| Status::new(Code::Internal, e.to_string()))?;
let result = rpc.call(Request::ListPeerChannels(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method ListPeerChannels: {:?}", e)))?;
match result {
Response::ListPeerChannels(r) => {
trace!("list_peer_channels response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call ListPeerChannels",
r
)
)),
}
}
async fn disconnect(
&self,
request: tonic::Request<pb::DisconnectRequest>,

BIN
cln-rpc/src/model.rs generated

Binary file not shown.

View File

@ -42,6 +42,12 @@ overrides = {
'ListPeers.peers[].channels[].opener': "ChannelSide",
'ListPeers.peers[].channels[].closer': "ChannelSide",
'ListPeers.peers[].channels[].features[]': "string",
'ListPeerChannels.channels[].state_changes[]': None,
'ListPeerChannels.channels[].htlcs[].state': None,
'ListPeerChannels.channels[].opener': "ChannelSide",
'ListPeerChannels.channels[].closer': "ChannelSide",
'ListPeerChannels.channels[].features[]': None,
'ListPeerChannels.channels[].channel_type': None,
'ListFunds.channels[].state': 'ChannelState',
'ListTransactions.transactions[].type[]': None,
}

View File

@ -69,12 +69,10 @@ class Grpc2PyGenerator(IGenerator):
def hexlify(b):
return b if b is None else b.hex()
def amount2msat(a):
return a.msat
def amount_or_all2msat(a):
breakpoint()
def remove_default(d):
# grpc is really not good at empty values, they get replaced with the type's default value...

View File

@ -64,6 +64,7 @@ def load_jsonrpc_service(schema_dir: str):
"TxDiscard",
"TxPrepare",
"TxSend",
"ListPeerChannels",
# "decodepay",
# "decode",
# "delpay",

View File

@ -8,12 +8,10 @@ import json
def hexlify(b):
return b if b is None else b.hex()
def amount2msat(a):
return a.msat
def amount_or_all2msat(a):
breakpoint()
def remove_default(d):
# grpc is really not good at empty values, they get replaced with the type's default value...
@ -724,6 +722,131 @@ def txsend2py(m):
})
def listpeerchannels_channels_channel_type2py(m):
return remove_default({
"bits": [m.bits for i in m.bits], # ArrayField[primitive] in generate_composite
"names": [str(i) for i in m.names], # ArrayField[composite] in generate_composite
})
def listpeerchannels_channels_feerate2py(m):
return remove_default({
"perkw": m.perkw, # PrimitiveField in generate_composite
"perkb": m.perkb, # PrimitiveField in generate_composite
})
def listpeerchannels_channels_inflight2py(m):
return remove_default({
"funding_txid": hexlify(m.funding_txid), # PrimitiveField in generate_composite
"funding_outnum": m.funding_outnum, # PrimitiveField in generate_composite
"feerate": m.feerate, # PrimitiveField in generate_composite
"total_funding_msat": amount2msat(m.total_funding_msat), # PrimitiveField in generate_composite
"our_funding_msat": amount2msat(m.our_funding_msat), # PrimitiveField in generate_composite
"scratch_txid": hexlify(m.scratch_txid), # PrimitiveField in generate_composite
})
def listpeerchannels_channels_funding2py(m):
return remove_default({
"pushed_msat": amount2msat(m.pushed_msat), # PrimitiveField in generate_composite
"local_funds_msat": amount2msat(m.local_funds_msat), # PrimitiveField in generate_composite
"remote_funds_msat": amount2msat(m.remote_funds_msat), # PrimitiveField in generate_composite
"fee_paid_msat": amount2msat(m.fee_paid_msat), # PrimitiveField in generate_composite
"fee_rcvd_msat": amount2msat(m.fee_rcvd_msat), # PrimitiveField in generate_composite
})
def listpeerchannels_channels_alias2py(m):
return remove_default({
"local": m.local, # PrimitiveField in generate_composite
"remote": m.remote, # PrimitiveField in generate_composite
})
def listpeerchannels_channels_state_changes2py(m):
return remove_default({
"timestamp": m.timestamp, # PrimitiveField in generate_composite
"old_state": str(m.old_state), # EnumField in generate_composite
"new_state": str(m.new_state), # EnumField in generate_composite
"cause": str(m.cause), # EnumField in generate_composite
"message": m.message, # PrimitiveField in generate_composite
})
def listpeerchannels_channels_htlcs2py(m):
return remove_default({
"direction": str(m.direction), # EnumField in generate_composite
"id": m.id, # PrimitiveField in generate_composite
"amount_msat": amount2msat(m.amount_msat), # PrimitiveField in generate_composite
"expiry": m.expiry, # PrimitiveField in generate_composite
"payment_hash": hexlify(m.payment_hash), # PrimitiveField in generate_composite
"local_trimmed": m.local_trimmed, # PrimitiveField in generate_composite
"status": m.status, # PrimitiveField in generate_composite
"state": str(m.state), # EnumField in generate_composite
})
def listpeerchannels_channels2py(m):
return remove_default({
"peer_id": hexlify(m.peer_id), # PrimitiveField in generate_composite
"peer_connected": m.peer_connected, # PrimitiveField in generate_composite
"state": str(m.state), # EnumField in generate_composite
"scratch_txid": hexlify(m.scratch_txid), # PrimitiveField in generate_composite
"owner": m.owner, # PrimitiveField in generate_composite
"short_channel_id": m.short_channel_id, # PrimitiveField in generate_composite
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
"funding_txid": hexlify(m.funding_txid), # PrimitiveField in generate_composite
"funding_outnum": m.funding_outnum, # PrimitiveField in generate_composite
"initial_feerate": m.initial_feerate, # PrimitiveField in generate_composite
"last_feerate": m.last_feerate, # PrimitiveField in generate_composite
"next_feerate": m.next_feerate, # PrimitiveField in generate_composite
"next_fee_step": m.next_fee_step, # PrimitiveField in generate_composite
"inflight": [listpeerchannels_channels_inflight2py(i) for i in m.inflight], # ArrayField[composite] in generate_composite
"close_to": hexlify(m.close_to), # PrimitiveField in generate_composite
"private": m.private, # PrimitiveField in generate_composite
"opener": str(m.opener), # EnumField in generate_composite
"closer": str(m.closer), # EnumField in generate_composite
"features": [str(i) for i in m.features], # ArrayField[composite] in generate_composite
"to_us_msat": amount2msat(m.to_us_msat), # PrimitiveField in generate_composite
"min_to_us_msat": amount2msat(m.min_to_us_msat), # PrimitiveField in generate_composite
"max_to_us_msat": amount2msat(m.max_to_us_msat), # PrimitiveField in generate_composite
"total_msat": amount2msat(m.total_msat), # PrimitiveField in generate_composite
"fee_base_msat": amount2msat(m.fee_base_msat), # PrimitiveField in generate_composite
"fee_proportional_millionths": m.fee_proportional_millionths, # PrimitiveField in generate_composite
"dust_limit_msat": amount2msat(m.dust_limit_msat), # PrimitiveField in generate_composite
"max_total_htlc_in_msat": amount2msat(m.max_total_htlc_in_msat), # PrimitiveField in generate_composite
"their_reserve_msat": amount2msat(m.their_reserve_msat), # PrimitiveField in generate_composite
"our_reserve_msat": amount2msat(m.our_reserve_msat), # PrimitiveField in generate_composite
"spendable_msat": amount2msat(m.spendable_msat), # PrimitiveField in generate_composite
"receivable_msat": amount2msat(m.receivable_msat), # PrimitiveField in generate_composite
"minimum_htlc_in_msat": amount2msat(m.minimum_htlc_in_msat), # PrimitiveField in generate_composite
"minimum_htlc_out_msat": amount2msat(m.minimum_htlc_out_msat), # PrimitiveField in generate_composite
"maximum_htlc_out_msat": amount2msat(m.maximum_htlc_out_msat), # PrimitiveField in generate_composite
"their_to_self_delay": m.their_to_self_delay, # PrimitiveField in generate_composite
"our_to_self_delay": m.our_to_self_delay, # PrimitiveField in generate_composite
"max_accepted_htlcs": m.max_accepted_htlcs, # PrimitiveField in generate_composite
"state_changes": [listpeerchannels_channels_state_changes2py(i) for i in m.state_changes], # ArrayField[composite] in generate_composite
"status": [m.status for i in m.status], # ArrayField[primitive] in generate_composite
"in_payments_offered": m.in_payments_offered, # PrimitiveField in generate_composite
"in_offered_msat": amount2msat(m.in_offered_msat), # PrimitiveField in generate_composite
"in_payments_fulfilled": m.in_payments_fulfilled, # PrimitiveField in generate_composite
"in_fulfilled_msat": amount2msat(m.in_fulfilled_msat), # PrimitiveField in generate_composite
"out_payments_offered": m.out_payments_offered, # PrimitiveField in generate_composite
"out_offered_msat": amount2msat(m.out_offered_msat), # PrimitiveField in generate_composite
"out_payments_fulfilled": m.out_payments_fulfilled, # PrimitiveField in generate_composite
"out_fulfilled_msat": amount2msat(m.out_fulfilled_msat), # PrimitiveField in generate_composite
"htlcs": [listpeerchannels_channels_htlcs2py(i) for i in m.htlcs], # ArrayField[composite] in generate_composite
"close_to_addr": m.close_to_addr, # PrimitiveField in generate_composite
})
def listpeerchannels2py(m):
return remove_default({
"channels": [listpeerchannels_channels2py(i) for i in m.channels], # ArrayField[composite] in generate_composite
})
def disconnect2py(m):
return remove_default({
})

Binary file not shown.

View File

@ -199,6 +199,11 @@ class NodeStub(object):
request_serializer=node__pb2.TxsendRequest.SerializeToString,
response_deserializer=node__pb2.TxsendResponse.FromString,
)
self.ListPeerChannels = channel.unary_unary(
'/cln.Node/ListPeerChannels',
request_serializer=node__pb2.ListpeerchannelsRequest.SerializeToString,
response_deserializer=node__pb2.ListpeerchannelsResponse.FromString,
)
self.Disconnect = channel.unary_unary(
'/cln.Node/Disconnect',
request_serializer=node__pb2.DisconnectRequest.SerializeToString,
@ -486,6 +491,12 @@ class NodeServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListPeerChannels(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def Disconnect(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@ -746,6 +757,11 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.TxsendRequest.FromString,
response_serializer=node__pb2.TxsendResponse.SerializeToString,
),
'ListPeerChannels': grpc.unary_unary_rpc_method_handler(
servicer.ListPeerChannels,
request_deserializer=node__pb2.ListpeerchannelsRequest.FromString,
response_serializer=node__pb2.ListpeerchannelsResponse.SerializeToString,
),
'Disconnect': grpc.unary_unary_rpc_method_handler(
servicer.Disconnect,
request_deserializer=node__pb2.DisconnectRequest.FromString,
@ -1445,6 +1461,23 @@ class Node(object):
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListPeerChannels(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/cln.Node/ListPeerChannels',
node__pb2.ListpeerchannelsRequest.SerializeToString,
node__pb2.ListpeerchannelsResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Disconnect(request,
target,