msggen: Add DecodePay to the mappings

Changelog-Added: grpc: Added mapping for `listpeerchannels`, `listclosedchannels`, `decode` and `decodepay` RPC method
This commit is contained in:
Christian Decker
2023-05-03 14:59:58 +02:00
committed by Rusty Russell
parent 0031f1160b
commit fc26675336
10 changed files with 2393 additions and 680 deletions

View File

@@ -28,6 +28,19 @@
"must-create": 0, "must-create": 0,
"must-replace": 1 "must-replace": 1
}, },
"DecodeType": {
"bolt11 invoice": 3,
"bolt12 invoice": 1,
"bolt12 invoice_request": 2,
"bolt12 offer": 0,
"rune": 4
},
"DecodepayFallbacksType": {
"P2PKH": 0,
"P2SH": 1,
"P2WPKH": 2,
"P2WSH": 3
},
"DelinvoiceStatus": { "DelinvoiceStatus": {
"expired": 1, "expired": 1,
"paid": 0, "paid": 0,
@@ -390,6 +403,147 @@
"Datastore.key[]": 1, "Datastore.key[]": 1,
"Datastore.string": 4 "Datastore.string": 4
}, },
"DecodeExtra": {
"Decode.extra[].data": 2,
"Decode.extra[].tag": 1
},
"DecodeFallbacks": {
"Decode.fallbacks[].warning_invoice_fallbacks_version_invalid": 1
},
"DecodeInvoice_fallbacks": {
"Decode.invoice_fallbacks[].address": 3,
"Decode.invoice_fallbacks[].hex": 2,
"Decode.invoice_fallbacks[].version": 1
},
"DecodeInvoice_pathsPath": {
"Decode.invoice_paths[].path[].blinded_node_id": 1,
"Decode.invoice_paths[].path[].encrypted_recipient_data": 2
},
"DecodeOffer_paths": {
"Decode.offer_paths[].blinding": 2,
"Decode.offer_paths[].first_node_id": 1,
"Decode.offer_paths[].path[]": 3
},
"DecodeOffer_recurrencePaywindow": {
"Decode.offer_recurrence.paywindow.proportional_amount": 3,
"Decode.offer_recurrence.paywindow.seconds_after": 2,
"Decode.offer_recurrence.paywindow.seconds_before": 1
},
"DecodeRequest": {
"Decode.string": 1
},
"DecodeResponse": {
"Decode.created_at": 60,
"Decode.currency_minor_unit": 8,
"Decode.description_hash": 64,
"Decode.expiry": 61,
"Decode.extra[]": 69,
"Decode.fallbacks[]": 59,
"Decode.hex": 75,
"Decode.invoice_amount_msat": 44,
"Decode.invoice_created_at": 41,
"Decode.invoice_fallbacks[]": 45,
"Decode.invoice_features": 46,
"Decode.invoice_node_id": 47,
"Decode.invoice_paths[]": 40,
"Decode.invoice_payment_hash": 43,
"Decode.invoice_recurrence_basetime": 48,
"Decode.invoice_relative_expiry": 42,
"Decode.invreq_amount_msat": 28,
"Decode.invreq_chain": 27,
"Decode.invreq_features": 29,
"Decode.invreq_metadata": 25,
"Decode.invreq_payer_id": 26,
"Decode.invreq_payer_note": 31,
"Decode.invreq_quantity": 30,
"Decode.invreq_recurrence_counter": 32,
"Decode.invreq_recurrence_start": 33,
"Decode.min_final_cltv_expiry": 65,
"Decode.offer_absolute_expiry": 14,
"Decode.offer_amount": 9,
"Decode.offer_amount_msat": 10,
"Decode.offer_chains[]": 4,
"Decode.offer_currency": 6,
"Decode.offer_description": 11,
"Decode.offer_features": 13,
"Decode.offer_id": 3,
"Decode.offer_issuer": 12,
"Decode.offer_metadata": 5,
"Decode.offer_node_id": 17,
"Decode.offer_paths[]": 16,
"Decode.offer_quantity_max": 15,
"Decode.offer_recurrence": 18,
"Decode.payee": 62,
"Decode.payment_hash": 63,
"Decode.payment_metadata": 67,
"Decode.payment_secret": 66,
"Decode.restrictions[]": 73,
"Decode.routes[][]": 68,
"Decode.string": 72,
"Decode.type": 1,
"Decode.unique_id": 70,
"Decode.unknown_invoice_request_tlvs[]": 34,
"Decode.unknown_invoice_tlvs[]": 49,
"Decode.unknown_offer_tlvs[]": 19,
"Decode.valid": 2,
"Decode.version": 71,
"Decode.warning_invalid_invoice_request_signature": 39,
"Decode.warning_invalid_invoice_signature": 58,
"Decode.warning_invalid_invreq_payer_note": 37,
"Decode.warning_invalid_offer_currency": 23,
"Decode.warning_invalid_offer_description": 21,
"Decode.warning_invalid_offer_issuer": 24,
"Decode.warning_missing_invoice_amount": 54,
"Decode.warning_missing_invoice_blindedpay": 51,
"Decode.warning_missing_invoice_created_at": 52,
"Decode.warning_missing_invoice_node_id": 56,
"Decode.warning_missing_invoice_paths": 50,
"Decode.warning_missing_invoice_payment_hash": 53,
"Decode.warning_missing_invoice_recurrence_basetime": 55,
"Decode.warning_missing_invoice_request_signature": 38,
"Decode.warning_missing_invoice_signature": 57,
"Decode.warning_missing_invreq_metadata": 35,
"Decode.warning_missing_invreq_payer_id": 36,
"Decode.warning_missing_offer_description": 22,
"Decode.warning_missing_offer_node_id": 20,
"Decode.warning_rune_invalid_utf8": 74,
"Decode.warning_unknown_offer_currency": 7
},
"DecodeRestrictions": {
"Decode.restrictions[].alternatives[]": 1,
"Decode.restrictions[].summary": 2
},
"DecodepayExtra": {
"DecodePay.extra[].data": 2,
"DecodePay.extra[].tag": 1
},
"DecodepayFallbacks": {
"DecodePay.fallbacks[].addr": 2,
"DecodePay.fallbacks[].hex": 3,
"DecodePay.fallbacks[].type": 1
},
"DecodepayRequest": {
"DecodePay.bolt11": 1,
"DecodePay.description": 2
},
"DecodepayResponse": {
"DecodePay.amount_msat": 5,
"DecodePay.created_at": 2,
"DecodePay.currency": 1,
"DecodePay.description": 8,
"DecodePay.description_hash": 9,
"DecodePay.expiry": 3,
"DecodePay.extra[]": 16,
"DecodePay.fallbacks[]": 14,
"DecodePay.features": 12,
"DecodePay.min_final_cltv_expiry": 10,
"DecodePay.payee": 4,
"DecodePay.payment_hash": 6,
"DecodePay.payment_metadata": 13,
"DecodePay.payment_secret": 11,
"DecodePay.routes[][]": 15,
"DecodePay.signature": 7
},
"DeldatastoreRequest": { "DeldatastoreRequest": {
"DelDatastore.generation": 2, "DelDatastore.generation": 2,
"DelDatastore.key": 3, "DelDatastore.key": 3,
@@ -1654,6 +1808,610 @@
"added": "pre-v0.10.1", "added": "pre-v0.10.1",
"deprecated": false "deprecated": false
}, },
"Decode": {
"added": "v23.05",
"deprecated": null
},
"Decode.created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.currency_minor_unit": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.description_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.extra[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.extra[].data": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.extra[].tag": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[].warning_invoice_fallbacks_version_invalid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.hex": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_fallbacks[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_fallbacks[].address": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_fallbacks[].hex": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_fallbacks[].version": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].blinding": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].first_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].path[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].path[].blinded_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].path[].encrypted_recipient_data": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].payinfo": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].payinfo.cltv_expiry_delta": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].payinfo.features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].payinfo.fee_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_paths[].payinfo.fee_proportional_millionths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_recurrence_basetime": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invoice_relative_expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_chain": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_metadata": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_payer_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_payer_note": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_quantity": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_recurrence_counter": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.invreq_recurrence_start": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.min_final_cltv_expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_absolute_expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_amount": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_chains[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_issuer": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_metadata": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[].blinding": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[].first_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[].path[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[].path[].blinded_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_paths[].path[].encrypted_recipient_data": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_quantity_max": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.basetime": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.limit": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.paywindow": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.paywindow.proportional_amount": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.paywindow.seconds_after": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.paywindow.seconds_before": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.period": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.start_any_period": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.time_unit": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.offer_recurrence.time_unit_name": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.payee": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.payment_metadata": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.payment_secret": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.restrictions[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.restrictions[].alternatives[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.restrictions[].summary": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][].cltv_expiry_delta": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][].fee_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][].fee_proportional_millionths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][].pubkey": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.routes[][].short_channel_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.string": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unique_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_request_tlvs[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_request_tlvs[].length": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_request_tlvs[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_request_tlvs[].value": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_tlvs[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_tlvs[].length": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_tlvs[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_invoice_tlvs[].value": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_offer_tlvs[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_offer_tlvs[].length": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_offer_tlvs[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.unknown_offer_tlvs[].value": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.valid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.version": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_invoice_request_signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_invoice_signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_invreq_payer_note": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_offer_currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_offer_description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_invalid_offer_issuer": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_amount": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_blindedpay": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_paths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_recurrence_basetime": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_request_signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invoice_signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invreq_metadata": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_invreq_payer_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_offer_description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_missing_offer_node_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_rune_invalid_utf8": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.warning_unknown_offer_currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay": {
"added": "v23.05",
"deprecated": null
},
"DecodePay.amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.bolt11": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.description_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.extra[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.extra[].data": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.extra[].tag": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.fallbacks[]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.fallbacks[].addr": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.fallbacks[].hex": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.fallbacks[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.min_final_cltv_expiry": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.payee": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.payment_metadata": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.payment_secret": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][]": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][].cltv_expiry_delta": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][].fee_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][].fee_proportional_millionths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][].pubkey": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.routes[][].short_channel_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DecodePay.signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelDatastore": { "DelDatastore": {
"added": "pre-v0.10.1", "added": "pre-v0.10.1",
"deprecated": null "deprecated": null

View File

@@ -47,6 +47,8 @@ service Node {
rpc TxSend(TxsendRequest) returns (TxsendResponse) {} rpc TxSend(TxsendRequest) returns (TxsendResponse) {}
rpc ListPeerChannels(ListpeerchannelsRequest) returns (ListpeerchannelsResponse) {} rpc ListPeerChannels(ListpeerchannelsRequest) returns (ListpeerchannelsResponse) {}
rpc ListClosedChannels(ListclosedchannelsRequest) returns (ListclosedchannelsResponse) {} rpc ListClosedChannels(ListclosedchannelsRequest) returns (ListclosedchannelsResponse) {}
rpc DecodePay(DecodepayRequest) returns (DecodepayResponse) {}
rpc Decode(DecodeRequest) returns (DecodeResponse) {}
rpc Disconnect(DisconnectRequest) returns (DisconnectResponse) {} rpc Disconnect(DisconnectRequest) returns (DisconnectResponse) {}
rpc Feerates(FeeratesRequest) returns (FeeratesResponse) {} rpc Feerates(FeeratesRequest) returns (FeeratesResponse) {}
rpc FundChannel(FundchannelRequest) returns (FundchannelResponse) {} rpc FundChannel(FundchannelRequest) returns (FundchannelResponse) {}
@@ -267,6 +269,7 @@ message ListpeersPeersChannelsHtlcs {
bytes payment_hash = 5; bytes payment_hash = 5;
optional bool local_trimmed = 6; optional bool local_trimmed = 6;
optional string status = 7; optional string status = 7;
HtlcState state = 8;
} }
message ListfundsRequest { message ListfundsRequest {
@@ -590,7 +593,6 @@ message InvoiceRequest {
optional uint64 expiry = 7; optional uint64 expiry = 7;
repeated string fallbacks = 4; repeated string fallbacks = 4;
optional bytes preimage = 5; optional bytes preimage = 5;
optional bool exposeprivatechannels = 8;
optional uint32 cltv = 6; optional uint32 cltv = 6;
optional bool deschashonly = 9; optional bool deschashonly = 9;
} }
@@ -1220,6 +1222,7 @@ message ListpeerchannelsChannelsHtlcs {
optional bytes payment_hash = 5; optional bytes payment_hash = 5;
optional bool local_trimmed = 6; optional bool local_trimmed = 6;
optional string status = 7; optional string status = 7;
optional HtlcState state = 8;
} }
message ListclosedchannelsRequest { message ListclosedchannelsRequest {
@@ -1270,6 +1273,167 @@ message ListclosedchannelsClosedchannelsAlias {
optional string remote = 2; optional string remote = 2;
} }
message DecodepayRequest {
string bolt11 = 1;
optional string description = 2;
}
message DecodepayResponse {
string currency = 1;
uint64 created_at = 2;
uint64 expiry = 3;
bytes payee = 4;
optional Amount amount_msat = 5;
bytes payment_hash = 6;
bytes signature = 7;
optional string description = 8;
optional bytes description_hash = 9;
uint32 min_final_cltv_expiry = 10;
optional bytes payment_secret = 11;
optional bytes features = 12;
optional bytes payment_metadata = 13;
repeated DecodepayFallbacks fallbacks = 14;
repeated DecodepayExtra extra = 16;
}
message DecodepayFallbacks {
// DecodePay.fallbacks[].type
enum DecodepayFallbacksType {
P2PKH = 0;
P2SH = 1;
P2WPKH = 2;
P2WSH = 3;
}
DecodepayFallbacksType item_type = 1;
optional string addr = 2;
bytes hex = 3;
}
message DecodepayExtra {
string tag = 1;
string data = 2;
}
message DecodeRequest {
string string = 1;
}
message DecodeResponse {
// Decode.type
enum DecodeType {
BOLT12_OFFER = 0;
BOLT12_INVOICE = 1;
BOLT12_INVOICE_REQUEST = 2;
BOLT11_INVOICE = 3;
RUNE = 4;
}
DecodeType item_type = 1;
bool valid = 2;
optional bytes offer_id = 3;
repeated bytes offer_chains = 4;
optional bytes offer_metadata = 5;
optional string offer_currency = 6;
optional string warning_unknown_offer_currency = 7;
optional uint32 currency_minor_unit = 8;
optional uint64 offer_amount = 9;
optional Amount offer_amount_msat = 10;
optional string offer_description = 11;
optional string offer_issuer = 12;
optional bytes offer_features = 13;
optional uint64 offer_absolute_expiry = 14;
optional uint64 offer_quantity_max = 15;
repeated DecodeOffer_paths offer_paths = 16;
optional bytes offer_node_id = 17;
optional string warning_missing_offer_node_id = 20;
optional string warning_invalid_offer_description = 21;
optional string warning_missing_offer_description = 22;
optional string warning_invalid_offer_currency = 23;
optional string warning_invalid_offer_issuer = 24;
optional bytes invreq_metadata = 25;
optional bytes invreq_payer_id = 26;
optional bytes invreq_chain = 27;
optional Amount invreq_amount_msat = 28;
optional bytes invreq_features = 29;
optional uint64 invreq_quantity = 30;
optional string invreq_payer_note = 31;
optional uint32 invreq_recurrence_counter = 32;
optional uint32 invreq_recurrence_start = 33;
optional string warning_missing_invreq_metadata = 35;
optional string warning_missing_invreq_payer_id = 36;
optional string warning_invalid_invreq_payer_note = 37;
optional string warning_missing_invoice_request_signature = 38;
optional string warning_invalid_invoice_request_signature = 39;
optional uint64 invoice_created_at = 41;
optional uint32 invoice_relative_expiry = 42;
optional bytes invoice_payment_hash = 43;
optional Amount invoice_amount_msat = 44;
repeated DecodeInvoice_fallbacks invoice_fallbacks = 45;
optional bytes invoice_features = 46;
optional bytes invoice_node_id = 47;
optional uint64 invoice_recurrence_basetime = 48;
optional string warning_missing_invoice_paths = 50;
optional string warning_missing_invoice_blindedpay = 51;
optional string warning_missing_invoice_created_at = 52;
optional string warning_missing_invoice_payment_hash = 53;
optional string warning_missing_invoice_amount = 54;
optional string warning_missing_invoice_recurrence_basetime = 55;
optional string warning_missing_invoice_node_id = 56;
optional string warning_missing_invoice_signature = 57;
optional string warning_invalid_invoice_signature = 58;
repeated DecodeFallbacks fallbacks = 59;
optional uint64 created_at = 60;
optional uint64 expiry = 61;
optional bytes payee = 62;
optional bytes payment_hash = 63;
optional bytes description_hash = 64;
optional uint32 min_final_cltv_expiry = 65;
optional bytes payment_secret = 66;
optional bytes payment_metadata = 67;
repeated DecodeExtra extra = 69;
optional string unique_id = 70;
optional string version = 71;
optional string string = 72;
repeated DecodeRestrictions restrictions = 73;
optional string warning_rune_invalid_utf8 = 74;
optional bytes hex = 75;
}
message DecodeOffer_paths {
bytes first_node_id = 1;
bytes blinding = 2;
}
message DecodeOffer_recurrencePaywindow {
uint32 seconds_before = 1;
uint32 seconds_after = 2;
optional bool proportional_amount = 3;
}
message DecodeInvoice_pathsPath {
bytes blinded_node_id = 1;
bytes encrypted_recipient_data = 2;
}
message DecodeInvoice_fallbacks {
uint32 version = 1;
bytes hex = 2;
optional string address = 3;
}
message DecodeFallbacks {
optional string warning_invoice_fallbacks_version_invalid = 1;
}
message DecodeExtra {
string tag = 1;
string data = 2;
}
message DecodeRestrictions {
repeated string alternatives = 1;
string summary = 2;
}
message DisconnectRequest { message DisconnectRequest {
bytes id = 1; bytes id = 1;
optional bool force = 2; optional bool force = 2;

276
cln-grpc/src/convert.rs generated
View File

@@ -64,7 +64,9 @@ impl From<responses::GetinfoResponse> for pb::GetinfoResponse {
blockheight: c.blockheight, // Rule #2 for type u32 blockheight: c.blockheight, // Rule #2 for type u32
network: c.network, // Rule #2 for type string network: c.network, // Rule #2 for type string
fees_collected_msat: Some(c.fees_collected_msat.into()), // Rule #2 for type msat fees_collected_msat: Some(c.fees_collected_msat.into()), // Rule #2 for type msat
// Field: Getinfo.address[]
address: c.address.into_iter().map(|i| i.into()).collect(), // Rule #3 for type GetinfoAddress address: c.address.into_iter().map(|i| i.into()).collect(), // Rule #3 for type GetinfoAddress
// Field: Getinfo.binding[]
binding: c.binding.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 binding: c.binding.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
warning_bitcoind_sync: c.warning_bitcoind_sync, // Rule #2 for type string? warning_bitcoind_sync: c.warning_bitcoind_sync, // Rule #2 for type string?
warning_lightningd_sync: c.warning_lightningd_sync, // Rule #2 for type string? warning_lightningd_sync: c.warning_lightningd_sync, // Rule #2 for type string?
@@ -145,6 +147,7 @@ impl From<responses::ListpeersPeersChannelsHtlcs> for pb::ListpeersPeersChannels
payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash
local_trimmed: c.local_trimmed, // Rule #2 for type boolean? local_trimmed: c.local_trimmed, // Rule #2 for type boolean?
status: c.status, // Rule #2 for type string? status: c.status, // Rule #2 for type string?
state: c.state as i32,
} }
} }
} }
@@ -165,11 +168,13 @@ impl From<responses::ListpeersPeersChannels> for pb::ListpeersPeersChannels {
last_feerate: c.last_feerate, // Rule #2 for type string? last_feerate: c.last_feerate, // Rule #2 for type string?
next_feerate: c.next_feerate, // Rule #2 for type string? next_feerate: c.next_feerate, // Rule #2 for type string?
next_fee_step: c.next_fee_step, // Rule #2 for type u32? next_fee_step: c.next_fee_step, // Rule #2 for type u32?
// Field: ListPeers.peers[].channels[].inflight[]
inflight: c.inflight.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 inflight: c.inflight.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
private: c.private, // Rule #2 for type boolean? private: c.private, // Rule #2 for type boolean?
opener: c.opener as i32, opener: c.opener as i32,
closer: c.closer.map(|v| v as i32), closer: c.closer.map(|v| v as i32),
// Field: ListPeers.peers[].channels[].features[]
features: c.features.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpeersPeersChannelsFeatures features: c.features.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpeersPeersChannelsFeatures
funding: c.funding.map(|v| v.into()), funding: c.funding.map(|v| v.into()),
to_us_msat: c.to_us_msat.map(|f| f.into()), // Rule #2 for type msat? to_us_msat: c.to_us_msat.map(|f| f.into()), // Rule #2 for type msat?
@@ -191,6 +196,7 @@ impl From<responses::ListpeersPeersChannels> for pb::ListpeersPeersChannels {
our_to_self_delay: c.our_to_self_delay, // Rule #2 for type u32? our_to_self_delay: c.our_to_self_delay, // Rule #2 for type u32?
max_accepted_htlcs: c.max_accepted_htlcs, // Rule #2 for type u32? max_accepted_htlcs: c.max_accepted_htlcs, // Rule #2 for type u32?
alias: c.alias.map(|v| v.into()), alias: c.alias.map(|v| v.into()),
// Field: ListPeers.peers[].channels[].status[]
status: c.status.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 status: c.status.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
in_payments_offered: c.in_payments_offered, // Rule #2 for type u64? in_payments_offered: c.in_payments_offered, // Rule #2 for type u64?
in_offered_msat: c.in_offered_msat.map(|f| f.into()), // Rule #2 for type msat? in_offered_msat: c.in_offered_msat.map(|f| f.into()), // Rule #2 for type msat?
@@ -200,6 +206,7 @@ impl From<responses::ListpeersPeersChannels> for pb::ListpeersPeersChannels {
out_offered_msat: c.out_offered_msat.map(|f| f.into()), // Rule #2 for type msat? out_offered_msat: c.out_offered_msat.map(|f| f.into()), // Rule #2 for type msat?
out_payments_fulfilled: c.out_payments_fulfilled, // Rule #2 for type u64? out_payments_fulfilled: c.out_payments_fulfilled, // Rule #2 for type u64?
out_fulfilled_msat: c.out_fulfilled_msat.map(|f| f.into()), // Rule #2 for type msat? out_fulfilled_msat: c.out_fulfilled_msat.map(|f| f.into()), // Rule #2 for type msat?
// Field: ListPeers.peers[].channels[].htlcs[]
htlcs: c.htlcs.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 htlcs: c.htlcs.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
close_to_addr: c.close_to_addr, // Rule #2 for type string? close_to_addr: c.close_to_addr, // Rule #2 for type string?
} }
@@ -213,8 +220,11 @@ impl From<responses::ListpeersPeers> for pb::ListpeersPeers {
id: c.id.serialize().to_vec(), // Rule #2 for type pubkey id: c.id.serialize().to_vec(), // Rule #2 for type pubkey
connected: c.connected, // Rule #2 for type boolean connected: c.connected, // Rule #2 for type boolean
num_channels: c.num_channels, // Rule #2 for type u32? num_channels: c.num_channels, // Rule #2 for type u32?
// Field: ListPeers.peers[].log[]
log: c.log.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 log: c.log.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
// Field: ListPeers.peers[].channels[]
channels: c.channels.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 channels: c.channels.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
// Field: ListPeers.peers[].netaddr[]
netaddr: c.netaddr.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 netaddr: c.netaddr.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
remote_addr: c.remote_addr, // Rule #2 for type string? remote_addr: c.remote_addr, // Rule #2 for type string?
features: c.features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? features: c.features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
@@ -226,6 +236,7 @@ impl From<responses::ListpeersPeers> for pb::ListpeersPeers {
impl From<responses::ListpeersResponse> for pb::ListpeersResponse { impl From<responses::ListpeersResponse> for pb::ListpeersResponse {
fn from(c: responses::ListpeersResponse) -> Self { fn from(c: responses::ListpeersResponse) -> Self {
Self { Self {
// Field: ListPeers.peers[]
peers: c.peers.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpeersPeers peers: c.peers.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpeersPeers
} }
} }
@@ -269,7 +280,9 @@ impl From<responses::ListfundsChannels> for pb::ListfundsChannels {
impl From<responses::ListfundsResponse> for pb::ListfundsResponse { impl From<responses::ListfundsResponse> for pb::ListfundsResponse {
fn from(c: responses::ListfundsResponse) -> Self { fn from(c: responses::ListfundsResponse) -> Self {
Self { Self {
// Field: ListFunds.outputs[]
outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListfundsOutputs outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListfundsOutputs
// Field: ListFunds.channels[]
channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListfundsChannels channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListfundsChannels
} }
} }
@@ -326,6 +339,7 @@ impl From<responses::ListchannelsChannels> for pb::ListchannelsChannels {
impl From<responses::ListchannelsResponse> for pb::ListchannelsResponse { impl From<responses::ListchannelsResponse> for pb::ListchannelsResponse {
fn from(c: responses::ListchannelsResponse) -> Self { fn from(c: responses::ListchannelsResponse) -> Self {
Self { Self {
// Field: ListChannels.channels[]
channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListchannelsChannels channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListchannelsChannels
} }
} }
@@ -421,6 +435,7 @@ impl From<responses::CreateinvoiceResponse> for pb::CreateinvoiceResponse {
impl From<responses::DatastoreResponse> for pb::DatastoreResponse { impl From<responses::DatastoreResponse> for pb::DatastoreResponse {
fn from(c: responses::DatastoreResponse) -> Self { fn from(c: responses::DatastoreResponse) -> Self {
Self { Self {
// Field: Datastore.key
key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
generation: c.generation, // Rule #2 for type u64? generation: c.generation, // Rule #2 for type u64?
hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
@@ -434,6 +449,7 @@ impl From<responses::CreateonionResponse> for pb::CreateonionResponse {
fn from(c: responses::CreateonionResponse) -> Self { fn from(c: responses::CreateonionResponse) -> Self {
Self { Self {
onion: hex::decode(&c.onion).unwrap(), // Rule #2 for type hex onion: hex::decode(&c.onion).unwrap(), // Rule #2 for type hex
// Field: CreateOnion.shared_secrets[]
shared_secrets: c.shared_secrets.into_iter().map(|i| i.to_vec()).collect(), // Rule #3 for type secret shared_secrets: c.shared_secrets.into_iter().map(|i| i.to_vec()).collect(), // Rule #3 for type secret
} }
} }
@@ -443,6 +459,7 @@ impl From<responses::CreateonionResponse> for pb::CreateonionResponse {
impl From<responses::DeldatastoreResponse> for pb::DeldatastoreResponse { impl From<responses::DeldatastoreResponse> for pb::DeldatastoreResponse {
fn from(c: responses::DeldatastoreResponse) -> Self { fn from(c: responses::DeldatastoreResponse) -> Self {
Self { Self {
// Field: DelDatastore.key
key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
generation: c.generation, // Rule #2 for type u64? generation: c.generation, // Rule #2 for type u64?
hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
@@ -498,6 +515,7 @@ impl From<responses::InvoiceResponse> for pb::InvoiceResponse {
impl From<responses::ListdatastoreDatastore> for pb::ListdatastoreDatastore { impl From<responses::ListdatastoreDatastore> for pb::ListdatastoreDatastore {
fn from(c: responses::ListdatastoreDatastore) -> Self { fn from(c: responses::ListdatastoreDatastore) -> Self {
Self { Self {
// Field: ListDatastore.datastore[].key[]
key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
generation: c.generation, // Rule #2 for type u64? generation: c.generation, // Rule #2 for type u64?
hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
@@ -510,6 +528,7 @@ impl From<responses::ListdatastoreDatastore> for pb::ListdatastoreDatastore {
impl From<responses::ListdatastoreResponse> for pb::ListdatastoreResponse { impl From<responses::ListdatastoreResponse> for pb::ListdatastoreResponse {
fn from(c: responses::ListdatastoreResponse) -> Self { fn from(c: responses::ListdatastoreResponse) -> Self {
Self { Self {
// Field: ListDatastore.datastore[]
datastore: c.datastore.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListdatastoreDatastore datastore: c.datastore.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListdatastoreDatastore
} }
} }
@@ -541,6 +560,7 @@ impl From<responses::ListinvoicesInvoices> for pb::ListinvoicesInvoices {
impl From<responses::ListinvoicesResponse> for pb::ListinvoicesResponse { impl From<responses::ListinvoicesResponse> for pb::ListinvoicesResponse {
fn from(c: responses::ListinvoicesResponse) -> Self { fn from(c: responses::ListinvoicesResponse) -> Self {
Self { Self {
// Field: ListInvoices.invoices[]
invoices: c.invoices.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListinvoicesInvoices invoices: c.invoices.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListinvoicesInvoices
} }
} }
@@ -594,6 +614,7 @@ impl From<responses::ListsendpaysPayments> for pb::ListsendpaysPayments {
impl From<responses::ListsendpaysResponse> for pb::ListsendpaysResponse { impl From<responses::ListsendpaysResponse> for pb::ListsendpaysResponse {
fn from(c: responses::ListsendpaysResponse) -> Self { fn from(c: responses::ListsendpaysResponse) -> Self {
Self { Self {
// Field: ListSendPays.payments[]
payments: c.payments.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListsendpaysPayments payments: c.payments.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListsendpaysPayments
} }
} }
@@ -635,7 +656,9 @@ impl From<responses::ListtransactionsTransactions> for pb::ListtransactionsTrans
txindex: c.txindex, // Rule #2 for type u32 txindex: c.txindex, // Rule #2 for type u32
locktime: c.locktime, // Rule #2 for type u32 locktime: c.locktime, // Rule #2 for type u32
version: c.version, // Rule #2 for type u32 version: c.version, // Rule #2 for type u32
// Field: ListTransactions.transactions[].inputs[]
inputs: c.inputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactionsInputs inputs: c.inputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactionsInputs
// Field: ListTransactions.transactions[].outputs[]
outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactionsOutputs outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactionsOutputs
} }
} }
@@ -645,6 +668,7 @@ impl From<responses::ListtransactionsTransactions> for pb::ListtransactionsTrans
impl From<responses::ListtransactionsResponse> for pb::ListtransactionsResponse { impl From<responses::ListtransactionsResponse> for pb::ListtransactionsResponse {
fn from(c: responses::ListtransactionsResponse) -> Self { fn from(c: responses::ListtransactionsResponse) -> Self {
Self { Self {
// Field: ListTransactions.transactions[]
transactions: c.transactions.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactions transactions: c.transactions.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListtransactionsTransactions
} }
} }
@@ -687,6 +711,7 @@ impl From<responses::ListnodesNodes> for pb::ListnodesNodes {
alias: c.alias, // Rule #2 for type string? alias: c.alias, // Rule #2 for type string?
color: c.color.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? color: c.color.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
features: c.features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? features: c.features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
// Field: ListNodes.nodes[].addresses[]
addresses: c.addresses.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 addresses: c.addresses.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -696,6 +721,7 @@ impl From<responses::ListnodesNodes> for pb::ListnodesNodes {
impl From<responses::ListnodesResponse> for pb::ListnodesResponse { impl From<responses::ListnodesResponse> for pb::ListnodesResponse {
fn from(c: responses::ListnodesResponse) -> Self { fn from(c: responses::ListnodesResponse) -> Self {
Self { Self {
// Field: ListNodes.nodes[]
nodes: c.nodes.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListnodesNodes nodes: c.nodes.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListnodesNodes
} }
} }
@@ -824,6 +850,7 @@ impl From<responses::FundpsbtResponse> for pb::FundpsbtResponse {
estimated_final_weight: c.estimated_final_weight, // Rule #2 for type u32 estimated_final_weight: c.estimated_final_weight, // Rule #2 for type u32
excess_msat: Some(c.excess_msat.into()), // Rule #2 for type msat excess_msat: Some(c.excess_msat.into()), // Rule #2 for type msat
change_outnum: c.change_outnum, // Rule #2 for type u32? change_outnum: c.change_outnum, // Rule #2 for type u32?
// Field: FundPsbt.reservations[]
reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -870,6 +897,7 @@ impl From<responses::UtxopsbtResponse> for pb::UtxopsbtResponse {
estimated_final_weight: c.estimated_final_weight, // Rule #2 for type u32 estimated_final_weight: c.estimated_final_weight, // Rule #2 for type u32
excess_msat: Some(c.excess_msat.into()), // Rule #2 for type msat excess_msat: Some(c.excess_msat.into()), // Rule #2 for type msat
change_outnum: c.change_outnum, // Rule #2 for type u32? change_outnum: c.change_outnum, // Rule #2 for type u32?
// Field: UtxoPsbt.reservations[]
reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 reservations: c.reservations.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -965,6 +993,7 @@ impl From<responses::ListpeerchannelsChannelsHtlcs> for pb::ListpeerchannelsChan
payment_hash: c.payment_hash.map(|v| v.to_vec()), // Rule #2 for type hash? payment_hash: c.payment_hash.map(|v| v.to_vec()), // Rule #2 for type hash?
local_trimmed: c.local_trimmed, // Rule #2 for type boolean? local_trimmed: c.local_trimmed, // Rule #2 for type boolean?
status: c.status, // Rule #2 for type string? status: c.status, // Rule #2 for type string?
state: c.state.map(|v| v as i32),
} }
} }
} }
@@ -987,6 +1016,7 @@ impl From<responses::ListpeerchannelsChannels> for pb::ListpeerchannelsChannels
last_feerate: c.last_feerate, // Rule #2 for type string? last_feerate: c.last_feerate, // Rule #2 for type string?
next_feerate: c.next_feerate, // Rule #2 for type string? next_feerate: c.next_feerate, // Rule #2 for type string?
next_fee_step: c.next_fee_step, // Rule #2 for type u32? next_fee_step: c.next_fee_step, // Rule #2 for type u32?
// Field: ListPeerChannels.channels[].inflight[]
inflight: c.inflight.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 inflight: c.inflight.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? close_to: c.close_to.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
private: c.private, // Rule #2 for type boolean? private: c.private, // Rule #2 for type boolean?
@@ -1012,6 +1042,7 @@ impl From<responses::ListpeerchannelsChannels> for pb::ListpeerchannelsChannels
our_to_self_delay: c.our_to_self_delay, // Rule #2 for type u32? our_to_self_delay: c.our_to_self_delay, // Rule #2 for type u32?
max_accepted_htlcs: c.max_accepted_htlcs, // Rule #2 for type u32? max_accepted_htlcs: c.max_accepted_htlcs, // Rule #2 for type u32?
alias: c.alias.map(|v| v.into()), alias: c.alias.map(|v| v.into()),
// Field: ListPeerChannels.channels[].status[]
status: c.status.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 status: c.status.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
in_payments_offered: c.in_payments_offered, // Rule #2 for type u64? in_payments_offered: c.in_payments_offered, // Rule #2 for type u64?
in_offered_msat: c.in_offered_msat.map(|f| f.into()), // Rule #2 for type msat? in_offered_msat: c.in_offered_msat.map(|f| f.into()), // Rule #2 for type msat?
@@ -1021,6 +1052,7 @@ impl From<responses::ListpeerchannelsChannels> for pb::ListpeerchannelsChannels
out_offered_msat: c.out_offered_msat.map(|f| f.into()), // Rule #2 for type msat? out_offered_msat: c.out_offered_msat.map(|f| f.into()), // Rule #2 for type msat?
out_payments_fulfilled: c.out_payments_fulfilled, // Rule #2 for type u64? out_payments_fulfilled: c.out_payments_fulfilled, // Rule #2 for type u64?
out_fulfilled_msat: c.out_fulfilled_msat.map(|f| f.into()), // Rule #2 for type msat? out_fulfilled_msat: c.out_fulfilled_msat.map(|f| f.into()), // Rule #2 for type msat?
// Field: ListPeerChannels.channels[].htlcs[]
htlcs: c.htlcs.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 htlcs: c.htlcs.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
close_to_addr: c.close_to_addr, // Rule #2 for type string? close_to_addr: c.close_to_addr, // Rule #2 for type string?
} }
@@ -1031,6 +1063,7 @@ impl From<responses::ListpeerchannelsChannels> for pb::ListpeerchannelsChannels
impl From<responses::ListpeerchannelsResponse> for pb::ListpeerchannelsResponse { impl From<responses::ListpeerchannelsResponse> for pb::ListpeerchannelsResponse {
fn from(c: responses::ListpeerchannelsResponse) -> Self { fn from(c: responses::ListpeerchannelsResponse) -> Self {
Self { Self {
// Field: ListPeerChannels.channels[]
channels: c.channels.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 channels: c.channels.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1081,11 +1114,192 @@ impl From<responses::ListclosedchannelsClosedchannels> for pb::Listclosedchannel
impl From<responses::ListclosedchannelsResponse> for pb::ListclosedchannelsResponse { impl From<responses::ListclosedchannelsResponse> for pb::ListclosedchannelsResponse {
fn from(c: responses::ListclosedchannelsResponse) -> Self { fn from(c: responses::ListclosedchannelsResponse) -> Self {
Self { Self {
// Field: ListClosedChannels.closedchannels[]
closedchannels: c.closedchannels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListclosedchannelsClosedchannels closedchannels: c.closedchannels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListclosedchannelsClosedchannels
} }
} }
} }
#[allow(unused_variables,deprecated)]
impl From<responses::DecodepayFallbacks> for pb::DecodepayFallbacks {
fn from(c: responses::DecodepayFallbacks) -> Self {
Self {
item_type: c.item_type as i32,
addr: c.addr, // Rule #2 for type string?
hex: hex::decode(&c.hex).unwrap(), // Rule #2 for type hex
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodepayExtra> for pb::DecodepayExtra {
fn from(c: responses::DecodepayExtra) -> Self {
Self {
tag: c.tag, // Rule #2 for type string
data: c.data, // Rule #2 for type string
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodepayResponse> for pb::DecodepayResponse {
fn from(c: responses::DecodepayResponse) -> Self {
Self {
currency: c.currency, // Rule #2 for type string
created_at: c.created_at, // Rule #2 for type u64
expiry: c.expiry, // Rule #2 for type u64
payee: c.payee.serialize().to_vec(), // Rule #2 for type pubkey
amount_msat: c.amount_msat.map(|f| f.into()), // Rule #2 for type msat?
payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash
signature: c.signature, // Rule #2 for type signature
description: c.description, // Rule #2 for type string?
description_hash: c.description_hash.map(|v| v.to_vec()), // Rule #2 for type hash?
min_final_cltv_expiry: c.min_final_cltv_expiry, // Rule #2 for type u32
payment_secret: c.payment_secret.map(|v| v.to_vec()), // Rule #2 for type hash?
features: c.features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
// Field: DecodePay.fallbacks[]
fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
// Field: DecodePay.extra[]
extra: c.extra.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeOffer_paths> for pb::DecodeOfferPaths {
fn from(c: responses::DecodeOffer_paths) -> Self {
Self {
first_node_id: c.first_node_id.serialize().to_vec(), // Rule #2 for type pubkey
blinding: c.blinding.serialize().to_vec(), // Rule #2 for type pubkey
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeInvoice_fallbacks> for pb::DecodeInvoiceFallbacks {
fn from(c: responses::DecodeInvoice_fallbacks) -> Self {
Self {
version: c.version.into(), // Rule #2 for type u8
hex: hex::decode(&c.hex).unwrap(), // Rule #2 for type hex
address: c.address, // Rule #2 for type string?
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeFallbacks> for pb::DecodeFallbacks {
fn from(c: responses::DecodeFallbacks) -> Self {
Self {
warning_invoice_fallbacks_version_invalid: c.warning_invoice_fallbacks_version_invalid, // Rule #2 for type string?
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeExtra> for pb::DecodeExtra {
fn from(c: responses::DecodeExtra) -> Self {
Self {
tag: c.tag, // Rule #2 for type string
data: c.data, // Rule #2 for type string
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeRestrictions> for pb::DecodeRestrictions {
fn from(c: responses::DecodeRestrictions) -> Self {
Self {
// Field: Decode.restrictions[].alternatives[]
alternatives: c.alternatives.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
summary: c.summary, // Rule #2 for type string
}
}
}
#[allow(unused_variables,deprecated)]
impl From<responses::DecodeResponse> for pb::DecodeResponse {
fn from(c: responses::DecodeResponse) -> Self {
Self {
item_type: c.item_type as i32,
valid: c.valid, // Rule #2 for type boolean
offer_id: c.offer_id.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
// Field: Decode.offer_chains[]
offer_chains: c.offer_chains.map(|arr| arr.into_iter().map(|i| i.to_vec()).collect()).unwrap_or(vec![]), // Rule #3
offer_metadata: c.offer_metadata.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
offer_currency: c.offer_currency, // Rule #2 for type string?
warning_unknown_offer_currency: c.warning_unknown_offer_currency, // Rule #2 for type string?
currency_minor_unit: c.currency_minor_unit, // Rule #2 for type u32?
offer_amount: c.offer_amount, // Rule #2 for type u64?
offer_amount_msat: c.offer_amount_msat.map(|f| f.into()), // Rule #2 for type msat?
offer_description: c.offer_description, // Rule #2 for type string?
offer_issuer: c.offer_issuer, // Rule #2 for type string?
offer_features: c.offer_features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
offer_absolute_expiry: c.offer_absolute_expiry, // Rule #2 for type u64?
offer_quantity_max: c.offer_quantity_max, // Rule #2 for type u64?
// Field: Decode.offer_paths[]
offer_paths: c.offer_paths.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
offer_node_id: c.offer_node_id.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey?
warning_missing_offer_node_id: c.warning_missing_offer_node_id, // Rule #2 for type string?
warning_invalid_offer_description: c.warning_invalid_offer_description, // Rule #2 for type string?
warning_missing_offer_description: c.warning_missing_offer_description, // Rule #2 for type string?
warning_invalid_offer_currency: c.warning_invalid_offer_currency, // Rule #2 for type string?
warning_invalid_offer_issuer: c.warning_invalid_offer_issuer, // Rule #2 for type string?
invreq_metadata: c.invreq_metadata.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invreq_payer_id: c.invreq_payer_id.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invreq_chain: c.invreq_chain.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invreq_amount_msat: c.invreq_amount_msat.map(|f| f.into()), // Rule #2 for type msat?
invreq_features: c.invreq_features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invreq_quantity: c.invreq_quantity, // Rule #2 for type u64?
invreq_payer_note: c.invreq_payer_note, // Rule #2 for type string?
invreq_recurrence_counter: c.invreq_recurrence_counter, // Rule #2 for type u32?
invreq_recurrence_start: c.invreq_recurrence_start, // Rule #2 for type u32?
warning_missing_invreq_metadata: c.warning_missing_invreq_metadata, // Rule #2 for type string?
warning_missing_invreq_payer_id: c.warning_missing_invreq_payer_id, // Rule #2 for type string?
warning_invalid_invreq_payer_note: c.warning_invalid_invreq_payer_note, // Rule #2 for type string?
warning_missing_invoice_request_signature: c.warning_missing_invoice_request_signature, // Rule #2 for type string?
warning_invalid_invoice_request_signature: c.warning_invalid_invoice_request_signature, // Rule #2 for type string?
invoice_created_at: c.invoice_created_at, // Rule #2 for type u64?
invoice_relative_expiry: c.invoice_relative_expiry, // Rule #2 for type u32?
invoice_payment_hash: c.invoice_payment_hash.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invoice_amount_msat: c.invoice_amount_msat.map(|f| f.into()), // Rule #2 for type msat?
// Field: Decode.invoice_fallbacks[]
invoice_fallbacks: c.invoice_fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
invoice_features: c.invoice_features.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
invoice_node_id: c.invoice_node_id.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey?
invoice_recurrence_basetime: c.invoice_recurrence_basetime, // Rule #2 for type u64?
warning_missing_invoice_paths: c.warning_missing_invoice_paths, // Rule #2 for type string?
warning_missing_invoice_blindedpay: c.warning_missing_invoice_blindedpay, // Rule #2 for type string?
warning_missing_invoice_created_at: c.warning_missing_invoice_created_at, // Rule #2 for type string?
warning_missing_invoice_payment_hash: c.warning_missing_invoice_payment_hash, // Rule #2 for type string?
warning_missing_invoice_amount: c.warning_missing_invoice_amount, // Rule #2 for type string?
warning_missing_invoice_recurrence_basetime: c.warning_missing_invoice_recurrence_basetime, // Rule #2 for type string?
warning_missing_invoice_node_id: c.warning_missing_invoice_node_id, // Rule #2 for type string?
warning_missing_invoice_signature: c.warning_missing_invoice_signature, // Rule #2 for type string?
warning_invalid_invoice_signature: c.warning_invalid_invoice_signature, // Rule #2 for type string?
// Field: Decode.fallbacks[]
fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
created_at: c.created_at, // Rule #2 for type u64?
expiry: c.expiry, // Rule #2 for type u64?
payee: c.payee.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey?
payment_hash: c.payment_hash.map(|v| v.to_vec()), // Rule #2 for type hash?
description_hash: c.description_hash.map(|v| v.to_vec()), // Rule #2 for type hash?
min_final_cltv_expiry: c.min_final_cltv_expiry, // Rule #2 for type u32?
payment_secret: c.payment_secret.map(|v| v.to_vec()), // Rule #2 for type secret?
payment_metadata: c.payment_metadata.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
// Field: Decode.extra[]
extra: c.extra.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
unique_id: c.unique_id, // Rule #2 for type string?
version: c.version, // Rule #2 for type string?
string: c.string, // Rule #2 for type string?
// Field: Decode.restrictions[]
restrictions: c.restrictions.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
warning_rune_invalid_utf8: c.warning_rune_invalid_utf8, // Rule #2 for type string?
hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
}
}
}
#[allow(unused_variables,deprecated)] #[allow(unused_variables,deprecated)]
impl From<responses::DisconnectResponse> for pb::DisconnectResponse { impl From<responses::DisconnectResponse> for pb::DisconnectResponse {
fn from(c: responses::DisconnectResponse) -> Self { fn from(c: responses::DisconnectResponse) -> Self {
@@ -1112,6 +1326,7 @@ impl From<responses::FeeratesPerkb> for pb::FeeratesPerkb {
min_acceptable: c.min_acceptable, // Rule #2 for type u32 min_acceptable: c.min_acceptable, // Rule #2 for type u32
max_acceptable: c.max_acceptable, // Rule #2 for type u32 max_acceptable: c.max_acceptable, // Rule #2 for type u32
floor: c.floor, // Rule #2 for type u32? floor: c.floor, // Rule #2 for type u32?
// Field: Feerates.perkb.estimates[]
estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
opening: c.opening, // Rule #2 for type u32? opening: c.opening, // Rule #2 for type u32?
mutual_close: c.mutual_close, // Rule #2 for type u32? mutual_close: c.mutual_close, // Rule #2 for type u32?
@@ -1143,6 +1358,7 @@ impl From<responses::FeeratesPerkw> for pb::FeeratesPerkw {
min_acceptable: c.min_acceptable, // Rule #2 for type u32 min_acceptable: c.min_acceptable, // Rule #2 for type u32
max_acceptable: c.max_acceptable, // Rule #2 for type u32 max_acceptable: c.max_acceptable, // Rule #2 for type u32
floor: c.floor, // Rule #2 for type u32? floor: c.floor, // Rule #2 for type u32?
// Field: Feerates.perkw.estimates[]
estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 estimates: c.estimates.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
opening: c.opening, // Rule #2 for type u32? opening: c.opening, // Rule #2 for type u32?
mutual_close: c.mutual_close, // Rule #2 for type u32? mutual_close: c.mutual_close, // Rule #2 for type u32?
@@ -1213,6 +1429,7 @@ impl From<responses::GetrouteRoute> for pb::GetrouteRoute {
impl From<responses::GetrouteResponse> for pb::GetrouteResponse { impl From<responses::GetrouteResponse> for pb::GetrouteResponse {
fn from(c: responses::GetrouteResponse) -> Self { fn from(c: responses::GetrouteResponse) -> Self {
Self { Self {
// Field: GetRoute.route[]
route: c.route.into_iter().map(|i| i.into()).collect(), // Rule #3 for type GetrouteRoute route: c.route.into_iter().map(|i| i.into()).collect(), // Rule #3 for type GetrouteRoute
} }
} }
@@ -1240,6 +1457,7 @@ impl From<responses::ListforwardsForwards> for pb::ListforwardsForwards {
impl From<responses::ListforwardsResponse> for pb::ListforwardsResponse { impl From<responses::ListforwardsResponse> for pb::ListforwardsResponse {
fn from(c: responses::ListforwardsResponse) -> Self { fn from(c: responses::ListforwardsResponse) -> Self {
Self { Self {
// Field: ListForwards.forwards[]
forwards: c.forwards.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListforwardsForwards forwards: c.forwards.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListforwardsForwards
} }
} }
@@ -1269,6 +1487,7 @@ impl From<responses::ListpaysPays> for pb::ListpaysPays {
impl From<responses::ListpaysResponse> for pb::ListpaysResponse { impl From<responses::ListpaysResponse> for pb::ListpaysResponse {
fn from(c: responses::ListpaysResponse) -> Self { fn from(c: responses::ListpaysResponse) -> Self {
Self { Self {
// Field: ListPays.pays[]
pays: c.pays.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpaysPays pays: c.pays.into_iter().map(|i| i.into()).collect(), // Rule #3 for type ListpaysPays
} }
} }
@@ -1313,6 +1532,7 @@ impl From<responses::SetchannelChannels> for pb::SetchannelChannels {
impl From<responses::SetchannelResponse> for pb::SetchannelResponse { impl From<responses::SetchannelResponse> for pb::SetchannelResponse {
fn from(c: responses::SetchannelResponse) -> Self { fn from(c: responses::SetchannelResponse) -> Self {
Self { Self {
// Field: SetChannel.channels[]
channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type SetchannelChannels channels: c.channels.into_iter().map(|i| i.into()).collect(), // Rule #3 for type SetchannelChannels
} }
} }
@@ -1389,6 +1609,7 @@ impl From<requests::SendpayRoute> for pb::SendpayRoute {
impl From<requests::SendpayRequest> for pb::SendpayRequest { impl From<requests::SendpayRequest> for pb::SendpayRequest {
fn from(c: requests::SendpayRequest) -> Self { fn from(c: requests::SendpayRequest) -> Self {
Self { Self {
// Field: SendPay.route[]
route: c.route.into_iter().map(|i| i.into()).collect(), // Rule #3 for type SendpayRoute route: c.route.into_iter().map(|i| i.into()).collect(), // Rule #3 for type SendpayRoute
payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash
label: c.label, // Rule #2 for type string? label: c.label, // Rule #2 for type string?
@@ -1453,6 +1674,7 @@ impl From<requests::CloseRequest> for pb::CloseRequest {
fee_negotiation_step: c.fee_negotiation_step, // Rule #2 for type string? fee_negotiation_step: c.fee_negotiation_step, // Rule #2 for type string?
wrong_funding: c.wrong_funding.map(|o|o.into()), // Rule #2 for type outpoint? wrong_funding: c.wrong_funding.map(|o|o.into()), // Rule #2 for type outpoint?
force_lease_closed: c.force_lease_closed, // Rule #2 for type boolean? force_lease_closed: c.force_lease_closed, // Rule #2 for type boolean?
// Field: Close.feerange[]
feerange: c.feerange.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 feerange: c.feerange.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1484,6 +1706,7 @@ impl From<requests::CreateinvoiceRequest> for pb::CreateinvoiceRequest {
impl From<requests::DatastoreRequest> for pb::DatastoreRequest { impl From<requests::DatastoreRequest> for pb::DatastoreRequest {
fn from(c: requests::DatastoreRequest) -> Self { fn from(c: requests::DatastoreRequest) -> Self {
Self { Self {
// Field: Datastore.key
key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
string: c.string, // Rule #2 for type string? string: c.string, // Rule #2 for type string?
hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? hex: c.hex.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
@@ -1507,6 +1730,7 @@ impl From<requests::CreateonionHops> for pb::CreateonionHops {
impl From<requests::CreateonionRequest> for pb::CreateonionRequest { impl From<requests::CreateonionRequest> for pb::CreateonionRequest {
fn from(c: requests::CreateonionRequest) -> Self { fn from(c: requests::CreateonionRequest) -> Self {
Self { Self {
// Field: CreateOnion.hops[]
hops: c.hops.into_iter().map(|i| i.into()).collect(), // Rule #3 for type CreateonionHops hops: c.hops.into_iter().map(|i| i.into()).collect(), // Rule #3 for type CreateonionHops
assocdata: hex::decode(&c.assocdata).unwrap(), // Rule #2 for type hex assocdata: hex::decode(&c.assocdata).unwrap(), // Rule #2 for type hex
session_key: c.session_key.map(|v| v.to_vec()), // Rule #2 for type secret? session_key: c.session_key.map(|v| v.to_vec()), // Rule #2 for type secret?
@@ -1519,6 +1743,7 @@ impl From<requests::CreateonionRequest> for pb::CreateonionRequest {
impl From<requests::DeldatastoreRequest> for pb::DeldatastoreRequest { impl From<requests::DeldatastoreRequest> for pb::DeldatastoreRequest {
fn from(c: requests::DeldatastoreRequest) -> Self { fn from(c: requests::DeldatastoreRequest) -> Self {
Self { Self {
// Field: DelDatastore.key
key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string key: c.key.into_iter().map(|i| i.into()).collect(), // Rule #3 for type string
generation: c.generation, // Rule #2 for type u64? generation: c.generation, // Rule #2 for type u64?
} }
@@ -1553,9 +1778,9 @@ impl From<requests::InvoiceRequest> for pb::InvoiceRequest {
description: c.description, // Rule #2 for type string description: c.description, // Rule #2 for type string
label: c.label, // Rule #2 for type string label: c.label, // Rule #2 for type string
expiry: c.expiry, // Rule #2 for type u64? expiry: c.expiry, // Rule #2 for type u64?
// Field: Invoice.fallbacks[]
fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 fallbacks: c.fallbacks.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
preimage: c.preimage.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? preimage: c.preimage.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
exposeprivatechannels: c.exposeprivatechannels, // Rule #2 for type boolean?
cltv: c.cltv, // Rule #2 for type u32? cltv: c.cltv, // Rule #2 for type u32?
deschashonly: c.deschashonly, // Rule #2 for type boolean? deschashonly: c.deschashonly, // Rule #2 for type boolean?
} }
@@ -1566,6 +1791,7 @@ impl From<requests::InvoiceRequest> for pb::InvoiceRequest {
impl From<requests::ListdatastoreRequest> for pb::ListdatastoreRequest { impl From<requests::ListdatastoreRequest> for pb::ListdatastoreRequest {
fn from(c: requests::ListdatastoreRequest) -> Self { fn from(c: requests::ListdatastoreRequest) -> Self {
Self { Self {
// Field: ListDatastore.key
key: c.key.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 key: c.key.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1602,6 +1828,7 @@ impl From<requests::SendonionRequest> for pb::SendonionRequest {
first_hop: Some(c.first_hop.into()), first_hop: Some(c.first_hop.into()),
payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash payment_hash: c.payment_hash.to_vec(), // Rule #2 for type hash
label: c.label, // Rule #2 for type string? label: c.label, // Rule #2 for type string?
// Field: SendOnion.shared_secrets[]
shared_secrets: c.shared_secrets.map(|arr| arr.into_iter().map(|i| i.to_vec()).collect()).unwrap_or(vec![]), // Rule #3 shared_secrets: c.shared_secrets.map(|arr| arr.into_iter().map(|i| i.to_vec()).collect()).unwrap_or(vec![]), // Rule #3
partid: c.partid.map(|v| v.into()), // Rule #2 for type u16? partid: c.partid.map(|v| v.into()), // Rule #2 for type u16?
bolt11: c.bolt11, // Rule #2 for type string? bolt11: c.bolt11, // Rule #2 for type string?
@@ -1645,6 +1872,7 @@ impl From<requests::PayRequest> for pb::PayRequest {
maxdelay: c.maxdelay.map(|v| v.into()), // Rule #2 for type u16? maxdelay: c.maxdelay.map(|v| v.into()), // Rule #2 for type u16?
exemptfee: c.exemptfee.map(|f| f.into()), // Rule #2 for type msat? exemptfee: c.exemptfee.map(|f| f.into()), // Rule #2 for type msat?
localinvreqid: c.localinvreqid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex? localinvreqid: c.localinvreqid.map(|v| hex::decode(v).unwrap()), // Rule #2 for type hex?
// Field: Pay.exclude
exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
maxfee: c.maxfee.map(|f| f.into()), // Rule #2 for type msat? maxfee: c.maxfee.map(|f| f.into()), // Rule #2 for type msat?
description: c.description, // Rule #2 for type string? description: c.description, // Rule #2 for type string?
@@ -1709,6 +1937,7 @@ impl From<requests::WithdrawRequest> for pb::WithdrawRequest {
satoshi: c.satoshi.map(|o|o.into()), // Rule #2 for type msat_or_all? satoshi: c.satoshi.map(|o|o.into()), // Rule #2 for type msat_or_all?
feerate: c.feerate.map(|o|o.into()), // Rule #2 for type feerate? feerate: c.feerate.map(|o|o.into()), // Rule #2 for type feerate?
minconf: c.minconf.map(|v| v.into()), // Rule #2 for type u16? minconf: c.minconf.map(|v| v.into()), // Rule #2 for type u16?
// Field: Withdraw.utxos[]
utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1762,6 +1991,7 @@ impl From<requests::SignpsbtRequest> for pb::SignpsbtRequest {
fn from(c: requests::SignpsbtRequest) -> Self { fn from(c: requests::SignpsbtRequest) -> Self {
Self { Self {
psbt: c.psbt, // Rule #2 for type string psbt: c.psbt, // Rule #2 for type string
// Field: SignPsbt.signonly[]
signonly: c.signonly.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 signonly: c.signonly.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1774,6 +2004,7 @@ impl From<requests::UtxopsbtRequest> for pb::UtxopsbtRequest {
satoshi: Some(c.satoshi.into()), // Rule #2 for type msat satoshi: Some(c.satoshi.into()), // Rule #2 for type msat
feerate: Some(c.feerate.into()), // Rule #2 for type feerate feerate: Some(c.feerate.into()), // Rule #2 for type feerate
startweight: c.startweight, // Rule #2 for type u32 startweight: c.startweight, // Rule #2 for type u32
// Field: UtxoPsbt.utxos[]
utxos: c.utxos.into_iter().map(|i| i.into()).collect(), // Rule #3 for type outpoint utxos: c.utxos.into_iter().map(|i| i.into()).collect(), // Rule #3 for type outpoint
reserve: c.reserve, // Rule #2 for type u32? reserve: c.reserve, // Rule #2 for type u32?
reservedok: c.reservedok, // Rule #2 for type boolean? reservedok: c.reservedok, // Rule #2 for type boolean?
@@ -1797,9 +2028,11 @@ impl From<requests::TxdiscardRequest> for pb::TxdiscardRequest {
impl From<requests::TxprepareRequest> for pb::TxprepareRequest { impl From<requests::TxprepareRequest> for pb::TxprepareRequest {
fn from(c: requests::TxprepareRequest) -> Self { fn from(c: requests::TxprepareRequest) -> Self {
Self { Self {
// Field: TxPrepare.outputs[]
outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type outputdesc outputs: c.outputs.into_iter().map(|i| i.into()).collect(), // Rule #3 for type outputdesc
feerate: c.feerate.map(|o|o.into()), // Rule #2 for type feerate? feerate: c.feerate.map(|o|o.into()), // Rule #2 for type feerate?
minconf: c.minconf, // Rule #2 for type u32? minconf: c.minconf, // Rule #2 for type u32?
// Field: TxPrepare.utxos[]
utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
} }
} }
@@ -1832,6 +2065,25 @@ impl From<requests::ListclosedchannelsRequest> for pb::ListclosedchannelsRequest
} }
} }
#[allow(unused_variables,deprecated)]
impl From<requests::DecodepayRequest> for pb::DecodepayRequest {
fn from(c: requests::DecodepayRequest) -> Self {
Self {
bolt11: c.bolt11, // Rule #2 for type string
description: c.description, // Rule #2 for type string?
}
}
}
#[allow(unused_variables,deprecated)]
impl From<requests::DecodeRequest> for pb::DecodeRequest {
fn from(c: requests::DecodeRequest) -> Self {
Self {
string: c.string, // Rule #2 for type string
}
}
}
#[allow(unused_variables,deprecated)] #[allow(unused_variables,deprecated)]
impl From<requests::DisconnectRequest> for pb::DisconnectRequest { impl From<requests::DisconnectRequest> for pb::DisconnectRequest {
fn from(c: requests::DisconnectRequest) -> Self { fn from(c: requests::DisconnectRequest) -> Self {
@@ -1864,6 +2116,7 @@ impl From<requests::FundchannelRequest> for pb::FundchannelRequest {
close_to: c.close_to, // Rule #2 for type string? close_to: c.close_to, // Rule #2 for type string?
request_amt: c.request_amt.map(|f| f.into()), // Rule #2 for type msat? request_amt: c.request_amt.map(|f| f.into()), // Rule #2 for type msat?
compact_lease: c.compact_lease, // Rule #2 for type string? compact_lease: c.compact_lease, // Rule #2 for type string?
// Field: FundChannel.utxos[]
utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 utxos: c.utxos.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
mindepth: c.mindepth, // Rule #2 for type u32? mindepth: c.mindepth, // Rule #2 for type u32?
reserve: c.reserve.map(|f| f.into()), // Rule #2 for type msat? reserve: c.reserve.map(|f| f.into()), // Rule #2 for type msat?
@@ -1881,6 +2134,7 @@ impl From<requests::GetrouteRequest> for pb::GetrouteRequest {
cltv: c.cltv, // Rule #2 for type number? cltv: c.cltv, // Rule #2 for type number?
fromid: c.fromid.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey? fromid: c.fromid.map(|v| v.serialize().to_vec()), // Rule #2 for type pubkey?
fuzzpercent: c.fuzzpercent, // Rule #2 for type u32? fuzzpercent: c.fuzzpercent, // Rule #2 for type u32?
// Field: GetRoute.exclude[]
exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3 exclude: c.exclude.map(|arr| arr.into_iter().map(|i| i.into()).collect()).unwrap_or(vec![]), // Rule #3
maxhops: c.maxhops, // Rule #2 for type u32? maxhops: c.maxhops, // Rule #2 for type u32?
} }
@@ -2180,7 +2434,6 @@ impl From<pb::InvoiceRequest> for requests::InvoiceRequest {
expiry: c.expiry, // Rule #1 for type u64? expiry: c.expiry, // Rule #1 for type u64?
fallbacks: Some(c.fallbacks.into_iter().map(|s| s.into()).collect()), // Rule #4 fallbacks: Some(c.fallbacks.into_iter().map(|s| s.into()).collect()), // Rule #4
preimage: c.preimage.map(|v| hex::encode(v)), // Rule #1 for type hex? preimage: c.preimage.map(|v| hex::encode(v)), // Rule #1 for type hex?
exposeprivatechannels: c.exposeprivatechannels, // Rule #1 for type boolean?
cltv: c.cltv, // Rule #1 for type u32? cltv: c.cltv, // Rule #1 for type u32?
deschashonly: c.deschashonly, // Rule #1 for type boolean? deschashonly: c.deschashonly, // Rule #1 for type boolean?
} }
@@ -2457,6 +2710,25 @@ impl From<pb::ListclosedchannelsRequest> for requests::ListclosedchannelsRequest
} }
} }
#[allow(unused_variables,deprecated)]
impl From<pb::DecodepayRequest> for requests::DecodepayRequest {
fn from(c: pb::DecodepayRequest) -> Self {
Self {
bolt11: c.bolt11, // Rule #1 for type string
description: c.description, // Rule #1 for type string?
}
}
}
#[allow(unused_variables,deprecated)]
impl From<pb::DecodeRequest> for requests::DecodeRequest {
fn from(c: pb::DecodeRequest) -> Self {
Self {
string: c.string, // Rule #1 for type string
}
}
}
#[allow(unused_variables,deprecated)] #[allow(unused_variables,deprecated)]
impl From<pb::DisconnectRequest> for requests::DisconnectRequest { impl From<pb::DisconnectRequest> for requests::DisconnectRequest {
fn from(c: pb::DisconnectRequest) -> Self { fn from(c: pb::DisconnectRequest) -> Self {

View File

@@ -1274,6 +1274,70 @@ async fn list_closed_channels(
} }
async fn decode_pay(
&self,
request: tonic::Request<pb::DecodepayRequest>,
) -> Result<tonic::Response<pb::DecodepayResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::DecodepayRequest = req.into();
debug!("Client asked for decode_pay");
trace!("decode_pay 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::DecodePay(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method DecodePay: {:?}", e)))?;
match result {
Response::DecodePay(r) => {
trace!("decode_pay response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call DecodePay",
r
)
)),
}
}
async fn decode(
&self,
request: tonic::Request<pb::DecodeRequest>,
) -> Result<tonic::Response<pb::DecodeResponse>, tonic::Status> {
let req = request.into_inner();
let req: requests::DecodeRequest = req.into();
debug!("Client asked for decode");
trace!("decode 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::Decode(req))
.await
.map_err(|e| Status::new(
Code::Unknown,
format!("Error calling method Decode: {:?}", e)))?;
match result {
Response::Decode(r) => {
trace!("decode response: {:?}", r);
Ok(tonic::Response::new(r.into()))
},
r => Err(Status::new(
Code::Internal,
format!(
"Unexpected result {:?} to method call Decode",
r
)
)),
}
}
async fn disconnect( async fn disconnect(
&self, &self,
request: tonic::Request<pb::DisconnectRequest>, request: tonic::Request<pb::DisconnectRequest>,

673
cln-rpc/src/model.rs generated
View File

@@ -55,6 +55,8 @@ pub enum Request {
TxSend(requests::TxsendRequest), TxSend(requests::TxsendRequest),
ListPeerChannels(requests::ListpeerchannelsRequest), ListPeerChannels(requests::ListpeerchannelsRequest),
ListClosedChannels(requests::ListclosedchannelsRequest), ListClosedChannels(requests::ListclosedchannelsRequest),
DecodePay(requests::DecodepayRequest),
Decode(requests::DecodeRequest),
Disconnect(requests::DisconnectRequest), Disconnect(requests::DisconnectRequest),
Feerates(requests::FeeratesRequest), Feerates(requests::FeeratesRequest),
FundChannel(requests::FundchannelRequest), FundChannel(requests::FundchannelRequest),
@@ -112,6 +114,8 @@ pub enum Response {
TxSend(responses::TxsendResponse), TxSend(responses::TxsendResponse),
ListPeerChannels(responses::ListpeerchannelsResponse), ListPeerChannels(responses::ListpeerchannelsResponse),
ListClosedChannels(responses::ListclosedchannelsResponse), ListClosedChannels(responses::ListclosedchannelsResponse),
DecodePay(responses::DecodepayResponse),
Decode(responses::DecodeResponse),
Disconnect(responses::DisconnectResponse), Disconnect(responses::DisconnectResponse),
Feerates(responses::FeeratesResponse), Feerates(responses::FeeratesResponse),
FundChannel(responses::FundchannelResponse), FundChannel(responses::FundchannelResponse),
@@ -522,8 +526,6 @@ pub mod requests {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub preimage: Option<String>, pub preimage: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub exposeprivatechannels: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cltv: Option<u32>, pub cltv: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub deschashonly: Option<bool>, pub deschashonly: Option<bool>,
@@ -1038,6 +1040,38 @@ pub mod requests {
type Response = super::responses::ListclosedchannelsResponse; type Response = super::responses::ListclosedchannelsResponse;
} }
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodepayRequest {
pub bolt11: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
impl From<DecodepayRequest> for Request {
fn from(r: DecodepayRequest) -> Self {
Request::DecodePay(r)
}
}
impl IntoRequest for DecodepayRequest {
type Response = super::responses::DecodepayResponse;
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeRequest {
pub string: String,
}
impl From<DecodeRequest> for Request {
fn from(r: DecodeRequest) -> Self {
Request::Decode(r)
}
}
impl IntoRequest for DecodeRequest {
type Response = super::responses::DecodeResponse;
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DisconnectRequest { pub struct DisconnectRequest {
pub id: PublicKey, pub id: PublicKey,
@@ -1612,18 +1646,6 @@ pub mod responses {
pub remote: Option<ShortChannelId>, pub remote: Option<ShortChannelId>,
} }
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeersPeersChannelsState_changes {
pub timestamp: String,
// Path `ListPeers.peers[].channels[].state_changes[].old_state`
pub old_state: ChannelState,
// Path `ListPeers.peers[].channels[].state_changes[].new_state`
pub new_state: ChannelState,
// Path `ListPeers.peers[].channels[].state_changes[].cause`
pub cause: ChannelStateChangeCause,
pub message: String,
}
/// Whether it came from peer, or is going to peer /// Whether it came from peer, or is going to peer
#[derive(Copy, Clone, Debug, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeersPeersChannelsHtlcsDirection { pub enum ListpeersPeersChannelsHtlcsDirection {
@@ -1655,6 +1677,8 @@ pub mod responses {
pub local_trimmed: Option<bool>, pub local_trimmed: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>, pub status: Option<String>,
// Path `ListPeers.peers[].channels[].htlcs[].state`
pub state: HtlcState,
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
@@ -1735,8 +1759,6 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub alias: Option<ListpeersPeersChannelsAlias>, pub alias: Option<ListpeersPeersChannelsAlias>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")] #[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub state_changes: Option<Vec<ListpeersPeersChannelsState_changes>>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub status: Option<Vec<String>>, pub status: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub in_payments_offered: Option<u64>, pub in_payments_offered: Option<u64>,
@@ -3284,42 +3306,6 @@ pub mod responses {
} }
} }
} }
/// Name of feature bit
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsChannel_typeNames {
#[serde(rename = "static_remotekey/even")]
STATIC_REMOTEKEY_EVEN,
#[serde(rename = "anchor_outputs/even")]
ANCHOR_OUTPUTS_EVEN,
#[serde(rename = "anchors_zero_fee_htlc_tx/even")]
ANCHORS_ZERO_FEE_HTLC_TX_EVEN,
#[serde(rename = "scid_alias/even")]
SCID_ALIAS_EVEN,
#[serde(rename = "zeroconf/even")]
ZEROCONF_EVEN,
}
impl TryFrom<i32> for ListpeerchannelsChannelsChannel_typeNames {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsChannel_typeNames, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsChannel_typeNames::STATIC_REMOTEKEY_EVEN),
1 => Ok(ListpeerchannelsChannelsChannel_typeNames::ANCHOR_OUTPUTS_EVEN),
2 => Ok(ListpeerchannelsChannelsChannel_typeNames::ANCHORS_ZERO_FEE_HTLC_TX_EVEN),
3 => Ok(ListpeerchannelsChannelsChannel_typeNames::SCID_ALIAS_EVEN),
4 => Ok(ListpeerchannelsChannelsChannel_typeNames::ZEROCONF_EVEN),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsChannel_typeNames", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeerchannelsChannelsChannel_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<ListpeerchannelsChannelsChannel_typeNames>>,
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeerchannelsChannelsFeerate { pub struct ListpeerchannelsChannelsFeerate {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -3344,69 +3330,6 @@ pub mod responses {
pub scratch_txid: Option<String>, pub scratch_txid: Option<String>,
} }
/// Who initiated the channel
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsOpener {
#[serde(rename = "local")]
LOCAL,
#[serde(rename = "remote")]
REMOTE,
}
impl TryFrom<i32> for ListpeerchannelsChannelsOpener {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsOpener, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsOpener::LOCAL),
1 => Ok(ListpeerchannelsChannelsOpener::REMOTE),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsOpener", o)),
}
}
}
/// Who initiated the channel close (only present if closing)
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsCloser {
#[serde(rename = "local")]
LOCAL,
#[serde(rename = "remote")]
REMOTE,
}
impl TryFrom<i32> for ListpeerchannelsChannelsCloser {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsCloser, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsCloser::LOCAL),
1 => Ok(ListpeerchannelsChannelsCloser::REMOTE),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsCloser", o)),
}
}
}
/// BOLT #9 features which apply to this channel
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsFeatures {
#[serde(rename = "option_static_remotekey")]
OPTION_STATIC_REMOTEKEY,
#[serde(rename = "option_anchor_outputs")]
OPTION_ANCHOR_OUTPUTS,
#[serde(rename = "option_scid_alias")]
OPTION_SCID_ALIAS,
#[serde(rename = "option_zeroconf")]
OPTION_ZEROCONF,
}
impl TryFrom<i32> for ListpeerchannelsChannelsFeatures {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsFeatures, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsFeatures::OPTION_STATIC_REMOTEKEY),
1 => Ok(ListpeerchannelsChannelsFeatures::OPTION_ANCHOR_OUTPUTS),
2 => Ok(ListpeerchannelsChannelsFeatures::OPTION_SCID_ALIAS),
3 => Ok(ListpeerchannelsChannelsFeatures::OPTION_ZEROCONF),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsFeatures", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeerchannelsChannelsFunding { pub struct ListpeerchannelsChannelsFunding {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -3429,143 +3352,6 @@ pub mod responses {
pub remote: Option<ShortChannelId>, pub remote: Option<ShortChannelId>,
} }
/// Previous state
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsState_changesOld_state {
#[serde(rename = "OPENINGD")]
OPENINGD,
#[serde(rename = "CHANNELD_AWAITING_LOCKIN")]
CHANNELD_AWAITING_LOCKIN,
#[serde(rename = "CHANNELD_NORMAL")]
CHANNELD_NORMAL,
#[serde(rename = "CHANNELD_SHUTTING_DOWN")]
CHANNELD_SHUTTING_DOWN,
#[serde(rename = "CLOSINGD_SIGEXCHANGE")]
CLOSINGD_SIGEXCHANGE,
#[serde(rename = "CLOSINGD_COMPLETE")]
CLOSINGD_COMPLETE,
#[serde(rename = "AWAITING_UNILATERAL")]
AWAITING_UNILATERAL,
#[serde(rename = "FUNDING_SPEND_SEEN")]
FUNDING_SPEND_SEEN,
#[serde(rename = "ONCHAIN")]
ONCHAIN,
#[serde(rename = "DUALOPEND_OPEN_INIT")]
DUALOPEND_OPEN_INIT,
#[serde(rename = "DUALOPEND_AWAITING_LOCKIN")]
DUALOPEND_AWAITING_LOCKIN,
}
impl TryFrom<i32> for ListpeerchannelsChannelsState_changesOld_state {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsState_changesOld_state, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsState_changesOld_state::OPENINGD),
1 => Ok(ListpeerchannelsChannelsState_changesOld_state::CHANNELD_AWAITING_LOCKIN),
2 => Ok(ListpeerchannelsChannelsState_changesOld_state::CHANNELD_NORMAL),
3 => Ok(ListpeerchannelsChannelsState_changesOld_state::CHANNELD_SHUTTING_DOWN),
4 => Ok(ListpeerchannelsChannelsState_changesOld_state::CLOSINGD_SIGEXCHANGE),
5 => Ok(ListpeerchannelsChannelsState_changesOld_state::CLOSINGD_COMPLETE),
6 => Ok(ListpeerchannelsChannelsState_changesOld_state::AWAITING_UNILATERAL),
7 => Ok(ListpeerchannelsChannelsState_changesOld_state::FUNDING_SPEND_SEEN),
8 => Ok(ListpeerchannelsChannelsState_changesOld_state::ONCHAIN),
9 => Ok(ListpeerchannelsChannelsState_changesOld_state::DUALOPEND_OPEN_INIT),
10 => Ok(ListpeerchannelsChannelsState_changesOld_state::DUALOPEND_AWAITING_LOCKIN),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsState_changesOld_state", o)),
}
}
}
/// New state
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsState_changesNew_state {
#[serde(rename = "OPENINGD")]
OPENINGD,
#[serde(rename = "CHANNELD_AWAITING_LOCKIN")]
CHANNELD_AWAITING_LOCKIN,
#[serde(rename = "CHANNELD_NORMAL")]
CHANNELD_NORMAL,
#[serde(rename = "CHANNELD_SHUTTING_DOWN")]
CHANNELD_SHUTTING_DOWN,
#[serde(rename = "CLOSINGD_SIGEXCHANGE")]
CLOSINGD_SIGEXCHANGE,
#[serde(rename = "CLOSINGD_COMPLETE")]
CLOSINGD_COMPLETE,
#[serde(rename = "AWAITING_UNILATERAL")]
AWAITING_UNILATERAL,
#[serde(rename = "FUNDING_SPEND_SEEN")]
FUNDING_SPEND_SEEN,
#[serde(rename = "ONCHAIN")]
ONCHAIN,
#[serde(rename = "DUALOPEND_OPEN_INIT")]
DUALOPEND_OPEN_INIT,
#[serde(rename = "DUALOPEND_AWAITING_LOCKIN")]
DUALOPEND_AWAITING_LOCKIN,
}
impl TryFrom<i32> for ListpeerchannelsChannelsState_changesNew_state {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsState_changesNew_state, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsState_changesNew_state::OPENINGD),
1 => Ok(ListpeerchannelsChannelsState_changesNew_state::CHANNELD_AWAITING_LOCKIN),
2 => Ok(ListpeerchannelsChannelsState_changesNew_state::CHANNELD_NORMAL),
3 => Ok(ListpeerchannelsChannelsState_changesNew_state::CHANNELD_SHUTTING_DOWN),
4 => Ok(ListpeerchannelsChannelsState_changesNew_state::CLOSINGD_SIGEXCHANGE),
5 => Ok(ListpeerchannelsChannelsState_changesNew_state::CLOSINGD_COMPLETE),
6 => Ok(ListpeerchannelsChannelsState_changesNew_state::AWAITING_UNILATERAL),
7 => Ok(ListpeerchannelsChannelsState_changesNew_state::FUNDING_SPEND_SEEN),
8 => Ok(ListpeerchannelsChannelsState_changesNew_state::ONCHAIN),
9 => Ok(ListpeerchannelsChannelsState_changesNew_state::DUALOPEND_OPEN_INIT),
10 => Ok(ListpeerchannelsChannelsState_changesNew_state::DUALOPEND_AWAITING_LOCKIN),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsState_changesNew_state", o)),
}
}
}
/// What caused the change
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsState_changesCause {
#[serde(rename = "unknown")]
UNKNOWN,
#[serde(rename = "local")]
LOCAL,
#[serde(rename = "user")]
USER,
#[serde(rename = "remote")]
REMOTE,
#[serde(rename = "protocol")]
PROTOCOL,
#[serde(rename = "onchain")]
ONCHAIN,
}
impl TryFrom<i32> for ListpeerchannelsChannelsState_changesCause {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsState_changesCause, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsState_changesCause::UNKNOWN),
1 => Ok(ListpeerchannelsChannelsState_changesCause::LOCAL),
2 => Ok(ListpeerchannelsChannelsState_changesCause::USER),
3 => Ok(ListpeerchannelsChannelsState_changesCause::REMOTE),
4 => Ok(ListpeerchannelsChannelsState_changesCause::PROTOCOL),
5 => Ok(ListpeerchannelsChannelsState_changesCause::ONCHAIN),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsState_changesCause", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeerchannelsChannelsState_changes {
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub old_state: Option<ListpeerchannelsChannelsState_changesOld_state>,
#[serde(skip_serializing_if = "Option::is_none")]
pub new_state: Option<ListpeerchannelsChannelsState_changesNew_state>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cause: Option<ListpeerchannelsChannelsState_changesCause>,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
/// Whether it came from peer, or is going to peer /// Whether it came from peer, or is going to peer
#[derive(Copy, Clone, Debug, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsHtlcsDirection { pub enum ListpeerchannelsChannelsHtlcsDirection {
@@ -3585,49 +3371,6 @@ pub mod responses {
} }
} }
} }
/// Status of the HTLC
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListpeerchannelsChannelsHtlcsState {
#[serde(rename = "SENT_ADD_HTLC")]
SENT_ADD_HTLC,
#[serde(rename = "SENT_ADD_COMMIT")]
SENT_ADD_COMMIT,
#[serde(rename = "RCVD_ADD_REVOCATION")]
RCVD_ADD_REVOCATION,
#[serde(rename = "RCVD_ADD_ACK_COMMIT")]
RCVD_ADD_ACK_COMMIT,
#[serde(rename = "SENT_ADD_ACK_REVOCATION")]
SENT_ADD_ACK_REVOCATION,
#[serde(rename = "RCVD_REMOVE_HTLC")]
RCVD_REMOVE_HTLC,
#[serde(rename = "RCVD_REMOVE_COMMIT")]
RCVD_REMOVE_COMMIT,
#[serde(rename = "SENT_REMOVE_REVOCATION")]
SENT_REMOVE_REVOCATION,
#[serde(rename = "SENT_REMOVE_ACK_COMMIT")]
SENT_REMOVE_ACK_COMMIT,
#[serde(rename = "RCVD_REMOVE_ACK_REVOCATION")]
RCVD_REMOVE_ACK_REVOCATION,
}
impl TryFrom<i32> for ListpeerchannelsChannelsHtlcsState {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListpeerchannelsChannelsHtlcsState, anyhow::Error> {
match c {
0 => Ok(ListpeerchannelsChannelsHtlcsState::SENT_ADD_HTLC),
1 => Ok(ListpeerchannelsChannelsHtlcsState::SENT_ADD_COMMIT),
2 => Ok(ListpeerchannelsChannelsHtlcsState::RCVD_ADD_REVOCATION),
3 => Ok(ListpeerchannelsChannelsHtlcsState::RCVD_ADD_ACK_COMMIT),
4 => Ok(ListpeerchannelsChannelsHtlcsState::SENT_ADD_ACK_REVOCATION),
5 => Ok(ListpeerchannelsChannelsHtlcsState::RCVD_REMOVE_HTLC),
6 => Ok(ListpeerchannelsChannelsHtlcsState::RCVD_REMOVE_COMMIT),
7 => Ok(ListpeerchannelsChannelsHtlcsState::SENT_REMOVE_REVOCATION),
8 => Ok(ListpeerchannelsChannelsHtlcsState::SENT_REMOVE_ACK_COMMIT),
9 => Ok(ListpeerchannelsChannelsHtlcsState::RCVD_REMOVE_ACK_REVOCATION),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListpeerchannelsChannelsHtlcsState", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListpeerchannelsChannelsHtlcs { pub struct ListpeerchannelsChannelsHtlcs {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -3645,7 +3388,7 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>, pub status: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<ListpeerchannelsChannelsHtlcsState>, pub state: Option<HtlcState>,
} }
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
@@ -3659,8 +3402,6 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub scratch_txid: Option<String>, pub scratch_txid: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub channel_type: Option<ListpeerchannelsChannelsChannel_type>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feerate: Option<ListpeerchannelsChannelsFeerate>, pub feerate: Option<ListpeerchannelsChannelsFeerate>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<String>, pub owner: Option<String>,
@@ -3687,11 +3428,9 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub private: Option<bool>, pub private: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub opener: Option<ListpeerchannelsChannelsOpener>, pub opener: Option<ChannelSide>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub closer: Option<ListpeerchannelsChannelsCloser>, pub closer: Option<ChannelSide>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub features: Option<Vec<ListpeerchannelsChannelsFeatures>>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub funding: Option<ListpeerchannelsChannelsFunding>, pub funding: Option<ListpeerchannelsChannelsFunding>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -3733,8 +3472,6 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub alias: Option<ListpeerchannelsChannelsAlias>, pub alias: Option<ListpeerchannelsChannelsAlias>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")] #[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub state_changes: Option<Vec<ListpeerchannelsChannelsState_changes>>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub status: Option<Vec<String>>, pub status: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub in_payments_offered: Option<u64>, pub in_payments_offered: Option<u64>,
@@ -3783,40 +3520,6 @@ pub mod responses {
pub remote: Option<ShortChannelId>, pub remote: Option<ShortChannelId>,
} }
/// Name of feature bit
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListclosedchannelsClosedchannelsChannel_typeNames {
#[serde(rename = "static_remotekey/even")]
STATIC_REMOTEKEY_EVEN,
#[serde(rename = "anchor_outputs/even")]
ANCHOR_OUTPUTS_EVEN,
#[serde(rename = "anchors_zero_fee_htlc_tx/even")]
ANCHORS_ZERO_FEE_HTLC_TX_EVEN,
#[serde(rename = "scid_alias/even")]
SCID_ALIAS_EVEN,
#[serde(rename = "zeroconf/even")]
ZEROCONF_EVEN,
}
impl TryFrom<i32> for ListclosedchannelsClosedchannelsChannel_typeNames {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<ListclosedchannelsClosedchannelsChannel_typeNames, anyhow::Error> {
match c {
0 => Ok(ListclosedchannelsClosedchannelsChannel_typeNames::STATIC_REMOTEKEY_EVEN),
1 => Ok(ListclosedchannelsClosedchannelsChannel_typeNames::ANCHOR_OUTPUTS_EVEN),
2 => Ok(ListclosedchannelsClosedchannelsChannel_typeNames::ANCHORS_ZERO_FEE_HTLC_TX_EVEN),
3 => Ok(ListclosedchannelsClosedchannelsChannel_typeNames::SCID_ALIAS_EVEN),
4 => Ok(ListclosedchannelsClosedchannelsChannel_typeNames::ZEROCONF_EVEN),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ListclosedchannelsClosedchannelsChannel_typeNames", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ListclosedchannelsClosedchannelsChannel_type {
pub bits: Vec<u32>,
pub names: Vec<ListclosedchannelsClosedchannelsChannel_typeNames>,
}
/// What caused the channel to close /// What caused the channel to close
#[derive(Copy, Clone, Debug, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum ListclosedchannelsClosedchannelsClose_cause { pub enum ListclosedchannelsClosedchannelsClose_cause {
@@ -3862,8 +3565,6 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub closer: Option<ChannelSide>, pub closer: Option<ChannelSide>,
pub private: bool, pub private: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_type: Option<ListclosedchannelsClosedchannelsChannel_type>,
pub total_local_commitments: u64, pub total_local_commitments: u64,
pub total_remote_commitments: u64, pub total_remote_commitments: u64,
pub total_htlcs_sent: u64, pub total_htlcs_sent: u64,
@@ -3904,6 +3605,298 @@ pub mod responses {
} }
} }
/// the address type (if known)
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum DecodepayFallbacksType {
#[serde(rename = "P2PKH")]
P2PKH,
#[serde(rename = "P2SH")]
P2SH,
#[serde(rename = "P2WPKH")]
P2WPKH,
#[serde(rename = "P2WSH")]
P2WSH,
}
impl TryFrom<i32> for DecodepayFallbacksType {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<DecodepayFallbacksType, anyhow::Error> {
match c {
0 => Ok(DecodepayFallbacksType::P2PKH),
1 => Ok(DecodepayFallbacksType::P2SH),
2 => Ok(DecodepayFallbacksType::P2WPKH),
3 => Ok(DecodepayFallbacksType::P2WSH),
o => Err(anyhow::anyhow!("Unknown variant {} for enum DecodepayFallbacksType", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodepayFallbacks {
// Path `DecodePay.fallbacks[].type`
#[serde(rename = "type")]
pub item_type: DecodepayFallbacksType,
#[serde(skip_serializing_if = "Option::is_none")]
pub addr: Option<String>,
pub hex: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodepayExtra {
pub tag: String,
pub data: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodepayResponse {
pub currency: String,
pub created_at: u64,
pub expiry: u64,
pub payee: PublicKey,
#[serde(skip_serializing_if = "Option::is_none")]
pub amount_msat: Option<Amount>,
pub payment_hash: Sha256,
pub signature: Vec<u8>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description_hash: Option<Sha256>,
pub min_final_cltv_expiry: u32,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_secret: Option<Sha256>,
#[serde(skip_serializing_if = "Option::is_none")]
pub features: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_metadata: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub fallbacks: Option<Vec<DecodepayFallbacks>>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub extra: Option<Vec<DecodepayExtra>>,
}
impl TryFrom<Response> for DecodepayResponse {
type Error = super::TryFromResponseError;
fn try_from(response: Response) -> Result<Self, Self::Error> {
match response {
Response::DecodePay(response) => Ok(response),
_ => Err(TryFromResponseError)
}
}
}
/// what kind of object it decoded to
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
pub enum DecodeType {
#[serde(rename = "bolt12 offer")]
BOLT12_OFFER,
#[serde(rename = "bolt12 invoice")]
BOLT12_INVOICE,
#[serde(rename = "bolt12 invoice_request")]
BOLT12_INVOICE_REQUEST,
#[serde(rename = "bolt11 invoice")]
BOLT11_INVOICE,
#[serde(rename = "rune")]
RUNE,
}
impl TryFrom<i32> for DecodeType {
type Error = anyhow::Error;
fn try_from(c: i32) -> Result<DecodeType, anyhow::Error> {
match c {
0 => Ok(DecodeType::BOLT12_OFFER),
1 => Ok(DecodeType::BOLT12_INVOICE),
2 => Ok(DecodeType::BOLT12_INVOICE_REQUEST),
3 => Ok(DecodeType::BOLT11_INVOICE),
4 => Ok(DecodeType::RUNE),
o => Err(anyhow::anyhow!("Unknown variant {} for enum DecodeType", o)),
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeOffer_paths {
pub first_node_id: PublicKey,
pub blinding: PublicKey,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeInvoice_fallbacks {
pub version: u8,
pub hex: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeFallbacks {
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invoice_fallbacks_version_invalid: Option<String>,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeExtra {
pub tag: String,
pub data: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeRestrictions {
pub alternatives: Vec<String>,
pub summary: String,
}
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DecodeResponse {
// Path `Decode.type`
#[serde(rename = "type")]
pub item_type: DecodeType,
pub valid: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_id: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub offer_chains: Option<Vec<Sha256>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_metadata: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_currency: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_unknown_offer_currency: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub currency_minor_unit: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_amount: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_amount_msat: Option<Amount>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_issuer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_features: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_absolute_expiry: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_quantity_max: Option<u64>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub offer_paths: Option<Vec<DecodeOffer_paths>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub offer_node_id: Option<PublicKey>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_offer_node_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_offer_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_offer_description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_offer_currency: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_offer_issuer: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_metadata: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_payer_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_chain: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_amount_msat: Option<Amount>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_features: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_quantity: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_payer_note: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_recurrence_counter: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invreq_recurrence_start: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invreq_metadata: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invreq_payer_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_invreq_payer_note: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_request_signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_invoice_request_signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_created_at: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_relative_expiry: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_payment_hash: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_amount_msat: Option<Amount>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub invoice_fallbacks: Option<Vec<DecodeInvoice_fallbacks>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_features: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_node_id: Option<PublicKey>,
#[serde(skip_serializing_if = "Option::is_none")]
pub invoice_recurrence_basetime: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_paths: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_blindedpay: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_created_at: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_payment_hash: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_amount: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_recurrence_basetime: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_node_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_missing_invoice_signature: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_invalid_invoice_signature: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub fallbacks: Option<Vec<DecodeFallbacks>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expiry: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payee: Option<PublicKey>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_hash: Option<Sha256>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description_hash: Option<Sha256>,
#[serde(skip_serializing_if = "Option::is_none")]
pub min_final_cltv_expiry: Option<u32>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_secret: Option<Secret>,
#[serde(skip_serializing_if = "Option::is_none")]
pub payment_metadata: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub extra: Option<Vec<DecodeExtra>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub string: Option<String>,
#[serde(skip_serializing_if = "crate::is_none_or_empty")]
pub restrictions: Option<Vec<DecodeRestrictions>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub warning_rune_invalid_utf8: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hex: Option<String>,
}
impl TryFrom<Response> for DecodeResponse {
type Error = super::TryFromResponseError;
fn try_from(response: Response) -> Result<Self, Self::Error> {
match response {
Response::Decode(response) => Ok(response),
_ => Err(TryFromResponseError)
}
}
}
#[derive(Clone, Debug, Deserialize, Serialize)] #[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DisconnectResponse { pub struct DisconnectResponse {
} }

View File

@@ -66,8 +66,8 @@ def load_jsonrpc_service(schema_dir: str):
"TxSend", "TxSend",
"ListPeerChannels", "ListPeerChannels",
"ListClosedChannels", "ListClosedChannels",
# "decodepay", "DecodePay",
# "decode", "Decode",
# "delpay", # "delpay",
# "disableoffer", # "disableoffer",
"Disconnect", "Disconnect",

View File

@@ -894,6 +894,251 @@ def listclosedchannels2py(m):
}) })
def decodepay_fallbacks2py(m):
return remove_default({
"type": str(m.item_type), # EnumField in generate_composite
"addr": m.addr, # PrimitiveField in generate_composite
"hex": hexlify(m.hex), # PrimitiveField in generate_composite
})
def decodepay_routes2py(m):
return remove_default({
"pubkey": hexlify(m.pubkey), # PrimitiveField in generate_composite
"short_channel_id": m.short_channel_id, # 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
"cltv_expiry_delta": m.cltv_expiry_delta, # PrimitiveField in generate_composite
})
def decodepay_extra2py(m):
return remove_default({
"tag": m.tag, # PrimitiveField in generate_composite
"data": m.data, # PrimitiveField in generate_composite
})
def decodepay2py(m):
return remove_default({
"currency": m.currency, # PrimitiveField in generate_composite
"created_at": m.created_at, # PrimitiveField in generate_composite
"expiry": m.expiry, # PrimitiveField in generate_composite
"payee": hexlify(m.payee), # PrimitiveField in generate_composite
"amount_msat": amount2msat(m.amount_msat), # PrimitiveField in generate_composite
"payment_hash": hexlify(m.payment_hash), # PrimitiveField in generate_composite
"signature": hexlify(m.signature), # PrimitiveField in generate_composite
"description": m.description, # PrimitiveField in generate_composite
"description_hash": hexlify(m.description_hash), # PrimitiveField in generate_composite
"min_final_cltv_expiry": m.min_final_cltv_expiry, # PrimitiveField in generate_composite
"payment_secret": hexlify(m.payment_secret), # PrimitiveField in generate_composite
"features": hexlify(m.features), # PrimitiveField in generate_composite
"payment_metadata": hexlify(m.payment_metadata), # PrimitiveField in generate_composite
"fallbacks": [decodepay_fallbacks2py(i) for i in m.fallbacks], # ArrayField[composite] in generate_composite
"routes": [decodepay_routes2py(i) for i in m.routes], # ArrayField[composite] in generate_composite
"extra": [decodepay_extra2py(i) for i in m.extra], # ArrayField[composite] in generate_composite
})
def decode_offer_paths_path2py(m):
return remove_default({
"blinded_node_id": hexlify(m.blinded_node_id), # PrimitiveField in generate_composite
"encrypted_recipient_data": hexlify(m.encrypted_recipient_data), # PrimitiveField in generate_composite
})
def decode_offer_paths2py(m):
return remove_default({
"first_node_id": hexlify(m.first_node_id), # PrimitiveField in generate_composite
"blinding": hexlify(m.blinding), # PrimitiveField in generate_composite
"path": [decode_offer_paths_path2py(i) for i in m.path], # ArrayField[composite] in generate_composite
})
def decode_offer_recurrence_paywindow2py(m):
return remove_default({
"seconds_before": m.seconds_before, # PrimitiveField in generate_composite
"seconds_after": m.seconds_after, # PrimitiveField in generate_composite
"proportional_amount": m.proportional_amount, # PrimitiveField in generate_composite
})
def decode_offer_recurrence2py(m):
return remove_default({
"time_unit": m.time_unit, # PrimitiveField in generate_composite
"time_unit_name": m.time_unit_name, # PrimitiveField in generate_composite
"period": m.period, # PrimitiveField in generate_composite
"basetime": m.basetime, # PrimitiveField in generate_composite
"start_any_period": m.start_any_period, # PrimitiveField in generate_composite
"limit": m.limit, # PrimitiveField in generate_composite
})
def decode_unknown_offer_tlvs2py(m):
return remove_default({
"item_type": m.type, # PrimitiveField in generate_composite
"length": m.length, # PrimitiveField in generate_composite
"value": hexlify(m.value), # PrimitiveField in generate_composite
})
def decode_unknown_invoice_request_tlvs2py(m):
return remove_default({
"item_type": m.type, # PrimitiveField in generate_composite
"length": m.length, # PrimitiveField in generate_composite
"value": hexlify(m.value), # PrimitiveField in generate_composite
})
def decode_invoice_paths_payinfo2py(m):
return remove_default({
"fee_base_msat": amount2msat(m.fee_base_msat), # PrimitiveField in generate_composite
"fee_proportional_millionths": m.fee_proportional_millionths, # PrimitiveField in generate_composite
"cltv_expiry_delta": m.cltv_expiry_delta, # PrimitiveField in generate_composite
"features": hexlify(m.features), # PrimitiveField in generate_composite
})
def decode_invoice_paths_path2py(m):
return remove_default({
"blinded_node_id": hexlify(m.blinded_node_id), # PrimitiveField in generate_composite
"encrypted_recipient_data": hexlify(m.encrypted_recipient_data), # PrimitiveField in generate_composite
})
def decode_invoice_paths2py(m):
return remove_default({
"first_node_id": hexlify(m.first_node_id), # PrimitiveField in generate_composite
"blinding": hexlify(m.blinding), # PrimitiveField in generate_composite
"path": [decode_invoice_paths_path2py(i) for i in m.path], # ArrayField[composite] in generate_composite
})
def decode_invoice_fallbacks2py(m):
return remove_default({
"version": m.version, # PrimitiveField in generate_composite
"hex": hexlify(m.hex), # PrimitiveField in generate_composite
"address": m.address, # PrimitiveField in generate_composite
})
def decode_unknown_invoice_tlvs2py(m):
return remove_default({
"item_type": m.type, # PrimitiveField in generate_composite
"length": m.length, # PrimitiveField in generate_composite
"value": hexlify(m.value), # PrimitiveField in generate_composite
})
def decode_fallbacks2py(m):
return remove_default({
"warning_invoice_fallbacks_version_invalid": m.warning_invoice_fallbacks_version_invalid, # PrimitiveField in generate_composite
})
def decode_routes2py(m):
return remove_default({
"pubkey": hexlify(m.pubkey), # PrimitiveField in generate_composite
"short_channel_id": m.short_channel_id, # 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
"cltv_expiry_delta": m.cltv_expiry_delta, # PrimitiveField in generate_composite
})
def decode_extra2py(m):
return remove_default({
"tag": m.tag, # PrimitiveField in generate_composite
"data": m.data, # PrimitiveField in generate_composite
})
def decode_restrictions2py(m):
return remove_default({
"alternatives": [m.alternatives for i in m.alternatives], # ArrayField[primitive] in generate_composite
"summary": m.summary, # PrimitiveField in generate_composite
})
def decode2py(m):
return remove_default({
"type": str(m.item_type), # EnumField in generate_composite
"valid": m.valid, # PrimitiveField in generate_composite
"offer_id": hexlify(m.offer_id), # PrimitiveField in generate_composite
"offer_chains": [hexlify(m.offer_chains) for i in hexlify(m.offer_chains)], # ArrayField[primitive] in generate_composite
"offer_metadata": hexlify(m.offer_metadata), # PrimitiveField in generate_composite
"offer_currency": m.offer_currency, # PrimitiveField in generate_composite
"warning_unknown_offer_currency": m.warning_unknown_offer_currency, # PrimitiveField in generate_composite
"currency_minor_unit": m.currency_minor_unit, # PrimitiveField in generate_composite
"offer_amount": m.offer_amount, # PrimitiveField in generate_composite
"offer_amount_msat": amount2msat(m.offer_amount_msat), # PrimitiveField in generate_composite
"offer_description": m.offer_description, # PrimitiveField in generate_composite
"offer_issuer": m.offer_issuer, # PrimitiveField in generate_composite
"offer_features": hexlify(m.offer_features), # PrimitiveField in generate_composite
"offer_absolute_expiry": m.offer_absolute_expiry, # PrimitiveField in generate_composite
"offer_quantity_max": m.offer_quantity_max, # PrimitiveField in generate_composite
"offer_paths": [decode_offer_paths2py(i) for i in m.offer_paths], # ArrayField[composite] in generate_composite
"offer_node_id": hexlify(m.offer_node_id), # PrimitiveField in generate_composite
"unknown_offer_tlvs": [decode_unknown_offer_tlvs2py(i) for i in m.unknown_offer_tlvs], # ArrayField[composite] in generate_composite
"warning_missing_offer_node_id": m.warning_missing_offer_node_id, # PrimitiveField in generate_composite
"warning_invalid_offer_description": m.warning_invalid_offer_description, # PrimitiveField in generate_composite
"warning_missing_offer_description": m.warning_missing_offer_description, # PrimitiveField in generate_composite
"warning_invalid_offer_currency": m.warning_invalid_offer_currency, # PrimitiveField in generate_composite
"warning_invalid_offer_issuer": m.warning_invalid_offer_issuer, # PrimitiveField in generate_composite
"invreq_metadata": hexlify(m.invreq_metadata), # PrimitiveField in generate_composite
"invreq_payer_id": hexlify(m.invreq_payer_id), # PrimitiveField in generate_composite
"invreq_chain": hexlify(m.invreq_chain), # PrimitiveField in generate_composite
"invreq_amount_msat": amount2msat(m.invreq_amount_msat), # PrimitiveField in generate_composite
"invreq_features": hexlify(m.invreq_features), # PrimitiveField in generate_composite
"invreq_quantity": m.invreq_quantity, # PrimitiveField in generate_composite
"invreq_payer_note": m.invreq_payer_note, # PrimitiveField in generate_composite
"invreq_recurrence_counter": m.invreq_recurrence_counter, # PrimitiveField in generate_composite
"invreq_recurrence_start": m.invreq_recurrence_start, # PrimitiveField in generate_composite
"unknown_invoice_request_tlvs": [decode_unknown_invoice_request_tlvs2py(i) for i in m.unknown_invoice_request_tlvs], # ArrayField[composite] in generate_composite
"warning_missing_invreq_metadata": m.warning_missing_invreq_metadata, # PrimitiveField in generate_composite
"warning_missing_invreq_payer_id": m.warning_missing_invreq_payer_id, # PrimitiveField in generate_composite
"warning_invalid_invreq_payer_note": m.warning_invalid_invreq_payer_note, # PrimitiveField in generate_composite
"warning_missing_invoice_request_signature": m.warning_missing_invoice_request_signature, # PrimitiveField in generate_composite
"warning_invalid_invoice_request_signature": m.warning_invalid_invoice_request_signature, # PrimitiveField in generate_composite
"invoice_paths": [decode_invoice_paths2py(i) for i in m.invoice_paths], # ArrayField[composite] in generate_composite
"invoice_created_at": m.invoice_created_at, # PrimitiveField in generate_composite
"invoice_relative_expiry": m.invoice_relative_expiry, # PrimitiveField in generate_composite
"invoice_payment_hash": hexlify(m.invoice_payment_hash), # PrimitiveField in generate_composite
"invoice_amount_msat": amount2msat(m.invoice_amount_msat), # PrimitiveField in generate_composite
"invoice_fallbacks": [decode_invoice_fallbacks2py(i) for i in m.invoice_fallbacks], # ArrayField[composite] in generate_composite
"invoice_features": hexlify(m.invoice_features), # PrimitiveField in generate_composite
"invoice_node_id": hexlify(m.invoice_node_id), # PrimitiveField in generate_composite
"invoice_recurrence_basetime": m.invoice_recurrence_basetime, # PrimitiveField in generate_composite
"unknown_invoice_tlvs": [decode_unknown_invoice_tlvs2py(i) for i in m.unknown_invoice_tlvs], # ArrayField[composite] in generate_composite
"warning_missing_invoice_paths": m.warning_missing_invoice_paths, # PrimitiveField in generate_composite
"warning_missing_invoice_blindedpay": m.warning_missing_invoice_blindedpay, # PrimitiveField in generate_composite
"warning_missing_invoice_created_at": m.warning_missing_invoice_created_at, # PrimitiveField in generate_composite
"warning_missing_invoice_payment_hash": m.warning_missing_invoice_payment_hash, # PrimitiveField in generate_composite
"warning_missing_invoice_amount": m.warning_missing_invoice_amount, # PrimitiveField in generate_composite
"warning_missing_invoice_recurrence_basetime": m.warning_missing_invoice_recurrence_basetime, # PrimitiveField in generate_composite
"warning_missing_invoice_node_id": m.warning_missing_invoice_node_id, # PrimitiveField in generate_composite
"warning_missing_invoice_signature": m.warning_missing_invoice_signature, # PrimitiveField in generate_composite
"warning_invalid_invoice_signature": m.warning_invalid_invoice_signature, # PrimitiveField in generate_composite
"fallbacks": [decode_fallbacks2py(i) for i in m.fallbacks], # ArrayField[composite] in generate_composite
"created_at": m.created_at, # PrimitiveField in generate_composite
"expiry": m.expiry, # PrimitiveField in generate_composite
"payee": hexlify(m.payee), # PrimitiveField in generate_composite
"payment_hash": hexlify(m.payment_hash), # PrimitiveField in generate_composite
"description_hash": hexlify(m.description_hash), # PrimitiveField in generate_composite
"min_final_cltv_expiry": m.min_final_cltv_expiry, # PrimitiveField in generate_composite
"payment_secret": hexlify(m.payment_secret), # PrimitiveField in generate_composite
"payment_metadata": hexlify(m.payment_metadata), # PrimitiveField in generate_composite
"routes": [decode_routes2py(i) for i in m.routes], # ArrayField[composite] in generate_composite
"extra": [decode_extra2py(i) for i in m.extra], # ArrayField[composite] in generate_composite
"unique_id": m.unique_id, # PrimitiveField in generate_composite
"version": m.version, # PrimitiveField in generate_composite
"string": m.string, # PrimitiveField in generate_composite
"restrictions": [decode_restrictions2py(i) for i in m.restrictions], # ArrayField[composite] in generate_composite
"warning_rune_invalid_utf8": m.warning_rune_invalid_utf8, # PrimitiveField in generate_composite
"hex": hexlify(m.hex), # PrimitiveField in generate_composite
})
def disconnect2py(m): def disconnect2py(m):
return remove_default({ return remove_default({
}) })

File diff suppressed because one or more lines are too long

View File

@@ -209,6 +209,16 @@ class NodeStub(object):
request_serializer=node__pb2.ListclosedchannelsRequest.SerializeToString, request_serializer=node__pb2.ListclosedchannelsRequest.SerializeToString,
response_deserializer=node__pb2.ListclosedchannelsResponse.FromString, response_deserializer=node__pb2.ListclosedchannelsResponse.FromString,
) )
self.DecodePay = channel.unary_unary(
'/cln.Node/DecodePay',
request_serializer=node__pb2.DecodepayRequest.SerializeToString,
response_deserializer=node__pb2.DecodepayResponse.FromString,
)
self.Decode = channel.unary_unary(
'/cln.Node/Decode',
request_serializer=node__pb2.DecodeRequest.SerializeToString,
response_deserializer=node__pb2.DecodeResponse.FromString,
)
self.Disconnect = channel.unary_unary( self.Disconnect = channel.unary_unary(
'/cln.Node/Disconnect', '/cln.Node/Disconnect',
request_serializer=node__pb2.DisconnectRequest.SerializeToString, request_serializer=node__pb2.DisconnectRequest.SerializeToString,
@@ -508,6 +518,18 @@ class NodeServicer(object):
context.set_details('Method not implemented!') context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!') raise NotImplementedError('Method not implemented!')
def DecodePay(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 Decode(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): def Disconnect(self, request, context):
"""Missing associated documentation comment in .proto file.""" """Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -778,6 +800,16 @@ def add_NodeServicer_to_server(servicer, server):
request_deserializer=node__pb2.ListclosedchannelsRequest.FromString, request_deserializer=node__pb2.ListclosedchannelsRequest.FromString,
response_serializer=node__pb2.ListclosedchannelsResponse.SerializeToString, response_serializer=node__pb2.ListclosedchannelsResponse.SerializeToString,
), ),
'DecodePay': grpc.unary_unary_rpc_method_handler(
servicer.DecodePay,
request_deserializer=node__pb2.DecodepayRequest.FromString,
response_serializer=node__pb2.DecodepayResponse.SerializeToString,
),
'Decode': grpc.unary_unary_rpc_method_handler(
servicer.Decode,
request_deserializer=node__pb2.DecodeRequest.FromString,
response_serializer=node__pb2.DecodeResponse.SerializeToString,
),
'Disconnect': grpc.unary_unary_rpc_method_handler( 'Disconnect': grpc.unary_unary_rpc_method_handler(
servicer.Disconnect, servicer.Disconnect,
request_deserializer=node__pb2.DisconnectRequest.FromString, request_deserializer=node__pb2.DisconnectRequest.FromString,
@@ -1511,6 +1543,40 @@ class Node(object):
options, channel_credentials, options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def DecodePay(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/DecodePay',
node__pb2.DecodepayRequest.SerializeToString,
node__pb2.DecodepayResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def Decode(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/Decode',
node__pb2.DecodeRequest.SerializeToString,
node__pb2.DecodeResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod @staticmethod
def Disconnect(request, def Disconnect(request,
target, target,

View File

@@ -15,12 +15,14 @@ _sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10primitives.proto\x12\x03\x63ln\"\x16\n\x06\x41mount\x12\x0c\n\x04msat\x18\x01 \x01(\x04\"D\n\x0b\x41mountOrAll\x12\x1d\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x12\r\n\x03\x61ll\x18\x02 \x01(\x08H\x00\x42\x07\n\x05value\"D\n\x0b\x41mountOrAny\x12\x1d\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x12\r\n\x03\x61ny\x18\x02 \x01(\x08H\x00\x42\x07\n\x05value\"\x19\n\x17\x43hannelStateChangeCause\"(\n\x08Outpoint\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06outnum\x18\x02 \x01(\r\"h\n\x07\x46\x65\x65rate\x12\x0e\n\x04slow\x18\x01 \x01(\x08H\x00\x12\x10\n\x06normal\x18\x02 \x01(\x08H\x00\x12\x10\n\x06urgent\x18\x03 \x01(\x08H\x00\x12\x0f\n\x05perkb\x18\x04 \x01(\rH\x00\x12\x0f\n\x05perkw\x18\x05 \x01(\rH\x00\x42\x07\n\x05style\":\n\nOutputDesc\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x1b\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\"t\n\x08RouteHop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x02 \x01(\t\x12\x1c\n\x07\x66\x65\x65\x62\x61se\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0f\n\x07\x66\x65\x65prop\x18\x04 \x01(\r\x12\x13\n\x0b\x65xpirydelta\x18\x05 \x01(\r\"(\n\tRoutehint\x12\x1b\n\x04hops\x18\x01 \x03(\x0b\x32\r.cln.RouteHop\".\n\rRoutehintList\x12\x1d\n\x05hints\x18\x02 \x03(\x0b\x32\x0e.cln.Routehint\"\'\n\x08TlvEntry\x12\x0c\n\x04type\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\"+\n\tTlvStream\x12\x1e\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\r.cln.TlvEntry*$\n\x0b\x43hannelSide\x12\t\n\x05LOCAL\x10\x00\x12\n\n\x06REMOTE\x10\x01*\x84\x02\n\x0c\x43hannelState\x12\x0c\n\x08Openingd\x10\x00\x12\x1a\n\x16\x43hanneldAwaitingLockin\x10\x01\x12\x12\n\x0e\x43hanneldNormal\x10\x02\x12\x18\n\x14\x43hanneldShuttingDown\x10\x03\x12\x17\n\x13\x43losingdSigexchange\x10\x04\x12\x14\n\x10\x43losingdComplete\x10\x05\x12\x16\n\x12\x41waitingUnilateral\x10\x06\x12\x14\n\x10\x46undingSpendSeen\x10\x07\x12\x0b\n\x07Onchain\x10\x08\x12\x15\n\x11\x44ualopendOpenInit\x10\t\x12\x1b\n\x17\x44ualopendAwaitingLockin\x10\nb\x06proto3') DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10primitives.proto\x12\x03\x63ln\"\x16\n\x06\x41mount\x12\x0c\n\x04msat\x18\x01 \x01(\x04\"D\n\x0b\x41mountOrAll\x12\x1d\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x12\r\n\x03\x61ll\x18\x02 \x01(\x08H\x00\x42\x07\n\x05value\"D\n\x0b\x41mountOrAny\x12\x1d\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x0b.cln.AmountH\x00\x12\r\n\x03\x61ny\x18\x02 \x01(\x08H\x00\x42\x07\n\x05value\"\x19\n\x17\x43hannelStateChangeCause\"(\n\x08Outpoint\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06outnum\x18\x02 \x01(\r\"h\n\x07\x46\x65\x65rate\x12\x0e\n\x04slow\x18\x01 \x01(\x08H\x00\x12\x10\n\x06normal\x18\x02 \x01(\x08H\x00\x12\x10\n\x06urgent\x18\x03 \x01(\x08H\x00\x12\x0f\n\x05perkb\x18\x04 \x01(\rH\x00\x12\x0f\n\x05perkw\x18\x05 \x01(\rH\x00\x42\x07\n\x05style\":\n\nOutputDesc\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x1b\n\x06\x61mount\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\"t\n\x08RouteHop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x02 \x01(\t\x12\x1c\n\x07\x66\x65\x65\x62\x61se\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0f\n\x07\x66\x65\x65prop\x18\x04 \x01(\r\x12\x13\n\x0b\x65xpirydelta\x18\x05 \x01(\r\"(\n\tRoutehint\x12\x1b\n\x04hops\x18\x01 \x03(\x0b\x32\r.cln.RouteHop\".\n\rRoutehintList\x12\x1d\n\x05hints\x18\x02 \x03(\x0b\x32\x0e.cln.Routehint\"\'\n\x08TlvEntry\x12\x0c\n\x04type\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c\"+\n\tTlvStream\x12\x1e\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\r.cln.TlvEntry*$\n\x0b\x43hannelSide\x12\t\n\x05LOCAL\x10\x00\x12\n\n\x06REMOTE\x10\x01*\x84\x02\n\x0c\x43hannelState\x12\x0c\n\x08Openingd\x10\x00\x12\x1a\n\x16\x43hanneldAwaitingLockin\x10\x01\x12\x12\n\x0e\x43hanneldNormal\x10\x02\x12\x18\n\x14\x43hanneldShuttingDown\x10\x03\x12\x17\n\x13\x43losingdSigexchange\x10\x04\x12\x14\n\x10\x43losingdComplete\x10\x05\x12\x16\n\x12\x41waitingUnilateral\x10\x06\x12\x14\n\x10\x46undingSpendSeen\x10\x07\x12\x0b\n\x07Onchain\x10\x08\x12\x15\n\x11\x44ualopendOpenInit\x10\t\x12\x1b\n\x17\x44ualopendAwaitingLockin\x10\n*\x8a\x02\n\tHtlcState\x12\x0f\n\x0bSentAddHtlc\x10\x00\x12\x11\n\rSentAddCommit\x10\x01\x12\x15\n\x11RcvdAddRevocation\x10\x02\x12\x14\n\x10RcvdAddAckCommit\x10\x03\x12\x18\n\x14SentAddAckRevocation\x10\x04\x12\x18\n\x14RcvdAddAckRevocation\x10\x05\x12\x12\n\x0eRcvdRemoveHtlc\x10\x06\x12\x14\n\x10RcvdRemoveCommit\x10\x07\x12\x18\n\x14SentRemoveRevocation\x10\x08\x12\x17\n\x13SentRemoveAckCommit\x10\t\x12\x1b\n\x17RcvdRemoveAckRevocation\x10\nb\x06proto3')
_CHANNELSIDE = DESCRIPTOR.enum_types_by_name['ChannelSide'] _CHANNELSIDE = DESCRIPTOR.enum_types_by_name['ChannelSide']
ChannelSide = enum_type_wrapper.EnumTypeWrapper(_CHANNELSIDE) ChannelSide = enum_type_wrapper.EnumTypeWrapper(_CHANNELSIDE)
_CHANNELSTATE = DESCRIPTOR.enum_types_by_name['ChannelState'] _CHANNELSTATE = DESCRIPTOR.enum_types_by_name['ChannelState']
ChannelState = enum_type_wrapper.EnumTypeWrapper(_CHANNELSTATE) ChannelState = enum_type_wrapper.EnumTypeWrapper(_CHANNELSTATE)
_HTLCSTATE = DESCRIPTOR.enum_types_by_name['HtlcState']
HtlcState = enum_type_wrapper.EnumTypeWrapper(_HTLCSTATE)
LOCAL = 0 LOCAL = 0
REMOTE = 1 REMOTE = 1
Openingd = 0 Openingd = 0
@@ -34,6 +36,17 @@ FundingSpendSeen = 7
Onchain = 8 Onchain = 8
DualopendOpenInit = 9 DualopendOpenInit = 9
DualopendAwaitingLockin = 10 DualopendAwaitingLockin = 10
SentAddHtlc = 0
SentAddCommit = 1
RcvdAddRevocation = 2
RcvdAddAckCommit = 3
SentAddAckRevocation = 4
RcvdAddAckRevocation = 5
RcvdRemoveHtlc = 6
RcvdRemoveCommit = 7
SentRemoveRevocation = 8
SentRemoveAckCommit = 9
RcvdRemoveAckRevocation = 10
_AMOUNT = DESCRIPTOR.message_types_by_name['Amount'] _AMOUNT = DESCRIPTOR.message_types_by_name['Amount']
@@ -139,6 +152,8 @@ if _descriptor._USE_C_DESCRIPTORS == False:
_CHANNELSIDE._serialized_end=754 _CHANNELSIDE._serialized_end=754
_CHANNELSTATE._serialized_start=757 _CHANNELSTATE._serialized_start=757
_CHANNELSTATE._serialized_end=1017 _CHANNELSTATE._serialized_end=1017
_HTLCSTATE._serialized_start=1020
_HTLCSTATE._serialized_end=1286
_AMOUNT._serialized_start=25 _AMOUNT._serialized_start=25
_AMOUNT._serialized_end=47 _AMOUNT._serialized_end=47
_AMOUNTORALL._serialized_start=49 _AMOUNTORALL._serialized_start=49