mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
msggen: add low level openchannel methods
Changelog-None
This commit is contained in:
parent
70faab55e4
commit
fe180e189c
13 changed files with 1361 additions and 76 deletions
276
.msggen.json
276
.msggen.json
|
@ -1645,6 +1645,82 @@
|
|||
"Offer.single_use": 3,
|
||||
"Offer.used": 5
|
||||
},
|
||||
"Openchannel_abortRequest": {
|
||||
"OpenChannel_Abort.channel_id": 1
|
||||
},
|
||||
"Openchannel_abortResponse": {
|
||||
"OpenChannel_Abort.channel_canceled": 2,
|
||||
"OpenChannel_Abort.channel_id": 1,
|
||||
"OpenChannel_Abort.reason": 3
|
||||
},
|
||||
"Openchannel_bumpChannel_type": {
|
||||
"OpenChannel_Bump.channel_type.bits[]": 1,
|
||||
"OpenChannel_Bump.channel_type.names[]": 2
|
||||
},
|
||||
"Openchannel_bumpRequest": {
|
||||
"OpenChannel_Bump.amount": 4,
|
||||
"OpenChannel_Bump.channel_id": 1,
|
||||
"OpenChannel_Bump.funding_feerate": 3,
|
||||
"OpenChannel_Bump.initialpsbt": 2
|
||||
},
|
||||
"Openchannel_bumpResponse": {
|
||||
"OpenChannel_Bump.channel_id": 1,
|
||||
"OpenChannel_Bump.channel_type": 2,
|
||||
"OpenChannel_Bump.commitments_secured": 4,
|
||||
"OpenChannel_Bump.funding_serial": 5,
|
||||
"OpenChannel_Bump.psbt": 3,
|
||||
"OpenChannel_Bump.requires_confirmed_inputs": 6
|
||||
},
|
||||
"Openchannel_initChannel_type": {
|
||||
"OpenChannel_Init.channel_type.bits[]": 1,
|
||||
"OpenChannel_Init.channel_type.names[]": 2
|
||||
},
|
||||
"Openchannel_initRequest": {
|
||||
"OpenChannel_Init.amount": 10,
|
||||
"OpenChannel_Init.announce": 5,
|
||||
"OpenChannel_Init.channel_type[]": 9,
|
||||
"OpenChannel_Init.close_to": 6,
|
||||
"OpenChannel_Init.commitment_feerate": 3,
|
||||
"OpenChannel_Init.compact_lease": 8,
|
||||
"OpenChannel_Init.funding_feerate": 4,
|
||||
"OpenChannel_Init.id": 1,
|
||||
"OpenChannel_Init.initialpsbt": 2,
|
||||
"OpenChannel_Init.request_amt": 7
|
||||
},
|
||||
"Openchannel_initResponse": {
|
||||
"OpenChannel_Init.channel_id": 1,
|
||||
"OpenChannel_Init.channel_type": 3,
|
||||
"OpenChannel_Init.commitments_secured": 4,
|
||||
"OpenChannel_Init.funding_serial": 5,
|
||||
"OpenChannel_Init.psbt": 2,
|
||||
"OpenChannel_Init.requires_confirmed_inputs": 6
|
||||
},
|
||||
"Openchannel_signedRequest": {
|
||||
"OpenChannel_Signed.channel_id": 1,
|
||||
"OpenChannel_Signed.signed_psbt": 2
|
||||
},
|
||||
"Openchannel_signedResponse": {
|
||||
"OpenChannel_Signed.channel_id": 1,
|
||||
"OpenChannel_Signed.tx": 2,
|
||||
"OpenChannel_Signed.txid": 3
|
||||
},
|
||||
"Openchannel_updateChannel_type": {
|
||||
"OpenChannel_Update.channel_type.bits[]": 1,
|
||||
"OpenChannel_Update.channel_type.names[]": 2
|
||||
},
|
||||
"Openchannel_updateRequest": {
|
||||
"OpenChannel_Update.channel_id": 1,
|
||||
"OpenChannel_Update.psbt": 2
|
||||
},
|
||||
"Openchannel_updateResponse": {
|
||||
"OpenChannel_Update.channel_id": 1,
|
||||
"OpenChannel_Update.channel_type": 2,
|
||||
"OpenChannel_Update.close_to": 6,
|
||||
"OpenChannel_Update.commitments_secured": 4,
|
||||
"OpenChannel_Update.funding_outnum": 5,
|
||||
"OpenChannel_Update.psbt": 3,
|
||||
"OpenChannel_Update.requires_confirmed_inputs": 7
|
||||
},
|
||||
"PayRequest": {
|
||||
"Pay.amount_msat": 13,
|
||||
"Pay.bolt11": 1,
|
||||
|
@ -5888,6 +5964,206 @@
|
|||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Abort": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"OpenChannel_Abort.channel_canceled": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Abort.channel_id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Abort.reason": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"OpenChannel_Bump.amount": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.channel_id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.channel_type": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.channel_type.bits[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.channel_type.names[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.commitments_secured": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.funding_feerate": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.funding_serial": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.initialpsbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.psbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Bump.requires_confirmed_inputs": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"OpenChannel_Init.amount": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.announce": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.channel_id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.channel_type": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.channel_type.bits[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.channel_type.names[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.channel_type[]": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.close_to": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.commitment_feerate": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.commitments_secured": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.compact_lease": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.funding_feerate": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.funding_serial": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.initialpsbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.psbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.request_amt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Init.requires_confirmed_inputs": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Signed": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"OpenChannel_Signed.channel_id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Signed.signed_psbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Signed.tx": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Signed.txid": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
},
|
||||
"OpenChannel_Update.channel_id": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.channel_type": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.channel_type.bits[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.channel_type.names[]": {
|
||||
"added": "v24.02",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.close_to": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.commitments_secured": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.funding_outnum": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.psbt": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"OpenChannel_Update.requires_confirmed_inputs": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": false
|
||||
},
|
||||
"Pay": {
|
||||
"added": "pre-v0.10.1",
|
||||
"deprecated": null
|
||||
|
|
94
cln-grpc/proto/node.proto
generated
94
cln-grpc/proto/node.proto
generated
|
@ -60,6 +60,11 @@ service Node {
|
|||
rpc ListHtlcs(ListhtlcsRequest) returns (ListhtlcsResponse) {}
|
||||
rpc MultiFundChannel(MultifundchannelRequest) returns (MultifundchannelResponse) {}
|
||||
rpc Offer(OfferRequest) returns (OfferResponse) {}
|
||||
rpc OpenChannel_Abort(Openchannel_abortRequest) returns (Openchannel_abortResponse) {}
|
||||
rpc OpenChannel_Bump(Openchannel_bumpRequest) returns (Openchannel_bumpResponse) {}
|
||||
rpc OpenChannel_Init(Openchannel_initRequest) returns (Openchannel_initResponse) {}
|
||||
rpc OpenChannel_Signed(Openchannel_signedRequest) returns (Openchannel_signedResponse) {}
|
||||
rpc OpenChannel_Update(Openchannel_updateRequest) returns (Openchannel_updateResponse) {}
|
||||
rpc Ping(PingRequest) returns (PingResponse) {}
|
||||
rpc SendCustomMsg(SendcustommsgRequest) returns (SendcustommsgResponse) {}
|
||||
rpc SetChannel(SetchannelRequest) returns (SetchannelResponse) {}
|
||||
|
@ -1833,6 +1838,95 @@ message OfferResponse {
|
|||
optional string label = 7;
|
||||
}
|
||||
|
||||
message Openchannel_abortRequest {
|
||||
bytes channel_id = 1;
|
||||
}
|
||||
|
||||
message Openchannel_abortResponse {
|
||||
bytes channel_id = 1;
|
||||
bool channel_canceled = 2;
|
||||
string reason = 3;
|
||||
}
|
||||
|
||||
message Openchannel_bumpRequest {
|
||||
bytes channel_id = 1;
|
||||
string initialpsbt = 2;
|
||||
optional Feerate funding_feerate = 3;
|
||||
Amount amount = 4;
|
||||
}
|
||||
|
||||
message Openchannel_bumpResponse {
|
||||
bytes channel_id = 1;
|
||||
optional Openchannel_bumpChannel_type channel_type = 2;
|
||||
string psbt = 3;
|
||||
bool commitments_secured = 4;
|
||||
uint64 funding_serial = 5;
|
||||
optional bool requires_confirmed_inputs = 6;
|
||||
}
|
||||
|
||||
message Openchannel_bumpChannel_type {
|
||||
repeated uint32 bits = 1;
|
||||
repeated ChannelTypeName names = 2;
|
||||
}
|
||||
|
||||
message Openchannel_initRequest {
|
||||
bytes id = 1;
|
||||
string initialpsbt = 2;
|
||||
optional Feerate commitment_feerate = 3;
|
||||
optional Feerate funding_feerate = 4;
|
||||
optional bool announce = 5;
|
||||
optional string close_to = 6;
|
||||
optional Amount request_amt = 7;
|
||||
optional bytes compact_lease = 8;
|
||||
repeated uint32 channel_type = 9;
|
||||
Amount amount = 10;
|
||||
}
|
||||
|
||||
message Openchannel_initResponse {
|
||||
bytes channel_id = 1;
|
||||
string psbt = 2;
|
||||
optional Openchannel_initChannel_type channel_type = 3;
|
||||
bool commitments_secured = 4;
|
||||
uint64 funding_serial = 5;
|
||||
optional bool requires_confirmed_inputs = 6;
|
||||
}
|
||||
|
||||
message Openchannel_initChannel_type {
|
||||
repeated uint32 bits = 1;
|
||||
repeated ChannelTypeName names = 2;
|
||||
}
|
||||
|
||||
message Openchannel_signedRequest {
|
||||
bytes channel_id = 1;
|
||||
string signed_psbt = 2;
|
||||
}
|
||||
|
||||
message Openchannel_signedResponse {
|
||||
bytes channel_id = 1;
|
||||
bytes tx = 2;
|
||||
bytes txid = 3;
|
||||
}
|
||||
|
||||
message Openchannel_updateRequest {
|
||||
bytes channel_id = 1;
|
||||
string psbt = 2;
|
||||
}
|
||||
|
||||
message Openchannel_updateResponse {
|
||||
bytes channel_id = 1;
|
||||
optional Openchannel_updateChannel_type channel_type = 2;
|
||||
string psbt = 3;
|
||||
bool commitments_secured = 4;
|
||||
uint32 funding_outnum = 5;
|
||||
optional bytes close_to = 6;
|
||||
optional bool requires_confirmed_inputs = 7;
|
||||
}
|
||||
|
||||
message Openchannel_updateChannel_type {
|
||||
repeated uint32 bits = 1;
|
||||
repeated ChannelTypeName names = 2;
|
||||
}
|
||||
|
||||
message PingRequest {
|
||||
bytes id = 1;
|
||||
optional uint32 len = 2;
|
||||
|
|
220
cln-grpc/src/convert.rs
generated
220
cln-grpc/src/convert.rs
generated
|
@ -1695,6 +1695,107 @@ impl From<responses::OfferResponse> for pb::OfferResponse {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_abortResponse> for pb::OpenchannelAbortResponse {
|
||||
fn from(c: responses::Openchannel_abortResponse) -> Self {
|
||||
Self {
|
||||
channel_canceled: c.channel_canceled, // Rule #2 for type boolean
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
reason: c.reason, // Rule #2 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_bumpChannel_type> for pb::OpenchannelBumpChannelType {
|
||||
fn from(c: responses::Openchannel_bumpChannel_type) -> Self {
|
||||
Self {
|
||||
// Field: OpenChannel_Bump.channel_type.bits[]
|
||||
bits: c.bits.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
// Field: OpenChannel_Bump.channel_type.names[]
|
||||
names: c.names.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_bumpResponse> for pb::OpenchannelBumpResponse {
|
||||
fn from(c: responses::Openchannel_bumpResponse) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
channel_type: c.channel_type.map(|v| v.into()),
|
||||
commitments_secured: c.commitments_secured, // Rule #2 for type boolean
|
||||
funding_serial: c.funding_serial, // Rule #2 for type u64
|
||||
psbt: c.psbt, // Rule #2 for type string
|
||||
requires_confirmed_inputs: c.requires_confirmed_inputs, // Rule #2 for type boolean?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_initChannel_type> for pb::OpenchannelInitChannelType {
|
||||
fn from(c: responses::Openchannel_initChannel_type) -> Self {
|
||||
Self {
|
||||
// Field: OpenChannel_Init.channel_type.bits[]
|
||||
bits: c.bits.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
// Field: OpenChannel_Init.channel_type.names[]
|
||||
names: c.names.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_initResponse> for pb::OpenchannelInitResponse {
|
||||
fn from(c: responses::Openchannel_initResponse) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
channel_type: c.channel_type.map(|v| v.into()),
|
||||
commitments_secured: c.commitments_secured, // Rule #2 for type boolean
|
||||
funding_serial: c.funding_serial, // Rule #2 for type u64
|
||||
psbt: c.psbt, // Rule #2 for type string
|
||||
requires_confirmed_inputs: c.requires_confirmed_inputs, // Rule #2 for type boolean?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_signedResponse> for pb::OpenchannelSignedResponse {
|
||||
fn from(c: responses::Openchannel_signedResponse) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
tx: hex::decode(&c.tx).unwrap(), // Rule #2 for type hex
|
||||
txid: hex::decode(&c.txid).unwrap(), // Rule #2 for type txid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_updateChannel_type> for pb::OpenchannelUpdateChannelType {
|
||||
fn from(c: responses::Openchannel_updateChannel_type) -> Self {
|
||||
Self {
|
||||
// Field: OpenChannel_Update.channel_type.bits[]
|
||||
bits: c.bits.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
// Field: OpenChannel_Update.channel_type.names[]
|
||||
names: c.names.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::Openchannel_updateResponse> for pb::OpenchannelUpdateResponse {
|
||||
fn from(c: responses::Openchannel_updateResponse) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
channel_type: c.channel_type.map(|v| v.into()),
|
||||
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
|
||||
commitments_secured: c.commitments_secured, // Rule #2 for type boolean
|
||||
funding_outnum: c.funding_outnum, // Rule #2 for type u32
|
||||
psbt: c.psbt, // Rule #2 for type string
|
||||
requires_confirmed_inputs: c.requires_confirmed_inputs, // Rule #2 for type boolean?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<responses::PingResponse> for pb::PingResponse {
|
||||
fn from(c: responses::PingResponse) -> Self {
|
||||
|
@ -2569,6 +2670,66 @@ impl From<requests::OfferRequest> for pb::OfferRequest {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::Openchannel_abortRequest> for pb::OpenchannelAbortRequest {
|
||||
fn from(c: requests::Openchannel_abortRequest) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::Openchannel_bumpRequest> for pb::OpenchannelBumpRequest {
|
||||
fn from(c: requests::Openchannel_bumpRequest) -> Self {
|
||||
Self {
|
||||
amount: Some(c.amount.into()), // Rule #2 for type msat
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
funding_feerate: c.funding_feerate.map(|o|o.into()), // Rule #2 for type feerate?
|
||||
initialpsbt: c.initialpsbt, // Rule #2 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::Openchannel_initRequest> for pb::OpenchannelInitRequest {
|
||||
fn from(c: requests::Openchannel_initRequest) -> Self {
|
||||
Self {
|
||||
amount: Some(c.amount.into()), // Rule #2 for type msat
|
||||
announce: c.announce, // Rule #2 for type boolean?
|
||||
// Field: OpenChannel_Init.channel_type[]
|
||||
channel_type: c.channel_type.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
|
||||
close_to: c.close_to, // Rule #2 for type string?
|
||||
commitment_feerate: c.commitment_feerate.map(|o|o.into()), // Rule #2 for type feerate?
|
||||
compact_lease: c.compact_lease.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
|
||||
funding_feerate: c.funding_feerate.map(|o|o.into()), // Rule #2 for type feerate?
|
||||
id: c.id.serialize().to_vec(), // Rule #2 for type pubkey
|
||||
initialpsbt: c.initialpsbt, // Rule #2 for type string
|
||||
request_amt: c.request_amt.map(|f| f.into()), // Rule #2 for type msat?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::Openchannel_signedRequest> for pb::OpenchannelSignedRequest {
|
||||
fn from(c: requests::Openchannel_signedRequest) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
signed_psbt: c.signed_psbt, // Rule #2 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::Openchannel_updateRequest> for pb::OpenchannelUpdateRequest {
|
||||
fn from(c: requests::Openchannel_updateRequest) -> Self {
|
||||
Self {
|
||||
channel_id: <Sha256 as AsRef<[u8]>>::as_ref(&c.channel_id).to_vec(), // Rule #2 for type hash
|
||||
psbt: c.psbt, // Rule #2 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<requests::PingRequest> for pb::PingRequest {
|
||||
fn from(c: requests::PingRequest) -> Self {
|
||||
|
@ -3375,6 +3536,65 @@ impl From<pb::OfferRequest> for requests::OfferRequest {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::OpenchannelAbortRequest> for requests::Openchannel_abortRequest {
|
||||
fn from(c: pb::OpenchannelAbortRequest) -> Self {
|
||||
Self {
|
||||
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), // Rule #1 for type hash
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::OpenchannelBumpRequest> for requests::Openchannel_bumpRequest {
|
||||
fn from(c: pb::OpenchannelBumpRequest) -> Self {
|
||||
Self {
|
||||
amount: c.amount.unwrap().into(), // Rule #1 for type msat
|
||||
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), // Rule #1 for type hash
|
||||
funding_feerate: c.funding_feerate.map(|a| a.into()), // Rule #1 for type feerate?
|
||||
initialpsbt: c.initialpsbt, // Rule #1 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::OpenchannelInitRequest> for requests::Openchannel_initRequest {
|
||||
fn from(c: pb::OpenchannelInitRequest) -> Self {
|
||||
Self {
|
||||
amount: c.amount.unwrap().into(), // Rule #1 for type msat
|
||||
announce: c.announce, // Rule #1 for type boolean?
|
||||
channel_type: Some(c.channel_type.into_iter().map(|s| s).collect()), // Rule #4
|
||||
close_to: c.close_to, // Rule #1 for type string?
|
||||
commitment_feerate: c.commitment_feerate.map(|a| a.into()), // Rule #1 for type feerate?
|
||||
compact_lease: c.compact_lease.map(|v| hex::encode(v)), // Rule #1 for type hex?
|
||||
funding_feerate: c.funding_feerate.map(|a| a.into()), // Rule #1 for type feerate?
|
||||
id: PublicKey::from_slice(&c.id).unwrap(), // Rule #1 for type pubkey
|
||||
initialpsbt: c.initialpsbt, // Rule #1 for type string
|
||||
request_amt: c.request_amt.map(|a| a.into()), // Rule #1 for type msat?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::OpenchannelSignedRequest> for requests::Openchannel_signedRequest {
|
||||
fn from(c: pb::OpenchannelSignedRequest) -> Self {
|
||||
Self {
|
||||
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), // Rule #1 for type hash
|
||||
signed_psbt: c.signed_psbt, // Rule #1 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::OpenchannelUpdateRequest> for requests::Openchannel_updateRequest {
|
||||
fn from(c: pb::OpenchannelUpdateRequest) -> Self {
|
||||
Self {
|
||||
channel_id: Sha256::from_slice(&c.channel_id).unwrap(), // Rule #1 for type hash
|
||||
psbt: c.psbt, // Rule #1 for type string
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
impl From<pb::PingRequest> for requests::PingRequest {
|
||||
fn from(c: pb::PingRequest) -> Self {
|
||||
|
|
|
@ -1690,6 +1690,166 @@ async fn offer(
|
|||
|
||||
}
|
||||
|
||||
async fn open_channel_abort(
|
||||
&self,
|
||||
request: tonic::Request<pb::OpenchannelAbortRequest>,
|
||||
) -> Result<tonic::Response<pb::OpenchannelAbortResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::Openchannel_abortRequest = req.into();
|
||||
debug!("Client asked for open_channel_abort");
|
||||
trace!("open_channel_abort 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::OpenChannel_Abort(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method OpenChannel_Abort: {:?}", e)))?;
|
||||
match result {
|
||||
Response::OpenChannel_Abort(r) => {
|
||||
trace!("open_channel_abort response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call OpenChannel_Abort",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn open_channel_bump(
|
||||
&self,
|
||||
request: tonic::Request<pb::OpenchannelBumpRequest>,
|
||||
) -> Result<tonic::Response<pb::OpenchannelBumpResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::Openchannel_bumpRequest = req.into();
|
||||
debug!("Client asked for open_channel_bump");
|
||||
trace!("open_channel_bump 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::OpenChannel_Bump(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method OpenChannel_Bump: {:?}", e)))?;
|
||||
match result {
|
||||
Response::OpenChannel_Bump(r) => {
|
||||
trace!("open_channel_bump response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call OpenChannel_Bump",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn open_channel_init(
|
||||
&self,
|
||||
request: tonic::Request<pb::OpenchannelInitRequest>,
|
||||
) -> Result<tonic::Response<pb::OpenchannelInitResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::Openchannel_initRequest = req.into();
|
||||
debug!("Client asked for open_channel_init");
|
||||
trace!("open_channel_init 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::OpenChannel_Init(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method OpenChannel_Init: {:?}", e)))?;
|
||||
match result {
|
||||
Response::OpenChannel_Init(r) => {
|
||||
trace!("open_channel_init response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call OpenChannel_Init",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn open_channel_signed(
|
||||
&self,
|
||||
request: tonic::Request<pb::OpenchannelSignedRequest>,
|
||||
) -> Result<tonic::Response<pb::OpenchannelSignedResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::Openchannel_signedRequest = req.into();
|
||||
debug!("Client asked for open_channel_signed");
|
||||
trace!("open_channel_signed 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::OpenChannel_Signed(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method OpenChannel_Signed: {:?}", e)))?;
|
||||
match result {
|
||||
Response::OpenChannel_Signed(r) => {
|
||||
trace!("open_channel_signed response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call OpenChannel_Signed",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn open_channel_update(
|
||||
&self,
|
||||
request: tonic::Request<pb::OpenchannelUpdateRequest>,
|
||||
) -> Result<tonic::Response<pb::OpenchannelUpdateResponse>, tonic::Status> {
|
||||
let req = request.into_inner();
|
||||
let req: requests::Openchannel_updateRequest = req.into();
|
||||
debug!("Client asked for open_channel_update");
|
||||
trace!("open_channel_update 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::OpenChannel_Update(req))
|
||||
.await
|
||||
.map_err(|e| Status::new(
|
||||
Code::Unknown,
|
||||
format!("Error calling method OpenChannel_Update: {:?}", e)))?;
|
||||
match result {
|
||||
Response::OpenChannel_Update(r) => {
|
||||
trace!("open_channel_update response: {:?}", r);
|
||||
Ok(tonic::Response::new(r.into()))
|
||||
},
|
||||
r => Err(Status::new(
|
||||
Code::Internal,
|
||||
format!(
|
||||
"Unexpected result {:?} to method call OpenChannel_Update",
|
||||
r
|
||||
)
|
||||
)),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async fn ping(
|
||||
&self,
|
||||
request: tonic::Request<pb::PingRequest>,
|
||||
|
|
273
cln-rpc/src/model.rs
generated
273
cln-rpc/src/model.rs
generated
|
@ -69,6 +69,11 @@ pub enum Request {
|
|||
ListHtlcs(requests::ListhtlcsRequest),
|
||||
MultiFundChannel(requests::MultifundchannelRequest),
|
||||
Offer(requests::OfferRequest),
|
||||
OpenChannel_Abort(requests::Openchannel_abortRequest),
|
||||
OpenChannel_Bump(requests::Openchannel_bumpRequest),
|
||||
OpenChannel_Init(requests::Openchannel_initRequest),
|
||||
OpenChannel_Signed(requests::Openchannel_signedRequest),
|
||||
OpenChannel_Update(requests::Openchannel_updateRequest),
|
||||
Ping(requests::PingRequest),
|
||||
SendCustomMsg(requests::SendcustommsgRequest),
|
||||
SetChannel(requests::SetchannelRequest),
|
||||
|
@ -139,6 +144,11 @@ pub enum Response {
|
|||
ListHtlcs(responses::ListhtlcsResponse),
|
||||
MultiFundChannel(responses::MultifundchannelResponse),
|
||||
Offer(responses::OfferResponse),
|
||||
OpenChannel_Abort(responses::Openchannel_abortResponse),
|
||||
OpenChannel_Bump(responses::Openchannel_bumpResponse),
|
||||
OpenChannel_Init(responses::Openchannel_initResponse),
|
||||
OpenChannel_Signed(responses::Openchannel_signedResponse),
|
||||
OpenChannel_Update(responses::Openchannel_updateResponse),
|
||||
Ping(responses::PingResponse),
|
||||
SendCustomMsg(responses::SendcustommsgResponse),
|
||||
SetChannel(responses::SetchannelResponse),
|
||||
|
@ -2053,6 +2063,138 @@ pub mod requests {
|
|||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_abortRequest {
|
||||
pub channel_id: Sha256,
|
||||
}
|
||||
|
||||
impl From<Openchannel_abortRequest> for Request {
|
||||
fn from(r: Openchannel_abortRequest) -> Self {
|
||||
Request::OpenChannel_Abort(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for Openchannel_abortRequest {
|
||||
type Response = super::responses::Openchannel_abortResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for Openchannel_abortRequest {
|
||||
type Response = super::responses::Openchannel_abortResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"openchannel_abort"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_bumpRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub funding_feerate: Option<Feerate>,
|
||||
pub amount: Amount,
|
||||
pub channel_id: Sha256,
|
||||
pub initialpsbt: String,
|
||||
}
|
||||
|
||||
impl From<Openchannel_bumpRequest> for Request {
|
||||
fn from(r: Openchannel_bumpRequest) -> Self {
|
||||
Request::OpenChannel_Bump(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for Openchannel_bumpRequest {
|
||||
type Response = super::responses::Openchannel_bumpResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for Openchannel_bumpRequest {
|
||||
type Response = super::responses::Openchannel_bumpResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"openchannel_bump"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_initRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub announce: Option<bool>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub close_to: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub commitment_feerate: Option<Feerate>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub compact_lease: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub funding_feerate: Option<Feerate>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub request_amt: Option<Amount>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub channel_type: Option<Vec<u32>>,
|
||||
pub amount: Amount,
|
||||
pub id: PublicKey,
|
||||
pub initialpsbt: String,
|
||||
}
|
||||
|
||||
impl From<Openchannel_initRequest> for Request {
|
||||
fn from(r: Openchannel_initRequest) -> Self {
|
||||
Request::OpenChannel_Init(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for Openchannel_initRequest {
|
||||
type Response = super::responses::Openchannel_initResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for Openchannel_initRequest {
|
||||
type Response = super::responses::Openchannel_initResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"openchannel_init"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_signedRequest {
|
||||
pub channel_id: Sha256,
|
||||
pub signed_psbt: String,
|
||||
}
|
||||
|
||||
impl From<Openchannel_signedRequest> for Request {
|
||||
fn from(r: Openchannel_signedRequest) -> Self {
|
||||
Request::OpenChannel_Signed(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for Openchannel_signedRequest {
|
||||
type Response = super::responses::Openchannel_signedResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for Openchannel_signedRequest {
|
||||
type Response = super::responses::Openchannel_signedResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"openchannel_signed"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_updateRequest {
|
||||
pub channel_id: Sha256,
|
||||
pub psbt: String,
|
||||
}
|
||||
|
||||
impl From<Openchannel_updateRequest> for Request {
|
||||
fn from(r: Openchannel_updateRequest) -> Self {
|
||||
Request::OpenChannel_Update(r)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoRequest for Openchannel_updateRequest {
|
||||
type Response = super::responses::Openchannel_updateResponse;
|
||||
}
|
||||
|
||||
impl TypedRequest for Openchannel_updateRequest {
|
||||
type Response = super::responses::Openchannel_updateResponse;
|
||||
|
||||
fn method(&self) -> &str {
|
||||
"openchannel_update"
|
||||
}
|
||||
}
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct PingRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub len: Option<u16>,
|
||||
|
@ -5777,6 +5919,137 @@ pub mod responses {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_abortResponse {
|
||||
pub channel_canceled: bool,
|
||||
pub channel_id: Sha256,
|
||||
pub reason: String,
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for Openchannel_abortResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::OpenChannel_Abort(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_bumpChannel_type {
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub bits: Option<Vec<u32>>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub names: Option<Vec<ChannelTypeName>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_bumpResponse {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub channel_type: Option<Openchannel_bumpChannel_type>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub requires_confirmed_inputs: Option<bool>,
|
||||
pub channel_id: Sha256,
|
||||
pub commitments_secured: bool,
|
||||
pub funding_serial: u64,
|
||||
pub psbt: String,
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for Openchannel_bumpResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::OpenChannel_Bump(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_initChannel_type {
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub bits: Option<Vec<u32>>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub names: Option<Vec<ChannelTypeName>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_initResponse {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub channel_type: Option<Openchannel_initChannel_type>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub requires_confirmed_inputs: Option<bool>,
|
||||
pub channel_id: Sha256,
|
||||
pub commitments_secured: bool,
|
||||
pub funding_serial: u64,
|
||||
pub psbt: String,
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for Openchannel_initResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::OpenChannel_Init(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_signedResponse {
|
||||
pub channel_id: Sha256,
|
||||
pub tx: String,
|
||||
pub txid: String,
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for Openchannel_signedResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::OpenChannel_Signed(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_updateChannel_type {
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub bits: Option<Vec<u32>>,
|
||||
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
|
||||
pub names: Option<Vec<ChannelTypeName>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct Openchannel_updateResponse {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub channel_type: Option<Openchannel_updateChannel_type>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub close_to: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub requires_confirmed_inputs: Option<bool>,
|
||||
pub channel_id: Sha256,
|
||||
pub commitments_secured: bool,
|
||||
pub funding_outnum: u32,
|
||||
pub psbt: String,
|
||||
}
|
||||
|
||||
impl TryFrom<Response> for Openchannel_updateResponse {
|
||||
type Error = super::TryFromResponseError;
|
||||
|
||||
fn try_from(response: Response) -> Result<Self, Self::Error> {
|
||||
match response {
|
||||
Response::OpenChannel_Update(response) => Ok(response),
|
||||
_ => Err(TryFromResponseError)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub struct PingResponse {
|
||||
pub totlen: u16,
|
||||
|
|
|
@ -183,6 +183,9 @@ class OverridePatch(Patch):
|
|||
'ListHtlcs.htlcs[].state': "HtlcState",
|
||||
'FundChannel.channel_type.names[]': 'ChannelTypeName',
|
||||
'MultiFundChannel.channel_ids[].channel_type.names[]': 'ChannelTypeName',
|
||||
'OpenChannel_Init.channel_type.names[]': 'ChannelTypeName',
|
||||
'OpenChannel_Bump.channel_type.names[]': 'ChannelTypeName',
|
||||
'OpenChannel_Update.channel_type.names[]': 'ChannelTypeName',
|
||||
}
|
||||
|
||||
def visit(self, f: model.Field) -> None:
|
||||
|
|
|
@ -23330,7 +23330,7 @@
|
|||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
|
@ -23500,7 +23500,7 @@
|
|||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
|
|
|
@ -118,11 +118,11 @@ def load_jsonrpc_service():
|
|||
"MultiFundChannel",
|
||||
# "multiwithdraw",
|
||||
"Offer",
|
||||
# "openchannel_abort",
|
||||
# "openchannel_bump",
|
||||
# "openchannel_init",
|
||||
# "openchannel_signed",
|
||||
# "openchannel_update",
|
||||
"OpenChannel_Abort",
|
||||
"OpenChannel_Bump",
|
||||
"OpenChannel_Init",
|
||||
"OpenChannel_Signed",
|
||||
"OpenChannel_Update",
|
||||
# "parsefeerate",
|
||||
"Ping",
|
||||
# "plugin",
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -274,6 +274,31 @@ class NodeStub(object):
|
|||
request_serializer=node__pb2.OfferRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.OfferResponse.FromString,
|
||||
)
|
||||
self.OpenChannel_Abort = channel.unary_unary(
|
||||
'/cln.Node/OpenChannel_Abort',
|
||||
request_serializer=node__pb2.Openchannel_abortRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.Openchannel_abortResponse.FromString,
|
||||
)
|
||||
self.OpenChannel_Bump = channel.unary_unary(
|
||||
'/cln.Node/OpenChannel_Bump',
|
||||
request_serializer=node__pb2.Openchannel_bumpRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.Openchannel_bumpResponse.FromString,
|
||||
)
|
||||
self.OpenChannel_Init = channel.unary_unary(
|
||||
'/cln.Node/OpenChannel_Init',
|
||||
request_serializer=node__pb2.Openchannel_initRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.Openchannel_initResponse.FromString,
|
||||
)
|
||||
self.OpenChannel_Signed = channel.unary_unary(
|
||||
'/cln.Node/OpenChannel_Signed',
|
||||
request_serializer=node__pb2.Openchannel_signedRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.Openchannel_signedResponse.FromString,
|
||||
)
|
||||
self.OpenChannel_Update = channel.unary_unary(
|
||||
'/cln.Node/OpenChannel_Update',
|
||||
request_serializer=node__pb2.Openchannel_updateRequest.SerializeToString,
|
||||
response_deserializer=node__pb2.Openchannel_updateResponse.FromString,
|
||||
)
|
||||
self.Ping = channel.unary_unary(
|
||||
'/cln.Node/Ping',
|
||||
request_serializer=node__pb2.PingRequest.SerializeToString,
|
||||
|
@ -651,6 +676,36 @@ class NodeServicer(object):
|
|||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def OpenChannel_Abort(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 OpenChannel_Bump(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 OpenChannel_Init(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 OpenChannel_Signed(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 OpenChannel_Update(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 Ping(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
|
@ -986,6 +1041,31 @@ def add_NodeServicer_to_server(servicer, server):
|
|||
request_deserializer=node__pb2.OfferRequest.FromString,
|
||||
response_serializer=node__pb2.OfferResponse.SerializeToString,
|
||||
),
|
||||
'OpenChannel_Abort': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.OpenChannel_Abort,
|
||||
request_deserializer=node__pb2.Openchannel_abortRequest.FromString,
|
||||
response_serializer=node__pb2.Openchannel_abortResponse.SerializeToString,
|
||||
),
|
||||
'OpenChannel_Bump': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.OpenChannel_Bump,
|
||||
request_deserializer=node__pb2.Openchannel_bumpRequest.FromString,
|
||||
response_serializer=node__pb2.Openchannel_bumpResponse.SerializeToString,
|
||||
),
|
||||
'OpenChannel_Init': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.OpenChannel_Init,
|
||||
request_deserializer=node__pb2.Openchannel_initRequest.FromString,
|
||||
response_serializer=node__pb2.Openchannel_initResponse.SerializeToString,
|
||||
),
|
||||
'OpenChannel_Signed': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.OpenChannel_Signed,
|
||||
request_deserializer=node__pb2.Openchannel_signedRequest.FromString,
|
||||
response_serializer=node__pb2.Openchannel_signedResponse.SerializeToString,
|
||||
),
|
||||
'OpenChannel_Update': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.OpenChannel_Update,
|
||||
request_deserializer=node__pb2.Openchannel_updateRequest.FromString,
|
||||
response_serializer=node__pb2.Openchannel_updateResponse.SerializeToString,
|
||||
),
|
||||
'Ping': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.Ping,
|
||||
request_deserializer=node__pb2.PingRequest.FromString,
|
||||
|
@ -1940,6 +2020,91 @@ class Node(object):
|
|||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def OpenChannel_Abort(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/OpenChannel_Abort',
|
||||
node__pb2.Openchannel_abortRequest.SerializeToString,
|
||||
node__pb2.Openchannel_abortResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def OpenChannel_Bump(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/OpenChannel_Bump',
|
||||
node__pb2.Openchannel_bumpRequest.SerializeToString,
|
||||
node__pb2.Openchannel_bumpResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def OpenChannel_Init(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/OpenChannel_Init',
|
||||
node__pb2.Openchannel_initRequest.SerializeToString,
|
||||
node__pb2.Openchannel_initResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def OpenChannel_Signed(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/OpenChannel_Signed',
|
||||
node__pb2.Openchannel_signedRequest.SerializeToString,
|
||||
node__pb2.Openchannel_signedResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def OpenChannel_Update(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/OpenChannel_Update',
|
||||
node__pb2.Openchannel_updateRequest.SerializeToString,
|
||||
node__pb2.Openchannel_updateResponse.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def Ping(request,
|
||||
target,
|
||||
|
|
|
@ -1416,6 +1416,74 @@ def offer2py(m):
|
|||
})
|
||||
|
||||
|
||||
def openchannel_abort2py(m):
|
||||
return remove_default({
|
||||
"channel_canceled": m.channel_canceled, # PrimitiveField in generate_composite
|
||||
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
|
||||
"reason": m.reason, # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def openchannel_bump_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 openchannel_bump2py(m):
|
||||
return remove_default({
|
||||
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
|
||||
"commitments_secured": m.commitments_secured, # PrimitiveField in generate_composite
|
||||
"funding_serial": m.funding_serial, # PrimitiveField in generate_composite
|
||||
"psbt": m.psbt, # PrimitiveField in generate_composite
|
||||
"requires_confirmed_inputs": m.requires_confirmed_inputs, # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def openchannel_init_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 openchannel_init2py(m):
|
||||
return remove_default({
|
||||
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
|
||||
"commitments_secured": m.commitments_secured, # PrimitiveField in generate_composite
|
||||
"funding_serial": m.funding_serial, # PrimitiveField in generate_composite
|
||||
"psbt": m.psbt, # PrimitiveField in generate_composite
|
||||
"requires_confirmed_inputs": m.requires_confirmed_inputs, # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def openchannel_signed2py(m):
|
||||
return remove_default({
|
||||
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
|
||||
"tx": hexlify(m.tx), # PrimitiveField in generate_composite
|
||||
"txid": hexlify(m.txid), # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def openchannel_update_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 openchannel_update2py(m):
|
||||
return remove_default({
|
||||
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
|
||||
"close_to": hexlify(m.close_to), # PrimitiveField in generate_composite
|
||||
"commitments_secured": m.commitments_secured, # PrimitiveField in generate_composite
|
||||
"funding_outnum": m.funding_outnum, # PrimitiveField in generate_composite
|
||||
"psbt": m.psbt, # PrimitiveField in generate_composite
|
||||
"requires_confirmed_inputs": m.requires_confirmed_inputs, # PrimitiveField in generate_composite
|
||||
})
|
||||
|
||||
|
||||
def ping2py(m):
|
||||
return remove_default({
|
||||
"totlen": m.totlen, # PrimitiveField in generate_composite
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
]
|
||||
},
|
||||
"amount": {
|
||||
"type": "sat",
|
||||
"type": "msat",
|
||||
"description": [
|
||||
"Satoshi value that we will contribute to the channel. This value will be _added_ to the provided PSBT in the output which is encumbered by the 2-of-2 script for this channel."
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue