diff --git a/contrib/msggen/msggen/__main__.py b/contrib/msggen/msggen/__main__.py index a864940f0..e423ac568 100644 --- a/contrib/msggen/msggen/__main__.py +++ b/contrib/msggen/msggen/__main__.py @@ -81,22 +81,20 @@ def load_jsonrpc_service(): # "decode", # "delpay", # "disableoffer", - # "disconnect", - # "feerates", + "Disconnect", + "Feerates", # "fetchinvoice", # "fundchannel_cancel", # "fundchannel_complete", # "fundchannel", # "fundchannel_start", # "funderupdate", - # "fundpsbt", # "getlog", - # "getroute", + "GetRoute", # "getsharedsecret", - # "listconfigs", - # "listforwards", + "ListForwards", # "listoffers", - # "listpays", + "ListPays", # "multifundchannel", # "multiwithdraw", # "offerout", @@ -107,16 +105,14 @@ def load_jsonrpc_service(): # "openchannel_signed", # "openchannel_update", # "parsefeerate", - # "ping", + "Ping", # "plugin", # "reserveinputs", # "sendcustommsg", # "sendinvoice", # "sendonionmessage", - # "sendpsbt", # "setchannelfee", - # "signmessage", - # "signpsbt", + "SignMessage", # "unreserveinputs", # "waitblockheight", # "ListConfigs", diff --git a/doc/schemas/disconnect.request.json b/doc/schemas/disconnect.request.json new file mode 100644 index 000000000..8714dbe08 --- /dev/null +++ b/doc/schemas/disconnect.request.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey" + }, + "force": { + "type": "boolean" + } + } +} diff --git a/doc/schemas/feerates.request.json b/doc/schemas/feerates.request.json new file mode 100644 index 000000000..d4dbffe3b --- /dev/null +++ b/doc/schemas/feerates.request.json @@ -0,0 +1,17 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "style" + ], + "properties": { + "style": { + "type": "string", + "enum": [ + "perkb", + "perkw" + ] + } + } +} diff --git a/doc/schemas/getroute.request.json b/doc/schemas/getroute.request.json new file mode 100644 index 000000000..8a10aaf8c --- /dev/null +++ b/doc/schemas/getroute.request.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "id", + "msatoshi", + "riskfactor" + ], + "properties": { + "id": { + "type": "pubkey", + "description": "" + }, + "msatoshi": { + "type": "msat", + "description": "" + }, + "riskfactor": { + "type": "u64", + "description": "" + }, + "cltv": { + "type": "number", + "description": "" + }, + "fromid": { + "type": "pubkey", + "description": "" + }, + "fuzzpercent": { + "type": "u32", + "description": "" + }, + "exclude": { + "type": "array", + "description": "", + "items": { + "type": "string" + } + }, + "maxhops": { + "type": "u32", + "description": "" + } + } +} diff --git a/doc/schemas/listforwards.request.json b/doc/schemas/listforwards.request.json new file mode 100644 index 000000000..8bf542ab8 --- /dev/null +++ b/doc/schemas/listforwards.request.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "properties": { + "status": { + "type": "string", + "enum": [ + "offered", + "settled", + "local_failed", + "failed" + ] + }, + "in_channel": { + "type": "short_channel_id" + }, + "out_channel": { + "type": "short_channel_id" + } + } +} diff --git a/doc/schemas/listpays.request.json b/doc/schemas/listpays.request.json new file mode 100644 index 000000000..f313c8613 --- /dev/null +++ b/doc/schemas/listpays.request.json @@ -0,0 +1,22 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "additionalProperties": false, + "properties": { + "bolt11": { + "type": "string" + }, + "payment_hash": { + "type": "hash" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "complete", + "failed" + ] + } + } +} diff --git a/doc/schemas/ping.request.json b/doc/schemas/ping.request.json new file mode 100644 index 000000000..5ca1e50d4 --- /dev/null +++ b/doc/schemas/ping.request.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "id" + ], + "additionalProperties": false, + "properties": { + "id": { + "type": "pubkey" + }, + "len": { + "type": "number" + }, + "pongbytes": { + "type": "number" + } + } +} diff --git a/doc/schemas/signmessage.request.json b/doc/schemas/signmessage.request.json new file mode 100644 index 000000000..163239e20 --- /dev/null +++ b/doc/schemas/signmessage.request.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "message" + ], + "additionalProperties": false, + "properties": { + "message": { + "type": "string" + } + } +} diff --git a/tests/test_cln_rs.py b/tests/test_cln_rs.py index c85121d3c..2345d5f52 100644 --- a/tests/test_cln_rs.py +++ b/tests/test_cln_rs.py @@ -113,6 +113,9 @@ def test_grpc_connect(node_factory): )) print(inv) + rates = stub.Feerates(nodepb.FeeratesRequest(style='PERKB')) + print(rates) + # Test a failing RPC call, so we know that errors are returned correctly. with pytest.raises(Exception, match=r'Duplicate label'): # This request creates a label collision