From 3c32f7d8f6c5e605591be02171398286c10a6d8e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 14 Jan 2022 14:03:19 +0100 Subject: [PATCH] json-rpc: Add request stubs for a couple of calls These are required so we can generate the requests, not just the responses. We'll add more as we test compatibility with our generation code. --- doc/schemas/addgossip.request.json | 14 ++++++++ doc/schemas/autocleaninvoice.request.json | 16 +++++++++ doc/schemas/checkmessage.request.json | 23 +++++++++++++ doc/schemas/close.request.json | 40 +++++++++++++++++++++++ doc/schemas/getinfo.request.json | 7 ++++ doc/schemas/listchannels.request.json | 20 ++++++++++++ doc/schemas/listfunds.request.json | 12 +++++++ doc/schemas/listpeers.request.json | 16 +++++++++ 8 files changed, 148 insertions(+) create mode 100644 doc/schemas/addgossip.request.json create mode 100644 doc/schemas/autocleaninvoice.request.json create mode 100644 doc/schemas/checkmessage.request.json create mode 100644 doc/schemas/close.request.json create mode 100644 doc/schemas/getinfo.request.json create mode 100644 doc/schemas/listchannels.request.json create mode 100644 doc/schemas/listfunds.request.json create mode 100644 doc/schemas/listpeers.request.json diff --git a/doc/schemas/addgossip.request.json b/doc/schemas/addgossip.request.json new file mode 100644 index 000000000..5729e2fa2 --- /dev/null +++ b/doc/schemas/addgossip.request.json @@ -0,0 +1,14 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "message" + ], + "properties": { + "message": { + "type": "hex", + "description": "The raw, hex-encoded, gossip message to add to the local gossip view." + } + } +} diff --git a/doc/schemas/autocleaninvoice.request.json b/doc/schemas/autocleaninvoice.request.json new file mode 100644 index 000000000..229363d50 --- /dev/null +++ b/doc/schemas/autocleaninvoice.request.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [], + "properties": { + "expired_by": { + "type": "u64", + "description": "How long an invoice must be expired (seconds) before we delete it." + }, + "cycle_seconds": { + "type": "u64", + "description": "The interval (in seconds) between cleaning expired invoices" + } + } +} diff --git a/doc/schemas/checkmessage.request.json b/doc/schemas/checkmessage.request.json new file mode 100644 index 000000000..df896bbf4 --- /dev/null +++ b/doc/schemas/checkmessage.request.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "required": [ + "message", + "zbase" + ], + "properties": { + "message": { + "type": "string", + "description": "Message to be checked against the signature." + }, + "zbase": { + "type": "string", + "description": "The Zbase32 encoded signature to verify." + }, + "pubkey": { + "type": "pubkey", + "description": "The Zbase32 encoded signature to verify." + } + } +} diff --git a/doc/schemas/close.request.json b/doc/schemas/close.request.json new file mode 100644 index 000000000..c91f41a13 --- /dev/null +++ b/doc/schemas/close.request.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "pubkey", + "description": "" + }, + "unilateraltimeout": { + "type": "u32", + "description": "" + }, + "destination": { + "type": "string", + "description": "" + }, + "fee_negotiation_step": { + "type": "string", + "description": "" + }, + "wrong_funding": { + "type": "txid", + "description": "" + }, + "force_lease_closed": { + "type": "boolean", + "description": "" + }, + "feerange": { + "type": { + "type": "array", + "items": "u32" + }, + "description": "" + } + } +} diff --git a/doc/schemas/getinfo.request.json b/doc/schemas/getinfo.request.json new file mode 100644 index 000000000..f99496c5a --- /dev/null +++ b/doc/schemas/getinfo.request.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "additionalProperties": false, + "properties": {} +} diff --git a/doc/schemas/listchannels.request.json b/doc/schemas/listchannels.request.json new file mode 100644 index 000000000..80c734490 --- /dev/null +++ b/doc/schemas/listchannels.request.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "additionalProperties": false, + "properties": { + "short_channel_id": { + "type": "short_channel_id", + "description": "If short_channel_id is a short channel id, then only known channels with a matching short_channel_id are returned. Otherwise, it must be null." + }, + "source": { + "type": "pubkey", + "description": "If source is a node id, then only channels leading from that node id are returned." + }, + "destination": { + "type": "pubkey", + "description": "If destination is a node id, then only channels leading to that node id are returned." + } + } +} diff --git a/doc/schemas/listfunds.request.json b/doc/schemas/listfunds.request.json new file mode 100644 index 000000000..00faf6c65 --- /dev/null +++ b/doc/schemas/listfunds.request.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "additionalProperties": false, + "properties": { + "spent": { + "type": "boolean", + "description": "Should outputs that are already spent be included in the result?" + } + } +} diff --git a/doc/schemas/listpeers.request.json b/doc/schemas/listpeers.request.json new file mode 100644 index 000000000..f2b02304a --- /dev/null +++ b/doc/schemas/listpeers.request.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "required": [], + "additionalProperties": false, + "properties": { + "id": { + "type": "pubkey", + "description": "If supplied, limits the result to just the peer with the given ID, if it exists." + }, + "level": { + "type": "string", + "description": "Supplying level will show log entries related to that peer at the given log level. Valid log levels are “io”, “debug”, “info”, and “unusual”." + } + } +}