msggen: fix walk through nested json schemas

Changelog-None
This commit is contained in:
daywalker90 2024-04-14 17:18:11 +02:00 committed by Christian Decker
parent 507c2de9c1
commit ada4de1588
10 changed files with 3632 additions and 3011 deletions

View file

@ -28,6 +28,13 @@
"must-create": 0,
"must-replace": 1
},
"DecodeFallbacksType": {
"P2PKH": 0,
"P2SH": 1,
"P2TR": 4,
"P2WPKH": 2,
"P2WSH": 3
},
"DecodeType": {
"bolt11 invoice": 3,
"bolt12 invoice": 1,
@ -348,6 +355,17 @@
"StopResult": {
"Shutdown complete": 0
},
"WaitDetailsStatus": {
"complete": 5,
"expired": 2,
"failed": 4,
"local_failed": 8,
"offered": 6,
"paid": 1,
"pending": 3,
"settled": 7,
"unpaid": 0
},
"WaitIndexname": {
"created": 0,
"deleted": 2,
@ -515,6 +533,9 @@
"Decode.extra[].tag": 1
},
"DecodeFallbacks": {
"Decode.fallbacks[].addr": 3,
"Decode.fallbacks[].hex": 4,
"Decode.fallbacks[].type": 2,
"Decode.fallbacks[].warning_invoice_fallbacks_version_invalid": 1
},
"DecodeInvoice_fallbacks": {
@ -540,13 +561,17 @@
"Decode.string": 1
},
"DecodeResponse": {
"Decode.amount_msat": 79,
"Decode.created_at": 60,
"Decode.currency": 78,
"Decode.currency_minor_unit": 8,
"Decode.decrypted": 76,
"Decode.description": 80,
"Decode.description_hash": 64,
"Decode.expiry": 61,
"Decode.extra[]": 69,
"Decode.fallbacks[]": 59,
"Decode.features": 81,
"Decode.hex": 75,
"Decode.invoice_amount_msat": 44,
"Decode.invoice_created_at": 41,
@ -587,6 +612,7 @@
"Decode.payment_secret": 66,
"Decode.restrictions[]": 73,
"Decode.routes[][]": 68,
"Decode.signature": 77,
"Decode.string": 72,
"Decode.type": 1,
"Decode.unique_id": 70,
@ -674,6 +700,7 @@
},
"DelinvoiceResponse": {
"DelInvoice.amount_msat": 4,
"DelInvoice.amount_received_msat": 15,
"DelInvoice.bolt11": 2,
"DelInvoice.bolt12": 3,
"DelInvoice.created_index": 12,
@ -682,8 +709,11 @@
"DelInvoice.invreq_payer_note": 11,
"DelInvoice.label": 1,
"DelInvoice.local_offer_id": 9,
"DelInvoice.paid_at": 16,
"DelInvoice.pay_index": 14,
"DelInvoice.payer_note": 10,
"DelInvoice.payment_hash": 6,
"DelInvoice.payment_preimage": 17,
"DelInvoice.status": 7,
"DelInvoice.updated_index": 13
},
@ -838,6 +868,7 @@
"Getinfo.binding[].address": 2,
"Getinfo.binding[].port": 3,
"Getinfo.binding[].socket": 4,
"Getinfo.binding[].subtype": 5,
"Getinfo.binding[].type": 1
},
"GetinfoOur_features": {
@ -1014,6 +1045,8 @@
},
"ListforwardsForwards": {
"ListForwards.forwards[].created_index": 12,
"ListForwards.forwards[].failcode": 15,
"ListForwards.forwards[].failreason": 16,
"ListForwards.forwards[].fee_msat": 7,
"ListForwards.forwards[].in_channel": 1,
"ListForwards.forwards[].in_htlc_id": 10,
@ -1023,6 +1056,7 @@
"ListForwards.forwards[].out_msat": 8,
"ListForwards.forwards[].payment_hash": 6,
"ListForwards.forwards[].received_time": 4,
"ListForwards.forwards[].resolved_time": 14,
"ListForwards.forwards[].status": 3,
"ListForwards.forwards[].style": 9,
"ListForwards.forwards[].updated_index": 13
@ -1056,6 +1090,7 @@
"ListFunds.outputs[].output": 2,
"ListFunds.outputs[].redeemscript": 6,
"ListFunds.outputs[].reserved": 9,
"ListFunds.outputs[].reserved_to_block": 10,
"ListFunds.outputs[].scriptpubkey": 4,
"ListFunds.outputs[].status": 7,
"ListFunds.outputs[].txid": 1
@ -1124,13 +1159,22 @@
"ListNodes.nodes[].color": 4,
"ListNodes.nodes[].features": 5,
"ListNodes.nodes[].last_timestamp": 2,
"ListNodes.nodes[].nodeid": 1
"ListNodes.nodes[].nodeid": 1,
"ListNodes.nodes[].option_will_fund": 7
},
"ListnodesNodesAddresses": {
"ListNodes.nodes[].addresses[].address": 3,
"ListNodes.nodes[].addresses[].port": 2,
"ListNodes.nodes[].addresses[].type": 1
},
"ListnodesNodesOption_will_fund": {
"ListNodes.nodes[].option_will_fund.channel_fee_max_base_msat": 4,
"ListNodes.nodes[].option_will_fund.channel_fee_max_proportional_thousandths": 5,
"ListNodes.nodes[].option_will_fund.compact_lease": 6,
"ListNodes.nodes[].option_will_fund.funding_weight": 3,
"ListNodes.nodes[].option_will_fund.lease_fee_base_msat": 1,
"ListNodes.nodes[].option_will_fund.lease_fee_basis": 2
},
"ListnodesRequest": {
"ListNodes.id": 1
},
@ -1183,6 +1227,7 @@
"ListPeerChannels.channels[].close_to": 17,
"ListPeerChannels.channels[].close_to_addr": 53,
"ListPeerChannels.channels[].closer": 20,
"ListPeerChannels.channels[].direction": 60,
"ListPeerChannels.channels[].dust_limit_msat": 29,
"ListPeerChannels.channels[].features[]": 21,
"ListPeerChannels.channels[].fee_base_msat": 27,
@ -1201,6 +1246,7 @@
"ListPeerChannels.channels[].initial_feerate": 12,
"ListPeerChannels.channels[].last_feerate": 13,
"ListPeerChannels.channels[].last_stable_connection": 56,
"ListPeerChannels.channels[].last_tx_fee_msat": 59,
"ListPeerChannels.channels[].lost_state": 57,
"ListPeerChannels.channels[].max_accepted_htlcs": 40,
"ListPeerChannels.channels[].max_to_us_msat": 25,
@ -1842,6 +1888,20 @@
"UtxoPsbt.psbt": 1,
"UtxoPsbt.reservations[]": 6
},
"WaitDetails": {
"Wait.details.bolt11": 4,
"Wait.details.bolt12": 5,
"Wait.details.description": 3,
"Wait.details.groupid": 7,
"Wait.details.in_channel": 9,
"Wait.details.in_htlc_id": 10,
"Wait.details.in_msat": 11,
"Wait.details.label": 2,
"Wait.details.out_channel": 12,
"Wait.details.partid": 6,
"Wait.details.payment_hash": 8,
"Wait.details.status": 1
},
"WaitRequest": {
"Wait.indexname": 2,
"Wait.nextvalue": 3,
@ -1850,6 +1910,7 @@
"WaitResponse": {
"Wait.created": 2,
"Wait.deleted": 4,
"Wait.details": 5,
"Wait.subsystem": 1,
"Wait.updated": 3
},
@ -2307,10 +2368,18 @@
"added": "v23.05",
"deprecated": null
},
"Decode.amount_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.created_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.currency": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.currency_minor_unit": {
"added": "pre-v0.10.1",
"deprecated": false
@ -2319,6 +2388,10 @@
"added": "v23.11",
"deprecated": false
},
"Decode.description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.description_hash": {
"added": "pre-v0.10.1",
"deprecated": false
@ -2343,10 +2416,26 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[].addr": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[].hex": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[].type": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.fallbacks[].warning_invoice_fallbacks_version_invalid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.features": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.hex": {
"added": "pre-v0.10.1",
"deprecated": false
@ -2647,6 +2736,10 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.signature": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Decode.string": {
"added": "pre-v0.10.1",
"deprecated": false
@ -2947,6 +3040,10 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.amount_received_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.bolt11": {
"added": "pre-v0.10.1",
"deprecated": false
@ -2983,10 +3080,22 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.paid_at": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.pay_index": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.payment_preimage": {
"added": "pre-v0.10.1",
"deprecated": false
},
"DelInvoice.status": {
"added": "pre-v0.10.1",
"deprecated": false
@ -3531,6 +3640,10 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Getinfo.binding[].subtype": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Getinfo.binding[].type": {
"added": "pre-v0.10.1",
"deprecated": false
@ -4007,6 +4120,14 @@
"added": "v23.11",
"deprecated": false
},
"ListForwards.forwards[].failcode": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListForwards.forwards[].failreason": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListForwards.forwards[].fee_msat": {
"added": "pre-v0.10.1",
"deprecated": false
@ -4039,6 +4160,10 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"ListForwards.forwards[].resolved_time": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListForwards.forwards[].status": {
"added": "pre-v0.10.1",
"deprecated": false
@ -4147,6 +4272,10 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"ListFunds.outputs[].reserved_to_block": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListFunds.outputs[].scriptpubkey": {
"added": "pre-v0.10.1",
"deprecated": false
@ -4363,6 +4492,34 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.channel_fee_max_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.channel_fee_max_proportional_thousandths": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.compact_lease": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.funding_weight": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.lease_fee_base_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListNodes.nodes[].option_will_fund.lease_fee_basis": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListOffers": {
"added": "pre-v0.10.1",
"deprecated": null
@ -4535,6 +4692,10 @@
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].direction": {
"added": "v23.02",
"deprecated": false
},
"ListPeerChannels.channels[].dust_limit_msat": {
"added": "v23.02",
"deprecated": false
@ -4695,6 +4856,10 @@
"added": "v24.02",
"deprecated": false
},
"ListPeerChannels.channels[].last_tx_fee_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"ListPeerChannels.channels[].lost_state": {
"added": "v24.02",
"deprecated": false
@ -6399,6 +6564,58 @@
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.bolt11": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.bolt12": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.description": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.groupid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.in_channel": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.in_htlc_id": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.in_msat": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.label": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.out_channel": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.partid": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.payment_hash": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.details.status": {
"added": "pre-v0.10.1",
"deprecated": false
},
"Wait.indexname": {
"added": "pre-v0.10.1",
"deprecated": false

View file

@ -122,16 +122,17 @@ message GetinfoBinding {
// Getinfo.binding[].type
enum GetinfoBindingType {
LOCAL_SOCKET = 0;
WEBSOCKET = 5;
IPV4 = 1;
IPV6 = 2;
TORV2 = 3;
TORV3 = 4;
WEBSOCKET = 5;
}
GetinfoBindingType item_type = 1;
optional string address = 2;
optional uint32 port = 3;
optional string socket = 4;
optional string subtype = 5;
}
message ListpeersRequest {
@ -153,11 +154,11 @@ message ListpeersResponse {
message ListpeersPeers {
bytes id = 1;
bool connected = 2;
optional uint32 num_channels = 8;
repeated ListpeersPeersLog log = 3;
repeated string netaddr = 5;
optional string remote_addr = 7;
optional bytes features = 6;
optional string remote_addr = 7;
optional uint32 num_channels = 8;
}
message ListpeersPeersLog {
@ -204,8 +205,9 @@ message ListfundsOutputs {
optional string address = 5;
optional bytes redeemscript = 6;
ListfundsOutputsStatus status = 7;
bool reserved = 9;
optional uint32 blockheight = 8;
bool reserved = 9;
optional uint32 reserved_to_block = 10;
}
message ListfundsChannels {
@ -216,20 +218,20 @@ message ListfundsChannels {
uint32 funding_output = 5;
bool connected = 6;
ChannelState state = 7;
optional bytes channel_id = 9;
optional string short_channel_id = 8;
optional bytes channel_id = 9;
}
message SendpayRequest {
repeated SendpayRoute route = 1;
bytes payment_hash = 2;
optional string label = 3;
optional Amount amount_msat = 10;
optional string bolt11 = 5;
optional bytes payment_secret = 6;
optional uint64 partid = 7;
optional bytes localinvreqid = 11;
optional uint64 groupid = 9;
optional Amount amount_msat = 10;
optional bytes localinvreqid = 11;
optional bytes payment_metadata = 12;
optional string description = 13;
}
@ -240,8 +242,6 @@ message SendpayResponse {
PENDING = 0;
COMPLETE = 1;
}
optional uint64 created_index = 16;
optional uint64 updated_index = 17;
uint64 id = 1;
optional uint64 groupid = 2;
bytes payment_hash = 3;
@ -249,7 +249,6 @@ message SendpayResponse {
optional Amount amount_msat = 5;
optional bytes destination = 6;
uint64 created_at = 7;
optional uint64 completed_at = 15;
Amount amount_sent_msat = 8;
optional string label = 9;
optional uint64 partid = 10;
@ -257,12 +256,15 @@ message SendpayResponse {
optional string bolt12 = 12;
optional bytes payment_preimage = 13;
optional string message = 14;
optional uint64 completed_at = 15;
optional uint64 created_index = 16;
optional uint64 updated_index = 17;
}
message SendpayRoute {
bytes id = 2;
string channel = 4;
uint32 delay = 3;
string channel = 4;
Amount amount_msat = 5;
}
@ -280,7 +282,6 @@ message ListchannelsChannels {
bytes source = 1;
bytes destination = 2;
string short_channel_id = 3;
uint32 direction = 16;
bool public = 4;
Amount amount_msat = 5;
uint32 message_flags = 6;
@ -293,6 +294,7 @@ message ListchannelsChannels {
Amount htlc_minimum_msat = 13;
optional Amount htlc_maximum_msat = 14;
bytes features = 15;
uint32 direction = 16;
}
message AddgossipRequest {
@ -400,14 +402,14 @@ message CreateinvoiceResponse {
CreateinvoiceStatus status = 6;
string description = 7;
uint64 expires_at = 8;
optional uint64 created_index = 16;
optional uint64 pay_index = 9;
optional Amount amount_received_msat = 10;
optional uint64 paid_at = 11;
optional CreateinvoicePaid_outpoint paid_outpoint = 17;
optional bytes payment_preimage = 12;
optional bytes local_offer_id = 13;
optional string invreq_payer_note = 15;
optional uint64 created_index = 16;
optional CreateinvoicePaid_outpoint paid_outpoint = 17;
}
message CreateinvoicePaid_outpoint {
@ -424,18 +426,18 @@ message DatastoreRequest {
MUST_APPEND = 3;
CREATE_OR_APPEND = 4;
}
repeated string key = 5;
optional string string = 6;
optional bytes hex = 2;
optional DatastoreMode mode = 3;
optional uint64 generation = 4;
repeated string key = 5;
optional string string = 6;
}
message DatastoreResponse {
repeated string key = 5;
optional uint64 generation = 2;
optional bytes hex = 3;
optional string string = 4;
repeated string key = 5;
}
message DatastoreusageRequest {
@ -469,15 +471,15 @@ message CreateonionHops {
}
message DeldatastoreRequest {
repeated string key = 3;
optional uint64 generation = 2;
repeated string key = 3;
}
message DeldatastoreResponse {
repeated string key = 5;
optional uint64 generation = 2;
optional bytes hex = 3;
optional string string = 4;
repeated string key = 5;
}
message DelinvoiceRequest {
@ -505,23 +507,27 @@ message DelinvoiceResponse {
optional Amount amount_msat = 4;
optional string description = 5;
bytes payment_hash = 6;
optional uint64 created_index = 12;
optional uint64 updated_index = 13;
DelinvoiceStatus status = 7;
uint64 expires_at = 8;
optional bytes local_offer_id = 9;
optional string invreq_payer_note = 11;
optional uint64 created_index = 12;
optional uint64 updated_index = 13;
optional uint64 pay_index = 14;
optional Amount amount_received_msat = 15;
optional uint64 paid_at = 16;
optional bytes payment_preimage = 17;
}
message InvoiceRequest {
AmountOrAny amount_msat = 10;
string label = 3;
string description = 2;
optional uint64 expiry = 7;
string label = 3;
repeated string fallbacks = 4;
optional bytes preimage = 5;
optional uint32 cltv = 6;
optional uint64 expiry = 7;
optional bool deschashonly = 9;
AmountOrAny amount_msat = 10;
}
message InvoiceResponse {
@ -529,12 +535,12 @@ message InvoiceResponse {
bytes payment_hash = 2;
bytes payment_secret = 3;
uint64 expires_at = 4;
optional uint64 created_index = 10;
optional string warning_capacity = 5;
optional string warning_offline = 6;
optional string warning_deadends = 7;
optional string warning_private_unused = 8;
optional string warning_mpp = 9;
optional uint64 created_index = 10;
}
message ListdatastoreRequest {
@ -587,14 +593,14 @@ message ListinvoicesInvoices {
optional string bolt11 = 7;
optional string bolt12 = 8;
optional bytes local_offer_id = 9;
optional string invreq_payer_note = 15;
optional uint64 created_index = 16;
optional uint64 updated_index = 17;
optional uint64 pay_index = 11;
optional Amount amount_received_msat = 12;
optional uint64 paid_at = 13;
optional ListinvoicesInvoicesPaid_outpoint paid_outpoint = 18;
optional bytes payment_preimage = 14;
optional string invreq_payer_note = 15;
optional uint64 created_index = 16;
optional uint64 updated_index = 17;
optional ListinvoicesInvoicesPaid_outpoint paid_outpoint = 18;
}
message ListinvoicesInvoicesPaid_outpoint {
@ -610,10 +616,10 @@ message SendonionRequest {
repeated bytes shared_secrets = 5;
optional uint32 partid = 6;
optional string bolt11 = 7;
optional Amount amount_msat = 12;
optional bytes destination = 9;
optional bytes localinvreqid = 13;
optional uint64 groupid = 11;
optional Amount amount_msat = 12;
optional bytes localinvreqid = 13;
optional string description = 14;
}
@ -623,7 +629,6 @@ message SendonionResponse {
PENDING = 0;
COMPLETE = 1;
}
optional uint64 created_index = 14;
uint64 id = 1;
bytes payment_hash = 2;
SendonionStatus status = 3;
@ -634,10 +639,11 @@ message SendonionResponse {
optional string label = 8;
optional string bolt11 = 9;
optional string bolt12 = 10;
optional uint64 partid = 13;
optional uint64 updated_index = 15;
optional bytes payment_preimage = 11;
optional string message = 12;
optional uint64 partid = 13;
optional uint64 created_index = 14;
optional uint64 updated_index = 15;
}
message SendonionFirst_hop {
@ -677,12 +683,9 @@ message ListsendpaysPayments {
FAILED = 1;
COMPLETE = 2;
}
optional uint64 created_index = 16;
uint64 id = 1;
uint64 groupid = 2;
optional uint64 partid = 15;
bytes payment_hash = 3;
optional uint64 updated_index = 17;
ListsendpaysPaymentsStatus status = 4;
optional Amount amount_msat = 5;
optional bytes destination = 6;
@ -690,11 +693,14 @@ message ListsendpaysPayments {
Amount amount_sent_msat = 8;
optional string label = 9;
optional string bolt11 = 10;
optional string description = 14;
optional string bolt12 = 11;
optional uint64 completed_at = 18;
optional bytes payment_preimage = 12;
optional bytes erroronion = 13;
optional string description = 14;
optional uint64 partid = 15;
optional uint64 created_index = 16;
optional uint64 updated_index = 17;
optional uint64 completed_at = 18;
}
message ListtransactionsRequest {
@ -723,23 +729,23 @@ message ListtransactionsTransactionsInputs {
message ListtransactionsTransactionsOutputs {
uint32 index = 1;
Amount amount_msat = 6;
bytes scriptPubKey = 3;
Amount amount_msat = 6;
}
message PayRequest {
string bolt11 = 1;
optional Amount amount_msat = 13;
optional string label = 3;
optional double riskfactor = 8;
optional double maxfeepercent = 4;
optional uint32 retry_for = 5;
optional uint32 maxdelay = 6;
optional Amount exemptfee = 7;
optional bytes localinvreqid = 14;
optional double riskfactor = 8;
repeated string exclude = 10;
optional Amount maxfee = 11;
optional string description = 12;
optional Amount amount_msat = 13;
optional bytes localinvreqid = 14;
optional Amount partial_msat = 15;
}
@ -776,6 +782,16 @@ message ListnodesNodes {
optional bytes color = 4;
optional bytes features = 5;
repeated ListnodesNodesAddresses addresses = 6;
optional ListnodesNodesOption_will_fund option_will_fund = 7;
}
message ListnodesNodesOption_will_fund {
Amount lease_fee_base_msat = 1;
uint32 lease_fee_basis = 2;
uint32 funding_weight = 3;
Amount channel_fee_max_base_msat = 4;
uint32 channel_fee_max_proportional_thousandths = 5;
bytes compact_lease = 6;
}
message ListnodesNodesAddresses {
@ -811,13 +827,13 @@ message WaitanyinvoiceResponse {
optional Amount amount_msat = 6;
optional string bolt11 = 7;
optional string bolt12 = 8;
optional uint64 created_index = 13;
optional uint64 updated_index = 14;
optional uint64 pay_index = 9;
optional Amount amount_received_msat = 10;
optional uint64 paid_at = 11;
optional WaitanyinvoicePaid_outpoint paid_outpoint = 15;
optional bytes payment_preimage = 12;
optional uint64 created_index = 13;
optional uint64 updated_index = 14;
optional WaitanyinvoicePaid_outpoint paid_outpoint = 15;
}
message WaitanyinvoicePaid_outpoint {
@ -843,13 +859,13 @@ message WaitinvoiceResponse {
optional Amount amount_msat = 6;
optional string bolt11 = 7;
optional string bolt12 = 8;
optional uint64 created_index = 13;
optional uint64 updated_index = 14;
optional uint64 pay_index = 9;
optional Amount amount_received_msat = 10;
optional uint64 paid_at = 11;
optional WaitinvoicePaid_outpoint paid_outpoint = 15;
optional bytes payment_preimage = 12;
optional uint64 created_index = 13;
optional uint64 updated_index = 14;
optional WaitinvoicePaid_outpoint paid_outpoint = 15;
}
message WaitinvoicePaid_outpoint {
@ -859,8 +875,8 @@ message WaitinvoicePaid_outpoint {
message WaitsendpayRequest {
bytes payment_hash = 1;
optional uint32 timeout = 3;
optional uint64 partid = 2;
optional uint32 timeout = 3;
optional uint64 groupid = 4;
}
@ -869,7 +885,6 @@ message WaitsendpayResponse {
enum WaitsendpayStatus {
COMPLETE = 0;
}
optional uint64 created_index = 15;
uint64 id = 1;
optional uint64 groupid = 2;
bytes payment_hash = 3;
@ -877,37 +892,38 @@ message WaitsendpayResponse {
optional Amount amount_msat = 5;
optional bytes destination = 6;
uint64 created_at = 7;
optional uint64 updated_index = 16;
optional double completed_at = 14;
Amount amount_sent_msat = 8;
optional string label = 9;
optional uint64 partid = 10;
optional string bolt11 = 11;
optional string bolt12 = 12;
optional bytes payment_preimage = 13;
optional double completed_at = 14;
optional uint64 created_index = 15;
optional uint64 updated_index = 16;
}
message NewaddrRequest {
// NewAddr.addresstype
enum NewaddrAddresstype {
BECH32 = 0;
P2TR = 3;
ALL = 2;
P2TR = 3;
}
optional NewaddrAddresstype addresstype = 1;
}
message NewaddrResponse {
optional string p2tr = 3;
optional string bech32 = 1;
optional string p2tr = 3;
}
message WithdrawRequest {
string destination = 1;
AmountOrAll satoshi = 2;
optional Feerate feerate = 5;
optional uint32 minconf = 3;
repeated Outpoint utxos = 4;
optional Feerate feerate = 5;
}
message WithdrawResponse {
@ -918,7 +934,6 @@ message WithdrawResponse {
message KeysendRequest {
bytes destination = 1;
Amount amount_msat = 10;
optional string label = 3;
optional double maxfeepercent = 4;
optional uint32 retry_for = 5;
@ -926,6 +941,7 @@ message KeysendRequest {
optional Amount exemptfee = 7;
optional RoutehintList routehints = 8;
optional TlvStream extratlvs = 9;
Amount amount_msat = 10;
}
message KeysendResponse {
@ -999,9 +1015,9 @@ message UtxopsbtRequest {
uint32 startweight = 3;
repeated Outpoint utxos = 4;
optional uint32 reserve = 5;
optional bool reservedok = 8;
optional uint32 locktime = 6;
optional uint32 min_witness_weight = 7;
optional bool reservedok = 8;
optional bool excess_as_change = 9;
optional bool opening_anchor_channel = 10;
}
@ -1033,10 +1049,10 @@ message TxdiscardResponse {
}
message TxprepareRequest {
repeated OutputDesc outputs = 5;
optional Feerate feerate = 2;
optional uint32 minconf = 3;
repeated Outpoint utxos = 4;
repeated OutputDesc outputs = 5;
}
message TxprepareResponse {
@ -1083,12 +1099,8 @@ message ListpeerchannelsChannels {
}
optional bytes peer_id = 1;
optional bool peer_connected = 2;
optional bool reestablished = 58;
optional ListpeerchannelsChannelsState state = 3;
optional bytes scratch_txid = 4;
optional ListpeerchannelsChannelsUpdates updates = 55;
optional bool ignore_fee_limits = 54;
optional bool lost_state = 57;
optional ListpeerchannelsChannelsFeerate feerate = 6;
optional string owner = 7;
optional string short_channel_id = 8;
@ -1133,9 +1145,15 @@ message ListpeerchannelsChannels {
optional Amount out_offered_msat = 49;
optional uint64 out_payments_fulfilled = 50;
optional Amount out_fulfilled_msat = 51;
optional uint64 last_stable_connection = 56;
repeated ListpeerchannelsChannelsHtlcs htlcs = 52;
optional string close_to_addr = 53;
optional bool ignore_fee_limits = 54;
optional ListpeerchannelsChannelsUpdates updates = 55;
optional uint64 last_stable_connection = 56;
optional bool lost_state = 57;
optional bool reestablished = 58;
optional Amount last_tx_fee_msat = 59;
optional uint32 direction = 60;
}
message ListpeerchannelsChannelsUpdates {
@ -1169,9 +1187,9 @@ message ListpeerchannelsChannelsInflight {
optional uint32 funding_outnum = 2;
optional string feerate = 3;
optional Amount total_funding_msat = 4;
optional sint64 splice_amount = 7;
optional Amount our_funding_msat = 5;
optional bytes scratch_txid = 6;
optional sint64 splice_amount = 7;
}
message ListpeerchannelsChannelsFunding {
@ -1378,6 +1396,11 @@ message DecodeResponse {
optional string warning_rune_invalid_utf8 = 74;
optional bytes hex = 75;
optional bytes decrypted = 76;
optional string signature = 77;
optional string currency = 78;
optional Amount amount_msat = 79;
optional string description = 80;
optional bytes features = 81;
}
message DecodeOffer_paths {
@ -1403,7 +1426,18 @@ message DecodeInvoice_fallbacks {
}
message DecodeFallbacks {
// Decode.fallbacks[].type
enum DecodeFallbacksType {
P2PKH = 0;
P2SH = 1;
P2WPKH = 2;
P2WSH = 3;
P2TR = 4;
}
optional string warning_invoice_fallbacks_version_invalid = 1;
DecodeFallbacksType item_type = 2;
optional string addr = 3;
bytes hex = 4;
}
message DecodeExtra {
@ -1443,15 +1477,15 @@ message FeeratesResponse {
message FeeratesPerkb {
uint32 min_acceptable = 1;
uint32 max_acceptable = 2;
optional uint32 floor = 10;
repeated FeeratesPerkbEstimates estimates = 9;
optional uint32 opening = 3;
optional uint32 mutual_close = 4;
optional uint32 unilateral_close = 5;
optional uint32 unilateral_anchor_close = 11;
optional uint32 delayed_to_us = 6;
optional uint32 htlc_resolution = 7;
optional uint32 penalty = 8;
repeated FeeratesPerkbEstimates estimates = 9;
optional uint32 floor = 10;
optional uint32 unilateral_anchor_close = 11;
}
message FeeratesPerkbEstimates {
@ -1463,15 +1497,15 @@ message FeeratesPerkbEstimates {
message FeeratesPerkw {
uint32 min_acceptable = 1;
uint32 max_acceptable = 2;
optional uint32 floor = 10;
repeated FeeratesPerkwEstimates estimates = 9;
optional uint32 opening = 3;
optional uint32 mutual_close = 4;
optional uint32 unilateral_close = 5;
optional uint32 unilateral_anchor_close = 11;
optional uint32 delayed_to_us = 6;
optional uint32 htlc_resolution = 7;
optional uint32 penalty = 8;
repeated FeeratesPerkwEstimates estimates = 9;
optional uint32 floor = 10;
optional uint32 unilateral_anchor_close = 11;
}
message FeeratesPerkwEstimates {
@ -1484,9 +1518,9 @@ message FeeratesOnchain_fee_estimates {
uint64 opening_channel_satoshis = 1;
uint64 mutual_close_satoshis = 2;
uint64 unilateral_close_satoshis = 3;
optional uint64 unilateral_close_nonanchor_satoshis = 6;
uint64 htlc_timeout_satoshis = 4;
uint64 htlc_success_satoshis = 5;
optional uint64 unilateral_close_nonanchor_satoshis = 6;
}
message FetchinvoiceRequest {
@ -1523,15 +1557,15 @@ message FetchinvoiceNext_period {
}
message FundchannelRequest {
bytes id = 9;
AmountOrAll amount = 1;
optional Feerate feerate = 2;
optional bool announce = 3;
optional uint32 minconf = 10;
optional Amount push_msat = 5;
optional string close_to = 6;
optional Amount request_amt = 7;
optional string compact_lease = 8;
bytes id = 9;
optional uint32 minconf = 10;
repeated Outpoint utxos = 11;
optional uint32 mindepth = 12;
optional Amount reserve = 13;
@ -1543,9 +1577,9 @@ message FundchannelResponse {
bytes txid = 2;
uint32 outnum = 3;
bytes channel_id = 4;
optional FundchannelChannel_type channel_type = 7;
optional bytes close_to = 5;
optional uint32 mindepth = 6;
optional FundchannelChannel_type channel_type = 7;
}
message FundchannelChannel_type {
@ -1555,13 +1589,13 @@ message FundchannelChannel_type {
message GetrouteRequest {
bytes id = 1;
Amount amount_msat = 9;
uint64 riskfactor = 3;
optional uint32 cltv = 4;
optional bytes fromid = 5;
optional uint32 fuzzpercent = 6;
repeated string exclude = 7;
optional uint32 maxhops = 8;
Amount amount_msat = 9;
}
message GetrouteResponse {
@ -1619,18 +1653,21 @@ message ListforwardsForwards {
LEGACY = 0;
TLV = 1;
}
optional uint64 created_index = 12;
string in_channel = 1;
optional uint64 in_htlc_id = 10;
Amount in_msat = 2;
ListforwardsForwardsStatus status = 3;
double received_time = 4;
optional string out_channel = 5;
optional uint64 out_htlc_id = 11;
optional uint64 updated_index = 13;
optional ListforwardsForwardsStyle style = 9;
optional Amount fee_msat = 7;
optional Amount out_msat = 8;
optional ListforwardsForwardsStyle style = 9;
optional uint64 in_htlc_id = 10;
optional uint64 out_htlc_id = 11;
optional uint64 created_index = 12;
optional uint64 updated_index = 13;
optional double resolved_time = 14;
optional uint32 failcode = 15;
optional string failreason = 16;
}
message ListoffersRequest {
@ -1678,16 +1715,16 @@ message ListpaysPays {
ListpaysPaysStatus status = 2;
optional bytes destination = 3;
uint64 created_at = 4;
optional uint64 completed_at = 12;
optional string label = 5;
optional string bolt11 = 6;
optional string description = 11;
optional string bolt12 = 7;
optional Amount amount_msat = 8;
optional Amount amount_sent_msat = 9;
optional bytes erroronion = 10;
optional string description = 11;
optional uint64 completed_at = 12;
optional bytes preimage = 13;
optional uint64 number_of_parts = 14;
optional bytes erroronion = 10;
}
message ListhtlcsRequest {
@ -1835,11 +1872,11 @@ message SetchannelChannels {
optional string short_channel_id = 3;
Amount fee_base_msat = 4;
uint32 fee_proportional_millionths = 5;
optional bool ignore_fee_limits = 10;
Amount minimum_htlc_out_msat = 6;
optional string warning_htlcmin_too_low = 7;
Amount maximum_htlc_out_msat = 8;
optional string warning_htlcmax_too_high = 9;
optional bool ignore_fee_limits = 10;
}
message SigninvoiceRequest {
@ -1898,6 +1935,34 @@ message WaitResponse {
optional uint64 created = 2;
optional uint64 updated = 3;
optional uint64 deleted = 4;
optional WaitDetails details = 5;
}
message WaitDetails {
// Wait.details.status
enum WaitDetailsStatus {
UNPAID = 0;
PAID = 1;
EXPIRED = 2;
PENDING = 3;
FAILED = 4;
COMPLETE = 5;
OFFERED = 6;
SETTLED = 7;
LOCAL_FAILED = 8;
}
optional WaitDetailsStatus status = 1;
optional string label = 2;
optional string description = 3;
optional string bolt11 = 4;
optional string bolt12 = 5;
optional uint64 partid = 6;
optional uint64 groupid = 7;
optional bytes payment_hash = 8;
optional string in_channel = 9;
optional uint64 in_htlc_id = 10;
optional Amount in_msat = 11;
optional string out_channel = 12;
}
message StopRequest {

1625
cln-grpc/src/convert.rs generated

File diff suppressed because it is too large Load diff

2326
cln-rpc/src/model.rs generated

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,7 @@ typemap = {
"feerate": "Feerate",
"outputdesc": "OutputDesc",
"secret": "bytes",
"bip340sig": "bytes",
"bip340sig": "string",
"hash": "bytes",
}
@ -95,8 +95,10 @@ class GrpcGenerator(IGenerator):
def enumerate_fields(self, message_name, fields):
"""Use the meta map to identify which number this field will get.
"""
for f in fields:
yield (self.field2number(message_name, f), f)
enumerated_values = [(self.field2number(message_name, f), f) for f in fields]
sorted_enumerated_values = sorted(enumerated_values, key=lambda x: x[0])
for i, v in sorted_enumerated_values:
yield (i, v)
def enumvar2number(self, typename: TypeName, variant):
"""Find an existing variant number of generate a new one.
@ -122,8 +124,10 @@ class GrpcGenerator(IGenerator):
return m[typename][variant]
def enumerate_enum(self, typename, variants):
for v in variants:
yield (self.enumvar2number(typename, v), v)
enumerated_values = [(self.enumvar2number(typename, v), v) for v in variants]
sorted_enumerated_values = sorted(enumerated_values, key=lambda x: x[0])
for i, v in sorted_enumerated_values:
yield (i, v)
def gather_types(self, service):
"""Gather all types that might need to be defined.
@ -249,6 +253,8 @@ class GrpcConverterGenerator(IGenerator):
if field.omit():
return
field.sort()
# First pass: generate any sub-fields before we generate the
# top-level field itself.
for f in field.fields:
@ -325,7 +331,6 @@ class GrpcConverterGenerator(IGenerator):
'hash?': f'c.{name}.map(|v| <Sha256 as AsRef<[u8]>>::as_ref(&v).to_vec())',
'secret': f'c.{name}.to_vec()',
'secret?': f'c.{name}.map(|v| v.to_vec())',
'msat_or_any': f'Some(c.{name}.into())',
'msat_or_all': f'Some(c.{name}.into())',
'msat_or_all?': f'c.{name}.map(|o|o.into())',

View file

@ -97,6 +97,7 @@ class Grpc2PyGenerator(IGenerator):
self.converters[field.path] = "str(m.{{name}})"
def generate_composite(self, prefix, field: CompositeField):
field.sort()
if override.get(field.path, "") is None:
return
name = field.name.normalized()

View file

@ -35,7 +35,7 @@ typemap = {
'outputdesc': 'OutputDesc',
'hash': 'Sha256',
'secret': 'Secret',
'bip340sig': 'Secret',
'bip340sig': 'String',
'integer': 'i64',
}
@ -110,7 +110,8 @@ def gen_enum(e, meta):
complete_variants = False
if m != {} and complete_variants:
for v in e.variants:
sorted_variants = sorted(e.variants, key=lambda x: m[str(x)])
for v in sorted_variants:
if v is None:
continue
norm = v.normalized()
@ -128,7 +129,7 @@ def gen_enum(e, meta):
""")
if m != {} and complete_variants:
for v in e.variants:
for v in sorted_variants:
norm = v.normalized()
# decl += f" #[serde(rename = \"{v}\")]\n"
decl += f" {m[str(v)]} => Ok({e.typename}::{norm}),\n"
@ -241,6 +242,7 @@ def gen_composite(c, meta) -> Tuple[str, str]:
fields = []
for f in c.fields:
fields.append(gen_field(f, meta))
fields = sorted(fields)
r = "".join([f[1] for f in fields])

View file

@ -78,6 +78,15 @@ class Field:
self.type_override: Optional[str] = None
def __lt__(self, other):
return self.path < other.path
def __eq__(self, other):
return self.path == other.path
def __iter__(self):
yield self.path
@property
def name(self):
return FieldName(self.path.split(".")[-1])
@ -199,20 +208,45 @@ class CompositeField(Field):
'else': {'properties': js.get('else', {}).get('properties', [])},
}
# Yes, this is ugly, but walking nested dicts always is.
def merge_dicts(dict1, dict2):
merged_dict = {}
for key in set(dict1.keys()) | set(dict2.keys()):
if key in dict1 and key in dict2:
if isinstance(dict1[key], dict) and isinstance(dict2[key], dict):
merged_dict[key] = merge_dicts(dict1[key], dict2[key])
else:
if isinstance(dict1[key], list) and isinstance(dict2[key], list):
merged_dict[key] = sorted(list(set(dict1[key]).union(set(dict2[key]))))
elif key in dict1:
merged_dict[key] = dict1[key]
else:
merged_dict[key] = dict2[key]
elif key in dict1:
merged_dict[key] = dict1[key]
else:
merged_dict[key] = dict2[key]
return merged_dict
for a in [top] + js.get('allOf', []):
var = a.get('then', {})
props = var.get('properties', None)
props = var.get('properties', {})
if isinstance(props, dict):
for k, v in props.items():
if k not in properties:
properties[k] = v
if properties != {}:
if k in properties:
properties[k] = merge_dicts(properties[k], v)
else:
properties[k] = v
var = a.get('else', {})
props = var.get('properties', None)
props = var.get('properties', {})
if isinstance(props, dict):
for k, v in props.items():
if k not in properties:
properties[k] = v
if properties != {}:
if k in properties:
properties[k] = merge_dicts(properties[k], v)
else:
properties[k] = v
# Identify required fields
required = js.get("required", [])
fields = []
@ -262,6 +296,9 @@ class CompositeField(Field):
typename, fields, path, js["description"] if "description" in js else "", added=js.get('added', None), deprecated=js.get('deprecated', None)
)
def sort(self):
self.fields = sorted(self.fields)
def __str__(self):
fieldnames = ",".join([f.path.split(".")[-1] for f in self.fields])
return f"CompositeField[name={self.path}, fields=[{fieldnames}]]"
@ -276,6 +313,12 @@ class EnumVariant(Field):
def __str__(self):
return self.variant
def __lt__(self, other):
return self.variant < other.variant
def __eq__(self, other):
return self.variant == other.variant
def normalized(self):
return self.variant.replace(' ', '_').replace('-', '_').replace("/", "_").upper()

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff